Skip to content

68 improve study metadata naming#69

Merged
InfinityBowman merged 8 commits into
mainfrom
68-improve-study-metadata-naming
Dec 16, 2025
Merged

68 improve study metadata naming#69
InfinityBowman merged 8 commits into
mainfrom
68-improve-study-metadata-naming

Conversation

@InfinityBowman
Copy link
Copy Markdown
Owner

@InfinityBowman InfinityBowman commented Dec 16, 2025

Summary by CodeRabbit

  • New Features

    • Audit logging framework for admin/auth events
    • New inline editable text and enhanced role selector UI
    • Many new UI components (combobox, menu, popover, tags, number input, progress, radio group, toggle group, tour, clipboard, accordion, etc.)
    • Studies now preserve original article titles separately from display names
    • Project header: per-field name and description editing; description can be updated inline
  • Documentation

    • Expanded contributor guidelines: project structure, recommended libraries, component usage and plans location

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

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

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

Deploying with  Cloudflare Workers  Cloudflare Workers

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

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
corates dfebd1d Commit Preview URL Dec 16 2025, 06:27 PM

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 16, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR adds editorial docs and tooling guidance, introduces an audit-logs plan with example logger API, adds an originalTitle field across study model/sync/handlers and UI, introduces multiple Zag.js UI components, and updates package dependencies for Zag packages.

Changes

Cohort / File(s) Change Summary
Docs & Assistant config
\.clauderc, \.cursorrules, \.github/copilot-instructions.md
Added package role and build notes, documentation placement guidance (docs/plans/), coding standards, library recommendations (Zod, Drizzle, Better-Auth, Zag.js) and editorial updates.
Audit logging plan & examples
docs/plans/audit-logs-plan.md
Added audit-logs plan with schema, example createAuditLogger (now exposes log, logAdmin, logAuth), serialization of changes/metadata, async persistence pattern (waitUntil), middleware and route wiring examples.
Study model, sync & operations
packages/web/src/primitives/useProject/sync.js, packages/web/src/primitives/useProject/studies.js, packages/web/src/primitives/useProject/index.js
Added originalTitle to built study objects and persisted on create/update when provided; added updateDescription operation and exposed it via useProject exports.
Study handlers & naming flows
packages/web/src/primitives/useProjectStudyHandlers.js
Propagated originalTitle through create/import/rename and bulk-apply naming flows; renamed naming basis to use originalTitle, added skipped-count diagnostics for missing originalTitle.
Edit study UI
packages/web/src/components/project-ui/EditStudyModal.jsx
Added originalTitle state and Article Title textarea, renamed "Study Name" → "Display Name", included originalTitle in update payloads and adjusted form layout.
Project header, view & description editing
packages/web/src/components/project-ui/ProjectHeader.jsx, packages/web/src/components/project-ui/ProjectView.jsx
Split name/description editing into separate states/handlers; added description edit UI and wired onUpdateDescription to project actions (updateDescription).
Project card & member modal UI
packages/web/src/components/project-ui/ProjectCard.jsx, packages/web/src/components/project-ui/AddMemberModal.jsx
Layout changes for vertical header and metadata; description fallback; swapped native role <select> for reusable Select component.
Zag component additions
packages/web/src/components/zag/Editable.jsx, packages/web/src/components/zag/Accordion.jsx, packages/web/src/components/zag/Clipboard.jsx, packages/web/src/components/zag/Combobox.jsx, packages/web/src/components/zag/Menu.jsx, packages/web/src/components/zag/NumberInput.jsx, packages/web/src/components/zag/Popover.jsx, packages/web/src/components/zag/Progress.jsx, packages/web/src/components/zag/RadioGroup.jsx, packages/web/src/components/zag/TagsInput.jsx, packages/web/src/components/zag/ToggleGroup.jsx, packages/web/src/components/zag/Tour.jsx, packages/web/src/components/zag/README.md
Added many new Solid.js Zag-based UI components (Editable, Accordion, Clipboard/CopyButton, Combobox, Menu, NumberInput, Popover, Progress, RadioGroup, TagsInput, ToggleGroup, Tour) and README docs describing props/usage.
Package manifests / deps
packages/web/package.json, package.json
Added multiple @zag-js/* dependencies (e.g., @zag-js/* entries like editable, combobox, tour, etc., at ^1.31.1) to top-level and packages/web.
Minor UI/cleanup
packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionA.jsx, packages/web/src/components/zag/README.md
Small variable rename (key_key) and README component entries/documentation edits.

Sequence Diagram(s)

sequenceDiagram
  participant Client as Browser (UI)
  participant Server as App Server (route/middleware)
  participant Auth as Auth Hook (Better-Auth)
  participant DB as Database (auditLogs table / ORM)

  Client->>Server: Perform action (admin change / auth event / route)
  Server->>Auth: Run auth hook
  Auth-->>Server: Auth result + user info
  Server->>Server: createAuditLogger(db, executionCtx, request)
  Server->>Server: logger.log / logger.logAdmin / logger.logAuth invoked
  Server->>Server: Serialize changes & metadata (JSON)
  Server->>Server: schedule async persistence (waitUntil)
  alt persistence success
    Server->>DB: INSERT audit log row
    DB-->>Server: OK
  else persistence failure
    DB-->>Server: Error
    Server->>Server: console.error / fallback logging
  end
  Server-->>Client: Response (200/201 or error)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

  • Areas to focus:
    • docs/plans/audit-logs-plan.md: verify API shape (new logAdmin/logAuth) and persistence pattern matches production patterns.
    • packages/web/src/primitives/useProjectStudyHandlers.js: naming derivation, bulk-apply/rename edge cases, missing originalTitle handling.
    • EditStudyModal.jsx + study ops: ensure originalTitle included and trimmed in update payloads.
    • ProjectHeader.jsx / ProjectView.jsx: description save flow and error handling per-field.
    • New Zag components: accessibility, controlled/uncontrolled props, and dependency wiring.

Possibly related issues

Possibly related PRs

Poem

🐇 I hopped through docs and code at dawn,

Saved each title so no meaning's gone,
Logs now whisper who and when and why,
UI sprouted widgets as I scurried by,
A tiny rabbit cheers — the changes live on.

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 title directly addresses the main objective of the PR, which involves adding originalTitle field tracking and enhancing study metadata naming logic across components and services.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1a0f731 and dfebd1d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (15)
  • package.json (1 hunks)
  • packages/web/package.json (1 hunks)
  • packages/web/src/components/checklist-ui/ROBINSIChecklist/SectionA.jsx (1 hunks)
  • packages/web/src/components/zag/Accordion.jsx (1 hunks)
  • packages/web/src/components/zag/Clipboard.jsx (1 hunks)
  • packages/web/src/components/zag/Combobox.jsx (1 hunks)
  • packages/web/src/components/zag/Menu.jsx (1 hunks)
  • packages/web/src/components/zag/NumberInput.jsx (1 hunks)
  • packages/web/src/components/zag/Popover.jsx (1 hunks)
  • packages/web/src/components/zag/Progress.jsx (1 hunks)
  • packages/web/src/components/zag/README.md (1 hunks)
  • packages/web/src/components/zag/RadioGroup.jsx (1 hunks)
  • packages/web/src/components/zag/TagsInput.jsx (1 hunks)
  • packages/web/src/components/zag/ToggleGroup.jsx (1 hunks)
  • packages/web/src/components/zag/Tour.jsx (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: 0

🧹 Nitpick comments (1)
packages/web/src/primitives/useProjectStudyHandlers.js (1)

313-327: Consider fallback for studies without originalTitle.

In handleApplyNamingToAll, when study.originalTitle is null or undefined, the generateStudyName function receives undefined as the title (line 315). While generateStudyName has fallback logic to 'Untitled Study', you may want to explicitly fall back to study.name to preserve the current display name for studies that haven't been migrated yet:

 const newName = generateStudyName(
   {
-    title: study.originalTitle,
+    title: study.originalTitle || study.name,
     firstAuthor: study.firstAuthor,
     publicationYear: study.publicationYear,
     authors: study.authors,
   },
   namingConvention,
 );

This would ensure that the bulk rename operation doesn't inadvertently change names of studies that lack an originalTitle to "Untitled Study".

Also applies to: 334-346

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 56ac2ed and e783f3a.

📒 Files selected for processing (8)
  • .clauderc (5 hunks)
  • .cursorrules (5 hunks)
  • .github/copilot-instructions.md (1 hunks)
  • docs/plans/audit-logs-plan.md (19 hunks)
  • packages/web/src/components/project-ui/EditStudyModal.jsx (5 hunks)
  • packages/web/src/primitives/useProject/studies.js (2 hunks)
  • packages/web/src/primitives/useProject/sync.js (1 hunks)
  • packages/web/src/primitives/useProjectStudyHandlers.js (7 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

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

Files:

  • packages/web/src/primitives/useProject/studies.js
  • packages/web/src/components/project-ui/EditStudyModal.jsx
  • packages/web/src/primitives/useProject/sync.js
  • packages/web/src/primitives/useProjectStudyHandlers.js
packages/web/src/**/*.{jsx,tsx,js,ts}

📄 CodeRabbit inference engine (.cursorrules)

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

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

Files:

  • packages/web/src/primitives/useProject/studies.js
  • packages/web/src/components/project-ui/EditStudyModal.jsx
  • packages/web/src/primitives/useProject/sync.js
  • packages/web/src/primitives/useProjectStudyHandlers.js
packages/web/src/components/**/*.{jsx,tsx,js,ts}

📄 CodeRabbit inference engine (.cursorrules)

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

Files:

  • packages/web/src/components/project-ui/EditStudyModal.jsx
packages/web/src/components/**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursorrules)

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

Files:

  • packages/web/src/components/project-ui/EditStudyModal.jsx
packages/web/src/components/**

📄 CodeRabbit inference engine (.cursorrules)

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

Files:

  • packages/web/src/components/project-ui/EditStudyModal.jsx
packages/{web,landing}/src/**/*.{jsx,tsx,css}

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

Use responsive design principles for UI components

Files:

  • packages/web/src/components/project-ui/EditStudyModal.jsx
packages/web/src/**/*.{jsx,tsx}

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

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

Files:

  • packages/web/src/components/project-ui/EditStudyModal.jsx
🧠 Learnings (26)
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Keep files small, focused, and modular - if a file exceeds a high number of lines, refactor by extracting sub-modules into folders, moving complex logic into separate utility files, or splitting large forms into section components

Applied to files:

  • .github/copilot-instructions.md
  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Keep files small, focused, and modular. If a file exceeds a high number of lines, consider refactoring by extracting sub-modules into a folder, moving complex logic into separate utility files or primitives, and splitting large forms into section components

Applied to files:

  • .github/copilot-instructions.md
  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Applies to packages/{web,landing}/src/**/*.{jsx,tsx,css} : Use responsive design principles for UI components

Applied to files:

  • .github/copilot-instructions.md
  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Applies to packages/web/src/components/**/*.{jsx,tsx} : Use responsive design principles for UI components

Applied to files:

  • .github/copilot-instructions.md
  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx} : Reference existing Zag.js components in `packages/web/src/components/zag/*` and consult the README.md and documentation before adding new components or debugging

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx,js,ts} : For UI icons, use the `solid-icons` library or SVGs only. Do not use emojis

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Follow standard JavaScript/SolidJS/Cloudflare best practices

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Applies to packages/web/src/components/**/*.{jsx,tsx,js,ts} : For UI icons, use the `solid-icons` library or SVGs only. Do not use emojis

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Applies to packages/web/src/components/**/*.{jsx,tsx} : Do NOT prop-drill application state in SolidJS components - shared or cross-feature state must live in external stores under `packages/web/src/stores/` or relative to the component file

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx} : 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

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Applies to packages/web/src/components/**/*.{jsx,tsx} : When implementing UI components, use zag.js from `packages/web/src/components/zag/*` and reuse existing components

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx} : Use Zag.js for UI components and design system

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Applies to packages/web/src/components/** : Group related components in subdirectories with an `index.js` barrel export

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Group related components in subdirectories with an `index.js` barrel export

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Each file should handle one coherent responsibility

Applied to files:

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

Applied to files:

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

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Applies to packages/web/src/components/**/*.{jsx,tsx} : Components should be lean and focused - do not implement business logic in components; move that into stores, utilities, or primitives

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx} : Components should be lean and focused and should not implement business logic. Move business logic into stores, utilities, or primitives

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx} : 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

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Applies to packages/web/src/components/**/*.{jsx,tsx} : 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

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx,js,ts} : Create reusable logic in 'primitives' (hooks) that can be shared across components to keep components clean and focused on rendering

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Applies to packages/web/src/components/**/*.{jsx,tsx} : In SolidJS components, do not destructure props as it breaks reactivity - instead access props directly from the props object, or wrap them in a function to ensure they are always up-to-date

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx} : 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:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx,js,ts} : Create reusable logic in primitives (hooks) that can be shared across components to keep components clean and focused on rendering

Applied to files:

  • .clauderc
  • .cursorrules
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Applies to packages/workers/migrations/**/*.sql : All database migrations should go in a single file: `packages/workers/migrations/0001_init.sql` - do NOT create separate migration files

Applied to files:

  • docs/plans/audit-logs-plan.md
🧬 Code graph analysis (2)
packages/web/src/primitives/useProject/sync.js (1)
packages/web/src/lib/studyNaming.js (1)
  • studyData (123-123)
packages/web/src/primitives/useProjectStudyHandlers.js (1)
packages/web/src/lib/studyNaming.js (1)
  • generateStudyName (122-162)
🪛 LanguageTool
docs/plans/audit-logs-plan.md

[uncategorized] ~521-~521: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... logging to user deletion ### Phase 3: High Priority Events 10. [ ] Add audit logging to 2F...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


[uncategorized] ~527-~527: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...g to user profile updates ### Phase 4: Medium Priority Events 13. [ ] Add audit logging to pr...

(EN_COMPOUND_ADJECTIVE_INTERNAL)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Workers Builds: corates
🔇 Additional comments (10)
.github/copilot-instructions.md (1)

20-20: LGTM!

This guideline addition aligns well with the PR's organizational structure.

.clauderc (1)

5-10: LGTM!

The documentation updates provide clear guidance on project structure, libraries, and best practices. These changes are consistent with the updates in .github/copilot-instructions.md.

Also applies to: 31-37, 44-44, 67-67, 76-76

docs/plans/audit-logs-plan.md (1)

1-551: LGTM!

This is a comprehensive and well-structured implementation plan for audit logging. The plan includes clear phases, database schema, code examples, and security considerations.

packages/web/src/primitives/useProject/sync.js (1)

64-64: LGTM!

The originalTitle field addition follows the established pattern for other metadata fields and correctly defaults to null when not present.

.cursorrules (1)

5-10: LGTM!

These documentation updates are consistent with the changes in .clauderc and .github/copilot-instructions.md, ensuring uniform guidance across all configuration files.

Also applies to: 31-37, 44-44, 67-67, 76-76

packages/web/src/primitives/useProject/studies.js (1)

41-41: LGTM!

The originalTitle field handling in both createStudy and updateStudy follows the established pattern for other optional metadata fields.

Also applies to: 82-82

packages/web/src/components/project-ui/EditStudyModal.jsx (2)

21-21: LGTM! Smart lazy migration pattern.

The originalTitle signal initialization with fallback to study.name provides a smooth migration path for existing studies. This ensures the UI remains functional while gradually adopting the new field.

Also applies to: 52-53


85-85: LGTM! Clear UI structure and correct update handling.

The changes properly distinguish between:

  • Display Name: User-facing study identifier
  • Article Title: Original title for citation/naming purposes

The update payload correctly sends undefined instead of empty strings, preventing unintended overwrites.

Also applies to: 108-120, 138-151

packages/web/src/primitives/useProjectStudyHandlers.js (2)

43-43: LGTM! Consistent originalTitle handling in study addition.

The originalTitle preservation and propagation logic correctly:

  • Captures the original title before naming transformations
  • Updates it when better metadata is extracted from PDFs
  • Uses it as the basis for generating display names
  • Includes it in safe updates with proper undefined filtering

Also applies to: 46-46, 106-106, 132-132, 145-145


248-248: LGTM! Consistent originalTitle handling in reference import.

The reference import path correctly preserves the original title before applying naming conventions.

Also applies to: 254-254

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

🧹 Nitpick comments (2)
packages/web/src/components/project-ui/AddMemberModal.jsx (1)

9-292: Consider extracting business logic to stores/utilities.

While the current implementation works correctly, the component contains substantial business logic (API calls, search functionality, member addition) that could be extracted per coding guidelines. This would improve maintainability and testability.

Consider refactoring:

  • API calls → stores/projectMembersStore.js or utilities/memberApi.js
  • Search logic → primitives/useSearchUsers.js
  • Component focuses solely on rendering and UI interactions

This is a pre-existing pattern and not urgent, but would align the component with project guidelines for lean, focused components.

packages/web/src/components/zag/Editable.jsx (1)

61-82: Consider adding controlled mode synchronization.

The component correctly avoids prop destructuring and uses reactive getters. However, the Zag machine context is initialized once (lines 61-82), so external updates to the value prop won't sync back to the internal state.

For fully controlled behavior (e.g., programmatic resets, external validation), consider adding:

  const api = createMemo(() => editable.connect(service, normalizeProps));

+ // Sync external value changes in controlled mode
+ createEffect(() => {
+   if (value() !== undefined && value() !== api().value) {
+     api().setValue?.(value());
+   }
+ });

The current "uncontrolled with notifications" mode works for many use cases, but this addition would support scenarios where the parent needs to update the value programmatically.

As per coding guidelines, components should maintain reactivity for props and avoid breaking SolidJS patterns—the current implementation correctly avoids prop destructuring, but could improve controlled-mode reactivity.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e783f3a and 1a0f731.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • packages/web/package.json (1 hunks)
  • packages/web/src/components/project-ui/AddMemberModal.jsx (2 hunks)
  • packages/web/src/components/project-ui/ProjectCard.jsx (1 hunks)
  • packages/web/src/components/project-ui/ProjectHeader.jsx (3 hunks)
  • packages/web/src/components/project-ui/ProjectView.jsx (1 hunks)
  • packages/web/src/components/zag/Editable.jsx (1 hunks)
  • packages/web/src/components/zag/README.md (1 hunks)
  • packages/web/src/primitives/useProject/index.js (1 hunks)
  • packages/web/src/primitives/useProject/studies.js (3 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

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

Files:

  • packages/web/src/primitives/useProject/index.js
  • packages/web/src/components/project-ui/AddMemberModal.jsx
  • packages/web/src/primitives/useProject/studies.js
  • packages/web/src/components/zag/Editable.jsx
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/ProjectCard.jsx
  • packages/web/src/components/project-ui/ProjectHeader.jsx
packages/web/src/**/*.{jsx,tsx,js,ts}

📄 CodeRabbit inference engine (.cursorrules)

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

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

Files:

  • packages/web/src/primitives/useProject/index.js
  • packages/web/src/components/project-ui/AddMemberModal.jsx
  • packages/web/src/primitives/useProject/studies.js
  • packages/web/src/components/zag/Editable.jsx
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/ProjectCard.jsx
  • packages/web/src/components/project-ui/ProjectHeader.jsx
packages/web/src/components/**/*.{jsx,tsx,js,ts}

📄 CodeRabbit inference engine (.cursorrules)

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

Files:

  • packages/web/src/components/project-ui/AddMemberModal.jsx
  • packages/web/src/components/zag/Editable.jsx
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/ProjectCard.jsx
  • packages/web/src/components/project-ui/ProjectHeader.jsx
packages/web/src/components/**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursorrules)

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

Files:

  • packages/web/src/components/project-ui/AddMemberModal.jsx
  • packages/web/src/components/zag/Editable.jsx
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/ProjectCard.jsx
  • packages/web/src/components/project-ui/ProjectHeader.jsx
packages/web/src/components/**

📄 CodeRabbit inference engine (.cursorrules)

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

Files:

  • packages/web/src/components/project-ui/AddMemberModal.jsx
  • packages/web/src/components/zag/Editable.jsx
  • packages/web/src/components/zag/README.md
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/ProjectCard.jsx
  • packages/web/src/components/project-ui/ProjectHeader.jsx
packages/{web,landing}/src/**/*.{jsx,tsx,css}

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

Use responsive design principles for UI components

Files:

  • packages/web/src/components/project-ui/AddMemberModal.jsx
  • packages/web/src/components/zag/Editable.jsx
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/ProjectCard.jsx
  • packages/web/src/components/project-ui/ProjectHeader.jsx
packages/web/src/**/*.{jsx,tsx}

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

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

Files:

  • packages/web/src/components/project-ui/AddMemberModal.jsx
  • packages/web/src/components/zag/Editable.jsx
  • packages/web/src/components/project-ui/ProjectView.jsx
  • packages/web/src/components/project-ui/ProjectCard.jsx
  • packages/web/src/components/project-ui/ProjectHeader.jsx
🧠 Learnings (7)
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx} : Reference existing Zag.js components in `packages/web/src/components/zag/*` and consult the README.md and documentation before adding new components or debugging

Applied to files:

  • packages/web/src/components/zag/Editable.jsx
  • packages/web/src/components/zag/README.md
  • packages/web/package.json
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Applies to packages/web/src/components/**/*.{jsx,tsx} : When implementing UI components, use zag.js from `packages/web/src/components/zag/*` and reuse existing components

Applied to files:

  • packages/web/src/components/zag/Editable.jsx
  • packages/web/src/components/zag/README.md
  • packages/web/package.json
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx} : Use Zag.js for UI components and design system

Applied to files:

  • packages/web/src/components/zag/Editable.jsx
  • packages/web/src/components/zag/README.md
  • packages/web/package.json
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx,js,ts} : 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/zag/README.md
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx,js,ts} : 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/zag/README.md
📚 Learning: 2025-12-16T00:29:26.670Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursorrules:0-0
Timestamp: 2025-12-16T00:29:26.670Z
Learning: Applies to packages/web/src/components/**/*.{jsx,tsx} : Use responsive design principles for UI components

Applied to files:

  • packages/web/src/components/zag/README.md
📚 Learning: 2025-12-16T05:05:58.178Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-16T05:05:58.178Z
Learning: Applies to packages/{web,landing}/src/**/*.{jsx,tsx,css} : Use responsive design principles for UI components

Applied to files:

  • packages/web/src/components/zag/README.md
🧬 Code graph analysis (3)
packages/web/src/components/project-ui/AddMemberModal.jsx (1)
packages/web/src/components/zag/Select.jsx (1)
  • Select (22-152)
packages/web/src/primitives/useProject/studies.js (2)
packages/web/src/primitives/useProject/index.js (1)
  • getYDoc (48-48)
packages/web/src/stores/projectStore.js (1)
  • projectStore (469-469)
packages/web/src/components/project-ui/ProjectView.jsx (3)
packages/web/src/primitives/useProjectStudyHandlers.js (1)
  • projectActions (28-28)
packages/web/src/primitives/useProjectChecklistHandlers.js (1)
  • projectActions (16-16)
packages/web/src/primitives/useProjectPdfHandlers.js (1)
  • projectActions (21-21)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Workers Builds: corates
🔇 Additional comments (13)
packages/web/src/components/project-ui/AddMemberModal.jsx (2)

4-4: LGTM! Clean import using alias.

The import correctly uses the @components alias for improved readability, following project conventions.


250-262: Excellent integration of the Zag.js Select component!

The Select component is correctly wired with proper props:

  • Items follow the expected {label, value} structure with clear, descriptive labels
  • Signal getter/setter are correctly used without destructuring (maintaining SolidJS reactivity)
  • inDialog={true} appropriately prevents portal rendering to avoid focus-trap conflicts in the modal context

This change improves accessibility and consistency with the design system.

packages/web/package.json (1)

22-22: LGTM! Dependency addition is consistent.

The new @zag-js/editable dependency follows the established version pattern (^1.31.1) used by other Zag.js packages in this project.

packages/web/src/primitives/useProject/index.js (1)

178-178: LGTM! Clean API extension.

The new updateDescription operation follows the established delegation pattern and integrates seamlessly with the existing operation set.

packages/web/src/components/project-ui/ProjectView.jsx (1)

237-237: LGTM! Proper component wiring.

The onUpdateDescription prop follows the same pattern as onRename, maintaining consistency in the component hierarchy.

packages/web/src/primitives/useProject/studies.js (2)

41-41: LGTM! Consistent metadata field handling.

The originalTitle field follows the established pattern for optional metadata fields and integrates cleanly with the study creation and update flows.

Also applies to: 82-82


184-237: LGTM! Well-structured description update implementation.

The updateDescription function properly:

  • Handles empty descriptions by sending null to clear them
  • Updates both Y.Doc and local store for consistency
  • Includes comprehensive error handling
  • Mirrors the established pattern from renameProject
packages/web/src/components/zag/README.md (1)

9-9: LGTM! Comprehensive component documentation.

The Editable component entry provides clear prop documentation and helpful usage guidance, particularly the distinction between single-line and multi-line editing scenarios.

packages/web/src/components/project-ui/ProjectCard.jsx (1)

38-76: LGTM! Improved card layout structure.

The new vertical layout with dedicated sections (header, metadata, actions) provides better visual hierarchy and consistent spacing. The description fallback text ("No description") improves UX by eliminating empty space.

packages/web/src/components/zag/Editable.jsx (1)

86-160: LGTM! Clean Zag.js integration and accessibility.

The render logic properly:

  • Uses Zag's prop spreads for accessibility
  • Conditionally shows input/preview based on editing state
  • Includes optional controls with visibility transitions
  • Maintains proper disabled/readonly states

Based on learnings, the component correctly references Zag.js patterns from existing components.

packages/web/src/components/project-ui/ProjectHeader.jsx (3)

13-31: LGTM! Proper per-field state management.

The separate editing states for name and description avoid coupling and enable independent validation/error handling. The effect on lines 29-31 correctly syncs the local state with prop changes without causing infinite loops.

As per coding guidelines, props are accessed directly (not destructured) to maintain reactivity.


64-88: LGTM! Consistent handler pattern.

The description handlers follow the same error handling and state management pattern as the name handlers, maintaining consistency and predictability.


156-214: LGTM! Well-structured description editing UI.

The description editing section properly:

  • Uses textarea for multi-line input
  • Shows fallback text when empty
  • Reveals edit button on hover (good UX)
  • Displays per-field errors
  • Maintains proper disabled states during saves

@InfinityBowman InfinityBowman merged commit eef6ba9 into main Dec 16, 2025
0 of 2 checks passed
@InfinityBowman InfinityBowman deleted the 68-improve-study-metadata-naming branch December 16, 2025 18:27
@coderabbitai coderabbitai Bot mentioned this pull request Dec 16, 2025
InfinityBowman added a commit that referenced this pull request Dec 17, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improve study metadata naming

2 participants