Skip to content

104 refactor project state handlers#105

Merged
InfinityBowman merged 7 commits into
mainfrom
104-refactor-project-state-handlers
Dec 19, 2025
Merged

104 refactor project state handlers#105
InfinityBowman merged 7 commits into
mainfrom
104-refactor-project-state-handlers

Conversation

@InfinityBowman
Copy link
Copy Markdown
Owner

@InfinityBowman InfinityBowman commented Dec 19, 2025

Summary by CodeRabbit

  • Chores

    • Disabled SonarJS linting rules.
    • Bumped test dependency in package manifests.
  • Refactor

    • Centralized project mutation logic into a single actions store; UI components now use that store.
  • User-facing changes / Bug Fixes

    • Project actions (rename, delete, PDF view/download/upload, checklist flows) use unified store with confirmation dialogs and success/error toasts.
    • Removed legacy StudyCard UI (affects study list rendering).
  • Tests

    • Expanded connection reference-counting tests and concurrency coverage.

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

@InfinityBowman InfinityBowman linked an issue Dec 19, 2025 that may be closed by this pull request
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Dec 19, 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 a0a570a Commit Preview URL Dec 19 2025, 01:59 PM

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 19, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Centralizes project mutation logic into a new singleton projectActionsStore, migrates per-project handler hooks into domain action modules, removes the root StudyCard, narrows ProjectContext surface, updates many project UI components to use the store, and adjusts ESLint config and tests accordingly.

Changes

Cohort / File(s) Summary
Store Core
packages/web/src/stores/projectActionsStore/index.js
New singleton store managing active project, connection registry, lifecycle methods (_setConnection, _removeConnection, _setActiveProject, _clearActiveProject) and exposing domain action modules (study, checklist, pdf, project, member, reconciliation).
Study Actions
packages/web/src/stores/projectActionsStore/studies.js
New study action module: create/update/delete/addBatch/importReferences, PDF attachment workflows, DOI/metadata extraction, batch processing and rollback semantics.
PDF Actions
packages/web/src/stores/projectActionsStore/pdfs.js
New PDF action module: view/download/upload/delete/updateTag/updateMetadata, Google Drive import, addToStudy; coordinates cache, preview state, and server ops.
Checklist Actions
packages/web/src/stores/projectActionsStore/checklists.js
New checklist action module: create/update/delete/getAnswersMap/getData/updateAnswer/getQuestionNote with connection checks and toast feedback.
Project & Member Actions
packages/web/src/stores/projectActionsStore/project.js, packages/web/src/stores/projectActionsStore/members.js
New project-level actions (rename, updateDescription, delete/deleteById) and member removal (remove) implemented against API and projectStore updates.
Reconciliation Actions
packages/web/src/stores/projectActionsStore/reconciliation.js
New reconciliation action module: saveProgress/getProgress/applyToChecklists delegating to active connection ops.
Primitives Integration
packages/web/src/primitives/useProject/index.js
Registers per-project ops with projectActionsStore on connection creation (_setConnection) and cleans up on release (_removeConnection); exports test helpers _getOrCreateConnection, _releaseConnection, _connectionRegistry.
Removed Handler Hooks
packages/web/src/primitives/useProjectChecklistHandlers.js, .../useProjectMemberHandlers.js, .../useProjectPdfHandlers.js, .../useProjectStudyHandlers.js
Four per-project handler hooks removed; their responsibilities migrated into the action modules.
Project Context
packages/web/src/components/project-ui/ProjectContext.jsx
ProjectProvider surface narrowed to identity helpers only (projectId, userRole, isOwner, getAssigneeName); handlers/projectActions removed from context value.
Component Refactors — Project
packages/web/src/components/project-ui/ProjectDashboard.jsx, packages/web/src/components/project-ui/ProjectView.jsx
Components updated to use projectActionsStore for deletions/renames/description updates; ProjectView sets/clears active project on mount/unmount and passes only projectId to ProjectProvider.
Component Refactors — Studies & Tabs
packages/web/src/components/project-ui/all-studies-tab/..., packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx, packages/web/src/components/project-ui/completed-tab/CompletedTab.jsx, packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx, packages/web/src/components/project-ui/reconcile-tab/ReconcileTab.jsx
Tabs and AllStudiesTab updated to call projectActionsStore for mutations; UI wiring simplified, navigation helpers added, and modal/confirm flows localized to components where applicable.
StudyCard Removal / Adjustments
packages/web/src/components/project-ui/StudyCard.jsx, packages/web/src/components/project-ui/all-studies-tab/study-card/*
Root StudyCard.jsx removed; remaining study-card subcomponents refactored to perform mutations via projectActionsStore and drop many external callback props.
Primitives Tests
packages/web/src/primitives/__tests__/useProject.test.js
Tests expanded with connection reference-counting and concurrency suite; mocked projectActionsStore hooks and exported internal test utilities used.
Lint Config
eslint.config.js
SonarJS plugin import and cognitive-complexity rule commented out/disabled.
Package JSON Updates
packages/ui/package.json, packages/web/package.json
Added/bumped devDependency @testing-library/jest-dom to ^6.9.1.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant UI as Component (e.g., Tab / StudyCard)
  participant Store as projectActionsStore
  participant Conn as ActiveConnection (ops)
  participant API as Server/API
  participant Cache as pdfCache / projectStore
  participant UI2 as Toast/Preview UI

  UI->>Store: call e.g., pdf.upload(studyId, file, tag)
  Store->>Conn: getActiveConnection() → ops.uploadPdf(...)
  Conn->>API: upload request
  API-->>Conn: upload response (pdfId, metadata)
  Conn-->>Store: return uploaded metadata
  Store->>Cache: cache buffer, update projectStore/study
  Store->>UI2: showToast("Uploaded") / update preview
  UI2-->>UI: UI updates (progress/confirmation)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • Areas needing extra attention:
    • projectActionsStore/studies.js — metadata extraction, batch flows, rollback logic.
    • projectActionsStore/pdfs.js — cache lifecycle, upload/download edge cases, error propagation.
    • useProject/index.js — connection registration/cleanup and exported test helpers correctness.
    • Component changes where handler props were removed (ensure no lingering references) and activeProject lifecycle consistency.
    • Tests in primitives/__tests__/useProject.test.js for concurrency expectations.

Possibly related issues

Possibly related PRs

Poem

🐇 I hopped from props down to a central store,

No more handlers passed through every door.
PDFs and checklists now dance in one space,
The rabbit cheers for tidy code and grace.
Hooray for fewer props—and more embrace!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'refactor project state handlers' accurately reflects the main change—migrating from prop-based handler callbacks to a centralized projectActionsStore across the project codebase.
Docstring Coverage ✅ Passed Docstring coverage is 84.06% which is sufficient. The required threshold is 80.00%.

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2298130 and a0a570a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • packages/ui/package.json (1 hunks)
  • packages/web/package.json (1 hunks)
  • packages/web/src/components/project-ui/ProjectDashboard.jsx (2 hunks)
  • packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx (6 hunks)
  • packages/web/src/primitives/__tests__/useProject.test.js (4 hunks)
  • packages/web/src/primitives/useProject/index.js (4 hunks)
  • packages/web/src/stores/projectActionsStore/pdfs.js (1 hunks)
  • packages/web/src/stores/projectActionsStore/project.js (1 hunks)

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

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: 5

🧹 Nitpick comments (8)
eslint.config.js (1)

110-110: Reconsider suppressing cognitive-complexity checks.

The cognitive-complexity rule helps maintain code readability and testability. Since this PR involves a major refactoring to a store-based architecture, consider addressing any complexity issues in the refactored code rather than disabling the check. If specific functions exceed complexity thresholds, break them into smaller, focused units.

Based on learnings, keep files small, focused, and modular by extracting complex logic into separate utility files.

packages/web/src/stores/projectActionsStore/reconciliation.js (1)

14-33: Silent failures may hide reconciliation errors from users.

Unlike checklists.js which shows toast notifications on failures, these methods silently return undefined when the connection is unavailable or methods are missing. For user-facing operations like saving reconciliation progress, consider adding error feedback for consistency.

Example: Adding error handling to saveProgress
 function saveProgress(studyId, checklist1Id, checklist2Id, data) {
   const ops = getActiveConnection();
+  if (!ops?.saveReconciliationProgress) {
+    console.warn('Cannot save reconciliation progress: not connected');
+    return undefined;
+  }
   return ops?.saveReconciliationProgress?.(studyId, checklist1Id, checklist2Id, data);
 }
packages/web/src/stores/projectActionsStore/checklists.js (1)

86-89: Consider adding error handling to updateAnswer.

This is a mutation operation that modifies state, but unlike create/update/delete, it lacks error handling and user feedback. If the connection is unavailable, the user won't know their answer wasn't saved.

packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx (2)

77-80: Consider awaiting the async Google Drive import.

projectActionsStore.pdf.handleGoogleDriveImport likely performs async operations (API calls, file processing). If errors occur, they won't be caught here. Consider making this handler async and adding error handling.

Proposed improvement
-  const handleGoogleDriveImportSuccess = file => {
+  const handleGoogleDriveImportSuccess = async file => {
     const studyId = googleDriveTargetStudyId();
-    projectActionsStore.pdf.handleGoogleDriveImport(studyId, file);
+    try {
+      await projectActionsStore.pdf.handleGoogleDriveImport(studyId, file);
+    } catch (err) {
+      console.error('Google Drive import failed:', err);
+    }
   };

153-162: StudyCard prop count is at the threshold.

The component receives 6 props, which is slightly over the coding guideline of 1-5 props. Given that study is the data payload and the others are UI controls, this is acceptable for now. Consider consolidating callbacks into a single handlers object or moving expand state into a store if this grows further. Based on coding guidelines.

packages/web/src/stores/projectActionsStore/project.js (1)

19-31: Inconsistent error handling pattern across operations.

rename silently returns on failure (after showing a toast), while deleteById throws the error. This inconsistency can confuse callers. Consider making all operations either throw or return a result object for consistency.

Proposed pattern for consistency
   async function rename(newName) {
     const ops = getActiveConnection();
     if (!ops?.renameProject) {
       showToast.error('Rename Failed', 'Not connected to project');
-      return;
+      throw new Error('Not connected to project');
     }
     try {
       await ops.renameProject(newName);
     } catch (err) {
       console.error('Error renaming project:', err);
       showToast.error('Rename Failed', err.message || 'Failed to rename project');
+      throw err;
     }
   }
packages/web/src/stores/projectActionsStore/studies.js (1)

308-324: Minor: abstract passed as both description and metadata.

The study.abstract is used for both the description parameter and within metadata.abstract. This is likely intentional for different use cases but creates data duplication. Consider if the description parameter is needed.

packages/web/src/stores/projectActionsStore/index.js (1)

112-132: Note the getActiveProjectId aliasing for clarity.

Line 132 aliases the public getActiveProjectId to getActiveProjectIdOrNull, which returns null when no active project is set. Internally, there's also a getActiveProjectId() function that throws instead. While this works correctly (the throwing version isn't exported), future maintainers should be aware that the public API returns null rather than throwing.

Consider adding a JSDoc comment to the public API to clarify this behavior.

Optional: Add JSDoc to clarify behavior
   return {
     // Internal - called by useProject hook and ProjectView
     _setConnection,
     _removeConnection,
     _getConnection,
     _setActiveProject,
     _clearActiveProject,
 
-    // Utility
+    /**
+     * Get active project ID or null if not set
+     * @returns {string|null}
+     */
     getActiveProjectId: getActiveProjectIdOrNull,
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 997641e and 2298130.

📒 Files selected for processing (26)
  • eslint.config.js (3 hunks)
  • packages/web/src/components/project-ui/ProjectContext.jsx (1 hunks)
  • packages/web/src/components/project-ui/ProjectDashboard.jsx (2 hunks)
  • packages/web/src/components/project-ui/ProjectView.jsx (6 hunks)
  • packages/web/src/components/project-ui/StudyCard.jsx (0 hunks)
  • packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx (7 hunks)
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx (2 hunks)
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCardHeader.jsx (3 hunks)
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx (3 hunks)
  • packages/web/src/components/project-ui/completed-tab/CompletedTab.jsx (3 hunks)
  • packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx (6 hunks)
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx (1 hunks)
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileTab.jsx (3 hunks)
  • packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx (3 hunks)
  • packages/web/src/primitives/useProject/index.js (3 hunks)
  • packages/web/src/primitives/useProjectChecklistHandlers.js (0 hunks)
  • packages/web/src/primitives/useProjectMemberHandlers.js (0 hunks)
  • packages/web/src/primitives/useProjectPdfHandlers.js (0 hunks)
  • packages/web/src/primitives/useProjectStudyHandlers.js (0 hunks)
  • packages/web/src/stores/projectActionsStore/checklists.js (1 hunks)
  • packages/web/src/stores/projectActionsStore/index.js (1 hunks)
  • packages/web/src/stores/projectActionsStore/members.js (1 hunks)
  • packages/web/src/stores/projectActionsStore/pdfs.js (1 hunks)
  • packages/web/src/stores/projectActionsStore/project.js (1 hunks)
  • packages/web/src/stores/projectActionsStore/reconciliation.js (1 hunks)
  • packages/web/src/stores/projectActionsStore/studies.js (1 hunks)
💤 Files with no reviewable changes (5)
  • packages/web/src/components/project-ui/StudyCard.jsx
  • packages/web/src/primitives/useProjectMemberHandlers.js
  • packages/web/src/primitives/useProjectStudyHandlers.js
  • packages/web/src/primitives/useProjectChecklistHandlers.js
  • packages/web/src/primitives/useProjectPdfHandlers.js
🧰 Additional context used
📓 Path-based instructions (13)
**/*

📄 CodeRabbit inference engine (.cursorrules)

Do not use emojis in code, comments, documentation, or commit messages

Files:

  • eslint.config.js
  • packages/web/src/stores/projectActionsStore/project.js
  • packages/web/src/components/project-ui/completed-tab/CompletedTab.jsx
  • packages/web/src/components/project-ui/ProjectContext.jsx
  • packages/web/src/stores/projectActionsStore/reconciliation.js
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileTab.jsx
  • packages/web/src/stores/projectActionsStore/members.js
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCardHeader.jsx
  • packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx
  • packages/web/src/primitives/useProject/index.js
  • packages/web/src/components/project-ui/ProjectDashboard.jsx
  • packages/web/src/stores/projectActionsStore/checklists.js
  • packages/web/src/stores/projectActionsStore/pdfs.js
  • packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx
  • packages/web/src/stores/projectActionsStore/studies.js
  • packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx
  • packages/web/src/stores/projectActionsStore/index.js
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx
**/*.{js,jsx,ts,tsx,json,md,css,html}

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

Do not use emojis in code, comments, documentation, or commit messages

Files:

  • eslint.config.js
  • packages/web/src/stores/projectActionsStore/project.js
  • packages/web/src/components/project-ui/completed-tab/CompletedTab.jsx
  • packages/web/src/components/project-ui/ProjectContext.jsx
  • packages/web/src/stores/projectActionsStore/reconciliation.js
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileTab.jsx
  • packages/web/src/stores/projectActionsStore/members.js
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCardHeader.jsx
  • packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx
  • packages/web/src/primitives/useProject/index.js
  • packages/web/src/components/project-ui/ProjectDashboard.jsx
  • packages/web/src/stores/projectActionsStore/checklists.js
  • packages/web/src/stores/projectActionsStore/pdfs.js
  • packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx
  • packages/web/src/stores/projectActionsStore/studies.js
  • packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx
  • packages/web/src/stores/projectActionsStore/index.js
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx
**/*.{js,jsx,ts,tsx}

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

**/*.{js,jsx,ts,tsx}: Follow standard JavaScript/SolidJS/Cloudflare best practices
Prefer modern ES6+ syntax and features
Use aliases for imports when appropriate to improve readability
Prefer using config files rather than hardcoding values
Keep files small, focused, and modular. Extract sub-modules into a folder with index.jsx and helper components, move complex logic into separate utility files or primitives, and split large forms into section components
Each file should handle one coherent responsibility

Files:

  • eslint.config.js
  • packages/web/src/stores/projectActionsStore/project.js
  • packages/web/src/components/project-ui/completed-tab/CompletedTab.jsx
  • packages/web/src/components/project-ui/ProjectContext.jsx
  • packages/web/src/stores/projectActionsStore/reconciliation.js
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileTab.jsx
  • packages/web/src/stores/projectActionsStore/members.js
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCardHeader.jsx
  • packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx
  • packages/web/src/primitives/useProject/index.js
  • packages/web/src/components/project-ui/ProjectDashboard.jsx
  • packages/web/src/stores/projectActionsStore/checklists.js
  • packages/web/src/stores/projectActionsStore/pdfs.js
  • packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx
  • packages/web/src/stores/projectActionsStore/studies.js
  • packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx
  • packages/web/src/stores/projectActionsStore/index.js
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx
packages/web/src/**/*.{jsx,tsx,js,ts}

📄 CodeRabbit inference engine (.cursorrules)

packages/web/src/**/*.{jsx,tsx,js,ts}: For UI icons, use the solid-icons library or SVGs only. Do not use emojis
Import stores directly where needed instead of passing values through multiple components
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
You may create reusable logic in 'primitives' (hooks) that can be shared across components to keep components clean and focused on rendering

Files:

  • packages/web/src/stores/projectActionsStore/project.js
  • packages/web/src/components/project-ui/completed-tab/CompletedTab.jsx
  • packages/web/src/components/project-ui/ProjectContext.jsx
  • packages/web/src/stores/projectActionsStore/reconciliation.js
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileTab.jsx
  • packages/web/src/stores/projectActionsStore/members.js
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCardHeader.jsx
  • packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx
  • packages/web/src/primitives/useProject/index.js
  • packages/web/src/components/project-ui/ProjectDashboard.jsx
  • packages/web/src/stores/projectActionsStore/checklists.js
  • packages/web/src/stores/projectActionsStore/pdfs.js
  • packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx
  • packages/web/src/stores/projectActionsStore/studies.js
  • packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx
  • packages/web/src/stores/projectActionsStore/index.js
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx
packages/**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

packages/**/*.{js,jsx,ts,tsx}: Prefer modern ES6+ syntax and features
Use aliases for imports when appropriate to improve readability
Prefer using config files rather than hardcoding values
Keep files small, focused, and modular. If a file exceeds a high number of lines, consider refactoring by extracting sub-modules into a folder with index.jsx and helper components, moving complex logic into separate utility files or primitives, or splitting large forms into section components
Each file should handle one coherent responsibility
Use Zod for schema and input validation

Files:

  • packages/web/src/stores/projectActionsStore/project.js
  • packages/web/src/components/project-ui/completed-tab/CompletedTab.jsx
  • packages/web/src/components/project-ui/ProjectContext.jsx
  • packages/web/src/stores/projectActionsStore/reconciliation.js
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileTab.jsx
  • packages/web/src/stores/projectActionsStore/members.js
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCardHeader.jsx
  • packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx
  • packages/web/src/primitives/useProject/index.js
  • packages/web/src/components/project-ui/ProjectDashboard.jsx
  • packages/web/src/stores/projectActionsStore/checklists.js
  • packages/web/src/stores/projectActionsStore/pdfs.js
  • packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx
  • packages/web/src/stores/projectActionsStore/studies.js
  • packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx
  • packages/web/src/stores/projectActionsStore/index.js
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx
packages/web/src/**/*.{jsx,tsx,js,ts,css}

📄 CodeRabbit inference engine (.cursorrules)

Ensure browser compatibility for all frontend code (Safari is usually problematic)

Files:

  • packages/web/src/stores/projectActionsStore/project.js
  • packages/web/src/components/project-ui/completed-tab/CompletedTab.jsx
  • packages/web/src/components/project-ui/ProjectContext.jsx
  • packages/web/src/stores/projectActionsStore/reconciliation.js
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileTab.jsx
  • packages/web/src/stores/projectActionsStore/members.js
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCardHeader.jsx
  • packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx
  • packages/web/src/primitives/useProject/index.js
  • packages/web/src/components/project-ui/ProjectDashboard.jsx
  • packages/web/src/stores/projectActionsStore/checklists.js
  • packages/web/src/stores/projectActionsStore/pdfs.js
  • packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx
  • packages/web/src/stores/projectActionsStore/studies.js
  • packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx
  • packages/web/src/stores/projectActionsStore/index.js
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx
packages/web/src/**/*.{js,jsx,ts,tsx}

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

packages/web/src/**/*.{js,jsx,ts,tsx}: For UI icons, use the solid-icons library or SVGs only. Do not use emojis
Ensure browser compatibility for all frontend code (Safari is usually problematic)
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
Use createMemo to compute values based on props or state to ensure reactive updates
Create reusable logic in primitives (hooks) that can be shared across components to keep components clean and focused on rendering

Files:

  • packages/web/src/stores/projectActionsStore/project.js
  • packages/web/src/components/project-ui/completed-tab/CompletedTab.jsx
  • packages/web/src/components/project-ui/ProjectContext.jsx
  • packages/web/src/stores/projectActionsStore/reconciliation.js
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileTab.jsx
  • packages/web/src/stores/projectActionsStore/members.js
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCardHeader.jsx
  • packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx
  • packages/web/src/primitives/useProject/index.js
  • packages/web/src/components/project-ui/ProjectDashboard.jsx
  • packages/web/src/stores/projectActionsStore/checklists.js
  • packages/web/src/stores/projectActionsStore/pdfs.js
  • packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx
  • packages/web/src/stores/projectActionsStore/studies.js
  • packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx
  • packages/web/src/stores/projectActionsStore/index.js
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx
packages/web/src/stores/**/*.{js,ts}

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

Use Solid's createStore for complex state or state objects to ensure better performance and reactivity

Files:

  • packages/web/src/stores/projectActionsStore/project.js
  • packages/web/src/stores/projectActionsStore/reconciliation.js
  • packages/web/src/stores/projectActionsStore/members.js
  • packages/web/src/stores/projectActionsStore/checklists.js
  • packages/web/src/stores/projectActionsStore/pdfs.js
  • packages/web/src/stores/projectActionsStore/studies.js
  • packages/web/src/stores/projectActionsStore/index.js
packages/web/src/components/**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursorrules)

packages/web/src/components/**/*.{jsx,tsx}: Use responsive design principles for UI components
Use Zag.js for UI components and design system
Zag components exist in packages/web/src/components/zag/* and should be reused; check the README.md in that folder for a list of existing components before adding new components and when debugging
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
Components should be lean and focused and should not implement business logic; move business logic into stores, utilities, or primitives
Never have a component act as a 'God component' coordinating multiple large concerns

Files:

  • packages/web/src/components/project-ui/completed-tab/CompletedTab.jsx
  • packages/web/src/components/project-ui/ProjectContext.jsx
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileTab.jsx
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCardHeader.jsx
  • packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx
  • packages/web/src/components/project-ui/ProjectDashboard.jsx
  • packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx
packages/web/src/components/**/*.{jsx,tsx,js}

📄 CodeRabbit inference engine (.cursorrules)

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

Files:

  • packages/web/src/components/project-ui/completed-tab/CompletedTab.jsx
  • packages/web/src/components/project-ui/ProjectContext.jsx
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileTab.jsx
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCardHeader.jsx
  • packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx
  • packages/web/src/components/project-ui/ProjectDashboard.jsx
  • packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx
packages/web/src/**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursorrules)

packages/web/src/**/*.{jsx,tsx}: 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
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

Files:

  • packages/web/src/components/project-ui/completed-tab/CompletedTab.jsx
  • packages/web/src/components/project-ui/ProjectContext.jsx
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileTab.jsx
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCardHeader.jsx
  • packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx
  • packages/web/src/components/project-ui/ProjectDashboard.jsx
  • packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx
packages/web/src/components/**/*.{js,jsx,ts,tsx}

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

packages/web/src/components/**/*.{js,jsx,ts,tsx}: Use responsive design principles for UI components
Use Zag.js for UI components and design system
Reuse Zag components from packages/web/src/components/zag/* and check the README.md in that folder for existing components before adding new components
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. 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 on rendering. Do not implement business logic; move that into stores, utilities, or primitives
Never have a component act as a 'God component' coordinating multiple large concerns

Files:

  • packages/web/src/components/project-ui/completed-tab/CompletedTab.jsx
  • packages/web/src/components/project-ui/ProjectContext.jsx
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileTab.jsx
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCardHeader.jsx
  • packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx
  • packages/web/src/components/project-ui/ProjectDashboard.jsx
  • packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx
packages/web/src/components/**

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

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

Files:

  • packages/web/src/components/project-ui/completed-tab/CompletedTab.jsx
  • packages/web/src/components/project-ui/ProjectContext.jsx
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileTab.jsx
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCardHeader.jsx
  • packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx
  • packages/web/src/components/project-ui/ProjectDashboard.jsx
  • packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx
🧠 Learnings (21)
📓 Common learnings
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-19T12:38:18.491Z
Learning: Applies to packages/web/src/components/**/*.{jsx,tsx} : If a component would need more than 5 props, move the shared data into an external store, a primitive, or Solid context
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-19T12:38:18.491Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx,js,ts} : Import stores directly where needed instead of passing values through multiple components
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-19T12:38:18.491Z
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
📚 Learning: 2025-12-19T12:38:38.879Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T12:38:38.879Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Prefer using config files rather than hardcoding values

Applied to files:

  • eslint.config.js
📚 Learning: 2025-12-19T12:38:18.491Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-19T12:38:18.491Z
Learning: Applies to packages/**/*.{js,jsx,ts,tsx} : Prefer using config files rather than hardcoding values

Applied to files:

  • eslint.config.js
📚 Learning: 2025-12-19T12:38:38.879Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T12:38:38.879Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Follow standard JavaScript/SolidJS/Cloudflare best practices

Applied to files:

  • eslint.config.js
📚 Learning: 2025-12-19T12:38:38.879Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T12:38:38.879Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Prefer modern ES6+ syntax and features

Applied to files:

  • eslint.config.js
📚 Learning: 2025-12-19T12:38:18.491Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-19T12:38:18.491Z
Learning: Applies to packages/**/*.{js,jsx,ts,tsx} : Prefer modern ES6+ syntax and features

Applied to files:

  • eslint.config.js
📚 Learning: 2025-12-19T12:38:38.879Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T12:38:38.879Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Each file should handle one coherent responsibility

Applied to files:

  • eslint.config.js
📚 Learning: 2025-12-19T12:38:38.879Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T12:38:38.879Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Keep files small, focused, and modular. Extract sub-modules into a folder with index.jsx and helper components, move complex logic into separate utility files or primitives, and split large forms into section components

Applied to files:

  • eslint.config.js
📚 Learning: 2025-12-19T12:38:38.879Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T12:38:38.879Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use aliases for imports when appropriate to improve readability

Applied to files:

  • eslint.config.js
  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx
📚 Learning: 2025-12-19T12:38:18.491Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-19T12:38:18.491Z
Learning: Applies to packages/**/*.{js,jsx,ts,tsx} : Each file should handle one coherent responsibility

Applied to files:

  • eslint.config.js
📚 Learning: 2025-12-19T12:38:18.491Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-19T12:38:18.491Z
Learning: Applies to packages/**/*.{js,jsx,ts,tsx} : Use Zod for schema and input validation

Applied to files:

  • eslint.config.js
📚 Learning: 2025-12-19T12:38:18.491Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-19T12:38:18.491Z
Learning: Applies to packages/**/*.{js,jsx,ts,tsx} : Use aliases for imports when appropriate to improve readability

Applied to files:

  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx
📚 Learning: 2025-12-19T12:38:18.491Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-19T12:38:18.491Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx,js,ts} : Import stores directly where needed instead of passing values through multiple components

Applied to files:

  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx
  • packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx
  • packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx
  • packages/web/src/stores/projectActionsStore/index.js
  • packages/web/src/components/project-ui/ProjectView.jsx
📚 Learning: 2025-12-19T12:38:18.491Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-19T12:38:18.491Z
Learning: Applies to packages/web/src/components/**/*.{jsx,tsx} : Zag components exist in `packages/web/src/components/zag/*` and should be reused; check the README.md in that folder for a list of existing components before adding new components and when debugging

Applied to files:

  • packages/web/src/components/project-ui/reconcile-tab/ReconcileStudyCard.jsx
📚 Learning: 2025-12-19T12:38:38.880Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T12:38:38.880Z
Learning: Applies to packages/web/src/stores/**/*.{js,ts} : Use Solid's `createStore` for complex state or state objects to ensure better performance and reactivity

Applied to files:

  • packages/web/src/primitives/useProject/index.js
  • packages/web/src/stores/projectActionsStore/index.js
  • packages/web/src/components/project-ui/ProjectView.jsx
📚 Learning: 2025-12-19T12:38:18.491Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-19T12:38:18.491Z
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/project-ui/todo-tab/ToDoTab.jsx
  • packages/web/src/components/project-ui/ProjectView.jsx
📚 Learning: 2025-12-19T12:38:38.880Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T12:38:38.880Z
Learning: Applies to packages/web/src/**/*.{js,jsx,ts,tsx} : Create reusable logic in primitives (hooks) that can be shared across components to keep components clean and focused on rendering

Applied to files:

  • packages/web/src/components/project-ui/ProjectView.jsx
📚 Learning: 2025-12-19T12:38:18.491Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-19T12:38:18.491Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx,js,ts} : You may create reusable logic in 'primitives' (hooks) that can be shared across components to keep components clean and focused on rendering

Applied to files:

  • packages/web/src/components/project-ui/ProjectView.jsx
📚 Learning: 2025-12-19T12:38:18.491Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-19T12:38:18.491Z
Learning: Applies to packages/web/src/components/**/*.{jsx,tsx} : Use Zag.js for UI components and design system

Applied to files:

  • packages/web/src/components/project-ui/ProjectView.jsx
📚 Learning: 2025-12-19T12:38:18.491Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-19T12:38:18.491Z
Learning: Applies to packages/web/src/components/**/*.{jsx,tsx} : If a component would need more than 5 props, move the shared data into an external store, a primitive, or Solid context

Applied to files:

  • packages/web/src/components/project-ui/ProjectView.jsx
📚 Learning: 2025-12-19T12:38:18.491Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-19T12:38:18.491Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx} : 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

Applied to files:

  • packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx
🧬 Code graph analysis (9)
packages/web/src/components/project-ui/completed-tab/CompletedTab.jsx (8)
packages/web/src/components/project-ui/ProjectContext.jsx (1)
  • useProjectContext (53-59)
packages/web/src/components/project-ui/ProjectView.jsx (1)
  • navigate (33-33)
packages/web/src/components/project-ui/ProjectDashboard.jsx (1)
  • navigate (13-13)
packages/web/src/components/checklist-ui/ChecklistYjsWrapper.jsx (1)
  • navigate (16-16)
packages/web/src/components/checklist-ui/compare/ReconciliationWrapper.jsx (1)
  • navigate (16-16)
packages/web/src/stores/projectActionsStore/index.js (3)
  • pdf (114-114)
  • projectActionsStore (145-145)
  • study (112-112)
packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx (1)
  • study (25-25)
packages/web/src/components/project-ui/todo-tab/TodoStudyRow.jsx (1)
  • study (29-29)
packages/web/src/components/project-ui/reconcile-tab/ReconcileTab.jsx (14)
packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx (2)
  • useProjectContext (21-21)
  • navigate (23-23)
packages/web/src/components/project-ui/ProjectContext.jsx (1)
  • useProjectContext (53-59)
packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx (1)
  • useProjectContext (25-25)
packages/web/src/components/project-ui/completed-tab/CompletedTab.jsx (2)
  • useProjectContext (14-14)
  • navigate (15-15)
packages/web/src/components/project-ui/ProjectHeader.jsx (1)
  • useProjectContext (7-7)
packages/web/src/components/project-ui/ProjectView.jsx (1)
  • navigate (33-33)
packages/web/src/components/project-ui/ProjectDashboard.jsx (1)
  • navigate (13-13)
packages/web/src/components/checklist-ui/ChecklistYjsWrapper.jsx (1)
  • navigate (16-16)
packages/web/src/components/checklist-ui/compare/ReconciliationWrapper.jsx (1)
  • navigate (16-16)
packages/web/src/stores/projectActionsStore/index.js (3)
  • pdf (114-114)
  • projectActionsStore (145-145)
  • study (112-112)
packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx (1)
  • study (25-25)
packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCardHeader.jsx (1)
  • study (28-28)
packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx (1)
  • study (22-22)
packages/web/src/components/project-ui/todo-tab/TodoStudyRow.jsx (1)
  • study (29-29)
packages/web/src/stores/projectActionsStore/members.js (2)
packages/web/src/components/project-ui/overview-tab/OverviewTab.jsx (1)
  • currentUserId (28-28)
packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx (1)
  • currentUserId (28-28)
packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx (4)
packages/web/src/stores/projectActionsStore/index.js (3)
  • projectActionsStore (145-145)
  • study (112-112)
  • pdf (114-114)
packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCard.jsx (1)
  • study (25-25)
packages/web/src/components/project-ui/all-studies-tab/study-card/StudyCardHeader.jsx (2)
  • study (28-28)
  • handleDelete (57-59)
packages/web/src/components/project-ui/todo-tab/TodoStudyRow.jsx (1)
  • study (29-29)
packages/web/src/primitives/useProject/index.js (1)
packages/web/src/stores/projectActionsStore/index.js (1)
  • projectActionsStore (145-145)
packages/web/src/components/project-ui/ProjectDashboard.jsx (2)
packages/ui/src/zag/Dialog.jsx (1)
  • useConfirmDialog (243-321)
packages/ui/src/zag/Toast.jsx (2)
  • showToast (121-139)
  • showToast (121-139)
packages/web/src/stores/projectActionsStore/studies.js (5)
packages/web/src/lib/pdfUtils.js (2)
  • extractPdfTitle (69-71)
  • extractPdfDoi (216-218)
packages/web/src/lib/referenceLookup.js (1)
  • fetchFromDOI (139-170)
packages/web/src/api/pdf-api.js (4)
  • deletePdf (113-127)
  • downloadPdf (79-93)
  • fetchPdfViaProxy (12-30)
  • uploadPdf (40-70)
packages/web/src/api/google-drive.js (1)
  • importFromGoogleDrive (49-73)
packages/web/src/primitives/pdfCache.js (1)
  • cachePdf (111-138)
packages/web/src/components/project-ui/all-studies-tab/AllStudiesTab.jsx (5)
packages/web/src/components/project-ui/ProjectContext.jsx (1)
  • useProjectContext (53-59)
packages/web/src/components/project-ui/reconcile-tab/ReconcileTab.jsx (1)
  • useProjectContext (15-15)
packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx (1)
  • useProjectContext (15-15)
packages/web/src/stores/projectActionsStore/index.js (1)
  • projectActionsStore (145-145)
packages/web/src/stores/projectActionsStore/studies.js (1)
  • updates (29-29)
packages/web/src/stores/projectActionsStore/index.js (10)
packages/web/src/components/project-ui/ProjectView.jsx (1)
  • useBetterAuth (35-35)
packages/web/src/components/project-ui/ProjectContext.jsx (1)
  • useBetterAuth (21-21)
packages/web/src/components/project-ui/ProjectDashboard.jsx (1)
  • useBetterAuth (21-21)
packages/web/src/components/project-ui/todo-tab/ToDoTab.jsx (1)
  • useBetterAuth (16-16)
packages/web/src/stores/projectActionsStore/studies.js (1)
  • createStudyActions (204-431)
packages/web/src/stores/projectActionsStore/checklists.js (1)
  • createChecklistActions (12-108)
packages/web/src/stores/projectActionsStore/pdfs.js (1)
  • createPdfActions (17-223)
packages/web/src/stores/projectActionsStore/project.js (1)
  • createProjectActions (15-93)
packages/web/src/stores/projectActionsStore/members.js (1)
  • createMemberActions (14-49)
packages/web/src/stores/projectActionsStore/reconciliation.js (1)
  • createReconciliationActions (10-40)
⏰ 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

Comment on lines 62 to 81
const handleView = pdf => {
props.onViewPdf?.(study().id, pdf);
projectActionsStore.pdf.view(study().id, pdf);
};

const handleDownload = pdf => {
props.onDownloadPdf?.(study().id, pdf);
projectActionsStore.pdf.download(study().id, pdf);
};

const handleDelete = pdf => {
props.onDeletePdf?.(study().id, pdf);
projectActionsStore.pdf.delete(study().id, pdf);
};

const handleTagChange = (pdfId, newTag) => {
props.onTagChange?.(study().id, pdfId, newTag);
projectActionsStore.pdf.updateTag(study().id, pdfId, newTag);
};

const handleEditMetadata = pdf => {
props.onEditPdfMetadata?.(study().id, pdf);
// TODO: Open metadata edit modal - for now just log
console.log('Edit metadata for PDF:', pdf.id);
};
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

🧩 Analysis chain

🏁 Script executed:

find . -name "*projectActionsStore*" -o -name "*pdfs.js" | head -20

Repository: InfinityBowman/corates

Length of output: 252


🏁 Script executed:

# Examine the projectActionsStore/pdfs.js implementation
cat -n packages/web/src/stores/projectActionsStore/pdfs.js

Repository: InfinityBowman/corates

Length of output: 8186


🏁 Script executed:

# Examine StudyPdfSection.jsx around the relevant lines
cat -n packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx | sed -n '1,100p'

Repository: InfinityBowman/corates

Length of output: 3999


🏁 Script executed:

# Find and examine ProjectDashboard.jsx around line 100
find . -name "ProjectDashboard.jsx" -o -name "ProjectDashboard.js" | head -1 | xargs -I {} sh -c 'echo "File: {}" && cat -n {} | sed -n "90,110p"'

Repository: InfinityBowman/corates

Length of output: 991


Inconsistent error handling across PDF operations.

The store's view() function handles errors internally by updating pdfPreviewStore, but download() and deletePdfFromStudy() throw errors to the component. Meanwhile, the component handlers for these operations (lines 62-76) have no try-catch blocks, unlike handleFileSelect() which wraps the upload with error feedback. This creates silent failures for users on download and delete.

Either add try-catch blocks in the component handlers (following the upload pattern) or move error handling to the store for consistency.

🤖 Prompt for AI Agents
In
packages/web/src/components/project-ui/all-studies-tab/study-card/StudyPdfSection.jsx
around lines 62 to 81, the PDF action handlers call store methods that can throw
but currently have no error handling; make each handler async, await the store
call (e.g., await projectActionsStore.pdf.download(...) and await
projectActionsStore.pdf.delete(...)), wrap the await in try-catch, and in the
catch block log the error and surface user feedback (e.g., show the same
toast/notification used in handleFileSelect or a visible error message) so
download/delete failures are not silent.

Comment thread packages/web/src/components/project-ui/ProjectDashboard.jsx
Comment thread packages/web/src/primitives/useProject/index.js
Comment thread packages/web/src/stores/projectActionsStore/pdfs.js Outdated
Comment thread packages/web/src/stores/projectActionsStore/project.js
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.

Refactor project state handlers

2 participants