Skip to content

fix(studio): right-align FlatRow's value input in the flat inspector#2528

Merged
vanceingalls merged 1 commit into
mainfrom
fix/studio-flat-row-values-right-aligned
Jul 16, 2026
Merged

fix(studio): right-align FlatRow's value input in the flat inspector#2528
vanceingalls merged 1 commit into
mainfrom
fix/studio-flat-row-values-right-aligned

Conversation

@vanceingalls

@vanceingalls vanceingalls commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • FlatRow lays out label…gap…value across a justify-between row, but the shared CommitField input it wraps had no text-align, so its text hugged the LEFT edge of the value's own (often much wider) right-hand box — reading as left-aligned relative to the row, out of step with FlatSelectRow/FlatSlider, which already right-align.
  • Added an optional align prop to CommitField (default "left", preserving the legacy panel's MetricField/DetailField layouts where label-then-value sits inline and left reads naturally) and passed align="right" from FlatRow.
  • Left the Motion Timing row's Start/End/Duration cells alone — those stack label-above-value in a grid, a different pattern from the inline label…value row this fix targets.

Test plan

  • Verified live in a running Studio dev instance: Size, Weight, Letter spacing, Line height, Color, Stroke, etc. all right-aligned
  • New tests: FlatRow's input has text-right; legacy MetricField's input keeps text-left (pins CommitField's default so it doesn't drift for the panel that didn't ask for this)
  • Full studio suite green; typecheck/oxlint/oxfmt clean

🤖 Generated with Claude Code

@vanceingalls
vanceingalls force-pushed the fix/studio-flat-row-values-right-aligned branch from 9720290 to d1abb9a Compare July 16, 2026 07:20
@vanceingalls
vanceingalls force-pushed the fix/studio-variable-promote-shared-session-sync branch from aab7ec9 to 578d620 Compare July 16, 2026 07:20
Base automatically changed from fix/studio-variable-promote-shared-session-sync to main July 16, 2026 07:36
FlatRow lays out label…gap…value across a `justify-between` row, but the
shared CommitField input it wraps had no text-align, so its text hugged
the LEFT edge of the value's own (often much wider) right-hand box —
looking left-aligned relative to the row, out of step with FlatSelectRow
and FlatSlider, which already right-align.

Added an optional `align` prop to CommitField (default "left", preserving
the legacy panel's MetricField/DetailField layouts where label-then-value
sits inline and left reads naturally) and pass `align="right"` from
FlatRow. Left the Motion Timing row's Start/End/Duration cells alone —
those stack label-above-value in a grid, a different pattern from the
inline label…value row this fix targets.

New tests: FlatRow's input has `text-right` (not `text-left`); the legacy
MetricField's input keeps `text-left` (not `text-right`), pinning
CommitField's default so the shared component doesn't drift for the
panel that didn't ask for this.

Full studio suite (2645 tests) green; typecheck/oxlint/oxfmt clean.

@miga-heygen miga-heygen 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.

Review — #2528: right-align FlatRow value input

Clean. CommitField gets an align prop (default "left" for backward compat). FlatRow passes align="right" — correct for justify-between row layout. Classic panel regression guard test pins text-left. No logic changes.

Code: clean.


Review by Miga

@james-russo-rames-d-jusso james-russo-rames-d-jusso 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.

Reviewed at b32f9a3e. Traced the align prop end-to-end (default vs opt-in) and verified the classic panel is byte-identical to pre-PR via the regression-guard test.

Blockers

(none)

Concerns

(none)

Nits

(none)

Green notes

🟢 align prop defaults preserve classic-panel behavior. CommitField's new align?: "left" | "right" prop defaults to "left" at the signature, so every existing consumer (MetricField, FontWeightField, etc. flowing into the classic PropertyPanel) keeps text-left without changing a line. Only FlatRow opts into align="right" — the change is one-directional and additive.

🟢 Regression guard for the classic panel is explicit. propertyPanelInputCoverage.test.tsx:137-142 asserts text-left present AND text-right absent in the classic path — a shift in CommitField's default would break this test loudly. That's exactly the shape needed to catch a future "just default to right for consistency" refactor that would silently re-flow every classic input.

🟢 Class conditional is safe. The template literal ${align === "right" ? "text-right" : "text-left"} is exhaustive across the union — TypeScript enforces align is only "left" | "right", so no unexpected class combos can leak through, and Tailwind sees both classes at build time (they're literal strings in the source).

🟢 text-right on a min-w-0 w-full numeric input truncates the LEADING characters when overflow. For FlatRow values that are numeric-with-unit ("72px", "1.5rem", "auto") this is the correct direction — the meaningful trailing unit stays visible. Non-blocker either way.

Verdict framing

Tiny, well-tested addition to the shared primitive. LGTM from my side. Base PR for the stack — merge gate applies to the full graphite chain, not just this PR.

Review by Rames D Jusso

@vanceingalls
vanceingalls merged commit f96b781 into main Jul 16, 2026
41 checks passed
@vanceingalls
vanceingalls deleted the fix/studio-flat-row-values-right-aligned branch July 16, 2026 09:05
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.

3 participants