checklist state is handled much better now for all the different poss…#196
Conversation
📝 WalkthroughWalkthroughThis PR refactors checklist lifecycle states: removes Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
corates | 31dd112 | Commit Preview URL | Dec 30 2025, 12:23 AM |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/web/src/constants/checklist-status.js (1)
78-109: Consider documenting how RECONCILING status is assigned.The transition rules are correct, but there's no explicit transition path TO
RECONCILINGstatus incanTransitionTo. This is because reconciled checklists are created directly withRECONCILINGstatus inReconciliationWrapper.jsx(line 278). Consider adding a brief comment noting this to prevent future confusion.Suggested documentation improvement
+ // Note: RECONCILING status is assigned directly to newly created reconciled checklists, + // not transitioned to from another status. See ReconciliationWrapper.jsx. + // Can transition from reconciling to finalized (after reconciliation is complete) if (currentStatus === CHECKLIST_STATUS.RECONCILING && newStatus === CHECKLIST_STATUS.FINALIZED) { return true; }
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
packages/web/src/components/checklist/ChecklistYjsWrapper.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/lib/checklist-domain.jspackages/web/src/lib/inter-rater-reliability.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/primitives/useProject/sync.js
🧰 Additional context used
📓 Path-based instructions (20)
packages/web/**/!(*.test|*.spec).{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/error-handling.mdc)
packages/web/**/!(*.test|*.spec).{js,ts,jsx,tsx}: Always usehandleFetchErrorfrom@/lib/error-utils.jsfor frontend fetch calls with optionalshowToastparameter
UsecreateFormErrorSignalsfrom@/lib/form-errors.jsfor handling form validation errors, field-level errors, and global errors in frontend forms
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
packages/{web,workers}/**/!(*.test|*.spec).{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/error-handling.mdc)
packages/{web,workers}/**/!(*.test|*.spec).{js,ts,jsx,tsx}: Never throw string literals; always throw Error objects or return domain errors from API routes
UseisErrorCodeutility from@corates/sharedor@/lib/error-utils.jsto check for specific error codes instead of manual error comparisons
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
packages/web/src/**/*.{js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/form-state.mdc)
packages/web/src/**/*.{js,jsx}: Save form state to IndexedDB before initiating OAuth redirects (Google Drive, ORCID) using saveFormState() with form type ('createProject' or 'addStudies') and serializable state only
Only save serializable data to IndexedDB—exclude File objects, ArrayBuffers, functions, and other non-serializable objects from form state persistence
Restore form state after OAuth redirects by checking URL restore params with getRestoreParamsFromUrl(), retrieving saved state with getFormState(), restoring to form, clearing saved state with clearFormState(), and clearing URL params with clearRestoreParamsFromUrl()
For temporary File object storage during OAuth flows (e.g., pending PDFs), use projectStore.setPendingProjectData() instead of IndexedDB, as File objects cannot be serialized
Add restore parameters to the URL after OAuth redirects in the format '?restore=&projectId=' to signal form state restoration on mount
Clear URL restore parameters after form state restoration by calling clearRestoreParamsFromUrl() to prevent stale restoration attempts on subsequent navigation
Form state persistence library functions (saveFormState, getFormState, clearFormState, getRestoreParamsFromUrl, clearRestoreParamsFromUrl) are implemented in packages/web/src/lib/formStatePersistence.js and should be imported from @/lib/formStatePersistence.js
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
packages/web/src/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/pdf-handling.mdc)
packages/web/src/**/*.{js,jsx,ts,tsx}: Always useuploadPdffrom@api/pdf-api.jsfor uploading PDF files. Pass object with projectId, studyId, tag ('primary' or 'supplementary'), and fileName
Validate PDF files on frontend by checking file.type includes 'pdf' and file.size is within MAX_PDF_SIZE limit (full validation is done on backend)
UsecachePdfandgetCachedPdffrom@primitives/pdfCache.jsfor caching PDF data in IndexedDB
Implement PDF caching strategy: check cache first, download from server if not cached, then cache the downloaded PDF
Store only PDF metadata in Yjs (id, name, size, tag, uploadedAt, uploadedBy), never store PDF binary data in Yjs as it is too large
UseimportFromGoogleDrivefrom@api/google-drive.jsfor importing PDFs from Google Drive. Pass fileId, projectId, studyId, and tag
Save form state usingsaveFormStatefrom@/lib/formStatePersistence.jsbefore triggering OAuth redirects for Google Drive
UseaddPdfToStudyoperation fromuseProjecthook to add PDFs to a study, passing id, name, size, tag, uploadedAt, and uploadedBy
UseremovePdfFromStudyoperation fromuseProjecthook to remove PDFs from a study
UsepdfPreviewStorefrom@/stores/pdfPreviewStore.jsfor managing PDF preview state (openPreview, closePreview, getPreview methods)
UsedownloadPdffrom@api/pdf-api.jsto download PDFs from server, then cache the result usingcachePdf
Always cache PDFs after download and check cache before downloading to avoid redundant downloads
Use PDF operations fromuseProjecthook instead of bypassing through direct API calls
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
packages/web/src/**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/pdf-handling.mdc)
Use
PdfViewercomponent from@/components/checklist-ui/pdf/PdfViewer.jsxfor displaying PDFs, passing pdfData as ArrayBuffer, fileName, readOnly, and onPageChange
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
{packages/web/**,packages/landing/**}/**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/solidjs.mdc)
{packages/web/**,packages/landing/**}/**/*.{jsx,tsx}: NEVER destructure props in SolidJS components - access props directly or wrap in functions to maintain reactivity
Use external stores in packages/web/src/stores/ for shared/cross-feature state instead of prop-drilling
Keep SolidJS components lean and focused on rendering - move business logic to stores, primitives, or utilities
Create reusable logic in primitives (hooks) in packages/web/src/primitives/ and import them into components
Use Solid's Show component for conditional rendering instead of ternary operators
Use Solid's For component for rendering lists instead of Array.map()
Use the children helper when manipulating props.children in SolidJS components
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
{packages/web/**,packages/landing/**}/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/solidjs.mdc)
{packages/web/**,packages/landing/**}/**/*.{js,jsx,ts,tsx}: Use createSignal for simple reactive values in SolidJS components
Use createStore for complex objects and arrays that need granular reactivity in SolidJS
Use createMemo for computed/derived values that depend on reactive state in SolidJS
Always clean up SolidJS effects that create subscriptions or timers using onCleanup
Import stores directly in components and use store read/write action pattern - read from store, write via actions store
Prefer derived state with createMemo or signals over effects whenever possible
Use local createSignal or createStore for local component state; use external stores for shared/cross-feature state
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
packages/{web,ui}/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
packages/{web,ui}/**/*.{js,jsx,ts,tsx}: Import UI components from '@corates/ui' package instead of local components directories
Use solid-icons library for icons instead of emojis or other icon sources
Use Tailwind CSS classes for styling UI components
Apply responsive design using mobile-first approach with Tailwind CSS
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
packages/web/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Use import aliases from jsconfig.json (e.g., @/, @components/, @auth-ui/, @checklist-ui/, @project-ui/, @routes/, @primitives/, @api/, @config/, @lib/) instead of relative paths
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/yjs-sync.mdc)
**/*.{js,jsx,ts,tsx}: Use theuseProjecthook for managing Yjs connections with reference counting instead of creating Y.Doc instances directly
Never create Y.Doc instances directly; always use the connection registry managed by useProject
Access Y.Doc connection state via projectStore.getConnectionState(projectId) instead of checking connection state directly
Read Yjs-synced data from projectStore (using getStudies, getChecklist, etc.) rather than accessing Y.Doc maps/arrays directly
Use operation functions from useProject or projectActionsStore for writing data instead of directly modifying Y.Doc
Don't store Y.Doc references in component state; always retrieve the connection through useProject
Handle connection cleanup via onCleanup() in Solid.js components or equivalent cleanup patterns, calling disconnect() when the component unmounts
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
**/*
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*: NEVER use emojis anywhere - not in code, comments, documentation, plan files, commit messages, or examples
Do NOT use unicode symbols - unicode symbols are forbidden anywhere in the codebase
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
**/*.{ts,tsx,jsx,js}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx,jsx,js}: For UI icons, usesolid-iconslibrary or SVGs only (never emojis)
Prefer modern ES6+ syntax and features
Use import aliases from jsconfig.json as defined in the ui-components.mdc documentation
Prefer config files over hardcoding values
Ensure browser compatibility (Safari is usually problematic)
Group related components in subdirectories with barrel exports
Use Ark UI components from@corates/uipackage, not local component implementations
Usesolid-iconsicon library (e.g.,solid-icons/bi,solid-icons/fi) for icons
Comments should explain WHY something is being done, not WHAT the code is doing
Comment to explain why a particular approach or workaround was chosen
Comment to clarify intent when code could be misread or misunderstood
Comment to provide context from external systems, specs, or requirements
Comment to document assumptions, edge cases, or limitations
Do NOT comment by narrating what the code is doing
Do NOT duplicate function or variable names in plain English comments
Do NOT leave stale comments that contradict the code
Do NOT reference removed or obsolete code paths in comments
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
packages/web/**/*.{ts,tsx,jsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
packages/web/**/*.{ts,tsx,jsx}: Do NOT prop-drill application state in SolidJS - import stores directly where needed
Do NOT destructure props in SolidJS - accessprops.fielddirectly or wrap in function:() => props.field
SolidJS components should receive at most 1-5 props (local config only, not shared state)
Move business logic to stores, utilities, or primitives (not in components) in SolidJS
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
**/*.{ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/corates.mdc)
For UI icons, use
solid-iconslibrary or SVGs only (never emojis)
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/corates.mdc)
Prefer modern ES6+ syntax and features
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
packages/web/src/**/*.{ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/corates.mdc)
packages/web/src/**/*.{ts,tsx,jsx}: Use import aliases from jsconfig.json
Use Ark UI components from@corates/uipackage, NOT local components
Do NOT prop-drill application state; import stores directly where needed
UsecreateMemofor derived values
Move business logic to stores, utilities, or primitives (not components)
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
packages/web/src/components/**/*.{ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/corates.mdc)
packages/web/src/components/**/*.{ts,tsx,jsx}: Group related components in subdirectories with barrel exports
Do NOT destructure props; accessprops.fielddirectly or wrap in function:() => props.field
Components should receive at most 1-5 props (local config only, not shared state)
Files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
{packages/web/src/components/checklist-ui/compare/**,packages/web/src/lib/checklist-domain.js,packages/web/src/AMSTAR2/checklist-compare.js}
📄 CodeRabbit inference engine (.cursor/rules/reconciliation.mdc)
Store final answers in the reconciled checklist itself, not in reconciliation progress metadata
Files:
packages/web/src/lib/checklist-domain.js
{packages/web/src/components/checklist-ui/compare/**,packages/web/src/lib/checklist-domain.js}
📄 CodeRabbit inference engine (.cursor/rules/reconciliation.mdc)
{packages/web/src/components/checklist-ui/compare/**,packages/web/src/lib/checklist-domain.js}: Store reconciliation progress metadata (IDs and optional currentPage) in the study's Y.Map reconciliation property
Multi-part answers (q9a, q9b, q11a, q11b) should be stored as objects with answer matrix and critical flag properties
Files:
packages/web/src/lib/checklist-domain.js
{packages/web/src/lib/checklist-domain.js,packages/web/src/AMSTAR2/checklist-compare.js}
📄 CodeRabbit inference engine (.cursor/rules/reconciliation.mdc)
Reconciliation structure should contain checklist1Id, checklist2Id, and reconciledChecklistId
Files:
packages/web/src/lib/checklist-domain.js
🧠 Learnings (25)
📓 Common learnings
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/AMSTAR2/**,packages/web/src/ROBINS-I/**,packages/web/src/lib/checklist-domain.js : Checklist status transitions follow sequence: in_progress → completed (when all questions answered) → reconciled (after reconciliation complete)
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/AMSTAR2/**,packages/web/src/ROBINS-I/**,packages/web/src/lib/checklist-domain.js : Use getChecklistStatus utility from @/lib/checklist-domain.js to determine current checklist status before performing operations
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/reconciliation.mdc:0-0
Timestamp: 2025-12-27T03:02:14.854Z
Learning: Applies to {packages/web/src/components/checklist-ui/compare/**,packages/web/src/lib/checklist-domain.js,packages/web/src/AMSTAR2/checklist-compare.js} : Store final answers in the reconciled checklist itself, not in reconciliation progress metadata
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/AMSTAR2/**,packages/web/src/ROBINS-I/**,packages/web/src/lib/checklist-domain.js : Checklist status transitions follow sequence: in_progress → completed (when all questions answered) → reconciled (after reconciliation complete)
Applied to files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/AMSTAR2/**,packages/web/src/ROBINS-I/**,packages/web/src/lib/checklist-domain.js : Use getChecklistStatus utility from @/lib/checklist-domain.js to determine current checklist status before performing operations
Applied to files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/AMSTAR2/** : Use scoreChecklist utility from @/AMSTAR2/checklist.js to determine quality assessment rating: 'High' | 'Moderate' | 'Low' | 'Critically Low'
Applied to files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/AMSTAR2/**,packages/web/src/ROBINS-I/**,packages/web/src/lib/checklist-domain.js,packages/web/src/primitives/useProject/checklists.js : Use checklist operations from useProject hook (createChecklist, updateChecklistAnswer, getChecklistData) instead of manually updating checklist structure
Applied to files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
📚 Learning: 2025-12-27T03:02:14.854Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/reconciliation.mdc:0-0
Timestamp: 2025-12-27T03:02:14.854Z
Learning: Applies to {packages/web/src/components/checklist-ui/compare/**,packages/web/src/lib/checklist-domain.js,packages/web/src/AMSTAR2/checklist-compare.js} : Store final answers in the reconciled checklist itself, not in reconciliation progress metadata
Applied to files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
📚 Learning: 2025-12-27T03:02:14.854Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/reconciliation.mdc:0-0
Timestamp: 2025-12-27T03:02:14.854Z
Learning: Applies to {packages/web/src/components/checklist-ui/compare/**,packages/web/src/AMSTAR2/checklist-compare.js} : Use compareChecklists utility from checklist-compare.js for comparing reviewer checklists
Applied to files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/AMSTAR2/**,packages/web/src/ROBINS-I/**,packages/web/src/lib/checklist-domain.js : Maintain separate answer format implementations for each checklist type (AMSTAR2, ROBINS-I, Generic) to prevent data corruption
Applied to files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/constants/checklist-status.js
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/AMSTAR2/** : AMSTAR2 answers must use matrix format: array of column arrays with boolean values representing checkbox selections per column
Applied to files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsx
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/ROBINS-I/** : Use scoreChecklist utility from @/ROBINS-I/checklist.js to determine risk of bias rating: 'Low' | 'Moderate' | 'Serious' | 'Critical'
Applied to files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/AMSTAR2/** : Handle multi-part AMSTAR2 questions correctly: q9 (parts a, b), q11 (parts a, b) require separate answer entries
Applied to files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsx
📚 Learning: 2025-12-27T03:02:14.854Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/reconciliation.mdc:0-0
Timestamp: 2025-12-27T03:02:14.854Z
Learning: Applies to {packages/web/src/lib/checklist-domain.js,packages/web/src/AMSTAR2/checklist-compare.js} : Reconciliation structure should contain checklist1Id, checklist2Id, and reconciledChecklistId
Applied to files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.js
📚 Learning: 2025-12-27T03:02:14.854Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/reconciliation.mdc:0-0
Timestamp: 2025-12-27T03:02:14.854Z
Learning: Applies to {packages/web/src/components/checklist-ui/compare/**,packages/web/src/lib/checklist-domain.js} : Multi-part answers (q9a, q9b, q11a, q11b) should be stored as objects with answer matrix and critical flag properties
Applied to files:
packages/web/src/components/project/overview-tab/ChartSection.jsxpackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.js
📚 Learning: 2025-12-27T03:02:14.854Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/reconciliation.mdc:0-0
Timestamp: 2025-12-27T03:02:14.854Z
Learning: Applies to {packages/web/src/components/checklist-ui/compare/**,packages/web/src/lib/checklist-domain.js} : Store reconciliation progress metadata (IDs and optional currentPage) in the study's Y.Map reconciliation property
Applied to files:
packages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/constants/checklist-status.jspackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
📚 Learning: 2025-12-27T03:02:14.854Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/reconciliation.mdc:0-0
Timestamp: 2025-12-27T03:02:14.854Z
Learning: Applies to packages/web/src/components/checklist-ui/compare/** : Use multiPartAnswersEqual helper to compare multi-part answers between reviewers
Applied to files:
packages/web/src/lib/inter-rater-reliability.jspackages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.js
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/lib/checklist-domain.js : Register and retrieve checklists using checklist-registry: getChecklistType and getChecklistComponent functions
Applied to files:
packages/web/src/lib/checklist-domain.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/constants/checklist-status.js
📚 Learning: 2025-12-27T03:02:14.854Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/reconciliation.mdc:0-0
Timestamp: 2025-12-27T03:02:14.854Z
Learning: Applies to packages/web/src/components/checklist-ui/compare/** : Auto-fill final answer with reviewer1's answer when reviewers agree and no final answer exists
Applied to files:
packages/web/src/lib/checklist-domain.jspackages/web/src/primitives/useProject/sync.jspackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/ROBINS-I/** : Use shouldStopAssessment utility from @/ROBINS-I/checklist.js to check if Section B indicates critical risk of bias requiring assessment termination
Applied to files:
packages/web/src/lib/checklist-domain.jspackages/web/src/components/project/overview-tab/OverviewTab.jsx
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/primitives/useProject/checklists.js : Store question notes as Y.Text objects obtained from useProject hook via getQuestionNote operation to enable collaborative editing
Applied to files:
packages/web/src/primitives/useProject/sync.jspackages/web/src/primitives/__tests__/useProject.test.jspackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
📚 Learning: 2025-12-27T03:02:33.023Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/ui-components.mdc:0-0
Timestamp: 2025-12-27T03:02:33.023Z
Learning: Applies to packages/web/**/*.{js,jsx,ts,tsx} : Use import aliases from jsconfig.json (e.g., @/, components/, auth-ui/, checklist-ui/, project-ui/, routes/, primitives/, api/, config/, lib/) instead of relative paths
Applied to files:
packages/web/src/primitives/__tests__/useProject.test.js
📚 Learning: 2025-12-27T03:02:05.951Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/pdf-handling.mdc:0-0
Timestamp: 2025-12-27T03:02:05.951Z
Learning: Applies to packages/web/src/**/*.{js,jsx,ts,tsx} : Use PDF operations from `useProject` hook instead of bypassing through direct API calls
Applied to files:
packages/web/src/primitives/__tests__/useProject.test.js
📚 Learning: 2025-12-27T03:02:50.087Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/yjs-sync.mdc:0-0
Timestamp: 2025-12-27T03:02:50.087Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Read Yjs-synced data from projectStore (using getStudies, getChecklist, etc.) rather than accessing Y.Doc maps/arrays directly
Applied to files:
packages/web/src/primitives/__tests__/useProject.test.js
📚 Learning: 2025-12-27T03:02:14.854Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/reconciliation.mdc:0-0
Timestamp: 2025-12-27T03:02:14.854Z
Learning: Applies to packages/web/src/components/checklist-ui/compare/** : Use Y.Text objects for collaborative editing of question notes in reconciliation
Applied to files:
packages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsxpackages/web/src/components/project/overview-tab/OverviewTab.jsxpackages/web/src/components/checklist/compare/ReconciliationWrapper.jsxpackages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsxpackages/web/src/components/checklist/ChecklistYjsWrapper.jsx
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/** : Use NoteEditor component from @/components/checklist-ui/common/NoteEditor.jsx for question note editing with max 2000 character limit
Applied to files:
packages/web/src/components/checklist/ChecklistYjsWrapper.jsx
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/ROBINS-I/** : ROBINS-I answers must use string format: 'Y' | 'PY' | 'PN' | 'N' | 'NI' | 'NA' with optional comment field
Applied to files:
packages/web/src/components/checklist/ChecklistYjsWrapper.jsx
🧬 Code graph analysis (10)
packages/web/src/components/project/overview-tab/ChartSection.jsx (1)
packages/web/src/constants/checklist-status.js (2)
CHECKLIST_STATUS(8-14)CHECKLIST_STATUS(8-14)
packages/web/src/lib/inter-rater-reliability.js (1)
packages/web/src/constants/checklist-status.js (2)
CHECKLIST_STATUS(8-14)CHECKLIST_STATUS(8-14)
packages/web/src/primitives/useProject/sync.js (1)
packages/web/src/constants/checklist-status.js (2)
CHECKLIST_STATUS(8-14)CHECKLIST_STATUS(8-14)
packages/web/src/primitives/__tests__/useProject.test.js (1)
packages/web/src/constants/checklist-status.js (2)
CHECKLIST_STATUS(8-14)CHECKLIST_STATUS(8-14)
packages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsx (2)
packages/web/src/lib/checklist-domain.js (1)
isReconciledChecklist(16-20)packages/web/src/constants/checklist-status.js (2)
CHECKLIST_STATUS(8-14)CHECKLIST_STATUS(8-14)
packages/web/src/components/project/overview-tab/OverviewTab.jsx (3)
packages/web/src/lib/inter-rater-reliability.js (2)
completedChecklists(48-50)checklists(45-45)packages/web/src/lib/checklist-domain.js (8)
checklists(30-30)checklists(46-46)checklists(57-57)checklists(74-74)checklists(96-96)checklists(113-113)checklists(132-132)checklists(253-253)packages/web/src/constants/checklist-status.js (2)
CHECKLIST_STATUS(8-14)CHECKLIST_STATUS(8-14)
packages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsx (2)
packages/web/src/constants/checklist-status.js (2)
CHECKLIST_STATUS(8-14)CHECKLIST_STATUS(8-14)packages/web/src/lib/checklist-domain.js (8)
checklists(30-30)checklists(46-46)checklists(57-57)checklists(74-74)checklists(96-96)checklists(113-113)checklists(132-132)checklists(253-253)
packages/web/src/components/checklist/compare/ReconciliationWrapper.jsx (1)
packages/web/src/constants/checklist-status.js (2)
CHECKLIST_STATUS(8-14)CHECKLIST_STATUS(8-14)
packages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsx (2)
packages/web/src/lib/checklist-domain.js (1)
isReconciledChecklist(16-20)packages/web/src/constants/checklist-status.js (2)
CHECKLIST_STATUS(8-14)CHECKLIST_STATUS(8-14)
packages/web/src/constants/checklist-status.js (2)
packages/web/src/primitives/useProject/sync.js (1)
status(99-99)packages/web/src/components/billing/SubscriptionCard.jsx (1)
currentStatus(33-33)
⏰ 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 (28)
packages/web/src/components/project/overview-tab/ChartSection.jsx (1)
161-163: LGTM - Status filter correctly updated to FINALIZED.The chart section now appropriately filters for finalized checklists rather than individual reviewer completions. This ensures only reconciled/final AMSTAR2 data appears in charts, aligning with the new status lifecycle where FINALIZED represents the authoritative end state.
packages/web/src/lib/inter-rater-reliability.js (1)
47-50: LGTM - Correct status for inter-rater reliability calculations.The filter now appropriately selects REVIEWER_COMPLETED checklists for inter-rater reliability metrics. This ensures the calculation compares independent reviewer assessments rather than finalized/reconciled results, which is the correct semantic for measuring reviewer agreement.
packages/web/src/components/project/reconcile-tab/ReconcileStatusTag.jsx (1)
13-16: LGTM - Status filter correctly updated for reconciliation readiness.The filter now appropriately checks for REVIEWER_COMPLETED status to determine reconciliation readiness. This correctly identifies when both individual reviewers have completed their assessments and the study is ready to proceed to reconciliation.
packages/web/src/components/project/reconcile-tab/ReconcileStudyRow.jsx (1)
53-57: LGTM - Consistent status filter for reconciliation workflow.The filter correctly identifies checklists awaiting reconciliation by checking for REVIEWER_COMPLETED status. This maintains consistency with ReconcileStatusTag.jsx and ensures the reconciliation button enables only when both reviewers have independently completed their assessments.
packages/web/src/components/project/overview-tab/OverviewTab.jsx (1)
85-89: LGTM - User progress calculation correctly updated.The progress calculation now appropriately counts both FINALIZED and REVIEWER_COMPLETED statuses as completed work. This correctly reflects that reviewers have finished their assessment tasks regardless of whether reconciliation has occurred.
packages/web/src/primitives/useProject/sync.js (1)
113-131: LGTM - Correct status gate for answer extraction and scoring.The sync logic now appropriately processes only FINALIZED checklists for answer extraction and score computation. This ensures:
- Only authoritative final data (reconciled or individually finalized) is scored and displayed
- Consistency with downstream consumers (ChartSection.jsx, AMSTAR2ResultsTable.jsx) that filter for FINALIZED status
- consolidatedAnswers for AMSTAR2 charts are computed only from finalized data
This aligns with the new status lifecycle where FINALIZED represents the terminal state ready for results display.
packages/web/src/components/project/overview-tab/AMSTAR2ResultsTable.jsx (1)
27-42: LGTM - Results table correctly filters for finalized data.The checklist selection logic now appropriately checks for FINALIZED status when displaying AMSTAR2 scores. This ensures:
- Reconciled checklists are displayed when available and finalized
- Fallback to any finalized AMSTAR2 checklist maintains consistency
- Only authoritative final scores appear in results tables
This aligns with the broader pattern across results display components (ChartSection.jsx, sync.js) that gate on FINALIZED status.
packages/web/src/primitives/__tests__/useProject.test.js (2)
11-11: LGTM - Import added for status constant.Importing CHECKLIST_STATUS constant ensures tests use the same status values as production code, improving maintainability and preventing typos.
377-380: LGTM - Test updated to use status constant.The test now correctly uses CHECKLIST_STATUS.FINALIZED instead of the hardcoded string 'completed'. This maintains consistency with the new status lifecycle and ensures tests reflect the updated production code behavior.
packages/web/src/components/checklist/ChecklistYjsWrapper.jsx (4)
261-265: Status check updated correctly for the new lifecycle.The blocking logic for toggle-back now correctly checks for
FINALIZEDstatus. This aligns with the new status model where finalized checklists are permanently locked.
292-297: Status label mapping is correct.The toast message correctly maps
FINALIZEDto "completed" for user-facing text, and non-finalized statuses to "awaiting reconciliation". This provides clear feedback to users.
360-373: Badge styling and labels correctly use FINALIZED status.The fallback badge logic properly distinguishes between
FINALIZED(green "Completed" badge) and other read-only states (gray "Read-only" badge). This provides appropriate visual feedback.
384-394: Button styling and text correctly reflect FINALIZED status.The completion button properly shows "Completed" with green styling when finalized, and "Mark Complete" with blue styling otherwise. The disabled state for invalid checklists is correctly preserved.
packages/web/src/components/checklist/compare/ReconciliationWrapper.jsx (4)
239-247: Correct check for reusable reconciled checklist.The logic correctly verifies that an existing reconciled checklist is not finalized before reusing it. This allows resuming an in-progress reconciliation while preventing modifications to completed ones.
250-262: Existing reconciled checklist detection is correct.The fallback check for reconciled checklists created by other clients correctly excludes finalized ones, ensuring only in-progress reconciliations are reused.
276-280: New reconciled checklist correctly starts with RECONCILING status.This aligns with the new lifecycle where reconciled checklists begin in
RECONCILINGstate and transition toFINALIZEDupon completion.
368-376: Finalization logic is correct.The reconciled checklist is properly marked as
FINALIZED. The comment correctly notes that individual reviewer checklists remain asREVIEWER_COMPLETED- they serve as historical records and shouldn't be modified. Based on learnings, this follows the pattern of storing final answers in the reconciled checklist itself.packages/web/src/lib/checklist-domain.js (7)
28-37: getTodoChecklists correctly excludes completed states.Filtering out both
FINALIZEDandREVIEWER_COMPLETEDensures that only active/in-progress checklists appear in the todo tab.
44-48: getCompletedChecklists correctly filters by FINALIZED.Only truly finalized checklists should appear in the completed tab, which this logic correctly implements.
55-65: New getFinalizedChecklist helper is well-designed.This utility correctly prioritizes a finalized reconciled checklist (the consensus version) over other finalized checklists. This ensures tables/charts display the authoritative version. Based on learnings, this aligns with storing final answers in the reconciled checklist itself.
72-79: getReconciliationChecklists correctly identifies checklists awaiting reconciliation.The logic properly returns individual reviewer checklists with
REVIEWER_COMPLETEDstatus, excluding reconciled checklists (identified byassignedTo === null).
109-129: Reconcile tab visibility logic is comprehensive.The logic correctly:
- Requires dual reviewers (single-reviewer studies skip reconciliation)
- Hides studies with finalized reconciled checklists
- Shows studies with 1-2
REVIEWER_COMPLETEDindividual checklistsThis ensures proper workflow progression.
189-200: getNextStatusForCompletion implements correct branching logic.Single-reviewer studies go directly to
FINALIZED, while dual-reviewer studies go toREVIEWER_COMPLETED(awaiting reconciliation). This aligns with the updated status lifecycle.
223-229: getInProgressReconciledChecklists correctly filters non-finalized reconciled checklists.This enables race condition detection by finding all reconciled checklists that haven't been finalized yet.
packages/web/src/constants/checklist-status.js (4)
8-14: Status enum is clean and well-structured.The new statuses (
REVIEWER_COMPLETED,RECONCILING,FINALIZED) clearly represent the distinct stages in the checklist lifecycle, replacing the previous ambiguous naming.
21-27: isEditable correctly identifies all non-editable states.All three locked states (
FINALIZED,REVIEWER_COMPLETED,RECONCILING) are correctly marked as non-editable. Note thatRECONCILINGchecklists are still being edited during reconciliation, but this is handled specially inReconciliationWrapperwhich updates the reconciled checklist directly.
34-49: Status labels are clear and user-friendly.Each status has an appropriate human-readable label. The default fallback to
status || 'Pending'handles edge cases gracefully.
56-70: Status styling provides good visual distinction.Each status has a distinct color scheme:
- Green for finalized (success)
- Yellow for in-progress (active work)
- Blue for reviewer-completed (awaiting next step)
- Purple for reconciling (collaborative work)
- Gray for pending (inactive)
| const readyToReconcile = () => | ||
| studies().filter(s => { | ||
| const checklists = s.checklists || []; | ||
| const completedChecklists = checklists.filter(c => c.status === CHECKLIST_STATUS.COMPLETED); | ||
| const completedChecklists = checklists.filter(c => c.status === CHECKLIST_STATUS.FINALIZED); | ||
| return completedChecklists.length === 2; | ||
| }).length; |
There was a problem hiding this comment.
Verify the readyToReconcile logic - potential semantic issue.
The filter now checks for studies with 2 FINALIZED checklists to determine "ready to reconcile" count. This appears semantically incorrect:
- FINALIZED status implies reconciliation is already complete (based on the new status lifecycle)
- Studies should be "ready to reconcile" when both reviewers have REVIEWER_COMPLETED status (independent assessments done, reconciliation pending)
- Other reconciliation components (ReconcileStatusTag.jsx line 15, ReconcileStudyRow.jsx line 55) correctly use REVIEWER_COMPLETED for this purpose
Consider whether this should be:
- const completedChecklists = checklists.filter(c => c.status === CHECKLIST_STATUS.FINALIZED);
+ const completedChecklists = checklists.filter(c => c.status === CHECKLIST_STATUS.REVIEWER_COMPLETED);If the intent is to count studies with finalized reconciliation results instead of "ready to reconcile", consider renaming the variable to reconciledStudies or similar for clarity.
🤖 Prompt for AI Agents
In packages/web/src/components/project/overview-tab/OverviewTab.jsx around lines
46 to 51, the readyToReconcile function currently counts studies with two
CHECKLIST_STATUS.FINALIZED checklists which is semantically wrong for "ready to
reconcile"; change the logic to count studies whose two reviewer checklists have
status CHECKLIST_STATUS.REVIEWER_COMPLETED (i.e., filter checklists for status
REVIEWER_COMPLETED and require length === 2), or if the intention truly was to
count already-reconciled studies, rename the variable to reconciledStudies to
reflect that behavior.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/web/src/components/project/overview-tab/OverviewTab.jsx
🧰 Additional context used
📓 Path-based instructions (17)
packages/web/**/!(*.test|*.spec).{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/error-handling.mdc)
packages/web/**/!(*.test|*.spec).{js,ts,jsx,tsx}: Always usehandleFetchErrorfrom@/lib/error-utils.jsfor frontend fetch calls with optionalshowToastparameter
UsecreateFormErrorSignalsfrom@/lib/form-errors.jsfor handling form validation errors, field-level errors, and global errors in frontend forms
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
packages/{web,workers}/**/!(*.test|*.spec).{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/error-handling.mdc)
packages/{web,workers}/**/!(*.test|*.spec).{js,ts,jsx,tsx}: Never throw string literals; always throw Error objects or return domain errors from API routes
UseisErrorCodeutility from@corates/sharedor@/lib/error-utils.jsto check for specific error codes instead of manual error comparisons
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
packages/web/src/**/*.{js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/form-state.mdc)
packages/web/src/**/*.{js,jsx}: Save form state to IndexedDB before initiating OAuth redirects (Google Drive, ORCID) using saveFormState() with form type ('createProject' or 'addStudies') and serializable state only
Only save serializable data to IndexedDB—exclude File objects, ArrayBuffers, functions, and other non-serializable objects from form state persistence
Restore form state after OAuth redirects by checking URL restore params with getRestoreParamsFromUrl(), retrieving saved state with getFormState(), restoring to form, clearing saved state with clearFormState(), and clearing URL params with clearRestoreParamsFromUrl()
For temporary File object storage during OAuth flows (e.g., pending PDFs), use projectStore.setPendingProjectData() instead of IndexedDB, as File objects cannot be serialized
Add restore parameters to the URL after OAuth redirects in the format '?restore=&projectId=' to signal form state restoration on mount
Clear URL restore parameters after form state restoration by calling clearRestoreParamsFromUrl() to prevent stale restoration attempts on subsequent navigation
Form state persistence library functions (saveFormState, getFormState, clearFormState, getRestoreParamsFromUrl, clearRestoreParamsFromUrl) are implemented in packages/web/src/lib/formStatePersistence.js and should be imported from @/lib/formStatePersistence.js
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
packages/web/src/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/pdf-handling.mdc)
packages/web/src/**/*.{js,jsx,ts,tsx}: Always useuploadPdffrom@api/pdf-api.jsfor uploading PDF files. Pass object with projectId, studyId, tag ('primary' or 'supplementary'), and fileName
Validate PDF files on frontend by checking file.type includes 'pdf' and file.size is within MAX_PDF_SIZE limit (full validation is done on backend)
UsecachePdfandgetCachedPdffrom@primitives/pdfCache.jsfor caching PDF data in IndexedDB
Implement PDF caching strategy: check cache first, download from server if not cached, then cache the downloaded PDF
Store only PDF metadata in Yjs (id, name, size, tag, uploadedAt, uploadedBy), never store PDF binary data in Yjs as it is too large
UseimportFromGoogleDrivefrom@api/google-drive.jsfor importing PDFs from Google Drive. Pass fileId, projectId, studyId, and tag
Save form state usingsaveFormStatefrom@/lib/formStatePersistence.jsbefore triggering OAuth redirects for Google Drive
UseaddPdfToStudyoperation fromuseProjecthook to add PDFs to a study, passing id, name, size, tag, uploadedAt, and uploadedBy
UseremovePdfFromStudyoperation fromuseProjecthook to remove PDFs from a study
UsepdfPreviewStorefrom@/stores/pdfPreviewStore.jsfor managing PDF preview state (openPreview, closePreview, getPreview methods)
UsedownloadPdffrom@api/pdf-api.jsto download PDFs from server, then cache the result usingcachePdf
Always cache PDFs after download and check cache before downloading to avoid redundant downloads
Use PDF operations fromuseProjecthook instead of bypassing through direct API calls
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
packages/web/src/**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/pdf-handling.mdc)
Use
PdfViewercomponent from@/components/checklist-ui/pdf/PdfViewer.jsxfor displaying PDFs, passing pdfData as ArrayBuffer, fileName, readOnly, and onPageChange
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
{packages/web/**,packages/landing/**}/**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/solidjs.mdc)
{packages/web/**,packages/landing/**}/**/*.{jsx,tsx}: NEVER destructure props in SolidJS components - access props directly or wrap in functions to maintain reactivity
Use external stores in packages/web/src/stores/ for shared/cross-feature state instead of prop-drilling
Keep SolidJS components lean and focused on rendering - move business logic to stores, primitives, or utilities
Create reusable logic in primitives (hooks) in packages/web/src/primitives/ and import them into components
Use Solid's Show component for conditional rendering instead of ternary operators
Use Solid's For component for rendering lists instead of Array.map()
Use the children helper when manipulating props.children in SolidJS components
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
{packages/web/**,packages/landing/**}/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/solidjs.mdc)
{packages/web/**,packages/landing/**}/**/*.{js,jsx,ts,tsx}: Use createSignal for simple reactive values in SolidJS components
Use createStore for complex objects and arrays that need granular reactivity in SolidJS
Use createMemo for computed/derived values that depend on reactive state in SolidJS
Always clean up SolidJS effects that create subscriptions or timers using onCleanup
Import stores directly in components and use store read/write action pattern - read from store, write via actions store
Prefer derived state with createMemo or signals over effects whenever possible
Use local createSignal or createStore for local component state; use external stores for shared/cross-feature state
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
packages/{web,ui}/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
packages/{web,ui}/**/*.{js,jsx,ts,tsx}: Import UI components from '@corates/ui' package instead of local components directories
Use solid-icons library for icons instead of emojis or other icon sources
Use Tailwind CSS classes for styling UI components
Apply responsive design using mobile-first approach with Tailwind CSS
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
packages/web/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Use import aliases from jsconfig.json (e.g., @/, @components/, @auth-ui/, @checklist-ui/, @project-ui/, @routes/, @primitives/, @api/, @config/, @lib/) instead of relative paths
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/yjs-sync.mdc)
**/*.{js,jsx,ts,tsx}: Use theuseProjecthook for managing Yjs connections with reference counting instead of creating Y.Doc instances directly
Never create Y.Doc instances directly; always use the connection registry managed by useProject
Access Y.Doc connection state via projectStore.getConnectionState(projectId) instead of checking connection state directly
Read Yjs-synced data from projectStore (using getStudies, getChecklist, etc.) rather than accessing Y.Doc maps/arrays directly
Use operation functions from useProject or projectActionsStore for writing data instead of directly modifying Y.Doc
Don't store Y.Doc references in component state; always retrieve the connection through useProject
Handle connection cleanup via onCleanup() in Solid.js components or equivalent cleanup patterns, calling disconnect() when the component unmounts
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
**/*
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*: NEVER use emojis anywhere - not in code, comments, documentation, plan files, commit messages, or examples
Do NOT use unicode symbols - unicode symbols are forbidden anywhere in the codebase
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
**/*.{ts,tsx,jsx,js}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx,jsx,js}: For UI icons, usesolid-iconslibrary or SVGs only (never emojis)
Prefer modern ES6+ syntax and features
Use import aliases from jsconfig.json as defined in the ui-components.mdc documentation
Prefer config files over hardcoding values
Ensure browser compatibility (Safari is usually problematic)
Group related components in subdirectories with barrel exports
Use Ark UI components from@corates/uipackage, not local component implementations
Usesolid-iconsicon library (e.g.,solid-icons/bi,solid-icons/fi) for icons
Comments should explain WHY something is being done, not WHAT the code is doing
Comment to explain why a particular approach or workaround was chosen
Comment to clarify intent when code could be misread or misunderstood
Comment to provide context from external systems, specs, or requirements
Comment to document assumptions, edge cases, or limitations
Do NOT comment by narrating what the code is doing
Do NOT duplicate function or variable names in plain English comments
Do NOT leave stale comments that contradict the code
Do NOT reference removed or obsolete code paths in comments
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
packages/web/**/*.{ts,tsx,jsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
packages/web/**/*.{ts,tsx,jsx}: Do NOT prop-drill application state in SolidJS - import stores directly where needed
Do NOT destructure props in SolidJS - accessprops.fielddirectly or wrap in function:() => props.field
SolidJS components should receive at most 1-5 props (local config only, not shared state)
Move business logic to stores, utilities, or primitives (not in components) in SolidJS
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
**/*.{ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/corates.mdc)
For UI icons, use
solid-iconslibrary or SVGs only (never emojis)
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/corates.mdc)
Prefer modern ES6+ syntax and features
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
packages/web/src/**/*.{ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/corates.mdc)
packages/web/src/**/*.{ts,tsx,jsx}: Use import aliases from jsconfig.json
Use Ark UI components from@corates/uipackage, NOT local components
Do NOT prop-drill application state; import stores directly where needed
UsecreateMemofor derived values
Move business logic to stores, utilities, or primitives (not components)
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
packages/web/src/components/**/*.{ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/corates.mdc)
packages/web/src/components/**/*.{ts,tsx,jsx}: Group related components in subdirectories with barrel exports
Do NOT destructure props; accessprops.fielddirectly or wrap in function:() => props.field
Components should receive at most 1-5 props (local config only, not shared state)
Files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/AMSTAR2/**,packages/web/src/ROBINS-I/**,packages/web/src/lib/checklist-domain.js : Checklist status transitions follow sequence: in_progress → completed (when all questions answered) → reconciled (after reconciliation complete)
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/reconciliation.mdc:0-0
Timestamp: 2025-12-27T03:02:14.854Z
Learning: Applies to {packages/web/src/components/checklist-ui/compare/**,packages/web/src/lib/checklist-domain.js,packages/web/src/AMSTAR2/checklist-compare.js} : Store final answers in the reconciled checklist itself, not in reconciliation progress metadata
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/AMSTAR2/**,packages/web/src/ROBINS-I/**,packages/web/src/lib/checklist-domain.js : Use getChecklistStatus utility from @/lib/checklist-domain.js to determine current checklist status before performing operations
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/AMSTAR2/**,packages/web/src/ROBINS-I/**,packages/web/src/lib/checklist-domain.js : Checklist status transitions follow sequence: in_progress → completed (when all questions answered) → reconciled (after reconciliation complete)
Applied to files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
📚 Learning: 2025-12-27T03:02:14.854Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/reconciliation.mdc:0-0
Timestamp: 2025-12-27T03:02:14.854Z
Learning: Applies to {packages/web/src/components/checklist-ui/compare/**,packages/web/src/lib/checklist-domain.js,packages/web/src/AMSTAR2/checklist-compare.js} : Store final answers in the reconciled checklist itself, not in reconciliation progress metadata
Applied to files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/AMSTAR2/**,packages/web/src/ROBINS-I/**,packages/web/src/lib/checklist-domain.js : Use getChecklistStatus utility from @/lib/checklist-domain.js to determine current checklist status before performing operations
Applied to files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
📚 Learning: 2025-12-27T03:02:14.854Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/reconciliation.mdc:0-0
Timestamp: 2025-12-27T03:02:14.854Z
Learning: Applies to {packages/web/src/components/checklist-ui/compare/**,packages/web/src/lib/checklist-domain.js} : Store reconciliation progress metadata (IDs and optional currentPage) in the study's Y.Map reconciliation property
Applied to files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
📚 Learning: 2025-12-27T03:02:14.854Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/reconciliation.mdc:0-0
Timestamp: 2025-12-27T03:02:14.854Z
Learning: Applies to {packages/web/src/components/checklist-ui/compare/**,packages/web/src/AMSTAR2/checklist-compare.js} : Use compareChecklists utility from checklist-compare.js for comparing reviewer checklists
Applied to files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/AMSTAR2/**,packages/web/src/ROBINS-I/**,packages/web/src/lib/checklist-domain.js,packages/web/src/primitives/useProject/checklists.js : Use checklist operations from useProject hook (createChecklist, updateChecklistAnswer, getChecklistData) instead of manually updating checklist structure
Applied to files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
📚 Learning: 2025-12-27T03:02:14.854Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/reconciliation.mdc:0-0
Timestamp: 2025-12-27T03:02:14.854Z
Learning: Applies to {packages/web/src/lib/checklist-domain.js,packages/web/src/AMSTAR2/checklist-compare.js} : Reconciliation structure should contain checklist1Id, checklist2Id, and reconciledChecklistId
Applied to files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
📚 Learning: 2025-12-27T03:02:14.854Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/reconciliation.mdc:0-0
Timestamp: 2025-12-27T03:02:14.854Z
Learning: Applies to packages/web/src/components/checklist-ui/compare/** : Use Y.Text objects for collaborative editing of question notes in reconciliation
Applied to files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/AMSTAR2/** : Use scoreChecklist utility from @/AMSTAR2/checklist.js to determine quality assessment rating: 'High' | 'Moderate' | 'Low' | 'Critically Low'
Applied to files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/ROBINS-I/** : Use scoreChecklist utility from @/ROBINS-I/checklist.js to determine risk of bias rating: 'Low' | 'Moderate' | 'Serious' | 'Critical'
Applied to files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
📚 Learning: 2025-12-27T03:02:14.854Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/reconciliation.mdc:0-0
Timestamp: 2025-12-27T03:02:14.854Z
Learning: Applies to packages/web/src/components/checklist-ui/compare/** : Auto-fill final answer with reviewer1's answer when reviewers agree and no final answer exists
Applied to files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
📚 Learning: 2025-12-27T03:01:06.933Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/checklist-operations.mdc:0-0
Timestamp: 2025-12-27T03:01:06.933Z
Learning: Applies to packages/web/src/components/checklist-ui/**,packages/web/src/ROBINS-I/** : Use shouldStopAssessment utility from @/ROBINS-I/checklist.js to check if Section B indicates critical risk of bias requiring assessment termination
Applied to files:
packages/web/src/components/project/overview-tab/OverviewTab.jsx
⏰ 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 (1)
packages/web/src/components/project/overview-tab/OverviewTab.jsx (1)
87-91: LGTM: Status checks correctly updated for new lifecycle.The logic correctly counts checklists as completed when they have either
REVIEWER_COMPLETED(reviewer finished independent assessment) orFINALIZED(reconciliation complete) status. Both statuses appropriately represent completion from the user's perspective in the new checklist lifecycle.
| const readyToReconcile = () => | ||
| studies().filter(s => { | ||
| const checklists = s.checklists || []; | ||
| const completedChecklists = checklists.filter(c => c.status === CHECKLIST_STATUS.COMPLETED); | ||
| const completedChecklists = checklists.filter( | ||
| c => c.status === CHECKLIST_STATUS.REVIEWER_COMPLETED, | ||
| ); | ||
| return completedChecklists.length === 2; | ||
| }).length; | ||
| }).length / 2; // Divide by 2 because we need to count the number of studies that have both reviewers completed, not the number of checklists |
There was a problem hiding this comment.
Remove the incorrect division by 2.
The division by 2 on Line 53 is incorrect. The filter already counts studies (not checklists) where exactly 2 reviewers have REVIEWER_COMPLETED status. Each qualifying study is counted once, so dividing by 2 will incorrectly report half the actual number of studies ready to reconcile.
The comment's reasoning is flawed—the filter's completedChecklists.length === 2 condition already ensures we're counting studies with both reviewers completed, not counting individual checklists.
Proposed fix
const readyToReconcile = () =>
studies().filter(s => {
const checklists = s.checklists || [];
const completedChecklists = checklists.filter(
c => c.status === CHECKLIST_STATUS.REVIEWER_COMPLETED,
);
return completedChecklists.length === 2;
- }).length / 2; // Divide by 2 because we need to count the number of studies that have both reviewers completed, not the number of checklists
+ }).length;🤖 Prompt for AI Agents
In packages/web/src/components/project/overview-tab/OverviewTab.jsx around lines
46 to 53, the function readyToReconcile incorrectly divides the filtered studies
count by 2; remove the " / 2" so the function returns the actual number of
studies whose checklists have exactly two REVIEWER_COMPLETED entries. Update the
trailing comment to reflect that each filtered item is one study (no division
needed).
…ibilities
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.