Skip to content

fix(claims): keep export dropdown within the viewport on small screens - #633

Merged
nonsobethel0-dev merged 2 commits into
Parashield-Protocol:mainfrom
posimideveloper:fix/546-export-dropdown-overflow
Sep 23, 2026
Merged

nonsobethel0-dev merged 2 commits into
Parashield-Protocol:mainfrom
posimideveloper:fix/546-export-dropdown-overflow

Conversation

@posimideveloper

@posimideveloper posimideveloper commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On narrow viewports the Claims page header didn't adapt:

  • The header was a single non-wrapping row (flex justify-between) holding the title plus the Export, Pause and Refresh buttons, so on phone widths everything was squeezed into one line.
  • The export menu was absolute right-0 w-40 with no viewport constraint. Anchored to the right edge of the Export button, it grew leftward and could run past its container or the screen edge. Its z-20 also left it in a fragile stacking position over the claims table below.

Changes

Layout fix, commit 1 (src/app/claims/page.tsx)

  • The header stacks on mobile (flex-col → sm:flex-row), and the controls are left-aligned there and can wrap (flex-wrap).
  • The export menu:
    • is left-anchored below sm, where the controls are left-aligned, so it opens into the available space, and goes back to right-0 from sm up;
    • is capped at max-w-[calc(100vw-3rem)] (the viewport minus the page's px-6 padding), so it can never be wider than the screen;
    • is raised to z-30, clearly above the table and the click-away backdrop (z-10).
  • Desktop layout is visually unchanged.

A portal (the issue's other suggestion) wasn't needed: the menu has no clipping ancestor, so constraining its anchor and width fixes the overflow with far less code.

Accessibility + tests, commit 2

  • Escape closes the menu.
  • The trigger has aria-haspopup="menu" and aria-expanded; the menu uses role="menu" and its options role="menuitem".
  • New src/__tests__/ClaimsPage.test.tsx:
    • opening the menu sets aria-expanded, renders a menu with the viewport-constraint and anchoring classes, and shows 2 items;
    • pressing Escape closes it.

Verification

Stack the page header on mobile and let the controls wrap, anchor the
export menu to the left edge below sm (where the controls are
left-aligned), cap its width to the viewport, and raise its z-index
above the claims table.
Close the export menu on Escape, expose aria-haspopup/aria-expanded on
the trigger and menu/menuitem roles on the dropdown. Add ClaimsPage
tests covering the viewport-constrained menu classes and Escape close.
@drips-wave

drips-wave Bot commented Sep 23, 2026

Copy link
Copy Markdown

@posimideveloper Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@netlify

netlify Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for boisterous-sunshine-dd4c4c failed.

Name Link
🔨 Latest commit 999691a
🔍 Latest deploy log https://app.netlify.com/projects/boisterous-sunshine-dd4c4c/deploys/6ab427c769571c000972c72b

@nonsobethel0-dev
nonsobethel0-dev merged commit 46c5008 into Parashield-Protocol:main Sep 23, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants