Skip to content

fix(webkit): [ENG-48120] keep a chrome block's padding when it opens the prose - #981

Merged
isaque-bock-azion merged 7 commits into
mainfrom
fix/doc-prose-first-child-chrome-padding
Sep 22, 2026
Merged

isaque-bock-azion merged 7 commits into
mainfrom
fix/doc-prose-first-child-chrome-padding

Conversation

@isaque-bock-azion

@isaque-bock-azion isaque-bock-azion commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • DocProse's first-block reset ([&>*:first-child] and [&>*:first-child>*:first-child], mt-0! + pt-0!) had no data-doc-chrome guard, so a DocCallout sitting first in the document lost its own py-1.5 (inherited from Message) and rendered with no top padding. Seen on docs pages that open with the API v4 rollout callout.
  • The padding half of the reset now stops at data-doc-chrome at both levels. The margin half is unchanged: a block carries its outer space as margin-top (the block rung), so zeroing it is what opens the page flush.
  • A unit test pins the contract in the class list; the ladder itself stays with the visual gate.

How to test

  1. pnpm --filter @aziontech/webkit test -- src/components/documentation/doc-prose — 16 tests pass, including the two new ones under "the first-block reset stops at chrome".
  2. In Storybook, render DocProse with a DocCallout as the first child inside a wrapper div (mirrors Astro's astro-slot): the callout keeps its 6px top padding. Before this change the computed padding-top was 0px; a second callout further down the page still read 6px.
  3. In a consumer on this branch, open a docs page that starts with a callout (e.g. /en/documentation/platform/applications/) and compare the first callout's padding-top against the next one.

Notes

  • Jira: ENG-48120.
  • The Chrome boundary story is untouched, so no visual baseline changes. A variant that opens with a chrome block is worth adding when the linux baselines are next regenerated.

…the prose

DocProse opens the page flush by zeroing the first block's margin and
padding at two levels, so the reset reaches through a renderer wrapper
(Astro's astro-slot, a prose div). That reset carried no data-doc-chrome
guard, unlike every other prose rule, so when the first thing in the
document is a DocCallout the pt-0! landed on the component itself and
erased the py-1.5 it inherits from Message. The margin reset is right —
a block carries its outer space as margin-top, the block rung — but the
padding is the component's own, not a rung of the ladder.

The padding half of the reset now stops at data-doc-chrome at both
levels; the margin half is unchanged. A unit test pins the contract in
the class list, since the ladder itself belongs to the visual gate.
gabriel-lisboa-azion added a commit that referenced this pull request Sep 21, 2026
demo/vue-sample had drifted 540 ahead / 31 behind main while most of its
webkit work was reviewed and landed upstream (#941 command-menu, #942
GlobalHeader placements, #943 NavigationMenu, #952 Menu, #960 sidebar
collapse, #973 floating-panel placement, #975 paginator, #977 templates
exports, #921 amount ladder), after which main swept comments (#951) and
reworked the CLI onto a derived bundle (#968/#970).

Main is the source for everything the two share. Of the 28 conflicted
source files, 17 differed from main only in comments — their code was
byte-identical — and 6 more were genuinely newer on main, so all 23 take
main verbatim, including the use-placement TypeScript rewrite that
replaces the old index.js.

Three carve-outs keep demo work main does not have yet:

- sidebar: main's CSS-driven collapse is the base; the `side` axis is
  re-applied on top of it as data-[side=end] variants rather than the JS
  edge map it used to be, and the drag sign moves into the rail
  composable. The one test that asserted the removed inline transform now
  asserts the panel's published edge, since the direction is CSS the
  unstyled test env cannot see.
- theme: texts.data.js keeps demo's 13 extra text-wrap and 10 extra
  tracking declarations (PR #982, in flight). Both sides carry the same
  34 entries, so an entry count would not have caught the loss.
- doc-prose keeps its chrome-padding fix (PR #981, in flight).

catalog.json, authoring-baseline.json, the theme dist and the lockfile
are regenerated rather than hand-resolved; the 13 conflicted visual
baselines take main's and are regenerated from CI next.

Verified: every file main touched is byte-identical to main except the
22 accounted for above; 2364 browser tests, 179 toolkit tests, lint,
vue-tsc, 99.98% type coverage, both ratchets, the Storybook build and
the webkit-sample build all pass.
…opup

The positioner is a block container and the slot leaves empty text nodes
around the popup, so an anonymous line box opened after it and its strut
added ~16px to the positioner's height. The overhang paints nothing, but
it is still a box that takes the pointer: on a panel flipped above its
trigger it reached back over the very trigger the flip had just cleared.

`display: flex` drops whitespace-only text nodes, so the positioner box
is exactly the popup. It goes inline next to `min-width` instead of into
the class preset because browser-mode tests load no stylesheet, and this
is geometry the placement assertions depend on.

This is what made `flips above the trigger when there is no room below`
red: it asserts on the positioner's box, so it failed whenever the
viewport left the overhang unclamped — first try on every branch, all
three tries on some.
@isaque-bock-azion
isaque-bock-azion merged commit 264428d into main Sep 22, 2026
20 checks passed
@isaque-bock-azion
isaque-bock-azion deleted the fix/doc-prose-first-child-chrome-padding branch September 22, 2026 17:45
@github-actions github-actions Bot mentioned this pull request Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants