add tanstack query#193
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughMigrates many data flows from a local projectStore/createResource model to TanStack Solid Query: adds a singleton QueryClient with IndexedDB persistence, introduces queryKeys and query hooks, updates components to use queries and invalidation, and removes the project list offline cache from projectStore. Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (9)
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 | b530abf | Commit Preview URL | Dec 29 2025, 11:46 PM |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
packages/web/src/components/admin/AdminDashboard.jsx (1)
157-157: Fix incorrect loading state check.
usersDatais a function that returns the query data, not the query object itself. The loading state should be checked onusersDataQuery.Proposed fix
<Show - when={!usersData.loading} + when={!usersDataQuery.isLoading} fallback={packages/web/src/stores/projectActionsStore/project.js (1)
57-81: UnusedshouldNavigateparameter passed todeleteById.The
deleteProjectfunction passesshouldNavigatetodeleteById(line 80), butdeleteByIdonly acceptstargetProjectId(line 57). The second argument is silently ignored.Either remove the unused parameter from the call, or update
deleteByIdto accept and useshouldNavigateif navigation is intended.Proposed fix (remove unused arg)
async function deleteProject(shouldNavigate = true) { const projectId = getActiveProjectId(); - return deleteById(projectId, shouldNavigate); + return deleteById(projectId); }packages/web/src/components/project/ProjectDashboard.jsx (1)
68-71: Error type mismatch will cause runtime failure.
isOfflineErrortreatserror()as a string by calling.includes(), but TanStack Query returns Error objects, and line 195 also expects an object with.message. Calling.includes()on an Error object will throw a TypeError.Proposed fix
const isOfflineError = () => { const err = error(); - return err && (err.includes('No internet connection') || err.includes('connection error')); + const message = err?.message || ''; + return err && (message.includes('No internet connection') || message.includes('connection error')); };
🧹 Nitpick comments (3)
packages/web/src/lib/queryPersister.js (1)
22-28: Consider adding error handling for blocked database upgrades.The
openDBcall's upgrade callback doesn't handle the case where the database might be blocked by another tab. While rare, adding anonblockedhandler could improve resilience.Optional enhancement
dbPromise = openDB(DB_NAME, DB_VERSION, { upgrade(db) { if (!db.objectStoreNames.contains(STORE_NAME)) { db.createObjectStore(STORE_NAME); } }, + blocked() { + console.warn('[queryPersister] Database upgrade blocked by another tab'); + }, });packages/web/src/primitives/useAdminQueries.js (1)
13-23: RefactoradminFetchto usehandleFetchErrorutility.Per coding guidelines for frontend fetch calls in packages/web, wrap the fetch promise with
handleFetchErrorfrom@/lib/error-utils.jsinstead of inline error handling. This ensures consistent error handling, proper domain vs. transport error distinction, and optional toast notifications across the application.packages/web/src/primitives/useSubscription.js (1)
67-69: RedundantplaceholderData: undefined.Setting
placeholderDatatoundefinedis the default behavior and can be removed to reduce noise.Proposed fix
staleTime: 1000 * 60 * 5, // 5 minutes gcTime: 1000 * 60 * 10, // 10 minutes - // Use placeholderData so components can check loading state - // placeholderData is only used while loading, not as initial data - placeholderData: undefined, }));
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (19)
packages/web/package.jsonpackages/web/src/api/better-auth-store.jspackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/components/admin/StorageManagement.jsxpackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/components/sidebar/Sidebar.jsxpackages/web/src/lib/bfcache-handler.jspackages/web/src/lib/queryClient.jspackages/web/src/lib/queryKeys.jspackages/web/src/lib/queryPersister.jspackages/web/src/main.jsxpackages/web/src/primitives/useAdminQueries.jspackages/web/src/primitives/useProject/index.jspackages/web/src/primitives/useProject/studies.jspackages/web/src/primitives/useProjectList.jspackages/web/src/primitives/useSubscription.jspackages/web/src/stores/projectActionsStore/members.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/stores/projectStore.js
💤 Files with no reviewable changes (1)
- packages/web/src/stores/projectStore.js
🧰 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/lib/queryClient.jspackages/web/src/lib/queryKeys.jspackages/web/src/components/admin/StorageManagement.jsxpackages/web/src/lib/bfcache-handler.jspackages/web/src/lib/queryPersister.jspackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/primitives/useProjectList.jspackages/web/src/main.jsxpackages/web/src/api/better-auth-store.jspackages/web/src/primitives/useAdminQueries.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/stores/projectActionsStore/members.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useSubscription.jspackages/web/src/primitives/useProject/studies.jspackages/web/src/components/sidebar/Sidebar.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/lib/queryClient.jspackages/web/src/lib/queryKeys.jspackages/web/src/components/admin/StorageManagement.jsxpackages/web/src/lib/bfcache-handler.jspackages/web/src/lib/queryPersister.jspackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/primitives/useProjectList.jspackages/web/src/main.jsxpackages/web/src/api/better-auth-store.jspackages/web/src/primitives/useAdminQueries.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/stores/projectActionsStore/members.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useSubscription.jspackages/web/src/primitives/useProject/studies.jspackages/web/src/components/sidebar/Sidebar.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/lib/queryClient.jspackages/web/src/lib/queryKeys.jspackages/web/src/components/admin/StorageManagement.jsxpackages/web/src/lib/bfcache-handler.jspackages/web/src/lib/queryPersister.jspackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/primitives/useProjectList.jspackages/web/src/main.jsxpackages/web/src/api/better-auth-store.jspackages/web/src/primitives/useAdminQueries.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/stores/projectActionsStore/members.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useSubscription.jspackages/web/src/primitives/useProject/studies.jspackages/web/src/components/sidebar/Sidebar.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/lib/queryClient.jspackages/web/src/lib/queryKeys.jspackages/web/src/components/admin/StorageManagement.jsxpackages/web/src/lib/bfcache-handler.jspackages/web/src/lib/queryPersister.jspackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/primitives/useProjectList.jspackages/web/src/main.jsxpackages/web/src/api/better-auth-store.jspackages/web/src/primitives/useAdminQueries.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/stores/projectActionsStore/members.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useSubscription.jspackages/web/src/primitives/useProject/studies.jspackages/web/src/components/sidebar/Sidebar.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/lib/queryClient.jspackages/web/src/lib/queryKeys.jspackages/web/src/components/admin/StorageManagement.jsxpackages/web/src/lib/bfcache-handler.jspackages/web/src/lib/queryPersister.jspackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/primitives/useProjectList.jspackages/web/src/main.jsxpackages/web/src/api/better-auth-store.jspackages/web/src/primitives/useAdminQueries.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/stores/projectActionsStore/members.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useSubscription.jspackages/web/src/primitives/useProject/studies.jspackages/web/src/components/sidebar/Sidebar.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/lib/queryClient.jspackages/web/src/lib/queryKeys.jspackages/web/src/components/admin/StorageManagement.jsxpackages/web/src/lib/bfcache-handler.jspackages/web/src/lib/queryPersister.jspackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/primitives/useProjectList.jspackages/web/src/main.jsxpackages/web/src/api/better-auth-store.jspackages/web/src/primitives/useAdminQueries.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/stores/projectActionsStore/members.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useSubscription.jspackages/web/src/primitives/useProject/studies.jspackages/web/src/components/sidebar/Sidebar.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/lib/queryClient.jspackages/web/src/lib/queryKeys.jspackages/web/src/components/admin/StorageManagement.jsxpackages/web/src/lib/bfcache-handler.jspackages/web/src/lib/queryPersister.jspackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/primitives/useProjectList.jspackages/web/src/main.jsxpackages/web/src/api/better-auth-store.jspackages/web/src/primitives/useAdminQueries.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/stores/projectActionsStore/members.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useSubscription.jspackages/web/src/primitives/useProject/studies.jspackages/web/src/components/sidebar/Sidebar.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/lib/queryClient.jspackages/web/src/lib/queryKeys.jspackages/web/src/components/admin/StorageManagement.jsxpackages/web/src/lib/bfcache-handler.jspackages/web/src/lib/queryPersister.jspackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/primitives/useProjectList.jspackages/web/src/main.jsxpackages/web/src/api/better-auth-store.jspackages/web/src/primitives/useAdminQueries.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/stores/projectActionsStore/members.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useSubscription.jspackages/web/src/primitives/useProject/studies.jspackages/web/src/components/sidebar/Sidebar.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/lib/queryClient.jspackages/web/src/lib/queryKeys.jspackages/web/src/components/admin/StorageManagement.jsxpackages/web/src/lib/bfcache-handler.jspackages/web/src/lib/queryPersister.jspackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/primitives/useProjectList.jspackages/web/src/main.jsxpackages/web/src/api/better-auth-store.jspackages/web/src/primitives/useAdminQueries.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/stores/projectActionsStore/members.jspackages/web/src/primitives/useProject/index.jspackages/web/package.jsonpackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useSubscription.jspackages/web/src/primitives/useProject/studies.jspackages/web/src/components/sidebar/Sidebar.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/lib/queryClient.jspackages/web/src/lib/queryKeys.jspackages/web/src/components/admin/StorageManagement.jsxpackages/web/src/lib/bfcache-handler.jspackages/web/src/lib/queryPersister.jspackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/primitives/useProjectList.jspackages/web/src/main.jsxpackages/web/src/api/better-auth-store.jspackages/web/src/primitives/useAdminQueries.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/stores/projectActionsStore/members.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useSubscription.jspackages/web/src/primitives/useProject/studies.jspackages/web/src/components/sidebar/Sidebar.jsx
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/corates.mdc)
Prefer modern ES6+ syntax and features
Files:
packages/web/src/lib/queryClient.jspackages/web/src/lib/queryKeys.jspackages/web/src/components/admin/StorageManagement.jsxpackages/web/src/lib/bfcache-handler.jspackages/web/src/lib/queryPersister.jspackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/primitives/useProjectList.jspackages/web/src/main.jsxpackages/web/src/api/better-auth-store.jspackages/web/src/primitives/useAdminQueries.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/stores/projectActionsStore/members.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useSubscription.jspackages/web/src/primitives/useProject/studies.jspackages/web/src/components/sidebar/Sidebar.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/admin/StorageManagement.jsxpackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/main.jsxpackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/components/sidebar/Sidebar.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/admin/StorageManagement.jsxpackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/main.jsxpackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/components/sidebar/Sidebar.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/admin/StorageManagement.jsxpackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/main.jsxpackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/components/sidebar/Sidebar.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/admin/StorageManagement.jsxpackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/main.jsxpackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/components/sidebar/Sidebar.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/admin/StorageManagement.jsxpackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/main.jsxpackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/components/sidebar/Sidebar.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/admin/StorageManagement.jsxpackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/components/sidebar/Sidebar.jsx
🧠 Learnings (53)
📓 Common learnings
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 packages/web/src/primitives/useProject/**, packages/web/src/stores/projectStore.js : Local projects (with IDs starting with 'local-') use IndexedDB persistence only and skip WebSocket connection, but still use Y.Doc structure and sync to store normally
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 packages/web/src/primitives/useProject/**, packages/web/src/stores/projectStore.js : IndexedDB persistence is set up automatically by useProject with database name 'corates-project-${projectId}'; don't manually create IndexedDB providers
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/form-state.mdc:0-0
Timestamp: 2025-12-27T03:01:54.727Z
Learning: Applies to 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
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 packages/web/src/primitives/useProject/**, packages/web/src/stores/projectStore.js : When access is denied (user removed or project deleted), the connection automatically triggers cleanup: IndexedDB data cleared, connection closed, store cleared, and user redirected
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
📚 Learning: 2025-12-27T03:02:26.947Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-27T03:02:26.947Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{jsx,tsx} : Keep SolidJS components lean and focused on rendering - move business logic to stores, primitives, or utilities
Applied to files:
packages/web/src/components/admin/StorageManagement.jsxpackages/web/src/components/sidebar/Sidebar.jsx
📚 Learning: 2025-12-27T03:02:26.947Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-27T03:02:26.947Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{jsx,tsx} : Use external stores in packages/web/src/stores/ for shared/cross-feature state instead of prop-drilling
Applied to files:
packages/web/src/components/admin/StorageManagement.jsxpackages/web/src/api/better-auth-store.jspackages/web/src/components/sidebar/Sidebar.jsx
📚 Learning: 2025-12-27T15:42:01.079Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-27T15:42:01.079Z
Learning: Applies to packages/web/**/*.{ts,tsx} : Use `createStore` for complex state objects in SolidJS
Applied to files:
packages/web/src/components/admin/StorageManagement.jsxpackages/web/src/api/better-auth-store.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/sidebar/Sidebar.jsx
📚 Learning: 2025-12-27T03:02:26.947Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-27T03:02:26.947Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{js,jsx,ts,tsx} : Use createSignal for simple reactive values in SolidJS components
Applied to files:
packages/web/src/components/admin/StorageManagement.jsxpackages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/api/better-auth-store.jspackages/web/src/components/sidebar/Sidebar.jsx
📚 Learning: 2025-12-27T03:02:26.947Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-27T03:02:26.947Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{js,jsx,ts,tsx} : Use createStore for complex objects and arrays that need granular reactivity in SolidJS
Applied to files:
packages/web/src/components/admin/StorageManagement.jsxpackages/web/src/main.jsxpackages/web/src/api/better-auth-store.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/components/sidebar/Sidebar.jsx
📚 Learning: 2025-12-27T03:01:54.727Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/form-state.mdc:0-0
Timestamp: 2025-12-27T03:01:54.727Z
Learning: Applies to packages/web/src/**/*.{js,jsx} : For temporary File object storage during OAuth flows (e.g., pending PDFs), use projectStore.setPendingProjectData() instead of IndexedDB, as File objects cannot be serialized
Applied to files:
packages/web/src/lib/bfcache-handler.jspackages/web/src/api/better-auth-store.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsx
📚 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 packages/web/src/primitives/useProject/**, packages/web/src/stores/projectStore.js : When access is denied (user removed or project deleted), the connection automatically triggers cleanup: IndexedDB data cleared, connection closed, store cleared, and user redirected
Applied to files:
packages/web/src/lib/bfcache-handler.jspackages/web/src/primitives/useProjectList.jspackages/web/src/api/better-auth-store.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/stores/projectActionsStore/members.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useProject/studies.jspackages/web/src/components/sidebar/Sidebar.jsx
📚 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 `cachePdf` and `getCachedPdf` from `primitives/pdfCache.js` for caching PDF data in IndexedDB
Applied to files:
packages/web/src/lib/bfcache-handler.jspackages/web/src/primitives/useAdminQueries.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} : Implement PDF caching strategy: check cache first, download from server if not cached, then cache the downloaded PDF
Applied to files:
packages/web/src/lib/bfcache-handler.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 packages/web/src/primitives/useProject/**, packages/web/src/stores/projectStore.js : IndexedDB persistence is set up automatically by useProject with database name 'corates-project-${projectId}'; don't manually create IndexedDB providers
Applied to files:
packages/web/src/lib/bfcache-handler.jspackages/web/src/lib/queryPersister.jspackages/web/src/primitives/useProjectList.jspackages/web/src/api/better-auth-store.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useProject/studies.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/lib/bfcache-handler.jspackages/web/src/api/better-auth-store.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useProject/studies.jspackages/web/src/components/sidebar/Sidebar.jsx
📚 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 packages/web/src/primitives/useProject/**, packages/web/src/stores/projectStore.js : Local projects (with IDs starting with 'local-') use IndexedDB persistence only and skip WebSocket connection, but still use Y.Doc structure and sync to store normally
Applied to files:
packages/web/src/lib/bfcache-handler.jspackages/web/src/lib/queryPersister.jspackages/web/src/primitives/useProjectList.jspackages/web/src/api/better-auth-store.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/stores/projectActionsStore/members.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useProject/studies.jspackages/web/src/components/sidebar/Sidebar.jsx
📚 Learning: 2025-12-27T03:01:35.601Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/durable-objects.mdc:0-0
Timestamp: 2025-12-27T03:01:35.601Z
Learning: Applies to packages/workers/src/durable-objects/**/ProjectDoc.{js,ts} : Verify authentication before WebSocket upgrade in ProjectDoc
Applied to files:
packages/web/src/lib/bfcache-handler.jspackages/web/src/api/better-auth-store.js
📚 Learning: 2025-12-27T03:01:54.727Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/form-state.mdc:0-0
Timestamp: 2025-12-27T03:01:54.727Z
Learning: Applies to packages/web/src/**/*.{js,jsx} : Only save serializable data to IndexedDB—exclude File objects, ArrayBuffers, functions, and other non-serializable objects from form state persistence
Applied to files:
packages/web/src/lib/queryPersister.jspackages/web/src/main.jsx
📚 Learning: 2025-12-27T03:01:35.601Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/durable-objects.mdc:0-0
Timestamp: 2025-12-27T03:01:35.601Z
Learning: Applies to packages/workers/src/durable-objects/**/*.{js,ts} : Persist Y.Doc state to Durable Object storage using Y.encodeStateAsUpdate() on document updates
Applied to files:
packages/web/src/lib/queryPersister.js
📚 Learning: 2025-12-27T03:02:26.947Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-27T03:02:26.947Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{jsx,tsx} : Use Solid's Show component for conditional rendering instead of ternary operators
Applied to files:
packages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/components/sidebar/Sidebar.jsx
📚 Learning: 2025-12-27T03:02:26.947Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-27T03:02:26.947Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{js,jsx,ts,tsx} : Use local createSignal or createStore for local component state; use external stores for shared/cross-feature state
Applied to files:
packages/web/src/components/admin/AdminDashboard.jsxpackages/web/src/api/better-auth-store.jspackages/web/src/components/sidebar/Sidebar.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/primitives/useProjectList.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/components/sidebar/Sidebar.jsx
📚 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} : Use the `useProject` hook for managing Yjs connections with reference counting instead of creating Y.Doc instances directly
Applied to files:
packages/web/src/primitives/useProjectList.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useProject/studies.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/useProjectList.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/components/sidebar/Sidebar.jsx
📚 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 `addPdfToStudy` operation from `useProject` hook to add PDFs to a study, passing id, name, size, tag, uploadedAt, and uploadedBy
Applied to files:
packages/web/src/primitives/useProjectList.jspackages/web/src/primitives/useProject/studies.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 `removePdfFromStudy` operation from `useProject` hook to remove PDFs from a study
Applied to files:
packages/web/src/primitives/useProjectList.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/primitives/useProject/index.jspackages/web/src/primitives/useProject/studies.jspackages/web/src/components/sidebar/Sidebar.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/useProjectList.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useProject/studies.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} : Use operation functions from useProject or projectActionsStore for writing data instead of directly modifying Y.Doc
Applied to files:
packages/web/src/primitives/useProjectList.jspackages/web/src/api/better-auth-store.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/stores/projectActionsStore/members.jspackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useProject/studies.jspackages/web/src/components/sidebar/Sidebar.jsx
📚 Learning: 2025-12-27T15:42:01.079Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-27T15:42:01.079Z
Learning: Applies to packages/web/**/*.{ts,tsx,jsx} : Do NOT prop-drill application state in SolidJS - import stores directly where needed
Applied to files:
packages/web/src/main.jsxpackages/web/src/api/better-auth-store.jspackages/web/package.json
📚 Learning: 2025-12-27T03:01:54.727Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/form-state.mdc:0-0
Timestamp: 2025-12-27T03:01:54.727Z
Learning: Applies to packages/web/src/**/*.{js,jsx} : 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
Applied to files:
packages/web/src/main.jsx
📚 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} : Handle connection cleanup via onCleanup() in Solid.js components or equivalent cleanup patterns, calling disconnect() when the component unmounts
Applied to files:
packages/web/src/main.jsx
📚 Learning: 2025-12-27T03:01:54.727Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/form-state.mdc:0-0
Timestamp: 2025-12-27T03:01:54.727Z
Learning: Applies to 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
Applied to files:
packages/web/src/main.jsxpackages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsx
📚 Learning: 2025-12-27T03:01:54.727Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/form-state.mdc:0-0
Timestamp: 2025-12-27T03:01:54.727Z
Learning: Applies to packages/web/src/**/*.{js,jsx} : Clear URL restore parameters after form state restoration by calling clearRestoreParamsFromUrl() to prevent stale restoration attempts on subsequent navigation
Applied to files:
packages/web/src/main.jsx
📚 Learning: 2025-12-27T03:01:54.727Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/form-state.mdc:0-0
Timestamp: 2025-12-27T03:01:54.727Z
Learning: Applies to packages/web/src/**/*.{js,jsx} : 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()
Applied to files:
packages/web/src/main.jsx
📚 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} : Save form state using `saveFormState` from `@/lib/formStatePersistence.js` before triggering OAuth redirects for Google Drive
Applied to files:
packages/web/src/main.jsx
📚 Learning: 2025-12-27T03:02:26.947Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-27T03:02:26.947Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{js,jsx,ts,tsx} : Always clean up SolidJS effects that create subscriptions or timers using onCleanup
Applied to files:
packages/web/src/main.jsx
📚 Learning: 2025-12-27T15:42:18.945Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-27T15:42:18.945Z
Learning: Applies to packages/workers/src/**/*.{ts,tsx} : Use Better-Auth for authentication and user management
Applied to files:
packages/web/src/api/better-auth-store.js
📚 Learning: 2025-12-27T15:42:01.079Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-27T15:42:01.079Z
Learning: Applies to packages/workers/**/*.{ts,tsx} : Use Better-Auth for authentication and user management
Applied to files:
packages/web/src/api/better-auth-store.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 packages/web/src/primitives/useProject/**, packages/web/src/stores/projectStore.js : Never manually call syncFromYDoc() - sync from Y.Doc to store is handled automatically via ydoc.on('update')
Applied to files:
packages/web/src/api/better-auth-store.jspackages/web/src/stores/projectActionsStore/project.jspackages/web/src/stores/projectActionsStore/members.jspackages/web/src/primitives/useProject/index.jspackages/web/src/primitives/useProject/studies.js
📚 Learning: 2025-12-27T03:02:26.947Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-27T03:02:26.947Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{js,jsx,ts,tsx} : Prefer derived state with createMemo or signals over effects whenever possible
Applied to files:
packages/web/src/api/better-auth-store.jspackages/web/src/components/sidebar/Sidebar.jsx
📚 Learning: 2025-12-27T03:02:26.947Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-27T03:02:26.947Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{js,jsx,ts,tsx} : Use createMemo for computed/derived values that depend on reactive state in SolidJS
Applied to files:
packages/web/src/api/better-auth-store.jspackages/web/src/primitives/useSubscription.js
📚 Learning: 2025-12-27T03:01:35.601Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/durable-objects.mdc:0-0
Timestamp: 2025-12-27T03:01:35.601Z
Learning: Applies to packages/workers/src/durable-objects/**/ProjectDoc.{js,ts} : Check user membership in project before allowing WebSocket connection in ProjectDoc
Applied to files:
packages/web/src/api/better-auth-store.jspackages/web/src/stores/projectActionsStore/members.js
📚 Learning: 2025-12-27T03:01:54.727Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/form-state.mdc:0-0
Timestamp: 2025-12-27T03:01:54.727Z
Learning: Applies to packages/web/src/components/project-ui/**/*.{js,jsx} : Form state should include serializable metadata when handling files (name, size, type) and use the store's pendingPdfs pattern for actual File objects that persist across redirects
Applied to files:
packages/web/src/stores/projectActionsStore/project.jspackages/web/src/components/project/ProjectDashboard.jsx
📚 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} : Access Y.Doc connection state via projectStore.getConnectionState(projectId) instead of checking connection state directly
Applied to files:
packages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsx
📚 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} : Don't store Y.Doc references in component state; always retrieve the connection through useProject
Applied to files:
packages/web/src/primitives/useProject/index.jspackages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/components/sidebar/Sidebar.jsx
📚 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 packages/workers/src/durable-objects/ProjectDoc.js, packages/web/src/primitives/useProject/** : Y.Doc structure in ProjectDoc follows a specific hierarchy: meta (Map), members (Map), reviews (Map containing studies with checklists, pdfs, and reconciliation)
Applied to files:
packages/web/src/primitives/useProject/index.jspackages/web/src/primitives/useProject/studies.js
📚 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,ui}/**/*.{js,jsx,ts,tsx} : Use solid-icons library for icons instead of emojis or other icon sources
Applied to files:
packages/web/package.json
📚 Learning: 2025-12-27T15:42:01.079Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-27T15:42:01.079Z
Learning: Applies to packages/web/**/*.{ts,tsx} : Use `createMemo` for derived values in SolidJS
Applied to files:
packages/web/package.json
📚 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,ui}/**/*.{js,jsx,ts,tsx} : Import UI components from 'corates/ui' package instead of local components directories
Applied to files:
packages/web/package.jsonpackages/web/src/components/project/ProjectDashboard.jsx
📚 Learning: 2025-12-27T15:42:01.079Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-27T15:42:01.079Z
Learning: Applies to **/*.{ts,tsx,jsx,js} : Use `solid-icons` icon library (e.g., `solid-icons/bi`, `solid-icons/fi`) for icons
Applied to files:
packages/web/package.json
📚 Learning: 2025-12-27T03:02:26.947Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-27T03:02:26.947Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{jsx,tsx} : Create reusable logic in primitives (hooks) in packages/web/src/primitives/ and import them into components
Applied to files:
packages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/components/sidebar/Sidebar.jsx
📚 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} : Never create Y.Doc instances directly; always use the connection registry managed by useProject
Applied to files:
packages/web/src/components/project/ProjectDashboard.jsxpackages/web/src/primitives/useProject/studies.js
📚 Learning: 2025-12-27T15:42:01.079Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-27T15:42:01.079Z
Learning: Applies to **/*.{ts,tsx,jsx,js} : Use Ark UI components from `corates/ui` package, not local component implementations
Applied to files:
packages/web/src/components/project/ProjectDashboard.jsx
📚 Learning: 2025-12-27T03:01:35.601Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/durable-objects.mdc:0-0
Timestamp: 2025-12-27T03:01:35.601Z
Learning: Applies to packages/workers/src/durable-objects/**/ProjectDoc.{js,ts} : Use y-websocket protocol with message type 0 for Yjs sync messages in ProjectDoc
Applied to files:
packages/web/src/primitives/useProject/studies.js
📚 Learning: 2025-12-27T15:42:01.079Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-27T15:42:01.079Z
Learning: Applies to packages/web/**/*.{ts,tsx,jsx} : Move business logic to stores, utilities, or primitives (not in components) in SolidJS
Applied to files:
packages/web/src/components/sidebar/Sidebar.jsx
📚 Learning: 2025-12-27T03:02:26.947Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-27T03:02:26.947Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{jsx,tsx} : Use Solid's For component for rendering lists instead of Array.map()
Applied to files:
packages/web/src/components/sidebar/Sidebar.jsx
🧬 Code graph analysis (10)
packages/web/src/lib/queryClient.js (1)
packages/web/src/lib/queryPersister.js (1)
createIDBPersister(38-80)
packages/web/src/lib/queryKeys.js (3)
packages/web/src/components/project/ProjectDashboard.jsx (1)
userId(31-31)packages/web/src/components/admin/AdminDashboard.jsx (2)
page(27-27)search(26-26)packages/web/src/components/admin/StorageManagement.jsx (4)
limit(56-56)search(47-47)cursor(49-49)prefix(48-48)
packages/web/src/lib/bfcache-handler.js (4)
packages/web/src/components/project/ProjectDashboard.jsx (1)
queryClient(32-32)packages/web/src/lib/queryClient.js (2)
queryClient(238-238)queryClient(238-238)packages/web/src/primitives/useSubscription.js (1)
queryClient(141-141)packages/web/src/lib/queryKeys.js (2)
queryKeys(8-37)queryKeys(8-37)
packages/web/src/components/admin/AdminDashboard.jsx (3)
packages/web/src/primitives/useAdminQueries.js (2)
useAdminStats(28-35)useAdminUsers(41-61)packages/web/src/components/admin/StorageManagement.jsx (1)
debouncedSearch(51-51)packages/web/src/components/admin/StatsCard.jsx (1)
StatsCard(30-51)
packages/web/src/primitives/useProjectList.js (2)
packages/web/src/primitives/useProject/index.js (1)
cleanupProjectLocalData(99-141)packages/web/src/lib/queryKeys.js (2)
queryKeys(8-37)queryKeys(8-37)
packages/web/src/stores/projectActionsStore/members.js (2)
packages/web/src/lib/queryClient.js (2)
queryClient(238-238)queryClient(238-238)packages/web/src/lib/queryKeys.js (2)
queryKeys(8-37)queryKeys(8-37)
packages/web/src/primitives/useProject/index.js (3)
packages/web/src/stores/projectStore.js (1)
projectStore(275-275)packages/web/src/lib/queryClient.js (2)
queryClient(238-238)queryClient(238-238)packages/web/src/lib/queryKeys.js (2)
queryKeys(8-37)queryKeys(8-37)
packages/web/src/primitives/useSubscription.js (2)
packages/web/src/lib/queryKeys.js (2)
queryKeys(8-37)queryKeys(8-37)packages/web/src/lib/queryClient.js (2)
queryClient(238-238)queryClient(238-238)
packages/web/src/primitives/useProject/studies.js (2)
packages/web/src/lib/queryClient.js (2)
queryClient(238-238)queryClient(238-238)packages/web/src/lib/queryKeys.js (2)
queryKeys(8-37)queryKeys(8-37)
packages/web/src/components/sidebar/Sidebar.jsx (3)
packages/web/src/components/project/ProjectDashboard.jsx (1)
projectListQuery(35-35)packages/web/src/primitives/useProjectList.js (1)
useProjectList(95-118)packages/web/src/api/better-auth-store.js (1)
isLoggedIn(132-138)
⏰ 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
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.