fix(mobile): remove half-screen black void below short phone answers#563
Conversation
On phones the answer view left a large near-black empty band below short answers (e.g. the source-only fallback) down to the fixed "Ask a follow-up" dock. Three phone-only reservations stacked: a viewport-height min-height floor forced the answer section to ~full height even for short content (scrollable dead-space with a false scroll affordance), the <main> follow-up reserve (18rem) far exceeded the real ~6rem composer dock (painting a black band above it), and pb-32 added more. - Bottom-anchor the answer section on phones (flex + floor + justify-end) so a short answer sits just above the composer instead of top-hugging with a black void beneath it; long answers exceed the floor so justify-end is inert and they scroll normally from the top. - Right-size the follow-up composer reserve (18rem -> 7.5rem) to hug the measured dock height, removing the black band above the dock. - Trim the phone answer wrapper padding (pb-32 -> pb-4) so nothing scrolls into a black strip below the anchored content. sm+/desktop, the answer-home centering, other result kinds, and the answer pending state are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A1ekcXQZVFVKKzdoVpjyVQ
📝 WalkthroughSummary by CodeRabbit
Walkthrough
ChangesMobile answer layout
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Follow-up to the phone answer-view black-void fix: per product choice, short answers stay top-aligned (just under the question) rather than bottom-anchoring against the composer. The two cleanup fixes are kept: the answer section is content-sized (no viewport-height floor, so no phantom scroll into black) and the follow-up composer reserve stays right-sized to the real dock (no black band above it). Long answers remain top-aligned and scroll from the top; sm+/desktop unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A1ekcXQZVFVKKzdoVpjyVQ
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/ClinicalDashboard.tsx (1)
3550-3558: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a regression test for short-answer phone layout.
The conditional spacing looks consistent with the intended fix, but this behavior should be locked down with a Chromium test covering: short answers without phantom scroll, long answers remaining scrollable, and the final content staying clear of
.answer-footer-search-dock. The existing dock-geometry helpers intests/ui-smoke.spec.tsare a suitable place to extend coverage.As per coding guidelines, run
npm run ensurebefore UI testing and usenpm run verify:uias the Chromium gate.Also applies to: 3590-3595, 3623-3632
🤖 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/ClinicalDashboard.tsx` around lines 3550 - 3558, Add Chromium regression coverage in the existing dock-geometry helpers in tests/ui-smoke.spec.ts for short-answer phone layouts: verify short answers have no phantom scroll, long answers remain scrollable, and the final content clears .answer-footer-search-dock. Run npm run ensure before UI testing and use npm run verify:ui as the validation gate.Source: Coding guidelines
🤖 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.
Nitpick comments:
In `@src/components/ClinicalDashboard.tsx`:
- Around line 3550-3558: Add Chromium regression coverage in the existing
dock-geometry helpers in tests/ui-smoke.spec.ts for short-answer phone layouts:
verify short answers have no phantom scroll, long answers remain scrollable, and
the final content clears .answer-footer-search-dock. Run npm run ensure before
UI testing and use npm run verify:ui as the validation gate.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8199635b-67da-4341-a1ac-2d04d17a9f01
📒 Files selected for processing (1)
src/components/ClinicalDashboard.tsx
Follow-up regression coverage for the merged phone answer-view fix (#563). Adds two Chromium tests to tests/ui-smoke.spec.ts, reusing the existing mockDemoApi/answerOverride and dock-geometry helpers: - short answer stays content-sized and top-aligned with no phantom scroll into the near-black shell (main scrollHeight === clientHeight); - long answer stays scrollable and top-aligned, with the opaque composer input clear of the scroll viewport. Verified the short-answer test fails if the viewport-height floor is reintroduced, so it genuinely guards the fix. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A1ekcXQZVFVKKzdoVpjyVQ
Summary
--background#060708).src/components/ClinicalDashboard.tsx:min-h-[calc(100dvh-12.5rem)]floor (borrowed from the centred answer-home) forced the answer<section>to ~full viewport height even for short content — a scrollable dead-space with a false scroll affordance you could scroll down into;<main>follow-up reservemb-[calc(18rem+…)]far exceeded the real composer dock (measured ~6rem / 98px), painting a black band above the dock;pb-32wrapper padding floated a long answer's last line high above the dock.sm:/desktop untouched), scoped toactiveModeResultKind === "answer" && answer:18rem → 7.5remso it hugs the measured dock height, removing the black band above the dock.pb-32 → pb-4so a long answer's last line sits close to the composer rather than floating above a large trailing gap.max-sm:min-h-[calc(100dvh-12.5rem)]branch), the answer pending/skeleton state, and every other result kind (tools/documents/services/differentials/favourites) are unchanged.Verification
npm run verify:cheap— passes (runtime, Actions pin, sitemap, brand, type-scale, icon-scale, full lint, typecheck, 1750 vitest tests includingtests/clinical-dashboard-merge-artifacts.test.ts). Re-ran typecheck + lint + full test after the top-aligned adjustment.verify:uigate) via Playwright at an iPhone-class phone viewport and desktop, dark theme, with before/after + DOM geometry measurement:scrollHeight === clientHeight(no phantom scroll into black); no band above the composer.sm+): visually identical to before.Clinical Governance Preflight
N/A — this is a pure phone-layout change (container
min-height/margin/padding). It does not touch ingestion, answer generation, search/ranking, source rendering logic, document access, privacy, production env, or clinical output. No source-backed claim behaviour, Supabase target, key handling, or demo/synthetic separation is affected.Notes