Skip to content

fix(webkit): [ENG-47884] make sidebar collapse/expand animate in CSS, not JS - #960

Merged
isaque-bock-azion merged 5 commits into
mainfrom
fix/webkit-sidebar-server-load-css
Sep 9, 2026
Merged

isaque-bock-azion merged 5 commits into
mainfrom
fix/webkit-sidebar-server-load-css

Conversation

@isaque-bock-azion

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

Copy link
Copy Markdown
Contributor

Summary

  • Sidebar collapse/expand, its motion, and the collapsed-rail preview affordance now run off a hidden native checkbox's :checked state and CSS :hover/:focus-within, instead of a JS-computed inline transition — so the component paints and animates correctly before hydration (ENG-47884).
  • resizable adds a native CSS resize: horizontal fallback (works with zero JS) that switches off once mounted, handing control back to the existing keyboard/ARIA-complete drag handle.
  • sidebar/presets/transitions.ts is removed; only the drag-driven preview sliver still needs a JS-computed transition, since its width comes from a pointer/focus gesture on a sibling element, not from the boolean.

How to test

  1. pnpm --filter webkit exec vitest run src/components/layout/sidebar — 61/61 tests pass.
  2. pnpm storybook:dev, open Components/Layout/Sidebar → Resizable. Click the collapse trigger: rail animates to 0 width; inspect the <aside> and confirm getComputedStyle(aside).width is driven by the has-checked: classes, not an inline width style.
  3. In the same story, hover the leading edge of a collapsed rail: it grows to --size-10 and the expand button rides in — this part is JS-driven (documented in the spec's new Progressive enhancement section) since the hovered zone and the rail are DOM siblings.
  4. pnpm webkit:lint, pnpm webkit:type-check, pnpm webkit:type-coverage, pnpm storybook:build all pass.

Notes

  • Visual baselines: only the Sidebar Resizable story changed (6 modes), regenerated on Linux by the baseline workflow and committed. Note the rail's resting width in that story moved from 408px (the max token) to about 312px: with width=null the aside used to open at w-full and measure() clamped it to the maximum; now the width class reads --sidebar-width, so the first measurement is the content's natural width, which is what the spec describes. Consumers that never pass width will see the same shift.
  • No breaking change: props/events/slots are unchanged.
  • Related issue: ENG-47884.

… not JS

Collapse/expand, its motion, and the collapsed-rail preview affordance
now run off a hidden native checkbox's :checked state and CSS
:hover/:focus-within, instead of a JS-computed inline transition — so
the sidebar paints and animates correctly before hydration. resizable
adds a native CSS resize: horizontal fallback that is switched off
once mounted in favor of the existing keyboard/ARIA-complete handle.
…SS-driven rail

Generated on Linux by the baseline workflow (run 34391803069). The rail's resting width in the
story moved from the max token (408px) to its measured natural width (about 312px): the width
class now reads --sidebar-width, so with width=null the aside no longer opens at w-full before
measure() clamps it to the maximum.
@isaque-bock-azion
isaque-bock-azion merged commit 5c4c055 into main Sep 9, 2026
23 checks passed
@isaque-bock-azion
isaque-bock-azion deleted the fix/webkit-sidebar-server-load-css branch September 9, 2026 19:34
@github-actions github-actions Bot mentioned this pull request Sep 9, 2026
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.
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