Align Therapy Compass home with shared mode-home template and enable universal search#875
Align Therapy Compass home with shared mode-home template and enable universal search#875BigSimmo wants to merge 7 commits into
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
📝 WalkthroughWalkthroughTherapy Compass now uses the shared search composer, a template-based home screen, and route-aware workspace chrome. The top navigation no longer includes Review Queue or its warning CTA, while non-home routes retain local navigation and footer rendering. ChangesTherapy Compass UI
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GlobalSearchShell
participant TherapyCompassWorkspace
participant ModeHomeTemplate
participant TherapyCompassNav
GlobalSearchShell->>TherapyCompassWorkspace: mount Therapy Compass
TherapyCompassWorkspace->>ModeHomeTemplate: render home route
TherapyCompassWorkspace-->>TherapyCompassNav: skip navigation on home route
ModeHomeTemplate->>ModeHomeTemplate: submit selected suggestion
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82aa600cba
ℹ️ 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. |
|
@codex resolve all comments |
|
Summary
Testing
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 69c2c071b0
ℹ️ 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".
| <ModeHomeVerificationFooter | ||
| icon={ShieldCheck} | ||
| label="Decision support" | ||
| body="Source-grounded — review status before clinical use" | ||
| /> |
There was a problem hiding this comment.
Remove the duplicate Therapy verification footer
On /therapy-compass, this new mode-home footer renders the same “Decision support — Source-grounded…” notice that TherapyCompassMain still appends unconditionally after every route, so the home page now shows two identical clinical verification/governance footers. Keep only one footer for the home route or suppress the workspace footer there; a DOM assertion that the home page contains this notice once would catch the regression.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Summary
- Removed the Therapy Compass home’s inline verification footer so the route relies on the workspace-level footer only, preventing duplicate “Decision support” notices on
/therapy-compass. src/components/therapy-compass/screens/home-screen.tsxL21-L67 - Added
as?: ElementTypesupport toModeHomeMain, preserving the default<main>while allowing nested route shells to render the shared template as another landmark-safe element. src/components/mode-home-template.tsxL102-L124 - Updated Therapy Compass home to render
ModeHomeMainas a<section>and keep the shared desktop composer slot wired. src/components/therapy-compass/screens/home-screen.tsxL21-L30 - Registered
/therapy-compassas a standalone mode home so the global search composer can portal into the shared hero composer slot instead of falling back to the bottom/default placement. src/components/clinical-dashboard/global-search-shell.tsxL242-L253 - Restored source-governance review reachability by showing a Review Queue action on the home screen when
reviewCount > 0. src/components/therapy-compass/screens/home-screen.tsxL49-L58 - Restored the Review Queue item and count badge in the Therapy Compass in-content nav when unreviewed therapy records exist. src/components/therapy-compass/nav.tsxL61-L83
- Added focused wiring guards for the single-footer invariant, nested-landmark guard, Therapy Compass composer routing, and Review Queue affordances. tests/therapy-compass-mode-wiring.test.tsL51-L89
- Committed changes on the current branch with commit
5f59f80(fix: resolve therapy compass home feedback) and created PR metadata with themake_prtool.
Testing
- ✅
source /root/.nvm/nvm.sh && nvm use 24.15.0 >/dev/null && npm ci - ✅
source /root/.nvm/nvm.sh && nvm use 24.15.0 >/dev/null && npm run test -- tests/therapy-compass-mode-wiring.test.ts - ✅
source /root/.nvm/nvm.sh && nvm use 24.15.0 >/dev/null && npx prettier --check tests/therapy-compass-mode-wiring.test.ts src/components/mode-home-template.tsx src/components/clinical-dashboard/global-search-shell.tsx src/components/therapy-compass/nav.tsx src/components/therapy-compass/screens/home-screen.tsx - ✅
source /root/.nvm/nvm.sh && nvm use 24.15.0 >/dev/null && npm run typecheck - ❌
source /root/.nvm/nvm.sh && nvm use 24.15.0 >/dev/null && npm run verify:cheap— broad gate reproduced the existing unrelatedtests/pdf-extraction-budget.test.tsfailure: missing/tmp/clinical-kb-pdf-deadline-*/child.pid. ⚠️ source /root/.nvm/nvm.sh && nvm use 24.15.0 >/dev/null && npm run ensure— local server did not become ready because Next.js failed fetching Google font resources fromfonts.gstatic.com;dev-server.logshowed repeated font request failures and/api/local-project-idreturned 500. The failed dev server process was stopped afterward.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Home already renders ModeHomeVerificationFooter via ModeHomeTemplate; skip the workspace footer on /therapy-compass so the notice appears once. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/components/therapy-compass/workspace.tsx`:
- Around line 65-71: Update TherapyCompassMain to render a div instead of a main
landmark when used by the home route, preventing nested main elements beneath
HomeScreen’s ModeHomeMain. Preserve the existing tc-main styling, error/content
rendering, and conditional TherapyCompassFooter behavior.
🪄 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: 2600026a-67c8-44d2-be98-107d0954e48d
📒 Files selected for processing (4)
src/app/therapy-compass/layout.tsxsrc/components/therapy-compass/nav.tsxsrc/components/therapy-compass/screens/home-screen.tsxsrc/components/therapy-compass/workspace.tsx
| function TherapyCompassMain({ children, showFooter }: { children: ReactNode; showFooter: boolean }) { | ||
| const b = useTcBindings(); | ||
| return ( | ||
| <main className="tc-main" style={s(`min-width:0;padding:32px 40px 40px;`)}> | ||
| {b.error ? <TherapyCompassDataError /> : children} | ||
| <TherapyCompassFooter /> | ||
| {/* Home uses ModeHomeTemplate's verification footer; skip the workspace copy there. */} | ||
| {showFooter ? <TherapyCompassFooter /> : null} |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Avoid nested <main> landmarks on the home route.
HomeScreen Line 22 now renders ModeHomeMain as <main>, beneath this existing <main>. Use a <div> here on home routes to preserve one main landmark.
Proposed fix
-function TherapyCompassMain({ children, showFooter }: { children: ReactNode; showFooter: boolean }) {
+function TherapyCompassMain({ children, isHome }: { children: ReactNode; isHome: boolean }) {
const b = useTcBindings();
+ const Root = isHome ? "div" : "main";
return (
- <main className="tc-main" style={s(`min-width:0;padding:32px 40px 40px;`)}>
+ <Root className="tc-main" style={s(`min-width:0;padding:32px 40px 40px;`)}>
{b.error ? <TherapyCompassDataError /> : children}
- {showFooter ? <TherapyCompassFooter /> : null}
- </main>
+ {!isHome ? <TherapyCompassFooter /> : null}
+ </Root>
);
}
@@
-<TherapyCompassMain showFooter={!isHome}>{children}</TherapyCompassMain>
+<TherapyCompassMain isHome={isHome}>{children}</TherapyCompassMain>Also applies to: 97-97
🤖 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/components/therapy-compass/workspace.tsx` around lines 65 - 71, Update
TherapyCompassMain to render a div instead of a main landmark when used by the
home route, preventing nested main elements beneath HomeScreen’s ModeHomeMain.
Preserve the existing tc-main styling, error/content rendering, and conditional
TherapyCompassFooter behavior.
|
Closing as duplicate — superseded by #887 (cursor/therapy-mode-home-align-1ae0), which carries the Therapy Compass home alignment with policy-compliant metadata. |
Motivation
Description
ModeHomeMain/ModeHomeTemplatestructure and mode-home composer slot (file:src/components/therapy-compass/screens/home-screen.tsx).GlobalSearchShellcomposer (file:src/app/therapy-compass/layout.tsx).usePathname()so the home page mirrors other mode home pages (files:src/components/therapy-compass/nav.tsx,src/components/therapy-compass/workspace.tsx).Testing
npm cito install dependencies which completed successfully with no vulnerabilities found.npm run test:focused -- --files <therapy files>which exited cleanly because no focused tests target these files.npm run typecheck) which passed with no errors.npx prettier --checkon the modified files which passed.npm run verify:cheapwhich reproduced an unrelated test failure intests/pdf-extraction-budget.test.ts(PDF extraction child-process deadline test), so the broad gate did not fully pass.npm run ensureto start the dev server and it failed to become ready due to repeated Google font fetch failures logged indev-server.log, so live browser verification was not completed.Files changed:
src/components/therapy-compass/screens/home-screen.tsx,src/app/therapy-compass/layout.tsx,src/components/therapy-compass/nav.tsx,src/components/therapy-compass/workspace.tsx.Notes/Risks: the CI/local
verify:cheapfailure is unrelated to the UI changes and should be triaged separately; live UI verification (local server) was blocked by external font fetch errors in the environment.Codex Task
Summary by CodeRabbit
New Features
Changes