Skip to content

fix(ui): systematise control surface fills and hover borders - #48887

Merged
dnywh merged 14 commits into
masterfrom
dnywh/fix/control-surface-tokens
Aug 18, 2026
Merged

dnywh merged 14 commits into
masterfrom
dnywh/fix/control-surface-tokens

Conversation

@dnywh

@dnywh dnywh commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Bug fix / design-system token hygiene for form and selector chrome.

What is the current behavior?

After opaque default-button fills, text fields, selects, and selector tiles drifted apart: inputs and selects mixed ad-hoc washes, hover borders bounced between border-stronger / border-foreground-muted, invalid fields had no hover step, and composites like InputGroup leaked inner hover borders.

Follow-up to #48837 (opaque button fills) where Select rest still felt darker than Input on forms such as scoped access tokens.

What is the new behavior?

Named control roles and one interactive border:

Role Fill Rest border Hover / focus / open
Field (sunk) bg-field border-control border-control-hover
Raised control bg-control-raised border-strong border-control-hover
Overlaying action card → popover border-strong border-control-hover
Invalid field bg-destructive-200 border-destructive-400 border-destructive
  • --field / --control-raised / --border-control-hover live in semantic.css (source of truth for roles; README points there)
  • Input / Textarea / InputGroup / legacy TextArea use the field ladder (incl. invalid hover)
  • Select and empty MultiSelect use raised; filled MultiSelect sinks to field
  • Default + dashed Button, CommandMenu trigger, and radio card/stacked/large use border-control-hover
  • Studio selector tiles aligned: Connect mode, role impersonation, DuckLake modes, compute “Contact us”
Before and After
Access Tokens  Account  Supabase
Access Tokens  Account  Supabase

Additional context

--control-raised aliases --card today (role name so fill can diverge later). Rest border-control / border-strong both still map to --input via compat; the shared interactive step is --border-control-hover.

To test

  1. Account → Access Tokens
    Open Generate / New scoped token. Side-by-side Input, Select, RadioGroupStacked, MultiSelect. Confirm sunk vs raised fills, shared hover border, MultiSelect flips to sunk once a value is selected. Leave a required field empty to check invalid rest → hover → focus.

  2. Org → Projects
    Hover the dashed Status filter. Hover default / filled filter buttons when active. Confirm hover/open borders match.

  3. Project → Connect
    Open Connect from the header. Mode grid tiles: hover + selected borders match radio cards (no old muted-foreground ring).

  4. Project → Compute (optional)
    Compute size radios + “Contact us” tile hover.

Introduce named field / control-raised fills and a shared control-hover
border so sunk inputs, raised selects, and overlaying buttons share one
chrome ladder (including invalid hover and selector tiles).
@dnywh
dnywh requested review from a team as code owners August 10, 2026 01:53
@vercel

vercel Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview Aug 13, 2026 6:47am
docs Ready Ready Preview, v0 Aug 13, 2026 6:47am
studio-self-hosted Ready Ready Preview Aug 13, 2026 6:47am
studio-staging Ready Ready Preview Aug 13, 2026 6:47am
ui-library Ready Ready Preview Aug 13, 2026 6:47am
zone-www-dot-com Ready Ready Preview, v0 Aug 13, 2026 6:47am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Aug 13, 2026 6:47am

Request Review

@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR adds semantic tokens for fields, raised controls, and hover borders. Shared UI components, UI patterns, and Studio controls now use these tokens for hover, focus, selected, open, and invalid states.

Changes

Semantic control styling

Layer / File(s) Summary
Semantic control tokens and conventions
packages/ui/build/css/source/semantic.css, packages/config/css/theme.css, packages/ui/README.md
Adds semantic field, raised-control, and hover-border tokens. Documents control-surface styling conventions.
Shared control state styling
packages/ui/src/components/Button/Button.tsx, packages/ui/src/components/radio-group-*.tsx, packages/ui/src/components/shadcn/ui/*
Updates buttons, radio groups, inputs, selects, and text areas to use semantic surfaces and border states.
Pattern control integration
packages/ui-patterns/src/CommandMenu/api/CommandMenu.tsx, packages/ui-patterns/src/FilterBar/*, packages/ui-patterns/src/multi-select/multi-select.tsx
Applies shared hover, focus, open, and surface styling to command menu, filter, and multi-select controls.
Studio selector styling
apps/studio/components/interfaces/...
Updates Studio selector and contact-card borders to use border-control-hover and removes selected-state rings where applicable.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: saxonf

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the PR’s main change: standardizing control-surface fills and hover borders.
Description check ✅ Passed The description covers the change type, current and new behavior, context, testing steps, and screenshots, but omits the CONTRIBUTING.md confirmation.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dnywh/fix/control-surface-tokens

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/ui/src/components/shadcn/ui/radio-group.tsx`:
- Around line 59-60: Update the RadioGroupLargeItem styling classes to include
focus-visible:border-control-hover alongside the existing hover and checked
border classes, preserving the radio cards/stacked/large contract for hover,
focus, and checked states.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8fe6ca52-d963-4b76-8ffc-1ba38c5f7b06

📥 Commits

Reviewing files that changed from the base of the PR and between 5b68af1 and d021cb3.

📒 Files selected for processing (20)
  • apps/studio/components/interfaces/ConnectSheet/ConnectModeButton.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DuckLake/Fields.tsx
  • apps/studio/components/interfaces/DiskManagement/fields/ComputeSizeField.tsx
  • apps/studio/components/interfaces/RoleImpersonationSelector/RoleImpersonationRadio.tsx
  • packages/config/css/theme.css
  • packages/ui-patterns/src/CommandMenu/api/CommandMenu.tsx
  • packages/ui-patterns/src/FilterBar/FilterCondition.tsx
  • packages/ui-patterns/src/FilterBar/FilterGroup.tsx
  • packages/ui-patterns/src/multi-select/multi-select.tsx
  • packages/ui/README.md
  • packages/ui/build/css/source/semantic.css
  • packages/ui/src/components/Button/Button.tsx
  • packages/ui/src/components/radio-group-card.tsx
  • packages/ui/src/components/radio-group-stacked.tsx
  • packages/ui/src/components/shadcn/ui/input-group.tsx
  • packages/ui/src/components/shadcn/ui/input.tsx
  • packages/ui/src/components/shadcn/ui/radio-group.tsx
  • packages/ui/src/components/shadcn/ui/select.tsx
  • packages/ui/src/components/shadcn/ui/text-area.tsx
  • packages/ui/src/components/shadcn/ui/textarea.tsx

@github-actions

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results (next)

passed  242 passed
flaky  1 flaky
skipped  5 skipped

Details

stats  248 tests across 29 suites
duration  3 minutes, 50 seconds
commit  d021cb3

Flaky tests

Features › wrappers.spec.ts › Stripe › can create a stripe wrapper with tables

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@github-actions

github-actions Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results (next)

passed  242 passed
flaky  1 flaky
skipped  5 skipped

Details

stats  248 tests across 29 suites
duration  3 minutes, 45 seconds
commit  0a01356

Flaky tests

Features › wrappers.spec.ts › Stripe › can create a stripe wrapper with tables

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

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.

Pull request overview

This PR standardizes “control surface” styling across the design system by introducing explicit semantic roles (field well vs raised control) and a single shared interactive border token, then applying those tokens across core inputs/selectors and key Studio selector tiles.

Changes:

  • Adds new semantic tokens for control fills and interactive borders (--field, --control-raised, --border-control-hover) and exposes them through theme variables.
  • Updates shadcn/ui form controls (Input/Textarea/Select/InputGroup) plus Button + radio card variants to use consistent rest/hover/focus/invalid chrome.
  • Aligns ui-patterns + Studio selector-like components (MultiSelect trigger, FilterBar inputs, CommandMenu trigger, various selector tiles) to the shared hover border behavior.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/ui/src/components/shadcn/ui/textarea.tsx Moves Textarea to field fill + shared hover/focus border; adds invalid hover/focus ladder.
packages/ui/src/components/shadcn/ui/text-area.tsx Keeps legacy TextArea visually aligned with shadcn Textarea role tokens.
packages/ui/src/components/shadcn/ui/select.tsx Switches Select trigger to raised control fill and shared hover/open border.
packages/ui/src/components/shadcn/ui/radio-group.tsx Aligns large radio item hover/checked borders to shared control-hover token.
packages/ui/src/components/shadcn/ui/input.tsx Updates Input to field fill + shared hover/focus border and invalid hover state.
packages/ui/src/components/shadcn/ui/input-group.tsx Makes InputGroup shell own hover/focus/invalid chrome; suppresses inner control borders.
packages/ui/src/components/radio-group-stacked.tsx Uses shared control-hover border for hover/focus/checked states.
packages/ui/src/components/radio-group-card.tsx Uses shared control-hover border for hover/checked states.
packages/ui/src/components/Button/Button.tsx Unifies default + dashed Button hover/open border to control-hover token.
packages/ui/README.md Documents control surface role tokens and points to semantic.css as source of truth.
packages/ui/build/css/source/semantic.css Defines --field, --control-raised, and --border-control-hover formulas.
packages/ui-patterns/src/multi-select/multi-select.tsx Makes MultiSelect trigger raised when empty and field when filled; uses shared hover/open border.
packages/ui-patterns/src/FilterBar/FilterGroup.tsx Prevents nested FilterBar inputs from introducing their own hover/focus borders.
packages/ui-patterns/src/FilterBar/FilterCondition.tsx Prevents nested FilterBar inputs from introducing their own hover/focus borders.
packages/ui-patterns/src/CommandMenu/api/CommandMenu.tsx Updates CommandMenu trigger to shared control-hover border on hover.
packages/config/css/theme.css Exposes new semantic fill + border tokens through config theme variables.
apps/studio/components/interfaces/RoleImpersonationSelector/RoleImpersonationRadio.tsx Aligns tile hover/selected border with shared control-hover border token.
apps/studio/components/interfaces/DiskManagement/fields/ComputeSizeField.tsx Aligns “Contact us” tile hover border to shared control-hover token.
apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DuckLake/Fields.tsx Aligns DuckLake mode selector hover/selected border to shared control-hover token.
apps/studio/components/interfaces/ConnectSheet/ConnectModeButton.tsx Aligns Connect mode tile hover/selected border to shared control-hover token.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

dnywh added 3 commits August 10, 2026 12:07
Solid e1-from-page fills sat between canvas and Sheet (popover e2) and
vanished on light near the white ceiling. Black/white alpha keeps wells
and plates relative to the local surface.

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.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated no new comments.

@dnywh
dnywh merged commit 5f9ce72 into master Aug 18, 2026
39 checks passed
@dnywh
dnywh deleted the dnywh/fix/control-surface-tokens branch August 18, 2026 06:54
dnywh added a commit that referenced this pull request Sep 24, 2026
## Problem

- Grouped textareas render text too close to the top border. The
standalone `Textarea` retains its normal top padding.
- `InputGroupTextarea` has overridden the inner textarea with `py-0`
since #44282 on 31 March 2026. The group initially supplied `py-2`;
#44387 removed that outer padding later the same day, leaving no top
spacing. The override was retained during the border and surface updates
in #44690 and #48887.
- The textarea component page had no grouped textarea example, so this
difference was easy to miss.

## Solution

- Give the grouped textarea `pt-2` while retaining `pb-0` for block-end
addons. The outer group continues to own its border and focus styles.
- Add a “With addon” example to the textarea component page to keep this
composition visible.

## Review instructions

- Open `/design-system/docs/components/textarea` and find “With addon”.
Confirm its text has the same top inset as the default textarea and the
block-end addon remains below the input.
- Open `/design-system/docs/ui-patterns/forms` and find “Textarea
Multi-line text input for longer content with addon”. Confirm the text
has the same top inset as the standalone textarea example immediately
above it.

## Checklist

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added a textarea example with a supporting addon below the text field,
showing a 120-character limit.
* **Bug Fixes**
* Clicking a block-end addon now focuses its textarea as well as an
input.
* **Documentation**
* Added the textarea-with-addon example to the textarea component
documentation.
* **Style**
* Added top padding to textareas within input groups while keeping
bottom padding unchanged, adjusting spacing above entered text.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
joshenlim pushed a commit that referenced this pull request Sep 25, 2026
## Problem

- Grouped textareas render text too close to the top border. The
standalone `Textarea` retains its normal top padding.
- `InputGroupTextarea` has overridden the inner textarea with `py-0`
since #44282 on 31 March 2026. The group initially supplied `py-2`;
#44387 removed that outer padding later the same day, leaving no top
spacing. The override was retained during the border and surface updates
in #44690 and #48887.
- The textarea component page had no grouped textarea example, so this
difference was easy to miss.

## Solution

- Give the grouped textarea `pt-2` while retaining `pb-0` for block-end
addons. The outer group continues to own its border and focus styles.
- Add a “With addon” example to the textarea component page to keep this
composition visible.

## Review instructions

- Open `/design-system/docs/components/textarea` and find “With addon”.
Confirm its text has the same top inset as the default textarea and the
block-end addon remains below the input.
- Open `/design-system/docs/ui-patterns/forms` and find “Textarea
Multi-line text input for longer content with addon”. Confirm the text
has the same top inset as the standalone textarea example immediately
above it.

## Checklist

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added a textarea example with a supporting addon below the text field,
showing a 120-character limit.
* **Bug Fixes**
* Clicking a block-end addon now focuses its textarea as well as an
input.
* **Documentation**
* Added the textarea-with-addon example to the textarea component
documentation.
* **Style**
* Added top padding to textareas within input groups while keeping
bottom padding unchanged, adjusting spacing above entered text.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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