Skip to content

refactor(comments): migrate comment menus, onboarding, avatars and task activity helpers to vanilla-extract - #14987

Draft
stipsan wants to merge 1 commit into
cody/ve-lite2-02-comments-legacy-0ee6from
cody/ve-lite2-03-comments-menus-tasks-0ee6
Draft

stipsan wants to merge 1 commit into
cody/ve-lite2-02-comments-legacy-0ee6from
cody/ve-lite2-03-comments-menus-tasks-0ee6

Conversation

@stipsan

@stipsan stipsan commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Description

Layer 3/10 of a second low-risk cherry-pick stack from the styled-components to vanilla-extract migration in #14566 (the 12-PR ve-stack series, #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 with main is 455717e. On top of static rules and && overrides, this tier allows attribute and pseudo selectors, keyframes, globalStyle scoped under a local class, closed-set styleVariants, a few prop- or theme-driven values (createVar with assignInlineVars, or useTheme_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 #14986.

This layer covers comment context menus, onboarding popovers, origin badges and avatars in both comment trees, plus two task activity helpers.

What to review

  • CommentsAvatar (both trees): the svg > ellipse rule moves to a globalStyle under the avatar class. At (0,1,2) it outranks v4 Avatar's own static ellipse stroke rules (0,1,0) regardless of stylesheet order, as the original did.
  • CommentsListItemContextMenu (both trees) uses &&:empty because the original &:empty tied Card's &:not([hidden]) display rule at (0,2,0) and won by order.
  • CommentsOnboardingPopover moves its fade-in to vanilla-extract keyframes; the task activity link rule is a doubled-class globalStyle, and NoWrap stays an exported wrapper.
  • Rebase note: tasks/.../helpers/index.tsx also carries feat(core): read every selected variant from perspective #14918 (read every selected variant), which main added in a separate hunk; the rebase kept both.
  • Package: sanity (core/comments, core/comments-v2, core/tasks).

Testing

Each layer passes oxfmt --check and a type-aware oxlint --type-check of its files plus every file importing them, on its own commit. At the stack tip pnpm check:oxlint passes, the packages build with the migrated rules in lib/bundle.css, and pnpm vitest run --project=sanity --changed origin/main passes (227 files, 1885 tests, rebased on main at 4cebde0), 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 on main and 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 CommentOriginBadge and comments-v2 MentionsMenu stories are pixel-identical.

Notes for release

N/A – Internal styling migration.


Open in Web Open in Cursor 

@vercel

vercel Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
auth-test-studio Ready Ready Preview Sep 25, 2026 7:49am UTC
page-building-studio Ready Ready Preview Sep 25, 2026 7:49am UTC
studio-diagnostics Ready Ready Preview Sep 25, 2026 7:49am UTC
studio-radar Ready Ready Preview Sep 25, 2026 7:49am UTC
studio-storybook Ready Ready Preview Sep 25, 2026 7:49am UTC
test-studio Ready Ready Preview Sep 25, 2026 7:49am UTC
test-studio-preview-iframe Ready Ready Preview Sep 25, 2026 7:49am UTC

Request Review

@stipsan stipsan added the 🤖 bot label Sep 24, 2026 — with Cursor
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

📦 Bundle Stats — sanity

Compared against cody/ve-lite2-02-comments-legacy-0ee6 (0878e79b) · v6.16.0 (npm)

sanity

Metric Value vs cody/ve-lite2-02-comments-legacy-0ee6 (0878e79) vs v6.16.0
Internal (raw) 4.46 MB +222 B, +0.0% +30.1 KB, +0.7%
Internal (gzip) 1.11 MB +72 B, +0.0% +9.7 KB, +0.9%
Bundled (raw) 13.29 MB -760 B, -0.0% +28.8 KB, +0.2%
Bundled (gzip) 3.14 MB -262 B, -0.0% +8.8 KB, +0.3%
Import time 1.85s -4ms, -0.2% +80ms, +4.5%

bin:sanity

Metric Value vs cody/ve-lite2-02-comments-legacy-0ee6 (0878e79) 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 5ms +0ms, +0.8% +0ms, +4.8%

🗺️ 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.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

📚 TypeDoc Generation Result

✅ TypeDoc generated successfully!

  • File size: 8.7M
  • Total exports: 1105
  • Artifact: sanity-typedoc-5d0ab877167381afc17a8528ce4cd281a3ade955

The TypeDoc JSON file has been generated and validated. All documentation scripts completed successfully.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

❌ E2E Tests

🟢 116 passed • 🔴 14 failed • 🟡 89 flaky • (⚪ 91 skipped) • view full report • view run

🤖 Share with an AI agent:

Fix the failing e2e tests. The failure report with error messages and page snapshots is at https://e2e-studio-3n7ggi6fp.sanity.dev/agent-report.md
Debug failing tests locally
SANITY_E2E_PROJECT_ID=ittbm412 \
SANITY_E2E_BASE_URL=https://e2e-studio-nmy3jbhkg.sanity.dev \
SANITY_E2E_DATASET=pr-14987-chromium-36109500585 \
SANITY_E2E_DATASET_CHROMIUM=pr-14987-chromium-36109500585 \
SANITY_E2E_DATASET_FIREFOX=pr-14987-firefox-36109500585 \
pnpm test:e2e --headed \
  e2e/tests/comments/inline.spec.ts \
  e2e/tests/default-layout/versionStatus.spec.ts \
  e2e/tests/desk/documentTypeListContextMenu.spec.ts \
  e2e/tests/document-actions/discardChanges.spec.ts \
  e2e/tests/document-actions/delete.spec.ts \
  e2e/tests/enhanced-object-dialog/smoke.spec.ts \
  e2e/tests/inputs/array.spec.ts \
  e2e/tests/presentation/presentation.spec.ts \
  e2e/tests/pte/referencesInPopover.spec.ts \
  e2e/tests/inputs/text.spec.ts \
  e2e/tests/variants/variantTool.spec.ts

Studio: https://e2e-studio-nmy3jbhkg.sanity.dev

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Visual regression coverage

59 changed UI files: 14 covered, 0 pending, 45 uncovered.

Per-file coverage (59)
File Status Evidence
packages/sanity/src/core/comments-v2/components/avatars/CommentsAvatar.css.ts uncovered
packages/sanity/src/core/comments-v2/components/avatars/CommentsAvatar.tsx uncovered
packages/sanity/src/core/comments-v2/components/list/CommentOriginBadge.css.ts covered packages/sanity/src/core/comments-v2/components/list/__tests__/CommentOriginBadge.stories.tsx
packages/sanity/src/core/comments-v2/components/list/CommentOriginBadge.tsx covered packages/sanity/src/core/comments-v2/components/list/__tests__/CommentOriginBadge.stories.tsx
packages/sanity/src/core/comments-v2/components/list/CommentsListItemContextMenu.css.ts uncovered
packages/sanity/src/core/comments-v2/components/list/CommentsListItemContextMenu.tsx uncovered
packages/sanity/src/core/comments-v2/components/mentions/MentionsMenu.css.ts covered packages/sanity/src/core/comments-v2/components/mentions/__tests__/MentionsMenu.stories.tsx
packages/sanity/src/core/comments-v2/components/mentions/MentionsMenu.tsx covered packages/sanity/src/core/comments-v2/components/mentions/__tests__/MentionsMenu.stories.tsx
packages/sanity/src/core/comments-v2/components/onboarding/CommentsOnboardingPopover.css.ts uncovered
packages/sanity/src/core/comments-v2/components/onboarding/CommentsOnboardingPopover.tsx uncovered
packages/sanity/src/core/comments-v2/plugin/inspector/CommentsInspector.css.ts uncovered
packages/sanity/src/core/comments-v2/plugin/inspector/CommentsInspector.tsx uncovered
packages/sanity/src/core/comments/components/avatars/CommentsAvatar.css.ts uncovered
packages/sanity/src/core/comments/components/avatars/CommentsAvatar.tsx uncovered
packages/sanity/src/core/comments/components/list/CommentsListItemContextMenu.css.ts uncovered
packages/sanity/src/core/comments/components/list/CommentsListItemContextMenu.tsx uncovered
packages/sanity/src/core/comments/components/mentions/MentionsMenu.css.ts covered packages/sanity/src/core/comments/components/mentions/__tests__/MentionsMenu.stories.tsx
packages/sanity/src/core/comments/components/mentions/MentionsMenu.tsx covered packages/sanity/src/core/comments/components/mentions/__tests__/MentionsMenu.stories.tsx
packages/sanity/src/core/comments/components/mentions/MentionsMenuItem.tsx uncovered
packages/sanity/src/core/comments/components/onboarding/CommentsOnboardingPopover.css.ts uncovered
packages/sanity/src/core/comments/components/onboarding/CommentsOnboardingPopover.tsx uncovered
packages/sanity/src/core/comments/components/pte/blocks/NormalBlock.css.ts uncovered
packages/sanity/src/core/comments/components/pte/blocks/NormalBlock.tsx uncovered
packages/sanity/src/core/comments/components/reactions/TransparentCard.css.ts uncovered
packages/sanity/src/core/comments/components/reactions/TransparentCard.styled.tsx uncovered
packages/sanity/src/core/comments/plugin/field/CommentsFieldButton.css.ts uncovered
packages/sanity/src/core/comments/plugin/field/CommentsFieldButton.tsx uncovered
packages/sanity/src/core/comments/plugin/input/components/FloatingButtonPopover.css.ts uncovered
packages/sanity/src/core/comments/plugin/input/components/FloatingButtonPopover.tsx uncovered
packages/sanity/src/core/comments/plugin/input/components/InlineCommentInputPopover.css.ts covered packages/sanity/src/core/comments/components/pte/comment-input/__tests__/InlineComposerMentions.browser.test.tsx (browser test)
packages/sanity/src/core/comments/plugin/input/components/InlineCommentInputPopover.tsx covered packages/sanity/src/core/comments/components/pte/comment-input/__tests__/InlineComposerMentions.browser.test.tsx (browser test)
packages/sanity/src/core/comments/plugin/inspector/CommentsInspector.css.ts uncovered
packages/sanity/src/core/comments/plugin/inspector/CommentsInspector.tsx uncovered
packages/sanity/src/core/comments/plugin/inspector/CommentsInspectorHeader.css.ts uncovered
packages/sanity/src/core/comments/plugin/inspector/CommentsInspectorHeader.tsx uncovered
packages/sanity/src/core/studio/components/navbar/free-trial/FreeTrialButton.css.ts uncovered
packages/sanity/src/core/studio/components/navbar/free-trial/FreeTrialButton.tsx uncovered
packages/sanity/src/core/studio/components/navbar/free-trial/PopoverContent.css.ts covered packages/sanity/src/core/studio/components/navbar/free-trial/__tests__/FreeTrialPopoverContent.stories.tsx
packages/sanity/src/core/studio/components/navbar/free-trial/PopoverContent.tsx covered packages/sanity/src/core/studio/components/navbar/free-trial/__tests__/FreeTrialPopoverContent.stories.tsx
packages/sanity/src/core/studio/components/navbar/new-document/NewDocumentList.css.ts uncovered
packages/sanity/src/core/studio/components/navbar/new-document/NewDocumentList.tsx uncovered
packages/sanity/src/core/studio/components/navbar/presence/PresenceMenu.css.ts uncovered
packages/sanity/src/core/studio/components/navbar/presence/PresenceMenu.tsx uncovered
packages/sanity/src/core/studio/components/navbar/resources/DiagnosticsReport.css.ts covered packages/sanity/src/core/studio/components/navbar/resources/__tests__/DiagnosticsReport.stories.tsx
packages/sanity/src/core/studio/components/navbar/resources/DiagnosticsReport.tsx covered packages/sanity/src/core/studio/components/navbar/resources/__tests__/DiagnosticsReport.stories.tsx
packages/sanity/src/core/studio/components/navbar/search/SearchDialog.css.ts uncovered
packages/sanity/src/core/studio/components/navbar/search/SearchDialog.tsx uncovered
packages/sanity/src/core/studio/components/navbar/search/components/common/FilterPill.css.ts uncovered
packages/sanity/src/core/studio/components/navbar/search/components/common/FilterPill.tsx uncovered
packages/sanity/src/core/studio/components/navbar/search/components/filters/filter/FilterPopoverContent.css.ts uncovered
packages/sanity/src/core/studio/components/navbar/search/components/filters/filter/FilterPopoverContent.tsx uncovered
packages/sanity/src/core/studio/components/navbar/search/components/filters/filter/inputs/date/datePicker/calendar/CalendarMonth.css.ts uncovered
packages/sanity/src/core/studio/components/navbar/search/components/filters/filter/inputs/date/datePicker/calendar/CalendarMonth.tsx uncovered
packages/sanity/src/core/studio/components/navbar/workspace/WorkspaceAuth/Layout.css.ts covered packages/sanity/src/core/studio/components/navbar/workspace/WorkspaceAuth/__tests__/WorkspaceAuthLayout.stories.tsx
packages/sanity/src/core/studio/components/navbar/workspace/WorkspaceAuth/Layout.tsx covered packages/sanity/src/core/studio/components/navbar/workspace/WorkspaceAuth/__tests__/WorkspaceAuthLayout.stories.tsx
packages/sanity/src/core/tasks/components/activity/helpers/index.css.ts uncovered
packages/sanity/src/core/tasks/components/activity/helpers/index.tsx uncovered
packages/sanity/src/core/tasks/plugin/TasksFooterOpenTasks.css.ts uncovered
packages/sanity/src/core/tasks/plugin/TasksFooterOpenTasks.tsx uncovered

covered: a committed *.stories.tsx (snapshotted by the "sanity studio" Chromatic project) or *.browser.test.tsx (end state snapshotted by "sanity studio vitest") imports the file, directly or through its *Story.tsx harness. pending: an open PR adds such a story; do not open a duplicate. uncovered: no story or browser test renders this file. How to add one: .agents/skills/sanity-visual-coverage/SKILL.md.

@stipsan
stipsan added this pull request to stack #14991 September 24, 2026 16:37
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 49.85% 40081 / 80397
🔵 Statements 45.03% 53223 / 118194
🔵 Functions 45.06% 8137 / 18057
🔵 Branches 40.02% 30732 / 76786
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/sanity/src/core/comments-v2/components/avatars/CommentsAvatar.css.ts 0% 0% 0% 0%
packages/sanity/src/core/comments-v2/components/avatars/CommentsAvatar.tsx 5.88% 0% 0% 11.76% 12-33
packages/sanity/src/core/comments-v2/components/list/CommentOriginBadge.css.ts 0% 0% 0% 0%
packages/sanity/src/core/comments-v2/components/list/CommentOriginBadge.tsx 0% 0% 0% 0% 13-28
packages/sanity/src/core/comments-v2/components/list/CommentsListItemContextMenu.css.ts 0% 0% 0% 0%
packages/sanity/src/core/comments-v2/components/list/CommentsListItemContextMenu.tsx 5.26% 0% 0% 6.66% 33-39, 77-85
packages/sanity/src/core/comments-v2/components/mentions/MentionsMenu.css.ts 0% 0% 0% 0%
packages/sanity/src/core/comments-v2/components/mentions/MentionsMenu.tsx 1.69% 0% 0% 2.5% 35-72
packages/sanity/src/core/comments-v2/components/onboarding/CommentsOnboardingPopover.css.ts 0% 0% 0% 0%
packages/sanity/src/core/comments-v2/components/onboarding/CommentsOnboardingPopover.tsx 0% 0% 0% 0% 15-19
packages/sanity/src/core/comments/components/avatars/CommentsAvatar.css.ts 0% 0% 0% 0%
packages/sanity/src/core/comments/components/avatars/CommentsAvatar.tsx 5.12% 0% 0% 11.76% 12-39
packages/sanity/src/core/comments/components/list/CommentsListItemContextMenu.css.ts 0% 0% 0% 0%
packages/sanity/src/core/comments/components/list/CommentsListItemContextMenu.tsx 5.12% 0% 0% 6.66% 33-39, 77-176
packages/sanity/src/core/comments/components/onboarding/CommentsOnboardingPopover.css.ts 0% 0% 0% 0%
packages/sanity/src/core/comments/components/onboarding/CommentsOnboardingPopover.tsx 0% 0% 0% 0% 15-19
packages/sanity/src/core/tasks/components/activity/helpers/index.css.ts 0% 0% 0% 0%
packages/sanity/src/core/tasks/components/activity/helpers/index.tsx 0% 0% 0% 0% 23-183
packages/sanity/src/core/tasks/plugin/TasksFooterOpenTasks.css.ts 0% 0% 0% 0%
packages/sanity/src/core/tasks/plugin/TasksFooterOpenTasks.tsx 95.91% 77.77% 66.66% 100% 36-37
Generated in workflow #71940 for commit 30076fd by the Vitest Coverage Report Action

…sk activity helpers to vanilla-extract

Layer 3/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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Both onboarding popovers can lose their animation class when callers provide a class name.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Migrates comment and task UI styling from styled-components to vanilla-extract while preserving existing behavior.

Changes:

  • Migrates comment avatars, menus, onboarding popovers, mentions, and origin badges.
  • Migrates task footer and activity helper styles.
  • Preserves specificity through scoped global styles and doubled selectors.
File Description
TasksFooterOpenTasks.tsx Applies the extracted container class.
TasksFooterOpenTasks.css.ts Defines footer badge positioning.
activity/​helpers/​index.tsx Replaces styled activity helpers.
activity/​helpers/​index.css.ts Defines activity text and link styles.
comments/​.../​CommentsOnboardingPopover.tsx Applies extracted onboarding styles.
comments/​.../​CommentsOnboardingPopover.css.ts Defines sizing and fade-in animation.
comments/​.../​CommentsListItemContextMenu.tsx Replaces the styled menu card.
comments/​.../​CommentsListItemContextMenu.css.ts Hides empty menu cards with sufficient specificity.
comments/​.../​CommentsAvatar.tsx Applies and merges the avatar class.
comments/​.../​CommentsAvatar.css.ts Overrides the avatar ellipse stroke.
comments-v2/​.../​CommentsOnboardingPopover.tsx Applies extracted v2 onboarding styles.
comments-v2/​.../​CommentsOnboardingPopover.css.ts Defines v2 sizing and fade-in animation.
comments-v2/​.../​MentionsMenu.tsx Replaces styled mentions wrappers.
comments-v2/​.../​MentionsMenu.css.ts Defines mentions menu size constraints.
comments-v2/​.../​CommentsListItemContextMenu.tsx Replaces the v2 styled menu card.
comments-v2/​.../​CommentsListItemContextMenu.css.ts Hides empty v2 menu cards.
comments-v2/​.../​CommentOriginBadge.tsx Applies the extracted icon-slot class.
comments-v2/​.../​CommentOriginBadge.css.ts Defines layout and origin colors.
comments-v2/​.../​CommentsAvatar.tsx Applies and merges the v2 avatar class.
comments-v2/​.../​CommentsAvatar.css.ts Overrides the v2 avatar ellipse stroke.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch was successfully deployed

7 active deployments
Preview – test-studio — 30076fd7 Deployed Sep 25, 2026 by vercel[bot]
Preview – studio-storybook — 30076fd7 Deployed Sep 25, 2026 by vercel[bot]
Preview – studio-radar — 30076fd7 Deployed Sep 25, 2026 by vercel[bot]
Preview – page-building-studio — 30076fd7 Deployed Sep 25, 2026 by vercel[bot]
Preview – studio-diagnostics — 30076fd7 Deployed Sep 25, 2026 by vercel[bot]
Preview – auth-test-studio — 30076fd7 Deployed Sep 25, 2026 by vercel[bot]
Preview – test-studio-preview-iframe — 30076fd7 Deployed Sep 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants