Skip to content

Clinical polish: Work-style header, compact cards, one Compare tray, desktop layouts - #3491

Merged
gitar-bot[bot] merged 45 commits into
mainfrom
claude/clinical-polish-mockups-dme269
Oct 12, 2026
Merged

gitar-bot[bot] merged 45 commits into
mainfrom
claude/clinical-polish-mockups-dme269

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

User description

Summary

Before: Clinical mode looked different from Work mode. It had boxed headers and result strips, long therapy cards, a split Psychiatry home, separate compare controls on each list, and filters that hid rows. Desktop records filled one long column.

After: Clinical uses Work's header, title band and centred column. Lists are calmer and grouped. Therapy and Differentials rows are compact, and the Avoid / modify warning is still shown in full. Psychiatry has one Home page. There is one shared Compare tray, and filters highlight matches instead of hiding the rest. On desktop, DSM, Therapy and Act records sit beside their list, and a cited source opens beside the answer.

The owner approved this on 12 Oct 2026 from high-fidelity mockups ("go ahead with all your recommendations"). The filter change was approved separately in the Ward Flow ideas.

  • Areas touched: App experience, Design system, Personal practice, Knowledge and records
  • Item 1: the Clinical header gets glass controls and the pill names the area only. A ModeNav title sits above the tabs, and the column is 64rem from 1024 px. The new src/app/clinical-mode.css holds the styles.
  • Item 2: SearchResultsHeaderBand is one plain line. DSM chapters are one grouped hairline card.
  • Item 3: compact Therapy and Differentials rows. "Best used for" and "Best fit" move into the record word for word. Therapy Review leaves the tab bar and is linked from Therapy search.
  • Item 4: Psychiatry tabs are now Home and Saved. ?page=tools lands on Home. Medicines drops "Lives in Psychiatry". The First Nations entry is kept.
  • Item 5: the Differentials tidy-up. The count is never clipped, the Must-check shelf is gone (Emergent still leads), and scenario chips sit in one scrolling row.
  • Item 6: a SharedCompareTray for Therapy, Differentials and DSM search.
  • Item 7: ClinicalSplit and DesktopSplitList, an Act topic list, and a docked answer source panel on desktop only. Phones are pixel-identical.
  • Item 8: recent questions show as a list, the Try line fits a 320 px phone, and the desktop shows one logo.
  • Filters highlight instead of hiding, on Differentials, DSM and Therapy. A note reads "N of M highlighted, all rows stay" and has a Clear button.
  • Favourites at 320 px with large text: the header goes to two rows and the content wraps.
  • The Differentials compare dock now claims its phone band only once something is ticked (compare-presence.ts).

Verification

  • Checks run:
    • npm run test:focused (combined branch): Test Files 1 failed | 563 passed (564). The one failure was the pill-weight test's source anchor; it was fixed, and tests/mode-pages-sheet-classes.test.ts now gives Tests 4 passed (4).
    • tsc --noEmit (combined branch): exit 0.
    • eslint --max-warnings=0 and prettier on the changed files: clean.
    • check:organisation: every new file is placed.
    • Design-system adoption: 55 components, 232 roots.
    • Builders' focused browser proof: smoke and desktop split specs passed.
    • Three Differentials, DSM and Tools browser tests failed against the dev server and were not proven to fail on base as well. The full browser suite is left to CI.
  • UI verification not run: full verify:ui and npm run build are memory-killed in this container; CI runs the browser suite.

Risk and rollout

  • Risk: medium, layout and interaction across Clinical. No clinical wording, sources, urgency order or retrieval changed.
  • Rollback: revert the merge commit.
  • Provider or production effects: None.

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use
  • No patient-identifiable document workflow was introduced or expanded without explicit governance approval
  • Supabase target remains PsychSift Production (sjrfecxgysukkwxsowpy)
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact was checked when clinical decision-support behavior changed

Presentation only. The Avoid / modify warning keeps its full text at every width. Emergent ordering is unchanged. Filtering now keeps every row visible instead of hiding the non-matching ones, which is the more conservative behaviour. No server, data or source code changed.

Notes

  • This PR stays a draft. It is clinical, and only the owner sends it live.
  • Known limits:
    • The Therapy list's existing 24-row cap now applies per group.
    • The therapy record's Cautions tile still clips with "Tap for detail", as it did before this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc


Generated by Claude Code


Summary by cubic

Pulls Clinical mode into Work's visual language: the header takes Work's glass controls with a calm title band, Therapy and Differentials rows become compact, one shared Compare tray replaces the separate compare controls, and filters now highlight matching rows instead of hiding the rest. From 1024px a record opens beside its list, and a cited source docks beside the answer.

List and record changes

  • Psychiatry's tabs are now Home and Saved; the split Ask/Tools pages merge into Home, and Medicines drops its signposts.
  • Therapy and Differentials rows are compact; the Avoid / modify warning shows in full at every width, and "Best used for" and "Best fit" move into the record.
  • DSM, Therapy and Act records show their list beside them from 1024px, with the current record marked; phones and upright tablets are unchanged.
  • A cited source opens docked beside the answer on desktop, dismisses with Escape or its close button without touching browser history, and reserves answer-column room so it never covers the prose.
  • Therapy Review leaves the main tabs and is linked from the Therapy search page; the 24-row cap now applies per group.
  • Recent questions render as a list, the Try line fits a phone, and favourites wrap at large text on 320px phones.

Filtering and compare

  • Differentials, DSM and Therapy filters highlight matching rows, keep the rest under "Not matching", show an "N of M highlighted" note with Clear, and announce changes through the shared announcer.
  • Therapy, Differentials and DSM search share one Compare tray, which claims its dock band only once something is ticked.
  • Therapy's tray lists each selection in a sheet with a 48px Remove button; the DSM tray keeps a ticked diagnosis title even outside the current results.
  • The Differentials Search tab links the results route directly when a query is carried.
  • Presentation only — no clinical wording, sources, urgency order or retrieval changed.

Written for commit 4e51281. Summary will update on new commits.

View guided diff Turn on auto-fix


CodeAnt-AI Description

Make clinical references easier to scan without hiding useful results

What Changed

  • Filters in Differential, DSM, and Therapy search now put matching rows first while keeping other results in view under a “Not matching” or urgency-specific heading. A count explains how many are highlighted, and Clear removes the highlighting filters.
  • DSM, Differential, and Therapy lists now use one Compare tray that names selected records, lets users clear the selection, and opens comparison when enough records are selected. On phones it sits above the search box or in the page footer; on wider screens it floats above the list.
  • Therapy search uses compact rows with the full Avoid / modify warning visible. Best-use and fit details are shown in the therapy record, and the Review queue remains one tap away from search.
  • On wide screens, DSM and Therapy records show a navigation list beside the record, and the Act page lists topics that jump to their sections. Cited sources open beside the answer instead of covering it; smaller screens keep the existing single-column pages and source drawer.
  • Psychiatry now has Home and Saved pages. Home brings together question search, shift tools, sections, builders, and recent activity; old links to the Tools page open Home.
  • Clinical headers and result counts use a simpler, Work-style layout. Recent questions on the home page appear as full-width tappable rows instead of chips.

Impact

✅ Non-matching clinical records stay accessible while filtering
✅ Full therapy cautions visible in search
✅ Side-by-side clinical references on wide screens

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

claude added 19 commits October 12, 2026 09:00
- Clinical header: glass circles and a glass pill (Work's glass tokens), the
  pill names the area alone on one line.
- Mode pages: a calm title above plain text tabs (ModeNav `title`); from
  1024px the title, tabs and page share Work's 64rem column
  (--clinical-col, new src/app/clinical-mode.css).
- Psychiatry and Medicines bands open out to the same column on desktop.
- Results band: one plain line; only a failed or partial search draws a
  mark; a browse subject stays as the screen-reader heading only.
- DSM chapters: one grouped card with hairline rows and a Chapters eyebrow.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
- Psychiatry tabs are Home and Saved. Home holds search, Resume, For a
  shift, Mental Health Act, Sections (with counts), Builders and Continue.
- Builders keeps every quick action (First Nations included) and gains the
  builders and comparisons the retired Tools page listed, so Home reaches
  all of them.
- /psychiatry?page=tools lands on Home.
- The "Your week" chart and the Medicines signpost go.
- Medicines loses "Lives in Psychiatry": Calculators and Dictionary are in
  Psychiatry's Sections and Safety plan is under For a shift.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
- Recent questions are one grouped list (History icon, chevron, 48px rows)
  instead of loose chips; the old chip CSS goes.
- The phone "Try this" line drops "Tap to search" so the example is not
  cut to a few letters at 320-390px; the button's name is unchanged.
- Desktop: the header no longer repeats the PsychSift lockup the rail
  already shows, and the "Try ... in Answer." line goes (the Prompts chips
  already offer the examples).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
…rce panel

From 1024px only (phones and upright tablets unchanged):
- A DSM diagnosis and a therapy record open with their list in a sticky
  column on the left (chapters or categories, the current record marked
  aria-current="page"). ClinicalSplit shares WorkSplit's column rule in
  work-mode.css; below 1024px it draws no list and its wrappers take no box.
- The Act page has a topic list beside the text, marking the topic being
  read with aria-current="location".
- A cited source in an answer opens in a panel docked beside the answer
  instead of the centred dialog: a labelled complementary landmark with a
  close button and Escape, focus moved in on open and returned to the
  citation on close. The panel loads lazily; the Sheet drawer is unchanged
  below 1024px.

Side list rows are 48px (min-h-12). The shell ignores the side list's own
scroll so it cannot hide the app header.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
Focus moves in from a callback ref (the overlay host can arrive a render
after open) and the opener is recorded once, so a second ref attach cannot
record the panel as its own opener. The return-focus resolver is read at
close time, while it still names the source the panel was showing. The panel
sets pointer-events inline to match the overlay layer's inline none.

Adds a DOM test for open, Escape and close-button close, focus return and the
unchanged phone Sheet, and a desktop Playwright smoke for the docked panel.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
Pins the DSM, therapy and Act side lists: drawn beside the record from 1024px with the current row marked and every row 48px, and not drawn at 390 or 768.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
… one shared Compare tray

- Therapy search rows become one compact row each: name, one-line summary,
  the Avoid / modify warning in amber shown in full at every width (no clamp,
  no ellipsis), tags, and 48px favourite / compare / sheet icon controls; the
  whole row opens the record, where Best used for and Best fit already show
  in full. Review (the sign-off queue) leaves the main tabs (group "more") and
  stays one tap away from the Therapy search page.
- Differentials: related diagnoses listed once as chips, title opens the
  record, count no longer clipped on phones (grouping control on its own
  row), Must-check shelf removed from Diagnoses (Emergent still first),
  scenario chips in one keyboard-reachable sideways row.
- SharedCompareTray ("N selected, Clear, Compare") replaces the Therapy tray,
  both Differentials compare bars and the DSM strip; appears only once
  something is ticked, announced through the live announcer, docks above
  the phone search box, pads the list end, and opens the existing compare
  pages. Differentials dock clearance drops to the one-row 9rem.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
The therapy record's pinned header carries its tabs, so the list beside it sets --clinical-split-top to clear it; other Clinical splits keep the default 5rem.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
… recent list

Covers the ?page=tools fallback landing on Home, the Builders list reaching
everything the retired Tools page linked, the plain results band, the recent
questions list and the one-logo desktop home.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
From 1024 to 1279px the Clinical list column is 17rem so the record keeps room for its four fact tiles; from 1280px it takes WorkSplit's shared 17-22rem range.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
…ared Compare tray

- Therapy result Playwright test now checks the compact row: the full Avoid
  warning (no clip, clamp or ellipsis) at 320-1920px, 48px icon controls,
  compare toggle names, and the tray appearing only once ticked.
- Mode-nav density and contract tests count Therapy's four bar destinations;
  Review stays registered off the bar.
- Differentials dock test ticks two diagnoses before using the shared tray;
  DSM scroll-hide test follows the renamed footer layer class.
- Style-contract exemptions and the differential compare contract follow the
  removed FAB and old Therapy tray.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
…linical in full

The Clinical top bar takes two rows once it is narrower than 17rem, so the
area pill keeps a full-width row and its name. Favourites opts into the
large-text flag Work pages use; its scope and view switches wrap, the On My
Day tiles drop to two or one across, and the Continue card and rows wrap
instead of cutting words off. Normal text is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
… tray

- Below 360px the tray's Clear label moves to screen readers only (the X
  keeps a 48px target), so "2 of 4 selected" is never cut.
- Differentials dock test: a submitted search pre-ticks two diagnoses, so the
  tray is already ready; the reserve floor follows the one-row 9rem band.
- Differential stream route test matches the title link name
  ("..., open pathway").

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
Owner-approved (ward-flow ideas item 7). A filter no longer removes rows:

- Matching rows come first in their usual order (Emergent still leads on
  Differentials); every other row stays listed below under "Not emergent"
  (a single urgency filter) or "Not matching", its title muted with the
  --text-muted token, never opacity. Rows stay tappable at 48px.
- A polite live note, "N of M highlighted, all rows stay", with Clear, which
  clears only the highlighting filters. The band count is the whole set.
- Differentials: urgency and chapter filters highlight; search scope and the
  family view still define the set. DSM: category and support filters.
  Therapy: topics, reviewed and handout filters (the existing 24-row display
  cap applies to each group).
- New shared FilterHighlightNote / FilterNotMatchingHeading, registered in
  the design-system adoption manifest. No clinical wording changed.

Tests: non-matching rows stay present (Differentials, DSM, Therapy), counts,
order, the live note and Clear; the shared note's live region stays mounted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
…sh-mockups-dme269

# Conflicts:
#	src/components/dsm/dsm-search-page.tsx
… claims its band only when something is ticked

Merge fixes: DSM chapters keep the grouped card inside the filter-highlight
column; the pill weight test follows the header's new page-line branch.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
@supabase

supabase Bot commented Oct 12, 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 Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 06b52dd4-daa7-48a0-beae-61ce62c40ea3

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

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

@codspeed

codspeed Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 5 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

ℹ️ 1 benchmark has no flame graph

The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.

✅ 8 untouched benchmarks


Comparing claude/clinical-polish-mockups-dme269 (4e51281) with main (5f6b272)

Open in CodSpeed

@codeant-ai

codeant-ai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: 4e51281f
Scan Time: 2026-10-12 17:22:18 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets ✅ PASSED 0 secrets found
Duplicate Code ✅ PASSED 0.0% duplicated
SAST ✅ PASSED No security issues
Bugs ✅ PASSED Rating S: No bugs
IAC ✅ PASSED No IAC issues

View Full Results

Keeps the design-drift ratchet at its ceiling (261 inline styles). The DOM
test opts out of user-event's CSS pointer check, since jsdom loads no
stylesheet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
Comment thread src/components/dsm/dsm-search-page.tsx Resolved
gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 12, 2026

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

Gitar has auto-approved this PR (configure)

gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 12, 2026

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

Gitar has auto-approved this PR (configure)

…results

Remembers the title when a row is ticked and falls back to a readable name
(never the raw slug) for ids that arrive by link.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit ccaf343

@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: ccaf343c3a

ℹ️ 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".

- Reuse source history marker across responsive frames
- Remove source history marker when closed externally
@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo Fixer

✅ Committed (2) · ☑ Fixed (2)

Grey Divider

Commits pushed directly to this PR — no separate fix PR opened.

Process — 2 fixed
  • ☑ Fixed: Resizing leaves an extra Back step
  • ☑ Fixed: Back can do nothing after an in-page action

gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 12, 2026

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

Gitar has auto-approved this PR (configure)

The panel is not modal, so a reader can leave it through the page; the
pushed entry was then left for Back to land on and do nothing, and a
resize from the phone sheet doubled it. Escape and the close button
dismiss it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc

BigSimmo commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner Author

Both Qodo Back-button findings on the docked source panel, and Codex's matching P2, are fixed in 3531247. That commit replaces Qodo's automatic fix c1dbf10, which is reverted in 3a043ce.

Qodo's fix changed the shared Sheet, so every drawer in the app would have behaved differently. It also called replaceState on history from a close effect, which can race the history.back() of a normal dismiss. That is the same kind of race that once undid the DSM search query. It also only removed the marker, so the stranded same-URL entry stayed in history.

The smaller fix is that the docked panel no longer adds a history entry, so Back does not close it on desktop. This deliberately undoes c7bd2e0, which made Back close the panel. A non-modal side panel that the reader can leave through the page cannot own a history entry without stranding one. Escape and the close button still dismiss it, and the phone Sheet keeps Back-to-close. A unit test now checks that opening the panel leaves history.length unchanged.


Generated by Claude Code

gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 12, 2026

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

Gitar has auto-approved this PR (configure)

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 3531247

Copy link
Copy Markdown
Owner Author

The CodSpeed flag on 3531247 (medicationEntityMatchesInText, -58%) is measurement noise. On the previous head, c1dbf10, the same benchmark showed +13.9%. The only change between those two commits is the desktop source panel's history handling, which touches no medication or search code. CodSpeed also reports "different runtime environments" and unmeasured system-call time for that benchmark. CodSpeed is not part of the required checks, and this PR does not fix it.


Generated by Claude Code

The mode-menu wrapper gained the universal-header-mode class, and the
recent-searches chip icon rule went with the chips; both tests still
pin the same contracts.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 12, 2026

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

Gitar has auto-approved this PR (configure)

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 86c1f56

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nv6DEPtQxG5JfAUBa2Q1gc
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 0add1b2

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

Gitar has auto-approved this PR (configure)

@qodo-code-review

qodo-code-review Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

No code changes since the last review — review skipped

Qodo Logo

@gitar-bot

gitar-bot Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor
Code Review ✅ Approved 3 closed / 3 findings

🟡 Medium risk · Reworking clinical filtering, comparison, and record navigation across 86 files could make users overlook or misselect references.

Brings Clinical mode in line with Work's header, compact Therapy and Differentials rows, one shared Compare tray, and desktop side-by-side record and source layouts. Clearing a filter is now announced as the doc comment describes. One open minor finding: switching the source from a sheet to the docked panel while open can leave a dead Back entry in src/components/clinical-dashboard/answer-source-drawer.tsx and src/components/clinical-dashboard/answer-source-docked-panel.tsx, which should be consumed before docking. The DSM Compare tray showing raw slugs for ticks outside current results was closed without a fix in this PR.

Auto-approved: No blocking issues found.
Please see Auto-approve Docs for details on setting custom approval criteria.

✅ 3 closed
✅ Edge Case: Clearing a filter is never announced, though the doc comment says it is

📄 src/components/clinical-dashboard/filter-highlight.tsx:17-19 📄 src/components/clinical-dashboard/filter-highlight.tsx:38-42
The new doc comment says turning a filter on, changing it, "or clearing it" is spoken through the shared announcer. When the filter is cleared, though, active becomes false, so message is "". The effect only calls announce when message is truthy, and announce() also drops empty text. So pressing Clear says nothing, and the Clear button unmounts as well, which leaves a screen-reader user with no confirmation. Fix: announce a clear message when the filter goes from active to inactive, for example by tracking the previous active value in a ref.

Closed: Edge Case: DSM Compare tray shows raw slugs for ticks outside current results

📄 src/components/dsm/dsm-search-page.tsx:550-560
The tray's second line looks up each selected slug in queryResults and falls back to the slug itself. selected is component state seeded from initialIds. It survives a client-side query change on /dsm/search, but queryResults only holds the current query's matches. So if a reader ticks diagnoses and then searches for something else, or arrives with ?ids= that the query doesn't match, the tray reads like "major-depressive-disorder · Panic Disorder". Fix: look the title up in the full DSM summary catalogue, or store {slug, title} when a row is ticked so the name doesn't depend on the current results.

Closed: Edge Case: Sheet→dock swap while open still leaves a dead Back entry

📄 src/components/clinical-dashboard/answer-source-drawer.tsx:61-72 📄 src/components/clinical-dashboard/answer-source-docked-panel.tsx:106-110
The drawer still passes dismissOnBack to the phone/tablet Sheet, and opening it there pushes a ps_sheet_* history entry. If the viewport then crosses 1024px while the source is open (for example, an iPad rotated to landscape), SourceDrawerFrame swaps to the docked panel. The Sheet's cleanup deliberately skips history.back(), and the docked panel now closes through onClose alone, so the pushed entry is never removed. The next Back press lands on that entry and does nothing, which is the stranded-Back problem this commit set out to remove. A fix: when the frame switches from Sheet to docked while open and history.state still carries the sheet's key, consume the entry (e.g. history.back() before docking, or replaceState to drop the key).

Review coverage

🤖 Auto-approval Approved

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@gitar-bot
gitar-bot Bot merged commit 2077255 into main Oct 12, 2026
39 checks passed
@gitar-bot
gitar-bot Bot deleted the claude/clinical-polish-mockups-dme269 branch October 12, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔴 Large blast radius size:XXL This PR changes 1000+ lines, ignoring generated files 🕐 40+ Minutes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants