feat(formulation): add psychiatric formulation workspace#660
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ac2747cdf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. After fixing or dispositioning a thread, reply in that thread with as the first line, followed by a concise summary; that marker authorizes the workflow to close that exact thread. If human input or new authorization is required, do not use the marker and leave the thread open with the blocker. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughReplaces the specifiers workspace with a formulation workspace, including clinical content, search and drafting utilities, pages, routes, dashboard mode wiring, legacy redirects, documentation, and automated tests. ChangesFormulation workspace
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant FormulationHomePage
participant FormulationMechanismPage
participant FormulationBuilderPage
User->>FormulationHomePage: Search formulation mechanisms
FormulationHomePage-->>User: Show ranked mechanism matches
User->>FormulationMechanismPage: Open mechanism guide
FormulationMechanismPage-->>User: Show formulation actions
User->>FormulationBuilderPage: Open builder with mechanism
FormulationBuilderPage-->>User: Build and edit formulation draft
Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ac2747cdf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
tests/ui-formulation.spec.ts (1)
7-31: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract shared Playwright helpers
blockExternalRequests,gotoApp, and the horizontal-overflow checks are repeated across the UI spec files. Move them into a shared test helper so the localhost allow-list and overflow tolerance stay consistent.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/ui-formulation.spec.ts` around lines 7 - 31, Extract blockExternalRequests, gotoApp, and expectNoHorizontalOverflow from tests/ui-formulation.spec.ts into a shared Playwright test helper, preserving the localhost allow-list, navigation behavior, and overflow tolerance. Update tests/ui-formulation.spec.ts (lines 7-31) and tests/ui-smoke.spec.ts (lines 34-37) to import and reuse the shared helpers, removing their duplicated local implementations.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/app/specifiers/`[[...path]]/page.tsx:
- Around line 8-19: The legacy redirect in LegacySpecifierRoute must preserve
compare pairs: when path targets “compare”, map the incoming specifier values to
query keys “a” and “b” in order, while retaining the existing “specifier” to
“mechanism” mapping for other routes. Update the query-parameter transformation
without changing pathname construction or redirect behavior.
In `@src/components/formulation/formulation-compare-page.tsx`:
- Around line 88-114: Update FormulationComparePage so leftId and rightId are
resynchronized with fallbackPair(initialLeft, initialRight) whenever the
query-derived initialLeft or initialRight values change, rather than retaining
only the first mount’s state. Preserve the existing chooseLeft, chooseRight, and
swap behavior while ensuring navigation to a new pair displays the corresponding
comparison.
In `@src/data/formulation-content.json`:
- Around line 74-75: Update the governance metadata represented by sourceStatus,
sourceConfidence, releaseStatus, and contentReviewSummary so release readiness
remains separate from owner-confirmation status; do not mark owner confirmation
complete while pendingOwnerConfirmations is 9 or sourceWarnings still reports
confirmation pending. Either preserve the pending owner-confirmation state or
clear all pending confirmations before marking it complete.
---
Nitpick comments:
In `@tests/ui-formulation.spec.ts`:
- Around line 7-31: Extract blockExternalRequests, gotoApp, and
expectNoHorizontalOverflow from tests/ui-formulation.spec.ts into a shared
Playwright test helper, preserving the localhost allow-list, navigation
behavior, and overflow tolerance. Update tests/ui-formulation.spec.ts (lines
7-31) and tests/ui-smoke.spec.ts (lines 34-37) to import and reuse the shared
helpers, removing their duplicated local implementations.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 29cd7639-968c-4a84-93b9-71d9bad55a81
📒 Files selected for processing (42)
docs/codebase-index.mddocs/site-map.mdplaywright.config.tsscripts/generate-site-map.tssrc/app/formulation/[slug]/page.tsxsrc/app/formulation/builder/page.tsxsrc/app/formulation/compare/page.tsxsrc/app/formulation/layout.tsxsrc/app/formulation/map/page.tsxsrc/app/formulation/page.tsxsrc/app/page.tsxsrc/app/specifiers/[[...path]]/page.tsxsrc/app/specifiers/[slug]/page.tsxsrc/app/specifiers/builder/page.tsxsrc/app/specifiers/compare/page.tsxsrc/app/specifiers/map/page.tsxsrc/app/specifiers/page.tsxsrc/components/clinical-dashboard/ClinicalSidebar.tsxsrc/components/clinical-dashboard/global-search-shell.tsxsrc/components/clinical-dashboard/master-search-header.tsxsrc/components/clinical-dashboard/mode-action-popup.tsxsrc/components/formulation/formulation-builder-page.tsxsrc/components/formulation/formulation-compare-page.tsxsrc/components/formulation/formulation-home-page.tsxsrc/components/formulation/formulation-map-page.tsxsrc/components/formulation/formulation-mechanism-page.tsxsrc/components/formulation/formulation-ui.tsxsrc/components/specifiers/specifier-builder-page.tsxsrc/components/specifiers/specifier-compare-page.tsxsrc/components/specifiers/specifier-map-page.tsxsrc/components/specifiers/specifier-record-page.tsxsrc/data/formulation-content.jsonsrc/lib/app-mode-icons.tssrc/lib/app-modes.tssrc/lib/formulation.tssrc/lib/specifiers.tstests/app-modes.test.tstests/formulation.test.tstests/specifiers.test.tstests/ui-formulation.spec.tstests/ui-smoke.spec.tstests/ui-specifiers.spec.ts
💤 Files with no reviewable changes (12)
- src/app/specifiers/builder/page.tsx
- src/app/specifiers/page.tsx
- tests/specifiers.test.ts
- tests/ui-specifiers.spec.ts
- src/components/specifiers/specifier-record-page.tsx
- src/components/specifiers/specifier-map-page.tsx
- src/app/specifiers/compare/page.tsx
- src/app/specifiers/[slug]/page.tsx
- src/components/specifiers/specifier-builder-page.tsx
- src/lib/specifiers.ts
- src/app/specifiers/map/page.tsx
- src/components/specifiers/specifier-compare-page.tsx
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d1e00ecce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/data/formulation-content.json (1)
1063-1063: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winRecord concrete source update dates for the attachment and dissociation entries.
sourceUpdatedAtshould use the source’s actual update date instead of"source page current at review"so the provenance stays reproducible.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/data/formulation-content.json` at line 1063, Update the sourceUpdatedAt values for the attachment and dissociation entries in formulation-content.json to their concrete source update dates, replacing the review-time placeholder while preserving the existing date format and entry structure.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/data/formulation-content.json`:
- Line 1063: Update the sourceUpdatedAt values for the attachment and
dissociation entries in formulation-content.json to their concrete source update
dates, replacing the review-time placeholder while preserving the existing date
format and entry structure.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 7187debb-03db-45f4-bf8c-ac1bce0f6e2f
📒 Files selected for processing (6)
src/app/formulation/compare/page.tsxsrc/app/specifiers/[[...path]]/page.tsxsrc/components/formulation/formulation-compare-page.tsxsrc/data/formulation-content.jsontests/formulation.test.tstests/ui-formulation.spec.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- src/app/formulation/compare/page.tsx
- tests/formulation.test.ts
- src/components/formulation/formulation-compare-page.tsx
- tests/ui-formulation.spec.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a6cb56b2a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… branch Resolve conflicts across 11 files, combining: - DSM-5 Diagnosis mode + Specifiers mode (this branch) - Formulation workspace mode (main, PR #660) All three modes coexist: dsm, specifiers, formulation added to AppModeId, AppModeSearchKind, appModeDefinitions, namespaceIsolatedModes, sidebar, global-search-shell, master-search-header, and mode-action-popup. Tests updated to cover all three modes. Site-map and generate-site-map regenerated with all three slug inventories.
Adds the recovered psychiatric Formulation workspace, including mechanism search, structured builder, comparison, relationship map, mechanism guidance, compatibility redirects, local content, documentation, and focused tests. Verification: verify:cheap passed; verify:pr-local passed including production build and client-bundle secret scan; 4 dedicated Chromium Formulation tests passed; production-readiness had no blockers. No live Supabase or OpenAI providers were contacted.
Summary by CodeRabbit