Skip to content

feat(editor): add inspector UI primitives#3171

Open
joaopcm wants to merge 1 commit intofeat/inspector-hooksfrom
feat/inspector-primitives
Open

feat(editor): add inspector UI primitives#3171
joaopcm wants to merge 1 commit intofeat/inspector-hooksfrom
feat/inspector-primitives

Conversation

@joaopcm
Copy link
Copy Markdown
Member

@joaopcm joaopcm commented Apr 2, 2026

Summary

  • Creates 10 UI primitive components (Label, Text, TextField, Textarea, Select, ToggleGroup, Tooltip, IconButton, Button, ColorInput)
  • Follows BubbleMenuItem pattern: plain HTML, data-re-* attributes, CSS custom properties
  • Adds CSS styles for all new primitives
  • Includes smoke tests + interaction tests (25 tests)

Stacks on #3170


Summary by cubic

Adds 10 inspector UI primitives and a minimal layout-only stylesheet to standardize inspector structure and enable consistent theming.

  • New Features
    • Components: Label, Text, TextField, Textarea, Select (Root/Item), ToggleGroup (Root/Item), Tooltip (Root/Trigger/Content), IconButton, Button, ColorInput.
    • Behaviors: plain HTML with data-re-inspector-* attrs and CSS vars; Button/IconButton default to type="button" (Button supports data-variant); Text supports data-size/data-color; TextField/Textarea forward refs (Textarea sets data-type="textarea"); ToggleGroup is controlled and sets data-active/aria-pressed; ColorInput keeps color picker and hex input in sync and normalizes hex.
    • Optional layout CSS at @react-email/editor/styles/inspector.css (layout only, no visual design).

Written for commit 6ee1074. Summary will update on new commits.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 2, 2026

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

Project Deployment Actions Updated (UTC)
react-email Ready Ready Preview, Comment Apr 2, 2026 8:35pm
react-email-demo Ready Ready Preview, Comment Apr 2, 2026 8:35pm
react-email-examples Ready Ready Preview, Comment Apr 2, 2026 8:35pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 2, 2026

⚠️ No Changeset found

Latest commit: 6ee1074

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 2, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@react-email/editor@3171

commit: 6ee1074

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 16 files

Confidence score: 3/5

  • There is a concrete regression risk in packages/editor/src/ui/inspector/primitives/toggle-group.tsx: spreading ...rest after the internal onClick allows consumers to override selection updates, which can break toggle interaction behavior.
  • The test issue in packages/editor/src/ui/inspector/primitives/select.spec.tsx is lower severity, but it weakens confidence because the assertion only checks that onChange fired rather than validating the selected value.
  • Score is 3 because the toggle-group handler ordering issue is user-facing (severity 6/10, high confidence), while the test mismatch is a smaller quality gap; this looks fixable without broad architectural risk.
  • Pay close attention to packages/editor/src/ui/inspector/primitives/toggle-group.tsx and packages/editor/src/ui/inspector/primitives/select.spec.tsx - event handling precedence may break selection state, and the test should assert the actual value to prevent regressions.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/editor/src/ui/inspector/primitives/select.spec.tsx">

<violation number="1" location="packages/editor/src/ui/inspector/primitives/select.spec.tsx:27">
P2: The test name says it verifies the selected value, but the assertion only checks that `onChange` was called. Assert the event value to ensure the behavior under test is actually validated.</violation>
</file>

<file name="packages/editor/src/ui/inspector/primitives/toggle-group.tsx">

<violation number="1" location="packages/editor/src/ui/inspector/primitives/toggle-group.tsx:48">
P2: `...rest` is spread after the internal `onClick`, so consumer-provided `onClick` can override selection updates and break toggle behavior.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@joaopcm joaopcm changed the base branch from feat/inspector-utils-config to feat/inspector-hooks April 2, 2026 18:56
@joaopcm joaopcm force-pushed the feat/inspector-primitives branch from 4da5510 to 22701c1 Compare April 2, 2026 18:57
@joaopcm joaopcm force-pushed the feat/inspector-hooks branch from 9aeacc3 to 6cd5d52 Compare April 2, 2026 19:02
@joaopcm joaopcm force-pushed the feat/inspector-primitives branch from 22701c1 to dea4fe0 Compare April 2, 2026 19:03
@joaopcm joaopcm force-pushed the feat/inspector-hooks branch from 6cd5d52 to 5bd34db Compare April 2, 2026 19:08
@joaopcm joaopcm force-pushed the feat/inspector-primitives branch from dea4fe0 to de2a026 Compare April 2, 2026 19:08
@joaopcm joaopcm force-pushed the feat/inspector-hooks branch from 5bd34db to f3452c2 Compare April 2, 2026 19:19
@joaopcm joaopcm force-pushed the feat/inspector-primitives branch from de2a026 to c02e5b7 Compare April 2, 2026 19:19
@joaopcm joaopcm force-pushed the feat/inspector-hooks branch from f3452c2 to 61aaa75 Compare April 2, 2026 19:23
@joaopcm joaopcm force-pushed the feat/inspector-primitives branch from c02e5b7 to 32d162c Compare April 2, 2026 19:23
@joaopcm joaopcm force-pushed the feat/inspector-primitives branch from aa5fc4e to f2fdb81 Compare April 2, 2026 19:56
@joaopcm joaopcm force-pushed the feat/inspector-hooks branch from 33bd0ca to 48849cb Compare April 2, 2026 20:03
@joaopcm joaopcm force-pushed the feat/inspector-primitives branch from f2fdb81 to 57a0309 Compare April 2, 2026 20:03
@joaopcm joaopcm force-pushed the feat/inspector-primitives branch from 57a0309 to f5fdfd0 Compare April 2, 2026 20:06
@joaopcm joaopcm self-assigned this Apr 2, 2026
@joaopcm joaopcm force-pushed the feat/inspector-primitives branch from f5fdfd0 to 2e87fc2 Compare April 2, 2026 20:10
@joaopcm joaopcm force-pushed the feat/inspector-primitives branch from 2e87fc2 to 8076ac4 Compare April 2, 2026 20:12
@joaopcm joaopcm force-pushed the feat/inspector-hooks branch from 2b74476 to 5f00899 Compare April 2, 2026 20:14
@joaopcm joaopcm force-pushed the feat/inspector-primitives branch from 8076ac4 to 589dd95 Compare April 2, 2026 20:14
@joaopcm joaopcm force-pushed the feat/inspector-primitives branch from 589dd95 to 1764134 Compare April 2, 2026 20:16
@joaopcm
Copy link
Copy Markdown
Member Author

joaopcm commented Apr 2, 2026

Auto-merge enabled (squash) via PR Sentinel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant