Repository navigation
Tabs example, and the segmented look follows shadcn's tabs.tsx (#346, PR 4) - #442
Merged
Merged
Conversation
The account and password forms of shadcn's demo, a code switcher, tabs with icons and a refused tab, and tabs that select on Enter. The trial build for the tabs widget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LesfK54UWq1haPSEr9X22o
…ser's pick) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LesfK54UWq1haPSEr9X22o
…346) Tabs draw in the segmented control's look, and the user decided both follow tabs.tsx exactly, with one exception: - an inactive cell's text is foreground at 60% in light (`text-foreground/60`), muted-foreground in dark, and foreground under the pointer (`hover:text-foreground`); - a cell is 1 pt shorter than the track's inside, centred (`h-[calc(100%-1px)]`): SegmentedMetrics::cell_trim, given to the track as half a point more vertical padding each side, so a caller's own track height still holds; the preset's cells take the point out of their vertical padding (3.5), since 29 pt cannot hold py-1, a 20 pt line and the border without overflowing; - the track keeps `input`, not tabs.tsx's `bg-muted`: on a muted panel that fill is the panel's own and the track disappears (the user's pick; revisit with the cascade, #443). Breaking: SegmentedMetrics gains `cell_trim` (0 keeps today's look), so a struct literal of it needs the field. 54 goldens move, reviewed as a before/after sheet; the two tests that pinned the cell 3 pt from the track pin 3.5 and 29 pt, and support::same matches a drawn rect per edge within the half point drawing rounds by. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LesfK54UWq1haPSEr9X22o
Owner
Author
|
Approved by the user after the Tabs trial (2026-11-19); the segmented look follows shadcn's tabs.tsx, with the input track fill. GitHub's required checks pass on the branch merged with current main. Merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #346: PR 4 of the design note, the tabs example and the trial. Stacked on #440 (PR 3,
tabs-346), so its diff shows the example alone.What
examples/tabs.rs, run withcargo xtask example tabsor served on the web:activate_on_enter), with a disabled third tab.For you to try
Keyboard:
Panels:
Disabled:
Screen reader: the list, the tabs and the panel read as a tab list, tabs and a tab panel. The panel is named by its tab.
The look: tabs.tsx, for tabs and the segmented control alike
Decided by the user: every widget names one shadcn source. Tabs follow
tabs.tsx, and the segmented control's source istabs.tsx's list look too, so the two stay identical and both change here. Each value is cited at the line that sets it incrates/eggshell-ui-shadcn/src/preset.rs.foregroundat 60% (text-foreground/60); dark keepsmuted-foreground(dark:text-muted-foreground).foregroundunder the pointer (hover:text-foreground).h-[calc(100%-1px)]).SegmentedMetrics::cell_trim, which the track takes as half a point more vertical padding each side, so a caller's own track height still holds. 0, core's default, keeps today's look.py-1, a 20 pttext-smline and the border: shadcn's own trigger overflows by 1 px there, which the browser hides and the overflow check here doesn't.input, notbg-muted.mutedpanel,bg-mutedis the panel's own colour, and the track disappears (contrast 1.00).slider_and_segmented_tracks_read_on_a_muted_panel,form::every_track_shows_on_a_section_…) stay.Goldens: 54 of 199 move, all for these changes. They're reviewed as a before/after sheet: https://claude.ai/artifact/YUU7rbNrLZdZjV7YowchQh
Tests:
owned_choice::segmented_track_and_cells_are_the_styles,style::the_shadcn_segmented_style_raises_exactly_the_selected_cell).tests/it/support::same, which finds a drawn rect, now allows each edge the half point drawing rounds by. Before, it measured the corner distance as a whole vector, and that failed on a cell at a half point.Breaking changes
SegmentedMetricsgainscell_trim. The struct isn't#[non_exhaustive], so a struct literal of it needs the field. 0 keeps today's look.Checks
cargo test --workspacepasses, and clippy is clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01LesfK54UWq1haPSEr9X22o