fix(client): the tab's process icon leaves the label, and stays on the cell path (UI/UX v3 N-3c) - #103
Merged
Merged
Conversation
…e cell path (UI/UX v3 N-3c) Last of the three N-3 PRs. The Nerd Font glyph for the foreground process was prepended to the label string, so after N-3b it was measured and drawn as part of a chrome run. `rasterize_chrome_char` boxes a glyph to its advance without cropping to ink, and Nerd Font icons commonly overhang, so it drew the icon into a box that could cut it. It is now drawn beside the label, in a slot the tab reserves for it through `tab_width`'s `icon_w` parameter — the one N-3a shipped and tested. The spec's D3 said to draw it "through the icon path, which crops". Checking that before building on it: `icons.rs` documents that the bundled Fluent subset's codepoints "live in the Private Use Area, which overlaps the Nerd Font range `tab_icons.rs` uses", and that they are only safe to draw through `FontRole::Icon` precisely so the two sets cannot resolve against each other. Asking the icon path for a process glyph would have silently returned a Fluent icon at that codepoint — a wrong glyph rather than a clipped one. So the icon stays on the cell path, which is where it has always come from: it resolves against the user's terminal font and boxes a glyph to a whole cell rather than to its advance, which is the clipping fix. D3 is corrected in the spec with the evidence. A test pins that the process glyph is not routed through the chrome icon path. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Coverage reportGenerated by |
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.
Last of the three N-3 PRs, and the second time this phase's own spec turned out to be wrong about a premise.
What N-3c is for
The Nerd Font glyph for the foreground process was prepended to the label string, so after #102 it was measured and drawn as part of a chrome run.
rasterize_chrome_charboxes a glyph to its advance without cropping to ink, and Nerd Font icons commonly overhang, so the icon was being drawn into a box that could cut it.It is now drawn beside the label, in a slot the tab reserves through
tab_width'sicon_wparameter — the one #101 shipped and tested.The spec said "draw it through the icon path". That would have been worse.
Checking D3 before building on it, from
icons.rs:Routing a process glyph through the chrome icon path would have silently returned the bundled Fluent icon sitting at that codepoint — a wrong glyph, not a clipped one.
So the icon stays on the cell path, which is where it has always come from: it resolves against the user's terminal font, and it boxes a glyph to a whole cell rather than to its advance, which is the clipping fix. D3 is corrected in the spec with the evidence, and a test pins that the process glyph is not routed through the chrome icon path.
Verification
cargo fmt --check— cleancargo clippy --workspace --all-targets -- -D warnings— no warningscargo test --workspace— 28 suites pass (tab_layout now 11 tests)tab_bar.show_process_icon = true— CI's font stack has no Nerd Font, so nothing here can observe the glyph that is actually drawn (spec §6).Stacked on #102 (merged). This closes N-3.
🤖 Generated with Claude Code