Skip to content

Align Therapy Compass home with shared mode-home template and enable universal search#875

Closed
BigSimmo wants to merge 7 commits into
mainfrom
codex/edit-therapy-page-structure-and-style
Closed

Align Therapy Compass home with shared mode-home template and enable universal search#875
BigSimmo wants to merge 7 commits into
mainfrom
codex/edit-therapy-page-structure-and-style

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Make the Therapy Compass home page share the same structure and responsive behavior as other mode home pages so the UX is consistent.
  • Use the app-wide universal search composer across all breakpoints so the search bar is identical on phone, tablet and desktop.
  • Remove the Therapy-specific header identity and top-right review badge so the tool chrome matches other mode homes.

Description

  • Replace the bespoke Therapy Compass hero/search layout with the shared ModeHomeMain / ModeHomeTemplate structure and mode-home composer slot (file: src/components/therapy-compass/screens/home-screen.tsx).
  • Re-enable the global responsive search composer for the therapy routes by restoring the GlobalSearchShell composer (file: src/app/therapy-compass/layout.tsx).
  • Remove the compact therapy identity block and the review-queue affordance from the therapy in-content nav, and hide the therapy subnav on the therapy home route via usePathname() so the home page mirrors other mode home pages (files: src/components/therapy-compass/nav.tsx, src/components/therapy-compass/workspace.tsx).
  • Small cleanup to wire existing actions into the shared template (common suggestions/pills and verification footer) and to keep behaviour for pathway/sheets/recommend actions.

Testing

  • Ran npm ci to install dependencies which completed successfully with no vulnerabilities found.
  • Ran focused check npm run test:focused -- --files <therapy files> which exited cleanly because no focused tests target these files.
  • Ran typecheck (npm run typecheck) which passed with no errors.
  • Ran npx prettier --check on the modified files which passed.
  • Ran the project gate npm run verify:cheap which reproduced an unrelated test failure in tests/pdf-extraction-budget.test.ts (PDF extraction child-process deadline test), so the broad gate did not fully pass.
  • Ran npm run ensure to start the dev server and it failed to become ready due to repeated Google font fetch failures logged in dev-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:cheap failure 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

    • Added the shared search experience to Therapy Compass.
    • Updated the home screen with streamlined therapy actions, search suggestions, and decision-support messaging.
    • Home and content pages now display tailored navigation and footer elements.
  • Changes

    • Removed the in-page Review Queue shortcut and warning prompt.
    • Improved workspace behavior by showing relevant error states and adapting layout elements to the current page.

@supabase

supabase Bot commented Jul 18, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Therapy 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.

Changes

Therapy Compass UI

Layer / File(s) Summary
Shared shell and route-aware chrome
src/app/therapy-compass/layout.tsx, src/components/therapy-compass/workspace.tsx
The shared search composer is enabled for Therapy Compass, and the workspace hides local navigation and footer content on /therapy-compass.
Template-based home screen
src/components/therapy-compass/screens/home-screen.tsx
The custom home UI is replaced with ModeHomeMain, ModeHomeTemplate, configured actions, suggestion pills, and a verification footer.
Simplified Therapy Compass navigation
src/components/therapy-compass/nav.tsx
The Review Queue button, review warning CTA, alert icon, and review-count binding are removed.

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
Loading

Possibly related PRs

  • BigSimmo/Database#679: Both modify Therapy Compass layout wiring for GlobalSearchShell and shared search composer visibility.
  • BigSimmo/Database#485: Both affect the shared mode-home template and composer presentation.
  • BigSimmo/Database#650: Both directly modify the Therapy Compass navigation review-warning behavior.

Suggested reviewers: claude

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately highlights the main change: aligning Therapy Compass home with the shared template and universal search.
Description check ✅ Passed The description is mostly complete and relevant, with summary and testing details present; it only needs the template's explicit Risk/Rollback fields filled out.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/edit-therapy-page-structure-and-style

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

@BigSimmo
BigSimmo marked this pull request as ready for review July 18, 2026 15:20
@BigSimmo
BigSimmo enabled auto-merge (squash) July 18, 2026 15:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/components/therapy-compass/nav.tsx
Comment thread src/components/therapy-compass/screens/home-screen.tsx
Comment thread src/components/therapy-compass/screens/home-screen.tsx
@BigSimmo

Copy link
Copy Markdown
Owner Author

@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.

@BigSimmo

Copy link
Copy Markdown
Owner Author

@codex resolve all comments

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

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 && npm run typecheck
  • 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 verify:cheap — broad gate reproduced the existing unrelated tests/pdf-extraction-budget.test.ts failure: missing /tmp/clinical-kb-pdf-deadline-*/child.pid in the PDF extraction child-process deadline test.
  • ⚠️ source /root/.nvm/nvm.sh && nvm use 24.15.0 >/dev/null && npm run ensure — local app did not become ready because Next.js failed fetching Google font resources; dev-server.log shows repeated fonts.gstatic.com request failures and /api/local-project-id returned 500. Screenshot/browser verification was therefore blocked by the local server readiness issue.

View task →

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +57 to +61
<ModeHomeVerificationFooter
icon={ShieldCheck}
label="Decision support"
body="Source-grounded — review status before clinical use"
/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex fix

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

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 unrelated tests/pdf-extraction-budget.test.ts failure: 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 from fonts.gstatic.com; dev-server.log showed repeated font request failures and /api/local-project-id returned 500. The failed dev server process was stopped afterward.

View task →

cursoragent and others added 2 commits July 18, 2026 15:49
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>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 44a4c51 and 0bab547.

📒 Files selected for processing (4)
  • src/app/therapy-compass/layout.tsx
  • src/components/therapy-compass/nav.tsx
  • src/components/therapy-compass/screens/home-screen.tsx
  • src/components/therapy-compass/workspace.tsx

Comment on lines +65 to +71
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}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

@BigSimmo

Copy link
Copy Markdown
Owner Author

Closing as duplicate — superseded by #887 (cursor/therapy-mode-home-align-1ae0), which carries the Therapy Compass home alignment with policy-compliant metadata.

@BigSimmo BigSimmo closed this Jul 18, 2026
auto-merge was automatically disabled July 18, 2026 16:22

Pull request was closed

@BigSimmo
BigSimmo deleted the codex/edit-therapy-page-structure-and-style branch July 18, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants