Job Alerts DS

Overlays — modal, drawer, confirm

When a task interrupts the page, which container it gets, what size it opens at, and where its actions live.

Show audit of the app before this rule

Audit — what we have today (2 modals, 2 drawers)

✓ Already right

  • Every destructive action routes through ConfirmDialog — no one-click deletes (Section 2).
  • Mantine Modal/Drawer ship the WAI-ARIA behavior for free: role="dialog", focus trap, Esc to close, focus returned to the trigger.
  • Both drawers open from the right; neither competes with the left nav.

✗ Violations

  1. No size scale. Sizes are ad hoc: shortcuts modal lg, ConfirmDialog default, help drawer min(22rem, 90vw), draft-context drawer min(46rem, 100vw) — four different systems.
  2. No modal-vs-drawer rule. Mobile help is a drawer and the shortcut reference is a modal, but nothing says why; the next reference panel could be either.
  3. No footer rule. ConfirmDialog puts its actions in a right-aligned Group that scrolls with the body; a long form would scroll its submit button out of sight.
  4. No scroll rule. Nothing caps overlay height, so a long body grows the modal past the viewport instead of scrolling inside it.

Axis 1 — Which container

Same task — edit a draft's context. Question: does focused editing belong in a modal or a drawer?

Option A — split by whether context matters

✓ CHOSEN

Modal = a short decision or a reference you read and dismiss (confirm, shortcuts). Drawer = work done against the list behind it (edit a draft, help beside the dashboard). Everything else stays inline or gets its own page.

+ Matches how the dashboard already behaves; keeps the record list visible while you edit.
− Two containers to learn; the boundary needs judgement on new screens.

Option B — modal for every interruption

One container. Drawers retire except the mobile help panel; editing a draft opens the same centered modal as a confirm.

+ One rule, nothing to decide per screen.
− Hides the list you are editing against; a wide form in a centered modal reads cramped, and it is the pattern most often called the overused default.

Axis 2 — Size scale and chrome

Same long form. Question: fixed sizes with a pinned footer, or let content decide?

Option A — three sizes, body scrolls, footer pinned

✓ CHOSEN

sm confirm · md default form · lg reference and tables. Height caps at calc(100vh - 8rem), the body scrolls, and the action row stays pinned at the bottom.

+ Submit is always reachable; four ad-hoc sizes collapse to three named ones.
− A pinned footer costs vertical space on short dialogs.

Option B — content-fit, actions scroll with the body

Today's behavior, written down: each overlay picks its own width, and the action row is the last thing in the body.

+ Nothing to change; short dialogs stay compact.
− On a long form the submit button sits below the fold, and widths keep drifting apart.

Shared rules (all options)

  • Overlays keep Mantine defaults for elevation — never a hand-rolled shadow (Section 5).
  • Accessibility is not optional: role="dialog", aria-modal, a labelled title, focus trapped inside, Esc closes, focus returns to the trigger. Mantine gives all of this — do not rebuild an overlay by hand.
  • Destructive work confirms through ConfirmDialog: red filled confirm with an explicit verb, default cancel (Section 2).
  • One overlay at a time. An overlay never opens another overlay; no toasts over an open overlay (Section 7).
  • Every overlay is dismissable by Esc, the close button, and the backdrop — except a destructive confirm, where the backdrop does not dismiss.
  • Motion: 200ms for a modal, 300ms max for a drawer (Section 13).
Show research sources

✓ Decision: Option A + Option A

Why Axis 1 Option A (split by context):

  1. Codifies what the dashboard already does — help and draft editing sit beside the list they belong to, confirms and the shortcut reference interrupt.
  2. Editing a draft against its list is exactly the case every source names as the drawer's reason to exist.
  3. The boundary is one question: does the user need the page behind it?

Why Axis 2 Option A (ladder + pinned footer):

  1. Four ad-hoc widths collapse to a named ladder that matches the Mantine size tokens.
  2. A pinned footer keeps submit reachable on the long draft-context form.
  3. Matches Carbon and Atlassian: chrome fixed, body scrolls, never scroll sideways.

Rules of record: overlays-system.md.

Design system for a freelance job-alert app. App copies are downstream.