Skip to content

feat(ui-react): add Tabs, and try them in Lite's branch header - #16155

Merged
PavelLaptev merged 2 commits into
design-core-10-control-sizesfrom
ui-react-tabs
Sep 29, 2026
Merged

PavelLaptev merged 2 commits into
design-core-10-control-sizesfrom
ui-react-tabs

Conversation

@PavelLaptev

@PavelLaptev PavelLaptev commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

A tab strip in @gitbutler/ui-react for but.dev's change pane, drawn in ⚛️ Core. Stacked on #16153, which brings design-core 10's --size-control.

  • Tabs and Tab on Base UI's tabs: value/onValueChange or defaultValue, arrow keys between tabs. A Tab takes an optional icon, count (a light grey Badge) and kbd (the shortcut, faint after the label). Inactive tabs brighten and take a hover fill under the pointer; the selected one doesn't react.
  • The underline is Base UI's indicator: 4px under the selected tab's content, 8px below the row, sliding to the next tab on the medium tier; it jumps under reduced motion. A header leaves 12px below the tabs so it sits on the divider.
  • Lite, as a trial in its own commit: a branch's header and a commit's review row switch Diff / Pull Request with Tabs (with icons) instead of the toggle group. The e2e tests find them as a tablist.
  • Figma: Tab (state default/hover/selected; icon, count, kbd) and Tabs, with descriptions naming the code.

@github-actions

Copy link
Copy Markdown

This pull request changes Lite's CSS. If the change shows on screen, before/after screenshots make it reviewable without checking the branch out — drag them into a comment, or use the lite-screenshots skill in this repository. Add the screenshots label once they are posted. Asked once; later pushes will not repeat it.

@github-actions

Copy link
Copy Markdown

🎩 Your Storybook has been served

  • 🫖 Have a look
  • 🔍 Inspect the changes: anything that looks different from master is waiting for your approval
  • 🤖 Service entrance for agents (MCP): https://ui-react-tabs--6ab536f5f40e41db628ccf1b.chromatic.com/mcp

but.dev switches a pane between its changes and its activity with a row
of hand-styled tabs; ui-react had nothing to build it from. Tabs is that
row, drawn in Core (2374:4526), on Base UI's tabs, so the roles and the
arrow keys come with it.

- Tabs takes value and onValueChange, or defaultValue, and lays its
  Tabs out 2px apart.
- A Tab is 28px (size/control) with a 10px inset, the label in 13px
  semibold after an optional icon, and an optional count as a light grey
  Badge. kbd names the shortcut that selects it, drawn after the label
  as Kbd's button variant, faint. Its icon and label sit at half
  strength until it is hovered, which lays bg/hover under it, or
  selected.
- The underline is Base UI's indicator: 4px of fill/gray/bg under the
  selected tab's content, inset by its 10px, 8px below the row, sliding
  and resizing to the next on the medium tier with ease-out, and jumping
  under reduced motion. It hangs outside the row, as in the drawing, so
  a header holding the tabs leaves 12px below them and the underline
  sits on its divider.
- The selected tab doesn't answer the pointer, and a disabled tab stays
  faded under it; neither gets the hover ground.

Lite's token check learns the --active-tab-* variables Base UI's
indicator sets.

Stories: Default, IconsAndCounts, Shortcuts, and InAHeader, where the
underline sits on the header's divider.
A branch's header and a commit's review row switched between the diff
and the pull request with a two-button toggle group. They now use
ui-react's Tabs, a Tab each with its icon (diff, pr), the way the pane
tabs are drawn in Core; the Pull Request tab is disabled, and says so,
when the branch has none.

The header's 12px below the row already fits the tabs' underline, 8px
under them and 4px thick, so it sits on the header's bottom edge; the
comment there says why the number is what it is.

The e2e tests find the tabs as a tablist and tabs, selected rather than
pressed.
@PavelLaptev
PavelLaptev added this pull request to stack #16154 September 29, 2026 20:09
@PavelLaptev
PavelLaptev merged commit acbdc06 into master Sep 29, 2026
46 checks passed
@PavelLaptev
PavelLaptev deleted the ui-react-tabs branch September 29, 2026 21:28

This branch was previously deployed

1 inactive deployment
Preview — 3298b52a Deployed Sep 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant