Skip to content

fix(answer): clear mobile footer overlap for table expansion#431

Merged
cursor[bot] merged 3 commits into
mainfrom
cursor/fix-cross-mode-dedupe-main-9098
Jul 9, 2026
Merged

fix(answer): clear mobile footer overlap for table expansion#431
cursor[bot] merged 3 commits into
mainfrom
cursor/fix-cross-mode-dedupe-main-9098

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes mobile answer view layout where the fixed composer dock and follow-up suggestion chips covered the clinical table Expand table control, making fullscreen expansion unreliable in UI smoke and on real devices.

Cross-mode link deduplication was already merged to main via #419; this PR is the remaining mobile table expansion follow-up.

Changes

  • ClinicalDashboard: Reserve 18rem bottom scroll margin on mobile when follow-up suggestion chips are visible (was 5.25rem, insufficient for the tall composer dock).
  • AccessibleTable: Add scroll-margin-bottom on the expand button; use scrollIntoView({ block: "nearest" }) to avoid over-scrolling.
  • ui-smoke: Target main#main-content with iterative scroll-until-clear helper; use direct DOM .click() for reliable handler invocation after scroll.

Verification

  • npm run verify:cheap — passed
  • Playwright: clinical table mobile expansion (390/768/1440) — passed
  • Playwright: answer results surface cross-mode quick links — passed (single strip, toHaveCount(1))

Screenshots

The failure mode showed the expand button sitting under the follow-up suggestion row; taps hit suggestion chips instead of opening the fullscreen table dialog.

Open in Web Open in Cursor 

Summary by CodeRabbit

  • Bug Fixes
    • Improved mobile table fullscreen/expansion reliability to avoid overlap with the bottom footer/dock.
    • Refined mobile clinical dashboard spacing in answer mode when follow-up suggestions are present, accounting for safe-area insets.
    • Updated the table expand trigger behavior to keep it more accessible after dialogs open.
  • Tests
    • Made the mobile clinical table fullscreen UI smoke flow more deterministic by scrolling the correct container and activating the expand button when available.

Reserve more bottom scroll room when follow-up suggestion chips are shown
so the table expand control stays above the fixed composer dock. Harden
ui-smoke scrolling and use direct DOM clicks for reliable expansion.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@supabase

supabase Bot commented Jul 9, 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 ↗︎.

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

ℹ️ 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 tests/ui-smoke.spec.ts Outdated
Comment thread src/components/ClinicalDashboard.tsx
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: dd36fcfa-7925-4e37-8ee5-b7974b07e0a6

📥 Commits

Reviewing files that changed from the base of the PR and between d45062b and b1e00d7.

📒 Files selected for processing (1)
  • tests/ui-smoke.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/ui-smoke.spec.ts

📝 Walkthrough

Walkthrough

This PR adjusts mobile clinical table fullscreen expansion so the trigger scrolls differently, the table button reserves safe-area space, answer-mode bottom spacing changes with follow-up suggestions, and the smoke tests follow the updated scroll and click behavior.

Changes

Mobile Table Expansion Scroll Fixes

Layer / File(s) Summary
Scroll alignment and spacing adjustments
src/components/AccessibleTable.tsx, src/components/ClinicalDashboard.tsx
openDialog scrolls the trigger using nearest instead of center; the expand button gains a safe-area-aware scroll-margin class; <main> bottom padding in answer mode now switches to a larger safe-area value when follow-up suggestions are present, otherwise keeping the smaller value.
Test helper updates for scroll and click behavior
tests/ui-smoke.spec.ts
scrollMobileTableExpandClearOfFooter now iteratively scrolls main#main-content up to 6 times based on footer overlap; fullscreen opening now prefers the visible expand button when present and otherwise uses the table surface, with related test flows updated to use normal clicks.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title concisely matches the main change: fixing mobile table expansion overlap in the answer view.
Description check ✅ Passed The description covers summary, changes, and verification; it only omits the template's checklist and notes sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 cursor/fix-cross-mode-dedupe-main-9098

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

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

🧹 Nitpick comments (2)
tests/ui-smoke.spec.ts (1)

590-609: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

DOM-level .click() bypasses Playwright's hit-testing, weakening the overlap regression check.

Switching from a native/forced Playwright click to element.evaluate(el => el.click()) skips actionability checks (visibility, not-obscured-by-another-element). Since the bug this PR fixes is specifically about the expand control being covered by a fixed footer/chip dock, this test can now pass even if residual overlap remains after scrollMobileTableExpandClearOfFooter's best-effort scroll — silently defeating the smoke test's ability to catch this exact regression.

Consider retrying with a real (non-forced) Playwright .click() after scrolling clear, and only falling back to the DOM click if that genuinely fails for an unrelated reason, so the test still verifies real click-target reachability.

Also applies to: 1219-1228, 1819-1821

🤖 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 `@tests/ui-smoke.spec.ts` around lines 590 - 609, The
`openMobileTableFullscreen` helper is bypassing Playwright’s actionability
checks by using `evaluate(...click())` on `table-expand-button` and
`accessible-table-surface`, which weakens the overlap regression coverage.
Update this flow to use a real Playwright click on those elements after
`scrollMobileTableExpandClearOfFooter` so visibility and
obscured-by-another-element are still verified, and only fall back to a DOM
click if a genuine non-overlap-related issue prevents interaction. Apply the
same pattern to the other smoke-test helpers that use the same click approach.
src/components/AccessibleTable.tsx (1)

450-465: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Scroll margin isn't scoped to mobile/answer context.

scroll-mb-[calc(18rem+env(safe-area-inset-bottom))] applies unconditionally at all breakpoints and in every mode that uses expandOnMobile, not just the mobile answer view with a fixed composer/suggestion dock. This risks an unnecessary large scroll offset on desktop/tablet or in modes without that fixed footer.

💡 Suggested scoping
-            className="relative z-50 mt-2 inline-flex min-h-11 w-full items-center justify-center gap-2 scroll-mb-[calc(18rem+env(safe-area-inset-bottom))] rounded-lg border border-[color:var(--border-lux)] bg-[color:var(--surface-raised)] px-3 text-xs font-semibold text-[color:var(--text)] shadow-[var(--shadow-tight)] transition hover:border-[color:var(--border-strong)] focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-[color:var(--focus)]/25"
+            className="relative z-50 mt-2 inline-flex min-h-11 w-full items-center justify-center gap-2 max-sm:scroll-mb-[calc(18rem+env(safe-area-inset-bottom))] rounded-lg border border-[color:var(--border-lux)] bg-[color:var(--surface-raised)] px-3 text-xs font-semibold text-[color:var(--text)] shadow-[var(--shadow-tight)] transition hover:border-[color:var(--border-strong)] focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-[color:var(--focus)]/25"

Also worth extracting the 18rem value shared with ClinicalDashboard.tsx into a common Tailwind theme token/CSS variable to avoid the two staying in sync manually.

🤖 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/AccessibleTable.tsx` around lines 450 - 465, The Expand table
button in AccessibleTable should not always use the large scroll margin, since
it is only needed for the mobile answer/composer dock layout. Update the
button’s scroll-mb utility in the AccessibleTable rendering path so it’s
conditionally applied only in that context (for example when the mobile answer
view is active), and leave desktop/tablet or other expandOnMobile modes without
the extra offset. Also consider replacing the hardcoded 18rem value with a
shared Tailwind token or CSS variable used by AccessibleTable and
ClinicalDashboard so both stay aligned.
🤖 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/AccessibleTable.tsx`:
- Around line 450-465: The Expand table button in AccessibleTable should not
always use the large scroll margin, since it is only needed for the mobile
answer/composer dock layout. Update the button’s scroll-mb utility in the
AccessibleTable rendering path so it’s conditionally applied only in that
context (for example when the mobile answer view is active), and leave
desktop/tablet or other expandOnMobile modes without the extra offset. Also
consider replacing the hardcoded 18rem value with a shared Tailwind token or CSS
variable used by AccessibleTable and ClinicalDashboard so both stay aligned.

In `@tests/ui-smoke.spec.ts`:
- Around line 590-609: The `openMobileTableFullscreen` helper is bypassing
Playwright’s actionability checks by using `evaluate(...click())` on
`table-expand-button` and `accessible-table-surface`, which weakens the overlap
regression coverage. Update this flow to use a real Playwright click on those
elements after `scrollMobileTableExpandClearOfFooter` so visibility and
obscured-by-another-element are still verified, and only fall back to a DOM
click if a genuine non-overlap-related issue prevents interaction. Apply the
same pattern to the other smoke-test helpers that use the same click approach.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 173da862-5c34-41b0-b7e8-cb511af72e12

📥 Commits

Reviewing files that changed from the base of the PR and between 8163549 and d45062b.

📒 Files selected for processing (3)
  • src/components/AccessibleTable.tsx
  • src/components/ClinicalDashboard.tsx
  • tests/ui-smoke.spec.ts

@cursor
cursor Bot enabled auto-merge July 9, 2026 05:14
Co-authored-by: BigSimmo <BigSimmo@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.

2 participants