Repository navigation
Phase 31 slice E: overlays in one layer above the content - #249
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slice E of Phase 31 (docs/specs/PHASE-31-SPEC.md, FR-E1 to FR-E3): overlays. Six overlay node types draw screen states (an open menu, a comment popover, a confirm dialog, a toast) and always render above the content, whatever their parent. The spec's "Slice E — contracts pinned before build" block (K1 to K8) records the contracts; the "Slice E — as built" block records the decisions the contracts left open and every fix from verification.
What changes
tooltip,popover,menu,modal,toastanddrawer.tooltipis an inverted hint that wraps at 240px and never renders children.popoveris a panel 192 / 320 / 480 / 640 wide, for a comment box or a filter form.menuholdsmenu-rows anddividers and is at least 192 wide.modalis 480 / 640 / 960 wide over its own scrim. Its header has a close button named "Close" (closeLabelrenames it). Its actions sit right-aligned with the filled one (primaryordestructive) rightmost; an action with no variant renderssecondary.toastsits bottom-centre with a tone glyph and an optional action.dangerrendersrole="alert".draweris pinned to the right edge at full height, with an optional scrim.text,anchor,closeLabel,actions,tone,action,scrim.x/yare offsets from the root's top-left, not from the parent.$bg-surface,$border,$text-primary,$text-secondaryand their depth from$elevation.overlay, with neutral fallbacks when unthemed.snapshot_layoutplaces overlays as the root's last children, and a modal (or a drawer with a scrim) carries a newscrimrect.desktop-app-currentanddesktop-app-primary-count.primaryactions count as primaries in the modal's own pane.desktop-app-artboardwarns on an undeclared canvas holding an overlay. Web and mobile canvases may hold overlays, including a menu with its rows.safeAreaor a pinned tab bar, a centred modal, a default toast and a drawer keep clear of the insets and the tab bar, and the safe-area rules skip them only then.canvas_add_variantrecommendsmenu-open,comment-open,confirm-deleteandtoast. Coverage lists them and never demands them.batch_design,snapshot_layout,canvas_add_variantandcanvas_evaluatedocstrings, a new "Overlays (screen states)" section indocs/GUIDELINES.md, an Overlays section in the README, and VISION.md.Decisions worth a look
$elevation.overlayshadow is a deep blue-black ink with a 25px blur, and thegradient-glowtell read it as a coloured glow, so every overlay on a generated design system was blocked from presenting. A coloured glow now also needs a lightness above 0.2. Indigo, violet, crimson and white glows still fire. A very dark saturated glow (such as#0B1B4Fat a 40px blur on a near-black surface) is no longer flagged.fullPagecapture keeps the overlay layer at the artboard. The page grows, but a scrim dims only the first screen. The docs say so.sheetuntil then.Testing
test-overlays.ts(fast) covers:confirm-deletevariant in coveragetest-overlays-render.ts(Chrome) covers:elementFromPoint: a menu in a sticky bar in a scrolling pane above a fixed sibling and unclipped, and the full ladder in reverse tree orderanchor, and missing sizes and positions in the guideline.npm run test:full: 130/130 on 042ce73.