Skip to content

fix(lab): CodeEditor ships the border and gutter divider it declares - #7770

Draft
vjeux wants to merge 1 commit into
meta:mainfrom
vjeux:lab-codeeditor-longhands
Draft

vjeux wants to merge 1 commit into
meta:mainfrom
vjeux:lab-codeeditor-longhands

Conversation

@vjeux

@vjeux vjeux commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

User impact

Why: Apps on the documented Next.js source build fail once @astryxdesign/lab is installed, even if they never import it. One CodeEditor border style stops the build. The prebuilt lab.css drops that style, so the editor draws none of its three declared borders.

What led to this: We are moving one of our products onto Astryx source builds. While adding Turbopack support (#7754), the Next.js example plus Lab would not build.

What changes: The outline and divider use longhand border properties, which both builds accept. Lab's build now rejects unsupported shorthands, as Core's does.

Visual authority

  • Existing component/module DD row reused or amended.
  • Durable component-local intent added to the optional Design decisions table by a team design owner.
  • Correction already settled by current family, design, theme, or objective accessibility authority.
  • New shared or cross-component direction settled in docs/design/.

No record covers CodeEditor's appearance, so its owners decide: keep the borders or remove them.

  • Longhands (this pull request). Both builds draw the declared borders, as Storybook already does. Prebuilt pixels change.
  • Remove both declarations. Prebuilt pixels stay the same and source builds work. Storybook loses its borders.
  • Fix it in the build, checking Astryx's own source leniently. No pixels change, but the borders stay silently dropped and library source loses fix(build): fail closed on missing StyleX output #6693's fail-closed check.

Longhands fix the style at its source and keep that check. spec:AST-080 FR7 (current) asks both builds for the same rules; today one throws and the other drops them.

Before and after

Prebuilt stylesheets only (Core, Lab, neutral theme); Chromium, line numbers on.

State Before After
Light
Light, focused
Dark
Dark, focused

State matrix

  • Light and dark: the outline and divider go from none to 1px in the border color.

  • Focused: before, only the focus ring; after, the accent border plus the ring.

  • The editor grows 1px on each side.

  • Right to left: the divider sits between the numbers and the code:

Scope

  • Appearance is the primary intent; the source-build failure is the same defect seen from the other build.
  • Behavior, API, interaction model, and unrelated layout changes were removed or split.
  • The evidence shows the changed pixels actively running, not only source or computed styles.
  • Public text and artifacts contain no internal Meta context.

Testing

  • A new test feeds Lab's build three unsupported shorthands. It passes here and fails on main, where Lab's build drops them silently.
  • With that check on, Lab's build fails on CodeEditor's old border and compiles with the fix.
  • A fresh install of the Next.js source example plus Lab fails to build on main. With the editor's borders as longhands it builds, and every rendered class has its CSS rule.
  • The prebuilt lab.css is byte-identical to main's: the longhands reuse rules the sheet already has, so only the editor's class list changes.
  • Lab's tests (78 files, 837 tests), the core and Lab type checks, lint, formatting and the repository checks pass.

@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 25, 2026 6:32am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 20, 2026
@astracat-bot

astracat-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Oct 30, 2026, 1:45 PM UTC

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

Modified Components

CodeEditor (@astryxdesign/lab) · View in Storybook
Metric Before After Delta
Entry File (ESM) 153B 153B 0B
Lines of Code 461 465 -
Complexity Very High Very High (64) -

Component Size

Component Import before Import after Delta CSS before CSS after Delta
lab/CodeEditor 12.8KB 12.8KB +74B 665B 742B +77B

Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included.

Bundle Size Summary

Gzip figures measure each package's entry file, not the code an import pulls in.

Package Entry (ESM) Entry gzip before Entry gzip after Delta
@astryxdesign/lab 4.6KB 1.9KB 1.9KB 0B
Package stylesheet Gzip before Gzip after Delta
@astryxdesign/lab 11.1KB 11.1KB 0B

Accessibility Audit

Status: 1 accessibility violation(s) found — 1 serious.

CodeEditor - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/7 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approval waits on a maintainer providing or identifying the governing spec for CodeEditor's new prebuilt appearance, settling whether the editor should gain the 1px outline, accent focus border and gutter divider its styles declare, or drop those declarations instead. The build side checks out: the prebuilt lab.css now carries the outline and divider, @astryxdesign/build compiles CodeEditor.tsx again, and Lab's build now fails on unsupported StyleX declarations the way Core's does. If the divider stays, please switch borderRightWidth/borderRightStyle/borderRightColor to their borderInlineEnd* equivalents, as Banner and DateRangeInput do: in right-to-left layouts the physical right border doubles the editor's outer edge instead of separating line numbers from code.

[Automated review]

Comment on lines +78 to +80
borderRightWidth: borderVars['--border-width'],
borderRightStyle: 'solid',
borderRightColor: colorVars['--color-border'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If the divider stays, please make it logical. In right-to-left layouts the gutter sits on the right, so a physical right border lands on the editor's outer edge (doubling the root border) and nothing separates line numbers from code. Core's Banner and DateRangeInput use the same logical longhands:

    borderInlineEndWidth: borderVars['--border-width'],
    borderInlineEndStyle: 'solid',
    borderInlineEndColor: colorVars['--color-border'],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in ddb9888: the divider now uses the borderInlineEnd* longhands. In right-to-left layouts it sits on the gutter's inner edge (RTL still added to the description). Left-to-right pixels are unchanged, and lab.css stays byte-identical to main's.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approval waits on a maintainer providing or identifying the governing spec for CodeEditor's prebuilt appearance: whether the editor should gain the 1px outline, the accent focus border and the line-number divider its styles declare, or drop those declarations and stay borderless. The build side checks out: @astryxdesign/build now compiles CodeEditor.tsx, lab.css is unchanged while the compiled editor uses rules it already held, and Lab's build rejects unsupported StyleX declarations as Core's does. The right-to-left divider now sits between the line numbers and the code, which resolves the earlier suggestion. Nothing else is needed from you unless a maintainer chooses the borderless option.

[Automated review]

CodeEditor declared its outline and gutter divider as `border` and
`borderRight` shorthands, which StyleX's default style resolution does not
support. The prebuilt lab.css, compiled in StyleX's silent mode, dropped
both, and source builds, which validate with `throw`, failed with
"CodeEditor.tsx: border is not supported" whenever Lab was installed.

Write them as longhands, the divider as a logical inline-end border so it
separates the line numbers from the code in right-to-left layouts too, and
make Lab's build reject unsupported declarations the way Core's does, with a
regression test.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approval waits on one owner decision: should Lab's prebuilt CodeEditor gain the 1px outline, the accent focus border and the line-number divider its styles declare, or should the root and gutter border declarations be removed so it stays borderless? No current spec covers CodeEditor's appearance, so an engineering owner records the decision to keep the borders by commenting /approve-spec <full head SHA> on this pull request, and you may record it yourself as an engineering owner; choosing the borderless editor instead means deleting those two declarations. The build side checks out: @astryxdesign/build compiles CodeEditor.tsx again, lab.css is unchanged, the right-to-left divider sits between the line numbers and the code, and Lab's build now rejects unsupported StyleX declarations as Core's does. Nothing else is needed.

[Automated review]

@vjeux
vjeux marked this pull request as draft October 29, 2026 22:45
@vjeux
vjeux marked this pull request as ready for review October 30, 2026 00:00
@vjeux
vjeux marked this pull request as draft October 30, 2026 03:37

This branch was successfully deployed

1 active deployment
Preview — ecb72b48 Deployed Oct 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant