feat: allow overriding widget symbols with a custom glyph#431
Merged
Conversation
Extends the item.character override (already honored by Git Staged/Unstaged/Untracked) to every widget with a hardcoded symbol and makes it editable in the TUI. - Add src/widgets/shared/symbol-override.tsx: shared (g)lyph keybind, symbol/prefix helpers, and a slot-based editor (type a character or emoji, Backspace renders without a symbol, choosing the default clears the override); single-symbol widgets store on item.character, multi-symbol widgets keep per-part metadata keys - Wire it into Git Branch (⎇), Git Worktree (𖠰), Git Worktree Mode (⎇), Git Conflicts (⚠), JJ Bookmarks (🔖), JJ Workspace (◆), the three presence widgets that already supported item.character, and the multi-symbol widgets Git Ahead/Behind (↑/↓) and Git Status (!+*?) - Add preview-path render coverage for default/override/suppressed plus helper unit tests; document the keybind in docs/USAGE.md Co-authored-by: Claude <noreply@anthropic.com>
This was referenced Jun 13, 2026
Owner
|
Thanks, this will go out in the next release. I added a 'Tab' keybind on the glyph editor to revert it to the default glyph, and aligned the labels so it looks nicer. |
This was referenced Jun 15, 2026
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.
Closes #436.
Lets users replace or remove any widget's hardcoded symbol.
item.characteralready worked on Git Staged/Unstaged/Untracked but had no editor. This extends it to every widget with a hardcoded glyph and adds a shared(g)lyphkeybind plus a tiny editor: type a character or emoji, Backspace renders the widget without a symbol, picking the default clears the override.⎇𖠰⎇⚠🔖◆+/*/?(now editable in the TUI)12 files, +366/-33. New
shared/symbol-override.tsxcarries the keybind, helpers, and editor; each widget adds ~15 lines (keybind entry,renderEditordelegation, prefix helper inrender). Preview-path tests cover default/override/suppressed for all nine widgets, plus helper units.Deferred: Git Ahead/Behind (paired
↑/↓) and Git Status (composite output) need a different shape than the singlecharacterfield; happy to follow up if there's interest.Motivation: nerd-font users who pair widgets with custom-symbol icons end up with doubled glyphs (
⎇ main); overriding or blanking the builtin fixes that without touching the renderer.Note: #430 touches some of the same widget files; whichever lands second gets a trivial rebase (conflicts are line-local).
Tested:
bun run lintclean;bun testgreen except the same Windows-environment failuresmainhas.