Repository navigation
Description
These came out of reviewing the before/after renders on #17. All of them are going into M4b (#1). #17 stays a draft until they land and the user approves fresh renders.
Preset gaps found by the examples
- 1. Primary buttons. egui has no primary button variant, so Save and Submit render in the pale secondary colour, and a disabled Save is nearly invisible. Add
primary()(and possiblydestructive(),outline(),ghost()) towidget::Button, drawn from the tokens. - 2. Unchecked checkbox/radio contrast. The
#e5e5e5fill barely shows on white. Map them to shadcn's look: a background-filled box with an input-coloured border. - 3. Hover tokens.
muted,accentandsecondaryare the same colour, so hover on a muted surface is invisible, and hovered and selected need different tokens. Add alpha variants such asaccent/50. - 4. Segmented sizing.
SegmentedClassesstretches across the row; shadcn usesw-fit. It also can't wrap with many options. Make it fit its content and add a wrapping variant. - 5. Shadow under a box with no background. It shows through inside the box, but CSS clips box-shadow to outside the border box. Clip it in the library.
- 6. Select popup height. It scrolls after about 5 items, because rows are 36 pt and
combo_heightis 200. Raise the popup height in the preset. - 7. Selected-text / focus-border colour. egui uses one colour (
selection.stroke) for both. Decision: use the foreground colour, which gives a strong focus border and readable selected text (the user picked option (b)). - 8.
Shadcn::of(ctx). Removes the token plumbing duplicated inexamples/commonandchat_shell.
Colour
- 9. Accent choice.
Shadcn::light().accent(Accent::Blue)and similar use shadcn's theme colours to re-tintprimary,ringandprimary-foreground. Neutral stays the default. - 10. Semantic tokens. Add
success,warningandinfoalongsidedestructive, in light and dark. - 11. Use them in
chat_shell.- The accent colours the context meter, the send button, the selected-recent marker and "Running".
- Green and red colour the
+N -Mchange counts. - The forms keep neutral chrome, with an accent primary button and focus.
Renders for the user
-
chat_shellandformin light and dark, with several accent candidates side by side (neutral, blue, violet, green, plus one or two more of shadcn's theme colours), so the user can pick the example accent. Regenerate the before/after comparisons with everything above applied.
Found while reviewing the follow-ups (decisions for the user)
-
12. Dark accents are dim. Decided: yes, dark-mode accent fills move to the brighter shade. shadcn's dark
primaryis the 700/800 shade, so on near-black the send button, the meter and the avatar have low contrast. chat_shell'sTok::AccentTextuses the ring (500) shade for text. Should dark fills move up to a brighter shade too? -
13. Selection background. Decided: keep primary at 30% opacity. Selected text uses the foreground colour (item 7), so
selection.bg_fillbecameprimaryat 30% alpha to keep it readable. Confirm. -
14. Button variants in
controls_gallery. Decided: add them. Add cells showing primary, secondary, destructive, outline and ghost, enabled and disabled. -
15.
hyperlink_colorDecided: use the ring shade. is stillprimary, which is dim in dark with an accent. Use the ring shade? -
16. Example accent. Decided: Blue. The user picks one from the contact sheets.
-
17. Examples follow the OS theme from startup, and every example has a System / Light / Dark toggle. Decided.
Found while reviewing 12–17 (decisions for the user)
- 18. Examples with hard-coded light palettes Decided: retheme them through the tokens. (
button,todo,kaolin,known_gaps) are only partly dark under the dark theme: the chrome follows, the content doesn't. Retheme them through the tokens? Their goldens would change. - 19. Neutral links are weak. Decided: links use
primary, as shadcn'slinkbutton variant does (text-primary underline-offset-4 hover:underline). This reverses item 15, which was only needed while darkprimarywas dim. The ring shade is #a1a1a1 on white (about 2.6:1) and #737373 on #0a0a0a (about 4.1:1). Accent links read well. - 20.
controls_galleryhas no accent Decided: use Blue., so its Primary cells are black in light and grey in dark. Give it Blue likeform?
Found by the user while trying M4b
- 21. kaolin sidebar rows overlap. Decided: fix the examples and use the recommended pattern. No library guard: we can't prevent misuse of the layout system; the examples should model the right pattern. Each row was a fixed
h_px(26.0)div_idadding a stockButton::selectablewithui.add_sized, so the library never measured it. Under the preset, egui's minimum button height (interact_size.y= 36) made each button spill over the next row. Rows becomeb.widget(.., Button..)sized by the library. Check every other example for hand-sized leaves holding stock widgets. - 22. Slider thumb. Decided: match shadcn's thumb. egui 0.37 defaults to
HandleShape::Rect { aspect_ratio: 0.75 }, a rounded rect, and paints the handle with the generic widgetbg_fillandfg_stroke. In dark,bg_fillisinput, which is white at 15%, so the handle is translucent. shadcn's thumb issize-4 rounded-full border border-primary bg-background shadow-sm: a circle, an opaque background fill and a primary border. The track isbg-muted h-1.5 rounded-fullwith the range inbg-primary. Set this through the preset (handle_shape: Circle, trailing fill on) and scope the thumb's fill and stroke insidewidget::Slider's ownUi, so other widgets' visuals don't change. Audit the other egui widgets that paint withbg_fillfor dark-mode translucency. - 23. A selectable button is shadcn's Toggle. Decided. Resting is transparent, hover is
bg-muted/text-muted-foreground, and selected isbg-accent/text-accent-foreground, so selected keeps the highlight background as the button's fill. Apply this towidget::Button's selectable form, with visuals scoped inside its ownUi. egui otherwise paints selected buttons with the globalselection.bg_fill, which also colours text selection. Apply it to thebuttonexample's selectable demo as well. Separately, rename theAccentenum (e.g.ThemeColor) in M4c (M4c: split the shadcn preset into its own crate behind a style contract #19), because shadcn'saccenttoken is the subtle hover background and not the theme colour.
Found while doing 19 and 21–23 (decisions for the user)
- 24. kaolin's selected row is invisible in neutral. Decided: (a), the sidebar uses the
backgroundsurface, as shadcn's sidebar block does. The selected row is shadcn Toggleaccent, which in neutral is the same colour as the sidebar'smutedbackground. Options: give the sidebar a different surface (e.g.background), or give selection a look that differs from the surface. - 25. Violet links in dark are 4.498:1 against the background Decided: nudge violet's dark link shade lighter so it reaches 4.5:1, and remove the test exception., just under 4.5. The test has a named exception for it. Options: nudge the colour, or accept it.
- Note: item 22 fixes the thumb fill by editing the circle shape egui emits, because egui paints rail and thumb from the same
inactive.bg_fill. Tests guard it, but it's a hack. If the slider becomes a bullseye-owned widget in M4c, the hack goes away. The rail is still egui's 8 pt; shadcn's is 6 pt.
Requested by the user while reviewing
- 26.
chat_shelldetails panel as a grouped form (like a macOS settings form, or shadcn's Card withdivide-y). Each section (Environment, Context, Changes, Background tasks) becomes a rounded, bordered container whose rows are separated by hairlines (divide_yinborder), with the label left-aligned and the value right-aligned. Built from existing classes, with no library change. HTML:<div class="rounded-lg border divide-y"><div class="flex justify-between px-3 py-2">…</div></div>. - 27. Some light goldens don't paint the page.
controls_gallery_*andport_button(light) show black wherever the app draws nothing. The live window paints its themed panel there, so these goldens don't show what the user sees. Dark goldens already use the harness's themedPage; light goldens should as well, so every golden matches the running app. Expect those goldens to change, but only in the unpainted area. - Final renders for the user. Approved by the user on try-out.
target/m4b-final/overview.png(not committed). The PR stays a draft until the user approves.
Activity
Accent, semantic and hover tokens; selection, popup height, Shadcn::o…
Test fit-content and wrapping segmented tracks (#18 item 4)
Button variants and shadcn checkbox/radio looks (#18 items 1-2)
Examples use the accent, semantic colours and Shadcn::of (#18 items 8…
chat_shell: the mode control's pressed cell is Line on the muted comp…
Dark accents fill with their bright shade; hyperlinks use the ring (#18…
controls_gallery: Button variant cells, enabled and disabled (#18 ite…
Every example follows the OS theme and shows a System/Light/Dark togg…
style::tokens read the theme before taking the data lock (#18)
controls_gallery uses the Blue accent like form (#18 item 20)
button, todo, kaolin and known_gaps follow the theme (#18 item 18)
kaolin sidebar rows are library-sized buttons (#18 item 21)
shadcn slider: circular opaque thumb, muted track, primary range (#18 …
hyperlink_color is primary, following shadcn's link variant (#18 item…
a selectable button is shadcn's Toggle (#18 item 23)
kaolin: sidebar uses the background surface so the selected row shows (…
style: nudge dark violet primary to 4.5:1 on the page, drop the test …
chat_shell: details panel as a grouped form (#18 item 26)
snapshots: every example golden paints the page its live example does (…
samitbasu commentedon Nov 8, 2026
Everything here landed in #17 (merged, tagged
v0.1.0-m4b). TheAccentrename moves to M4c (#19).