Skip to content

refactor(ui): move modal layers to Astryx - #1674

Merged
Astro-Han merged 6 commits into
mainfrom
refactor/1565-modal-layers
Jul 31, 2026
Merged

refactor(ui): move modal layers to Astryx#1674
Astro-Han merged 6 commits into
mainfrom
refactor/1565-modal-layers

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Refs #1565.

Moves Dialog, AlertDialog, Toast, and the root notification layer to Astryx while preserving Maka's product APIs and conditional-rendering semantics.

  • Makes Astryx Dialog the modal, backdrop, Escape, focus-trap, and visual authority.
  • Makes Astryx LayerProvider and Toast the notification viewport, lifecycle, live-region, surface, and dismissal authority.
  • Preserves Maka toast IDs, dismiss API, FIFO Promise-returning confirmation queue, unmount cancellation, explicit dialog roles, and stable product selectors.
  • Adds one local lifecycle bridge for the information Astryx loses when a controlled dialog is conditionally unmounted: explicit final focus wins, false suppresses restoration, otherwise focus returns to the opener.
  • Removes replaced modal/toast CSS without creating a parallel modal or notification engine.

Verification

  • npm run format:check && npm run lint && npm run typecheck
  • npm run build
  • Modal source/keyboard/deterministic-render contracts — 11 passed
  • npx playwright test --config e2e/playwright.config.ts — 87 passed
  • node scripts/check-visual-contract.mjs --against origin/main --scopes scripts/visual-contract-scopes/pr6-modal-layers.json — 20 comparisons clean
  • Earlier branch validation: UI 285 passed; Desktop 2,968 passed; hit-test 5 routes clean; Storybook 26 render/play checks passed

Root cause

The migration initially confused three different responsibilities. Astryx owns modal mechanics and visuals, but the Maka adapter still owns compatibility semantics used by application consumers. The deterministic E2E harness also paused Astryx's backwards-filled entry animation at time zero, which froze fixture dialogs in their hidden frame. Finally, two geometry tests sampled intentional 400 ms entry transforms instead of the settled layout.

The fix keeps those responsibilities at their natural owners: the adapter supplies only roles, stable hooks, and conditional-unmount focus information; the fixture removes decorative animation instead of freezing its first frame; geometry tests wait for the dialog's own animation to settle without weakening any dimensions.

Review focus

  • Dialog ownership and the small conditional-unmount focus bridge.
  • Explicit compatibility semantics at the Maka adapter boundary.
  • Deterministic fixture rendering versus real entry animation.
  • Toast ID/dismiss behavior, confirmation FIFO ordering, and unmount cancellation.
  • Deletion of replaced CSS and absence of parallel modal or notification engines.

@Astro-Han
Astro-Han force-pushed the refactor/1565-floating-controls branch from 0871f48 to 9b4b53e Compare July 31, 2026 03:08
@Astro-Han
Astro-Han force-pushed the refactor/1565-modal-layers branch from e5b8f4a to 153c848 Compare July 31, 2026 03:08
@Astro-Han
Astro-Han force-pushed the refactor/1565-floating-controls branch from 9b4b53e to 8a3d8ab Compare July 31, 2026 03:54
@Astro-Han
Astro-Han force-pushed the refactor/1565-modal-layers branch 2 times, most recently from 96c38f3 to 2505698 Compare July 31, 2026 04:03
@Astro-Han
Astro-Han changed the base branch from refactor/1565-floating-controls to main July 31, 2026 04:04
@Astro-Han
Astro-Han force-pushed the refactor/1565-modal-layers branch from 2505698 to 6597253 Compare July 31, 2026 04:04
@Astro-Han
Astro-Han marked this pull request as ready for review July 31, 2026 04:24
@Astro-Han
Astro-Han merged commit 72f5d98 into main Jul 31, 2026
3 checks passed
@Astro-Han
Astro-Han deleted the refactor/1565-modal-layers branch July 31, 2026 04:31
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.

1 participant