Skip to content

Fold the document viewer into the global shell - #205

Merged
BigSimmo merged 5 commits into
mainfrom
claude/doc-viewer-global-shell
Jul 2, 2026
Merged

Fold the document viewer into the global shell#205
BigSimmo merged 5 commits into
mainfrom
claude/doc-viewer-global-shell

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Render /documents/* inside GlobalSearchShell (documents mode) so the viewer gets the shared sidebar + global header like every other page
  • Demote the viewer's local sticky header to a compact in-page toolbar: back link, scope-this-document, and document-actions kept; the redundant Answer/Documents segmented toggle, duplicate #main-content id, and page-level backdrop removed
  • Shell search composer hidden on this route by design — the viewer is a reading surface with its own search-within-document field

Verification

  • typecheck + lint clean (only pre-existing warnings on main remain)
  • Playwright (Chromium): all document viewer smoke tests (pinned evidence ordering at 320px, failed-preview retry, private missing-source state, document summary), plus ui-stress overflow tests
  • Desktop + mobile screenshot QA: single header, viewer toolbar below, no composer overlaying the reader

Clinical governance preflight

  • UI chrome/layout only: no changes to ingestion, answer generation, search/ranking, source rendering logic, document access, privacy, or production env

🤖 Generated with Claude Code

Render /documents/* inside GlobalSearchShell (documents mode) so the
viewer gets the shared sidebar + global header like every other page.
The shell's search composer stays hidden here - the viewer is a reading
surface with its own search-within-document field.

The viewer's local sticky header becomes a compact in-page toolbar:
back link, scope-this-document, and document-actions buttons are kept;
the redundant Answer/Documents segmented toggle (now covered by the
global mode pill) is removed, along with the duplicate #main-content id
and page-level backdrop the shell now provides.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@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: 9cf6960392

ℹ️ 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/app/documents/layout.tsx
Comment thread src/components/DocumentViewer.tsx
@BigSimmo
BigSimmo enabled auto-merge (squash) July 2, 2026 17:20
BigSimmo and others added 4 commits July 3, 2026 01:22
…e skip target

- Add dashboard-composer-edge to the viewer's fixed bottom composer so
  it centres against the content area (not the full viewport) now that
  the route renders inside the shell with the desktop sidebar
- Make the shell's #main-content wrapper focusable (tabIndex -1,
  outline suppressed) so the root skip link still moves focus into the
  page content after the viewer's main lost the id

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@BigSimmo
BigSimmo merged commit 43fd36a into main Jul 2, 2026
4 checks passed
@BigSimmo
BigSimmo deleted the claude/doc-viewer-global-shell branch July 5, 2026 11:43
BigSimmo added a commit that referenced this pull request Aug 1, 2026
…1569)

* Start Therapy Compass teardown: shared layer off tc-* one-offs

First slice of #183. ui.tsx is now completely free of tc-* classes, and
nav.tsx, workspace.tsx and therapy-card.tsx no longer use any numbered
one-off class. Sizes map to the nearest scale rung so the mode does not
visibly change, per the agreed constraint.

The audit corrected the scope: therapy-compass.css defines 459 selectors
across 3286 lines, not the 81 base classes #183 recorded. 353 of those are
auto-extracted numbered one-offs (.tc-screens-search-screen-009 and
friends), which are per-element and carry no cross-file coupling. That makes
them the safe independent unit, so this slice migrates only those plus the
primitive kit.

Three ordering constraints the audit surfaced, recorded for the rest of the
teardown:

- tc-root must be removed LAST. Every numbered rule is scoped
  `.tc-root .tc-*`, so dropping it early unstyles every un-migrated screen.
  workspace.tsx keeps it with a comment saying so.
- controls.ts and its call sites must move together. State modifiers are
  two-class selectors (.tc-control-outline.tc-is-selected), so retiring the
  base class without the call sites silently drops the selected state.
- Some rules are irreducible to utilities and need a home in globals.css
  rather than deletion: the print isolation block (body:has(.tc-root) *
  visibility plus the named @page), the #phone-header-collapse-addon-slot
  contextual override, and the tc-scroll scrollbar styling.

Tone handling reuses the shared recipes where they are provably identical:
--success is an alias of --success-text and --success-soft of --success-bg,
so toneSuccess/toneInfo/toneWarning render exactly as the tc classes did.
Therapy keeps local neutral/purple/accent, which the shared kit lacks, and
keeps its centred loading/empty states rather than the left-aligned shared
EmptyState, so the CSS retires without the mode changing.

Two gates had to move with the code, both preserving their intent:

- check-design-system-contract.mjs allowed only the --tc-meter-width inline
  style in ui.tsx. That variable existed solely to hand a data-driven
  percentage to the stylesheet being retired, so the exemption now covers
  setting the width directly.
- therapy-compass-responsive-contract.test.ts counted phone reflow only as
  tc-stack-sm / tc-mobile-stack. It now also counts the Tailwind
  grid-cols-1 + sm:grid-cols-* expression of the same guarantee, and checks
  the disabled Favourite button by its cursor-not-allowed utility rather
  than a class name that is going away.

Note for the endgame: check-design-system-contract.mjs asserts on
therapy-compass.css contents (--tc-paper-muted, the .tc-paper focus rule,
.tc-btn hover/disabled, and the paper rule boundaries). Deleting the file
fails that gate until those assertions are rewritten against the migrated
markup.

Gate: check:design-system-contract, check:type-scale, check:icon-scale,
lint, prettier all pass; therapy-compass-responsive-contract 10/10 passed.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Retire Therapy Compass parallel CSS into Clinical Sky tokens.

Delete therapy-compass.css after migrating screens and control recipes to token-backed Tailwind, keep only print/paper/compare residuals in globals.css, and close ledger #183 once verify:cheap is green.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Format therapy teardown after Prettier pass

Follow-up to the CSS retirement commit so the push blob matches format:check.

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: record therapy-compass CSS teardown as issue #205 (resolved in PR-T)

The diverged therapy branch had locally reused #183 for this teardown, but
#183 on main is the Sentry metric-alert task. Allocate a fresh id via the
issues writer instead and close it in the same PR.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(therapy): define local focusRing after ui-primitives rename

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: append branch-review-ledger row for PR-T therapy teardown

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: supersede PR-T ledger row for post-append tip

Co-authored-by: Cursor <cursoragent@cursor.com>

* Update recommend-screen.tsx

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* Update sheets-screen.tsx

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* Update brief-screen.tsx

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* Update brief-screen.tsx

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.

1 participant