refactor(core): migrate shared previews, progress, collapse menu and status indicators to vanilla-extract - #14995
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📦 Bundle Stats —
|
| Metric | Value | vs cody/ve-lite2-07-navbar-chrome-0ee6 (4aca2d5) | vs v6.16.0 |
|---|---|---|---|
| Internal (raw) | 4.46 MB | -1.3 KB, -0.0% | +29.4 KB, +0.6% |
| Internal (gzip) | 1.11 MB | -133 B, -0.0% | +9.4 KB, +0.8% |
| Bundled (raw) | 13.29 MB | -1.6 KB, -0.0% | +27.2 KB, +0.2% |
| Bundled (gzip) | 3.14 MB | -250 B, -0.0% | +8.0 KB, +0.2% |
| Import time | 1.14s | -1ms, -0.0% | +64ms, +6.0% |
bin:sanity
| Metric | Value | vs cody/ve-lite2-07-navbar-chrome-0ee6 (4aca2d5) | vs v6.16.0 |
|---|---|---|---|
| Internal (raw) | 7.1 KB | - | - |
| Internal (gzip) | 2.9 KB | - | - |
| Bundled (raw) | 7.1 KB | - | - |
| Bundled (gzip) | 2.8 KB | - | - |
| Import time | 4ms | +0ms, +1.0% | +0ms, +5.9% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📚 TypeDoc Generation Result✅ TypeDoc generated successfully!
The TypeDoc JSON file has been generated and validated. All documentation scripts completed successfully. |
Visual regression coverage148 changed UI files: 32 covered, 10 pending, 106 uncovered. Per-file coverage (148)
covered: a committed |
✅ E2E Tests🟢 182 passed • 🟡 35 flaky • (⚪ 93 skipped) • view full report • view run |
4637223 to
b68b24c
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Specificity and className contract regressions remain, alongside gaps in visual regression coverage.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (6)
What changed in this PR
Migrates shared Studio components from styled-components to vanilla-extract while preserving existing rendering and APIs.
Changes:
- Converts preview, progress, status, table, resizer, and menu styles.
- Bridges dynamic height and theme-driven variants.
- Preserves class names, refs, and primitive props.
| File | Description |
|---|---|
structure/.../shared.tsx |
Adds incoming-reference wrapper. |
structure/.../shared.ts |
Removes styled wrapper. |
structure/.../shared.css.ts |
Adds dynamic height style. |
textWithTone/TextWithTone.tsx |
Applies extracted tone class. |
textWithTone/TextWithTone.css.ts |
Defines tone selectors. |
resizer/Resizable.tsx |
Replaces styled root. |
resizer/Resizable.css.ts |
Defines root layout. |
progress/LinearProgress.tsx |
Selects theme variant. |
progress/LinearProgress.css.ts |
Defines progress styles. |
portableText/BlockPreview.tsx |
Applies extracted header class. |
portableText/BlockPreview.css.ts |
Defines header sizing. |
general/CompactPreview.tsx |
Replaces styled preview elements. |
general/CompactPreview.css.ts |
Defines preview and skeleton sizing. |
documentTable/EditedByCell.tsx |
Applies container-query classes. |
documentTable/EditedByCell.css.ts |
Defines responsive cell layout. |
documentStatusIndicator/DocumentVersionsStatusIndicator.tsx |
Replaces styled icon slot. |
documentStatusIndicator/DocumentVersionsStatusIndicator.css.ts |
Defines status icon tones. |
collapseMenu/CollapseMenu.tsx |
Replaces styled menu wrappers. |
collapseMenu/CollapseMenu.css.ts |
Defines menu layout and visibility. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
b68b24c to
d0636fe
Compare
…status indicators to vanilla-extract Layer 8/10 of the second low-risk cherry-pick series from the styled-components to vanilla-extract migration in #14566. Files are taken from the tip of that stack.
d0636fe to
8cc6c99
Compare


Description
Layer 8/10 of a second low-risk cherry-pick stack from the styled-components to vanilla-extract migration in #14566 (the 12-PR
ve-stackseries, #14616 to #14627). The first stack (#14905 to #14914) took the purely static rules and has merged; this one takes the lowest-risk tier that is left, in the same shape: at most 20 files per layer, one commit each, every file copied verbatim from the reference tip, whose merge base withmainis455717e. On top of static rules and&&overrides, this tier allows attribute and pseudo selectors,keyframes,globalStylescoped under a local class, closed-setstyleVariants, a few prop- or theme-driven values (createVarwithassignInlineVars, oruseTheme_v2) and a few media or container queries with default-theme literal breakpoints. Layers are ordered by risk, lowest first, so the stack can be merged bottom-up and stopped at any layer. Based on #14994.This layer covers shared components: block and compact previews, the resizer, document status indicators, the edited-by table cell, the collapse menu, tone text, linear progress and the incoming references list container.
What to review
LinearProgress: thetheme.sanity.color.darkbranch becomesstyleVariantskeyed byuseTheme_v2().color._dark.EditedByCell: the container query carries over at single-class specificity, as in the original, and hides the name in narrow cells both before and after. The reference's comment claimedTextsetsdisplayat (0,2,0); v4Textis a plainstyled.divwith no rootdisplayrule, so the comment now says that instead. The declaration is unchanged.classNametoCollapseMenuProps, but the collapsed branch can't forward it.classNamenow lives only onAutoCollapseMenu, which renders the rootFlexand merges it, soCollapseMenu's props matchmain.incomingReferencesDecoration/shared.tsbecomesshared.tsx, with the$itemCount-derived height passed throughcreateVar.Resizableto passforwardedAsso styled-components would keep renderingBoxand its layout-prop filtering. This layer removes the styledRootand rendersBoxwithasdirectly, soBoxdoes that filtering itself; the conflict resolves to the reference version, fix(ui): prevent resizable layout props leaking to DOM #14937's newResizable.test.tsx(noflexgrow/flexbasisattributes leak withas="aside") passes against it, and its styled-components comment is dropped.DocumentVersionsStatusIndicator.tsxalso carries feat(core): read every selected variant from perspective #14918 in a separate hunk.sanity(core/components,structure).Testing
Each layer passes
oxfmt --checkand a type-awareoxlint --type-checkof its files plus every file importing them, on its own commit. At the stack tippnpm check:oxlintpasses, the packages build with the migrated rules inlib/bundle.css, andpnpm vitest run --project=sanity --changed origin/mainpasses (227 files, 1885 tests, rebased onmainat4cebde0), as does the exports snapshot test, so no public export changes shape. Every Storybook story that renders a file from this stack (17 stories) was screenshotted onmainand at the tip and compared pixel by pixel: all 17 are identical, while a one-value negative control produced 42,739 changed pixels. For this layer, the DocumentVersionsStatusIndicator and DocumentPreviews (CompactPreview) stories are pixel-identical.Notes for release
N/A – Internal styling migration.