Skip to content

improve ux for robins and add missing sections#66

Merged
InfinityBowman merged 2 commits into
mainfrom
65-improve-robins-i
Dec 16, 2025
Merged

improve ux for robins and add missing sections#66
InfinityBowman merged 2 commits into
mainfrom
65-improve-robins-i

Conversation

@InfinityBowman
Copy link
Copy Markdown
Owner

@InfinityBowman InfinityBowman commented Dec 16, 2025

Summary by CodeRabbit

  • New Features

    • Added Planning, Section A, Section C, and Section D to the ROBINS‑I checklist for richer data capture
    • Added judgement label "Low (except for concerns about uncontrolled confounding)"
  • Improvements

    • Replaced radio inputs with clickable buttons that toggle on/off and removed per‑section Clear controls
    • Updated information sources with clearer examples and expanded registry/regulatory references
  • Documentation

    • Removed the architecture-goals.md document

✏️ Tip: You can customize this high-level summary in your review settings.

@InfinityBowman InfinityBowman linked an issue Dec 16, 2025 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 16, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Removes an architecture-goals.md design document and substantially refactors the ROBINS‑I checklist: updates checklist-map entries, adds Planning/SectionA/SectionC/SectionD components, replaces radio inputs with toggle buttons in judgement/direction UIs, and integrates new sections into the main checklist component.

Changes

Cohort / File(s) Summary
Documentation Removal
architecture-goals.md
Deleted the Durable Object / Yjs CRDT sync architecture specification, including data model, storage notes (D1/R2), DO responsibilities, client pseudocode, and implementation roadmap.
Checklist Data Model
packages/web/src/ROBINS-I/checklist-map.js
Updated INFORMATION_SOURCES entries with clearer examples; removed "Other"; added new exports SECTION_D, PLANNING_SECTION, SECTION_A, and SECTION_C describing new fields and controls.
UI Control Refactoring
packages/web/src/components/checklist-ui/ROBINSIChecklist/DomainJudgement.jsx, packages/web/src/components/checklist-ui/ROBINSIChecklist/OverallSection.jsx
Replaced radio inputs with clickable toggle buttons for judgement and direction (toggle-to-null behavior), removed createUniqueId usage and Clear buttons, added a new judgement label ("Low (except for concerns about uncontrolled confounding)") and color mapping, adjusted styling for selected/disabled states.
New Section Components
packages/web/src/components/checklist-ui/ROBINSIChecklist/PlanningSection.jsx, packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionA.jsx, packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionC.jsx, packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionD.jsx
Added four Solid.js components (PlanningSection, SectionA, SectionC, SectionD). Each renders form fields (textareas, checkboxes, radio group), supports disabled, manages updates via onUpdate callbacks, and exports as named/default where applicable.
Checklist Integration & Exports
packages/web/src/components/checklist-ui/ROBINSIChecklist/ROBINSIChecklist.jsx, packages/web/src/components/checklist-ui/ROBINSIChecklist/index.js
Replaced old Protocol Type Toggle UI with new Planning section and "Preliminary Considerations" header; wired new section components into checklist state via dedicated handlers; re-exported PlanningSection, SectionA, SectionC, SectionD from the module index.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25–30 minutes

  • Pay attention to mapping between SECTION_* keys in checklist-map.js and each component's state keys/onUpdate payloads.
  • Verify toggle-to-null behavior and keyboard/accessibility for button-based judgement/direction controls.
  • Confirm disabled/read-only rendering across new components and integration in ROBINSIChecklist.jsx.

Possibly related PRs

Poem

🐰 I hopped through maps and buttons bright,
New sections sprung up overnight.
Radios fled, toggles took their place,
Planning, A, C, D — a snug new space.
Cheers from a rabbit, nimble and light! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: UX improvements to the ROBINS-I checklist (replacing radio inputs with button-based controls) and addition of missing sections (Planning, Section A, Section C, Section D).

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f29fad6 and 952ecda.

📒 Files selected for processing (3)
  • packages/web/src/ROBINS-I/checklist-map.js (3 hunks)
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/DomainJudgement.jsx (5 hunks)
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionA.jsx (1 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Dec 16, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
corates 952ecda Commit Preview URL Dec 16 2025, 05:03 PM

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/web/src/components/checklist-ui/ROBINSIChecklist/DomainJudgement.jsx (1)

7-7: Remove unused domainId prop.

The domainId prop is documented and accepted but never used in the component body.

Apply this diff:

 /**
  * Domain judgement selector with risk of bias level and optional direction
  * @param {Object} props
- * @param {string} props.domainId - Unique domain identifier
  * @param {string} props.judgement - Current judgement value

Also applies to: 16-16

🧹 Nitpick comments (4)
packages/web/src/components/checklist-ui/ROBINSIChecklist/DomainJudgement.jsx (1)

42-69: Consider using createMemo for the isSelected computation.

While the current arrow function approach works, using createMemo would be more explicit about reactive tracking and align with SolidJS best practices.

As per coding guidelines, when computing values based on props, prefer createMemo:

+import { For, createMemo } from 'solid-js';
   <For each={ROB_JUDGEMENTS}>
     {judgement => {
-      const isSelected = () => props.judgement === judgement;
+      const isSelected = createMemo(() => props.judgement === judgement);
       return (

Apply the same pattern to the direction buttons (lines 82-107).

packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionD.jsx (1)

12-21: Potential issue: Unnecessary spread may cause performance issues.

The handleSourceToggle function spreads props.sectionDState on every toggle. If sectionDState contains large nested objects beyond sources and otherSpecify, this could be inefficient. However, based on the JSDoc (line 7), it appears the state structure is simple, so this is likely fine.

If sectionDState ever grows to include large nested data, consider updating only the sources object:

 function handleSourceToggle(sourceName) {
-  const newSources = {
-    ...props.sectionDState?.sources,
-    [sourceName]: !props.sectionDState?.sources?.[sourceName],
-  };
   props.onUpdate({
     ...props.sectionDState,
-    sources: newSources,
+    sources: {
+      ...props.sectionDState?.sources,
+      [sourceName]: !props.sectionDState?.sources?.[sourceName],
+    },
   });
 }
packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionA.jsx (1)

13-17: Consider co-locating field-to-state mapping.

The fieldToStateKey mapping is hardcoded here but could be defined in checklist-map.js alongside SECTION_A for better maintainability. Based on the relevant snippets, SECTION_A items in checklist-map.js don't have a stateKey property, unlike other sections (e.g., SECTION_C.c1.stateKey).

To improve consistency across sections and reduce duplication, consider adding stateKey to each field in SECTION_A within checklist-map.js:

// In checklist-map.js
export const SECTION_A = {
  a1: {
    id: 'a1',
    label: 'A1',
    text: 'Specify the numerical result being assessed',
    placeholder: 'e.g., OR = 1.5 (95% CI: 1.2-1.9)',
    type: 'textarea',
    stateKey: 'numericalResult', // Add this
  },
  // ... similar for a2 and a3
};

Then in SectionA.jsx, you can access it directly:

- const fieldToStateKey = {
-   a1: 'numericalResult',
-   a2: 'furtherDetails',
-   a3: 'outcome',
- };
- const stateKey = fieldToStateKey[key];
+ const stateKey = field.stateKey;
packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionC.jsx (1)

13-16: Minor: Functions could be constants.

The textFields() and c4Field() functions don't access reactive state, so they could be constants or moved outside the component for clarity. However, wrapping them as functions is harmless and maintains consistency.

For slight performance improvement, consider:

- const textFields = () =>
-   Object.entries(SECTION_C).filter(([_key, field]) => field.type === 'textarea');
- const c4Field = () => SECTION_C.c4;
+ const textFields = Object.entries(SECTION_C).filter(([_key, field]) => field.type === 'textarea');
+ const c4Field = SECTION_C.c4;

And update usages to remove ():

- <For each={textFields()}>
+ <For each={textFields}>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2392857 and f29fad6.

📒 Files selected for processing (10)
  • architecture-goals.md (0 hunks)
  • packages/web/src/ROBINS-I/checklist-map.js (3 hunks)
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/DomainJudgement.jsx (5 hunks)
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/OverallSection.jsx (4 hunks)
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/PlanningSection.jsx (1 hunks)
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/ROBINSIChecklist.jsx (3 hunks)
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionA.jsx (1 hunks)
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionC.jsx (1 hunks)
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionD.jsx (1 hunks)
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/index.js (1 hunks)
💤 Files with no reviewable changes (1)
  • architecture-goals.md
🧰 Additional context used
📓 Path-based instructions (7)
packages/web/src/components/**/*.{jsx,tsx,js,ts}

📄 CodeRabbit inference engine (.cursorrules)

For UI icons, use the solid-icons library or SVGs only. Do not use emojis

Files:

  • packages/web/src/components/checklist-ui/ROBINSIChecklist/index.js
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/PlanningSection.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionA.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionC.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/OverallSection.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/ROBINSIChecklist.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionD.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/DomainJudgement.jsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,jsx,ts,tsx}: Prefer modern ES6+ syntax and features
Use aliases for imports when appropriate to improve readability

Files:

  • packages/web/src/components/checklist-ui/ROBINSIChecklist/index.js
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/PlanningSection.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionA.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionC.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/OverallSection.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/ROBINSIChecklist.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionD.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/DomainJudgement.jsx
  • packages/web/src/ROBINS-I/checklist-map.js
packages/web/src/components/**

📄 CodeRabbit inference engine (.cursorrules)

Group related components in subdirectories with an index.js barrel export

Files:

  • packages/web/src/components/checklist-ui/ROBINSIChecklist/index.js
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/PlanningSection.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionA.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionC.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/OverallSection.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/ROBINSIChecklist.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionD.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/DomainJudgement.jsx
packages/web/src/**/*.{jsx,tsx,js,ts}

📄 CodeRabbit inference engine (.cursorrules)

packages/web/src/**/*.{jsx,tsx,js,ts}: When you need to compute a value based on props or state in SolidJS, use createMemo to ensure it updates reactively
For complex state or state objects in SolidJS, use Solid's createStore for better performance and reactivity
Create reusable logic in 'primitives' (hooks) that can be shared across components to keep components clean and focused on rendering

packages/web/src/**/*.{jsx,tsx,js,ts}: For UI icons, use the solid-icons library or SVGs only. Do not use emojis
Use Solid's createStore for complex state or state objects to ensure better performance and reactivity
Create reusable logic in primitives (hooks) that can be shared across components to keep components clean and focused on rendering

Files:

  • packages/web/src/components/checklist-ui/ROBINSIChecklist/index.js
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/PlanningSection.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionA.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionC.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/OverallSection.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/ROBINSIChecklist.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionD.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/DomainJudgement.jsx
  • packages/web/src/ROBINS-I/checklist-map.js
packages/web/src/components/**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursorrules)

packages/web/src/components/**/*.{jsx,tsx}: Use responsive design principles for UI components
When implementing UI components, use zag.js from packages/web/src/components/zag/* and reuse existing components
Do NOT prop-drill application state in SolidJS components - shared or cross-feature state must live in external stores under packages/web/src/stores/ or relative to the component file
Components should receive at most 1-5 props, and only for local configuration, not shared state - if a component would need more than 5 props, move the shared data into an external store, a primitive, or Solid context
In SolidJS components, do not destructure props as it breaks reactivity - instead access props directly from the props object, or wrap them in a function to ensure they are always up-to-date
Components should be lean and focused - do not implement business logic in components; move that into stores, utilities, or primitives

Files:

  • packages/web/src/components/checklist-ui/ROBINSIChecklist/PlanningSection.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionA.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionC.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/OverallSection.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/ROBINSIChecklist.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionD.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/DomainJudgement.jsx
packages/{web,landing}/src/**/*.{jsx,tsx,css}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use responsive design principles for UI components

Files:

  • packages/web/src/components/checklist-ui/ROBINSIChecklist/PlanningSection.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionA.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionC.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/OverallSection.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/ROBINSIChecklist.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionD.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/DomainJudgement.jsx
packages/web/src/**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

packages/web/src/**/*.{jsx,tsx}: Use Zag.js for UI components and design system
Reference existing Zag.js components in packages/web/src/components/zag/* and consult the README.md and documentation before adding new components or debugging
Do NOT prop-drill application state. Shared or cross-feature state must live in external stores under packages/web/src/stores/ or relative to the component file
Components should receive at most 1–5 props, and only for local configuration, not shared state. If a component would need more than 5 props, move the shared data into an external store, a primitive, or Solid context
Do not destructure props in SolidJS components as it breaks reactivity. Instead access props directly from the props object or wrap them in a function to ensure they are always up-to-date
Use createMemo for derived values based on props or state to ensure reactive updates
Components should be lean and focused and should not implement business logic. Move business logic into stores, utilities, or primitives

Files:

  • packages/web/src/components/checklist-ui/ROBINSIChecklist/PlanningSection.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionA.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionC.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/OverallSection.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/ROBINSIChecklist.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionD.jsx
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/DomainJudgement.jsx
🧠 Learnings (4)
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Applies to packages/web/src/components/** : Group related components in subdirectories with an `index.js` barrel export

Applied to files:

  • packages/web/src/components/checklist-ui/ROBINSIChecklist/index.js
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx,js,ts} : For complex state or state objects in SolidJS, use Solid's `createStore` for better performance and reactivity

Applied to files:

  • packages/web/src/components/checklist-ui/ROBINSIChecklist/ROBINSIChecklist.jsx
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx,js,ts} : Use Solid's `createStore` for complex state or state objects to ensure better performance and reactivity

Applied to files:

  • packages/web/src/components/checklist-ui/ROBINSIChecklist/ROBINSIChecklist.jsx
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx,js,ts} : When you need to compute a value based on props or state in SolidJS, use `createMemo` to ensure it updates reactively

Applied to files:

  • packages/web/src/components/checklist-ui/ROBINSIChecklist/ROBINSIChecklist.jsx
🧬 Code graph analysis (6)
packages/web/src/components/checklist-ui/ROBINSIChecklist/PlanningSection.jsx (1)
packages/web/src/ROBINS-I/checklist-map.js (2)
  • PLANNING_SECTION (105-117)
  • PLANNING_SECTION (105-117)
packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionA.jsx (2)
packages/web/src/components/checklist-ui/ROBINSIChecklist/PlanningSection.jsx (1)
  • value (20-20)
packages/web/src/ROBINS-I/checklist-map.js (2)
  • SECTION_A (120-143)
  • SECTION_A (120-143)
packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionC.jsx (3)
packages/web/src/ROBINS-I/checklist-map.js (2)
  • SECTION_C (167-205)
  • SECTION_C (167-205)
packages/web/src/lib/referenceParser.js (1)
  • field (104-104)
packages/web/src/components/checklist-ui/ROBINSIChecklist/PlanningSection.jsx (1)
  • value (20-20)
packages/web/src/components/checklist-ui/ROBINSIChecklist/OverallSection.jsx (2)
packages/web/src/components/sidebar/ChecklistTreeItem.jsx (1)
  • isSelected (12-12)
packages/web/src/components/checklist-ui/ROBINSIChecklist/DomainJudgement.jsx (1)
  • getJudgementColor (19-34)
packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionD.jsx (1)
packages/web/src/ROBINS-I/checklist-map.js (4)
  • SECTION_D (83-94)
  • SECTION_D (83-94)
  • INFORMATION_SOURCES (66-80)
  • INFORMATION_SOURCES (66-80)
packages/web/src/components/checklist-ui/ROBINSIChecklist/DomainJudgement.jsx (1)
packages/web/src/components/checklist-ui/ROBINSIChecklist/OverallSection.jsx (1)
  • getJudgementColor (31-48)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Workers Builds: corates
🔇 Additional comments (12)
packages/web/src/components/checklist-ui/ROBINSIChecklist/DomainJudgement.jsx (1)

81-108: Direction selector implementation looks good.

The button-based direction selector correctly mirrors the judgement selector pattern, with appropriate optional chaining for the callback and consistent toggle behavior.

packages/web/src/components/checklist-ui/ROBINSIChecklist/OverallSection.jsx (2)

31-48: LGTM - Good color mapping expansion.

The expanded color mapping correctly handles the new judgement variants. The function remains a pure helper without side effects.


92-118: Verify toggle behavior matches user expectations.

The toggle implementation allows deselecting a judgement (setting to null). While this provides flexibility, ensure this matches the intended UX—typically, risk of bias judgements require a selection and shouldn't be clearable once set.

Consider whether the overall risk judgement should always require a value, or if clearing to null is acceptable in your workflow.

packages/web/src/components/checklist-ui/ROBINSIChecklist/PlanningSection.jsx (1)

1-54: LGTM - Clean implementation.

The component follows SolidJS best practices with proper reactivity patterns and a focused responsibility.

packages/web/src/components/checklist-ui/ROBINSIChecklist/index.js (1)

6-10: LGTM - Proper barrel export pattern.

The expanded exports follow the established pattern and coding guidelines for component organization.

Based on learnings, the barrel export pattern is correctly applied.

packages/web/src/components/checklist-ui/ROBINSIChecklist/ROBINSIChecklist.jsx (2)

38-56: LGTM - Consistent handler pattern.

The new handlers maintain consistency with the existing update pattern, properly forwarding section updates to the parent via the object-style API.


81-122: LGTM - Clean section integration.

The new sections are properly integrated with consistent prop patterns and update handlers. The flow from Planning → Preliminary Considerations (A, B, C, D) → Domains is logical and well-structured.

packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionD.jsx (1)

41-61: LGTM - Responsive grid layout.

The grid implementation properly uses Tailwind's responsive breakpoints and provides good visual feedback for checked states.

packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionA.jsx (1)

39-71: LGTM - Proper reactive pattern.

The value() function is correctly defined inside the For loop to ensure reactivity, and the component structure is clean.

packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionC.jsx (1)

73-101: LGTM - Proper radio implementation.

The C4 protocol type radio group is well-implemented with proper visual feedback and disabled state handling.

packages/web/src/ROBINS-I/checklist-map.js (2)

70-80: LGTM - Improved clarity with examples.

The expanded descriptions with specific examples improve user guidance. Removing "Other" from the array is correct since it's now handled by SECTION_D.otherField.


82-94: LGTM - Well-structured section definitions.

The new section exports (SECTION_D, PLANNING_SECTION, SECTION_C) are well-structured with clear field definitions and consistent patterns.

Also applies to: 104-117, 166-205

Comment on lines +119 to +143
// Section A: Specify the result being assessed for risk of bias
export const SECTION_A = {
a1: {
id: 'a1',
label: 'A1',
text: 'Specify the numerical result being assessed',
placeholder: 'e.g., OR = 1.5 (95% CI: 1.2-1.9)',
type: 'textarea',
},
a2: {
id: 'a2',
label: 'A2',
text: 'Provide further details about this result (for example, location in the study report, reason it was chosen)',
optional: true,
placeholder: 'e.g., Table 3, primary outcome analysis',
type: 'textarea',
},
a3: {
id: 'a3',
label: 'A3',
text: 'Specify the outcome to which this result relates',
placeholder: 'e.g., All-cause mortality at 12 months',
type: 'textarea',
},
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Inconsistency: Missing stateKey properties in SECTION_A.

Unlike SECTION_C (lines 170-193) which includes stateKey for each field, SECTION_A lacks this property. This forces SectionA.jsx to maintain a separate fieldToStateKey mapping (lines 13-17 in SectionA.jsx), creating duplication and potential for errors.

For consistency with SECTION_C and to eliminate the hardcoded mapping in SectionA.jsx, add stateKey to each field:

 export const SECTION_A = {
   a1: {
     id: 'a1',
     label: 'A1',
     text: 'Specify the numerical result being assessed',
     placeholder: 'e.g., OR = 1.5 (95% CI: 1.2-1.9)',
     type: 'textarea',
+    stateKey: 'numericalResult',
   },
   a2: {
     id: 'a2',
     label: 'A2',
     text: 'Provide further details about this result (for example, location in the study report, reason it was chosen)',
     optional: true,
     placeholder: 'e.g., Table 3, primary outcome analysis',
     type: 'textarea',
+    stateKey: 'furtherDetails',
   },
   a3: {
     id: 'a3',
     label: 'A3',
     text: 'Specify the outcome to which this result relates',
     placeholder: 'e.g., All-cause mortality at 12 months',
     type: 'textarea',
+    stateKey: 'outcome',
   },
 };

Then update SectionA.jsx to remove the hardcoded mapping (see comment in SectionA.jsx review).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Section A: Specify the result being assessed for risk of bias
export const SECTION_A = {
a1: {
id: 'a1',
label: 'A1',
text: 'Specify the numerical result being assessed',
placeholder: 'e.g., OR = 1.5 (95% CI: 1.2-1.9)',
type: 'textarea',
},
a2: {
id: 'a2',
label: 'A2',
text: 'Provide further details about this result (for example, location in the study report, reason it was chosen)',
optional: true,
placeholder: 'e.g., Table 3, primary outcome analysis',
type: 'textarea',
},
a3: {
id: 'a3',
label: 'A3',
text: 'Specify the outcome to which this result relates',
placeholder: 'e.g., All-cause mortality at 12 months',
type: 'textarea',
},
};
// Section A: Specify the result being assessed for risk of bias
export const SECTION_A = {
a1: {
id: 'a1',
label: 'A1',
text: 'Specify the numerical result being assessed',
placeholder: 'e.g., OR = 1.5 (95% CI: 1.2-1.9)',
type: 'textarea',
stateKey: 'numericalResult',
},
a2: {
id: 'a2',
label: 'A2',
text: 'Provide further details about this result (for example, location in the study report, reason it was chosen)',
optional: true,
placeholder: 'e.g., Table 3, primary outcome analysis',
type: 'textarea',
stateKey: 'furtherDetails',
},
a3: {
id: 'a3',
label: 'A3',
text: 'Specify the outcome to which this result relates',
placeholder: 'e.g., All-cause mortality at 12 months',
type: 'textarea',
stateKey: 'outcome',
},
};
🤖 Prompt for AI Agents
In packages/web/src/ROBINS-I/checklist-map.js around lines 119 to 143, SECTION_A
entries are missing stateKey properties (unlike SECTION_C), causing SectionA.jsx
to maintain a separate hardcoded field-to-state mapping; add a stateKey to each
a1, a2, and a3 entry (matching the keys used in component state) so the map
includes { id, label, text, placeholder, type, stateKey } and then remove the
hardcoded fieldToStateKey mapping from SectionA.jsx so the component reads
stateKey directly from the checklist map.

@InfinityBowman InfinityBowman merged commit 119e4de into main Dec 16, 2025
1 of 3 checks passed
@InfinityBowman InfinityBowman deleted the 65-improve-robins-i branch December 16, 2025 17:01
@github-actions github-actions Bot restored the 65-improve-robins-i branch December 16, 2025 17:01
@InfinityBowman InfinityBowman deleted the 65-improve-robins-i branch December 16, 2025 17:01
InfinityBowman added a commit that referenced this pull request Dec 17, 2025
improve ux for robins and add missing sections
This was referenced Jan 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve robins-i

1 participant