Skip to content

fix(a11y): keep notifications clear of dialog actions - #218

Merged
RentnerKev merged 1 commit into
mainfrom
codex/fix-mobile-dialog-notifications
Oct 7, 2026
Merged

RentnerKev merged 1 commit into
mainfrom
codex/fix-mobile-dialog-notifications

Conversation

@RentnerKev

@RentnerKev RentnerKev commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Persistent notifications at the bottom of a narrow viewport intercepted pointer clicks on modal footer actions. Keep the existing notification store and render its stack inside the active shared dialog, in a bounded scroll area above the footer. Nested dialogs receive the same stack; closing a dialog returns it to its parent or the page.

Errors remain visible, dismissible and inside the dialog's keyboard focus scope. Existing expiry deadlines and persistent notifications survive portal moves.

Fixes #217
Related to #74

Validation:

  • 7 real ToastProvider/store integration tests passed (52 assertions), including focus, dismissal, nesting, retained notifications and expiry deadlines.
  • Application TypeScript, scoped standard/typed lint and formatting passed.
  • Browser checks at 320×800, 360×800 and 640×450 with long synthetic persistent errors: footer buttons receive pointer clicks; invalid input and a valid local action work; toast dismissal is reachable by Tab; nested dialogs keep one notification stack.
  • SSR renders no portal without accessing document.

The 640×450 check covers viewport reflow equivalent to 200% of 1280×900. Actual browser zoom and a screen-reader pass remain part of the final beta verification in #74.

Summary by CodeRabbit

  • Bug Fixes
    • Toast notifications now appear in the active dialog when a modal is open, rather than outside it.
    • Notifications remain visible in the correct place as nested dialogs open or close, without restarting their display timing.
    • Toasts in dialogs remain focusable and dismissible, and timed notifications still expire as expected.

@github-actions github-actions Bot added the area: ui Web interface components, routes, styling, and localization. label Oct 7, 2026
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: RentnerKev/RentnerProxy/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 48bc3315-deaf-438c-a036-afd268e971f7
📥 Commits

Reviewing files that changed from the base of the PR and between 8d57cd0 and f0574c3.

📒 Files selected for processing (7)
  • web/src/layouts/AuthenticatedLayout/index.tsx
  • web/src/layouts/PublicLayout/index.tsx
  • web/src/shared/Modal/index.tsx
  • web/src/shared/Notifications/Hooks/useToastPortalTarget.ts
  • web/src/shared/Notifications/ToastPortal.tsx
  • web/src/shared/Notifications/Types/toast-portal.types.ts
  • web/src/tests/shared/Notifications/modal-toast-portal.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Toast notifications now render inside an open modal when a modal toast host is available, and otherwise render in the document body. Both authenticated and public layouts use the shared portal component. Tests cover toast behavior across nested dialog transitions.

Changes

Toast placement

Layer / File(s) Summary
Modal host and target selection
web/src/shared/Modal/index.tsx, web/src/shared/Notifications/Hooks/useToastPortalTarget.ts
Modal adds a toast host. The target hook observes DOM changes and selects the last host inside an open dialog, or falls back to document.body.
Portal integration and validation
web/src/shared/Notifications/Types/toast-portal.types.ts, web/src/shared/Notifications/ToastPortal.tsx, web/src/layouts/AuthenticatedLayout/index.tsx, web/src/layouts/PublicLayout/index.tsx, web/src/tests/shared/Notifications/modal-toast-portal.test.tsx
ToastPortal portals ToastProvider to the selected target. Both layouts use it. Tests cover placement, dismissal, and toast identity and timing as dialogs open and close.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant Layout
  participant ToastPortal
  participant useToastPortalTarget
  participant Modal
  participant ToastProvider
  Layout->>ToastPortal: Render with locale and messages
  ToastPortal->>useToastPortalTarget: Get portal target
  Modal-->>useToastPortalTarget: Provide host inside open dialog
  useToastPortalTarget-->>ToastPortal: Return dialog host or document.body
  ToastPortal->>ToastProvider: Portal provider to target
Loading

Merge Risk: ⚪ Minimal · up to f0574

The notification placement change is ready to merge after normal checks. The identified dialog-close transition does not block notification dismissal.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the accessibility fix: keeping notifications clear of dialog actions.
Description check ✅ Passed The description clearly explains the change, rationale, linked issues, validation results, accessibility behavior, and remaining beta verification. It omits the template headings and checklist, but th…
Linked Issues check ✅ Passed The PR satisfies the coding requirements in [#217]. Modal adds a bounded, scrollable notification host above the footer. useToastPortalTarget moves the existing ToastProvider to the last open mo…
Out of Scope Changes check ✅ Passed The changed layouts, modal host, portal target hook, portal component, types, and integration tests all support [#217]. The tests verify the required notification placement and behavior. No unrelated …
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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.

@RentnerKev
RentnerKev merged commit 56354cf into main Oct 7, 2026
31 of 32 checks passed
@RentnerKev
RentnerKev deleted the codex/fix-mobile-dialog-notifications branch October 7, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui Web interface components, routes, styling, and localization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ui): keep persistent notifications clear of mobile dialog actions

1 participant