fix(shell): honor [tokens] chip_height instead of a hardcoded table (v0.7.11) #19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/eco-17-chip-height-token"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes ECO-17 ("Text clipping in breadbar on custom themes").
Reported against a custom theme ("Strata") setting
font_family = "Space Grotesk, JetBrains Mono, sans-serif",font_size_base = 13,font_weight = 500,chip_height = 30,modules.workspaces.style = "dots". Screenshots showed descenders (y,g) on the media-title and a[[bar.widget]]uptime chip clipped flush against the chip's bottom edge.Root cause
chip_height_px— themin-heightbaked into.media-widget,.stat-pair, and Trail/Pill.workspace-btninassets/shell/base.css— came from a hardcoded per-WorkspaceStyletable (style::chip_height: Trail 26, Pill/Dots 22), completely independent oftokens.chip_height. The token was parsed, stored, exposed via an accessor, and documented, but never actually reached the CSS it's supposed to control.Every builtin theme happened to set
chip_heightto the exact same number that table already returns for its style — which is how this went unnoticed for so long — exceptloaf, which explicitly asks for24(chip_height = 24in its owntheme.toml) and silently got22instead, inherited fromglass-workbench'sstyle = "pill"viaextends. That's concrete proof this was dead even in a shipped, reviewed builtin, not just a hypothetical.Strata's
chip_height = 30was meant to give its 17px custom-font media label enough room; instead it got the "dots" style's 22px regardless, and the label's descenders clipped.Fix
resolve_tokens(manifest.rs) now takes the resolved workspace style and falls back to the per-style number only when a theme doesn't setchip_heightat all; an explicit value is used as-is, no matter the style.style::subst_pairsjust readst.chip_heightdirectly now — the fallback is baked into the token once at resolution time, matching this module's own "fully resolved, no further branching downstream" design.Also removed
breadbar::theme::approved_chip_height(companion breadbar change) — it existed specifically to bypass the token because of this exact staleness (see its own doc comment), so it's redundant now thattokens().chip_height()is always the correct, effective value.Test plan
cargo build --release -p bread-themecargo test --release -p bread-theme— 111 passing (2 new: an explicitchip_heightreaches.media-widget/.stat-pairCSS and beats the style fallback; an omitted one still gets the per-style number, not the stale32default)loaf.cssdrifted (22px → 24px, exactly the one builtin where the token and the hardcoded table actually disagreed) — every other builtin is byte-identical. Re-blessed withBLESS_GOLDEN=1.cargo clippy --release -p bread-theme— cleanVersion bump to 0.7.11 + CHANGELOG + a
docs/shell-themes.mdcorrection (the token's documented default,32, was also stale — now shows the real per-style fallback).🤖 Generated with Claude Code
https://claude.ai/code/session_01WtbAi2H268yYaoUb5YoPN9
Pull request closed