Repository navigation
fix(Layer): an exit copy keeps the padding and colors of what it copies - #11796
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| LayerProvider | 4.4 kB (0) · 20 B CSS (0) | — | ✓ · ✓ · ✗ |
| lab/ChatReactionBar | 114.6 kB (+115 B) · 1.1 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 113.5 kB (+110 B) · 773 B CSS (0) | — | — · — · — |
7 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Popover | 98.5 kB (+100 B) · 15.1 kB CSS (0) | — | — · — · — |
| lab/Comments | 369.6 kB (+98 B) · 2.5 kB CSS (0) | — | — · — · — |
| lab/CommentComposer | 162.6 kB (+96 B) · 1.9 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 362.3 kB (+95 B) · 2.4 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 299.4 kB (+89 B) · 454 B CSS (0) | — | — · — · — |
| layer | — | — | — · ✓ · — |
| Layer | — | — | ✓ · ✓ · — |
Package size: @astryxdesign/core 7.59 MB packed (+567 B); no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
|
/approve-spec d6a5376 |
There was a problem hiding this comment.
Changes requested: the exit-copy fix is correct, and one count in the description needs correcting.
- The description says DropdownMenu's six interaction spec files pass (in Evidence and in Testing step 3), but this head has five, which hold the 26 cases it reports, so change "six" to "five" in both places.
The copy now keeps the copied element's padding, border and colors, which matches the layer runtime's rule that a copy is drawn where the layer was drawn, and both new cases fail without the change and pass with it. The optional note on the browser fixture's [popover] rule (inline, line 162) still applies: excluding the copy from that rule would let the position check catch a lost padding too. CI has not run on this draft yet.
Claims and files checked
Review mode: same-head; reason: none
- Changed rule, incremental re-review now lists each changed rule with its result: checked: the five changed files at this head, the earlier review of this head and both rule versions, no finding.
- Changed rule, the review mode line gains reasons for a changed rule set: checked: this review's mode against the earlier review of this head, no finding.
- Release note: the exit copy keeps the copied element's padding, border and colors: verified (
layerExitCopy.ts:293-295, unit case). - Release note: before, the browser's popover style padded, bordered and painted the copy: verified (base copy: 4 px padding, a 3 px border without a reset stylesheet, the popover background in the browser case).
- Release note: a surface with no padding of its own drew its content inset during the close: verified (4 px right and down, 8 px narrower at the base; none at the head).
- Release note: this is the copy a touch close plays on: verified (touch gate,
usePopoverSurfaceMotion.ts:109-112). - Description: the copy is a manual popover, so the browser's popover rule applies: verified (
layerExitCopy.ts:239). - Description: Popover's touch motion copies the surface inside the layer: verified (
usePopoverSurfaceMotion.ts:120). - Description: the copy already kept the element's overflow: verified (
layerExitCopy.ts:286-289). - Description: one private list of 18 longhands and one loop, no new API, attribute or default: verified (
layerExitCopy.ts:66-85; no public API rows). - Description: on the DropdownMenu branch the rows moved 4 px and lost 8 px of width: consistent (the same numbers reproduce in a fixture).
- Description: Popover's own padding hides the defect today: verified with Core's reset stylesheet; without it the old copy also draws a 3 px border.
- Description: both new cases fail with the old file and pass with the change: verified (unit; Chromium).
- Description: the unit file passes (30) and the browser file passes: verified (unit 30 of 30; browser 6 of 6 in Chromium).
- Description: Popover's three interaction spec files pass: verified (31 cases, Chromium).
- Description: DropdownMenu's six interaction spec files pass (26): false at this head (five files, 26 cases).
- Description: no file under the CLI package changes: verified.
- Description: +125/-5 lines, Popover +99 B gzip, the four reference pages unchanged: verified.
- Description: no lint error or warning on a changed line, the knowledge check and the core type check pass: verified.
- Description: WebKit counts, the full UI and Node suites, the repository checks and the 12-component page size: not rerun.
- File
.changeset/exit-copy-keeps-padding.md: clear. - File
docs/architecture/layer-runtime.md: clear. - File
packages/core/src/Layer/layerExitCopy.ts: clear. - File
packages/core/src/Layer/layerExitCopy.test.ts: clear. - File
packages/core/src/Layer/__tests__/layerExitCopy.interaction.browser.spec.ts: non-blocking note on the fixture's[popover]rule.
|
/approve-spec f25d71c |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because the pull request is a draft from a fork; once it is ready for review, a maintainer adds the ci:run label so CI runs.
The exit copy now keeps the copied element's padding, border and colors, which matches the layer runtime's rule that a copy is drawn where the layer was drawn. Both earlier points are addressed: the description now counts five DropdownMenu interaction spec files, and the browser fixture lets the popover style reach the copy, so the new browser case fails 7 px off without the fix and passes with it.
Claims and files checked
Review mode: incremental; reason: none
- Release note: the exit copy keeps the copied element's padding, border and colors: verified (
layerExitCopy.ts:293-295; the new unit and browser cases). - Release note: before, the browser's popover style padded, bordered and painted the copy: verified (with the base code the browser case's copied text sits 7 px off, and a fixture copy takes 4 px padding and black text).
- Release note: a surface with no padding of its own drew its content inset during the close: verified (fixture: 4 px right and down, 8 px narrower with the base code; identical to the live surface with this change).
- Release note: this is the copy a touch close plays on: verified (touch gate,
usePopoverSurfaceMotion.ts:109-112). - Description: on the DropdownMenu touch branch the menu rows moved 4 px right and down and lost 8 px of width: verified by reproduction (the same numbers in a fixture with Core's reset; that branch itself not run).
- Description: Popover's own padding hides the defect today: verified (Popover's default surface padding,
Popover.tsx:531). - Description: the copy is a manual popover, so the browser's popover rule pads, borders and paints it: verified (
layerExitCopy.ts:239; fixture computed style). - Description: Popover's touch motion copies the surface inside the layer: verified (
usePopoverSurfaceMotion.ts:120). - Description: the copy already kept the element's overflow: verified (
layerExitCopy.ts:288-289). - Description: the layer runtime record's Exit copy section now says the copy keeps padding, border and colors: verified (
layer-runtime.md:347-348). - Description: one private list of 18 longhands and one loop, no new API, attribute or default: verified (
layerExitCopy.ts:66-85; no public API rows for Core, the themes or the build package). - Description: both new cases fail with main's file and pass with this change: verified in Chromium and the unit runner; WebKit not run.
- Description: the unit file passes (30) and the browser file passes in Chromium (12 over two repeats): verified; WebKit not run.
- Description: Popover's three and DropdownMenu's five interaction spec files pass: file counts verified (three and five); Chromium pass counts carried from the previous review of identical product code; WebKit not run.
- Description: ESLint reports no error and no warning on a changed line: verified (23 warnings, none on a changed line).
- Description: the knowledge check and the core type check pass: verified.
- Description: no file under the CLI package changes: verified.
- Description: +128/−7 lines, a Popover page +99 B gzip, the four reference pages unchanged: line counts verified; sizes carried from the previous review of identical product code; the 12-component page size not rerun.
- Description: the full UI and Node suites, the repository checks and the pre-review check pass: not rerun.
- File
.changeset/exit-copy-keeps-padding.md: clear. - File
docs/architecture/layer-runtime.md: clear. - File
packages/core/src/Layer/layerExitCopy.ts: clear. - File
packages/core/src/Layer/layerExitCopy.test.ts: clear. - File
packages/core/src/Layer/__tests__/layerExitCopy.interaction.browser.spec.ts: clear.
Base: main 270f680.
User impact
A touch close plays on an exit copy of the closing surface. The browser's popover style padded, bordered and painted that copy. A surface with no padding of its own then drew its content inset during the close. On #8080's head, a DropdownMenu's close drew its rows 4 px right and down, and 8 px narrower. Popover's own padding hides the defect today.
Problem and solution fit
placeLayerExitCopyclones the element it is given and shows the clone as a manual popover. So the user agent's[popover]rule applies to the clone:padding: 0.25em,border: solid,color: CanvasTextandbackground-color: Canvas.The element is often no popover. Popover's surface motion copies the surface inside the layer. Where that surface sets no padding, border or colors, the copy gains the browser's.
The copy already keeps the element's overflow for the same reason. It now also keeps the element's own padding, border and colors, as inline styles from its computed style.
Expected behavior and authority
architecture:layer-runtimeINV13: an exit copy is drawn where the layer was drawn. Its Exit copy section now says that the copy keeps the padding, border, and colors of the element it copies.Smallest restoration
One list holds the 18 longhands the popover rule sets that the copy did not yet keep. A loop writes each from the element's computed style. No new API, attribute or default.
Evidence
layerExitCopy.ts, a surface's copy draws its text 7 px off in Chromium and WebKit. A unit case finds no padding, border or colors written.layerExitCopy.tsand pass with this change.Scope
Components: the layer runtime's exit copy
Writing rubric results
R1 narration, R2 research, R4 rejected alternatives, R5 change references, R6 open questions, R7 project status: none. R3 evidence: INV13's verification names the exit copy's unit and browser tests.
Testing
At f25d71c. d6a5376 holds the fix on main 270f680. f25d71c lets the browser's own popover style reach the copy in the browser case.
layerExitCopy.tsand the new cases.pnpm exec vitest run --project ui packages/core/src/Layer/layerExitCopy.test.tsfails "keeps the padding, border and colors of what it copies".__tests__/layerExitCopy.interaction.browser.spec.tsfails its new case in Chromium and in WebKit's CI container. There the copy's text sits 7 px off the live text: the browser's popover padding and border. The file's five other cases pass.PopoverFocusReturn,PopoverKeyboard,PopoverTouchMotion) pass in Chromium (31) and WebKit (22 pass, 9 skip). DropdownMenu's five interaction spec files pass in Chromium (26) and WebKit (23 pass, 3 skip).Local gates: the ui project (25,822), the core type check,
pnpm check:knowledge,pnpm check:repoandpnpm review:prepass. ESLint reports no error, and no warning on a changed line. The Node project passes 23,733 cases and fails one inprivacy-contract.test.mjs: this machine setsAGENT_SESSION_ID, which the tested code reads. This pull request changes no file underpackages/cli. The ui and Node projects ran on a tree that differs only in a comment and that browser file's test code. Every other run here is at this head.Public and internal API delta
None. No export, prop, type, default or attribute changes.
POPOVER_STYLE_PROPERTIESis private tolayerExitCopy.ts..github/scripts/lib/component-size.jsmeasures an import: the size report's esbuild options, eager chunks only. A Popover page gains 99 B gzip, and a 12-component page with Popover, Dialog and BottomSheet gains 132 B.architecture:component-import-boundariesINV10's docs, form, menu and table pages are unchanged. The byte sizes come from a build whose product code differs from this head only in a comment.