Skip to content

feat(widgets): give the remaining git and jj widgets symbol slots - #574

Merged
sirmalloc merged 2 commits into
sirmalloc:mainfrom
zachthedev:feat-symbol-slots-parity
Sep 17, 2026
Merged

sirmalloc merged 2 commits into
sirmalloc:mainfrom
zachthedev:feat-symbol-slots-parity

Conversation

@zachthedev

Copy link
Copy Markdown
Contributor

Five widgets expose custom glyphs through SymbolSlot. Eight hardcode theirs,
so a line can restyle Git Status but not Git Changes beside it. This closes that
gap.

Widget Slots added Default
Git Insertions, Jj Insertions symbolInsertions +
Git Deletions, Jj Deletions symbolDeletions -
Git Changes, Jj Changes both + -
Git Clean Status symbolClean, symbolDirty ✓ ✗
Jj Revision character ``

No workaround existed for any of them. The insertions, deletions and changes
widgets return false from supportsRawValue, so the sign was unconditional.
Git Clean Status has raw mode but emits clean/dirty as words. Jj Revision's
raw mode drops the revision prefix along with the glyph.

Jj Revision uses character and formatSymbolPrefix rather than a named slot,
matching Jj Bookmarks and Git Branch: one space-separated prefix. That path also
drops the trailing space when the override is empty, which a named slot would
have left behind.

Git Clean Status mirrors Git Conflicts, which already pairs a symbol with a
clean-state symbol.

Defaults are unchanged, so existing configs render identically.

Tests extend the two tables in SymbolOverride.test.ts rather than adding a
suite: Jj Revision joins the character cases, the other seven join a new
slotCases table covering default, override, empty override, and the g
keybind plus editor. Reverting Git Changes and Git Clean Status turns 6 red.

bun run lint clean, bun test 2223 pass.

Five widgets carried customizable glyphs through SymbolSlot while eight
others hardcoded theirs, so a status line could restyle Git Status but not
Git Changes sitting next to it.

Git Insertions, Git Deletions, Jj Insertions and Jj Deletions gain one slot
each for their +/- sign. Git Changes and Jj Changes gain both, since they
render the pair. Git Clean Status gains symbolClean and symbolDirty, matching
the shape Git Conflicts already uses.

Jj Revision takes the character/formatSymbolPrefix path rather than a named
slot, because it renders a single space-separated prefix exactly like Jj
Bookmarks and Git Branch. That also drops the stray leading space an empty
override would otherwise leave.

None of these widgets could express a custom glyph before. Insertions,
deletions and the changes pairs return false from supportsRawValue, so the
sign was unconditional; Git Clean Status offered raw mode but emitted the
words clean and dirty rather than a symbol; Jj Revision's raw mode removed
the revision prefix along with the glyph.

Defaults are unchanged, so existing configs render identically.
@zachthedev
zachthedev force-pushed the feat-symbol-slots-parity branch from a5d37c8 to d04da05 Compare September 4, 2026 14:38
@sirmalloc
sirmalloc merged commit 747b7f1 into sirmalloc:main Sep 17, 2026
3 checks passed
@zachthedev
zachthedev deleted the feat-symbol-slots-parity branch September 18, 2026 18:00
pcvelz added a commit to pcvelz/ccstatusline-usage that referenced this pull request Sep 25, 2026
Upstream: TUI kept off the render path (sirmalloc#575), flex mode default full (sirmalloc#590), usage cache fingerprinted by refresh token (sirmalloc#536), CLAUDE_CONFIG_DIR keychain credential first (sirmalloc#573), llms.txt (sirmalloc#527), faster terminal width probing (sirmalloc#501), git/jj symbol slots (sirmalloc#574), model-scoped 0% quota as real zero (sirmalloc#534), custom-command output cache + timeout (sirmalloc#539), usage-percent widgets on a shared module (sirmalloc#545), hideable reset-timer placeholders (sirmalloc#542), git command timeouts (sirmalloc#559, sirmalloc#585)

Hand edits outside conflicts:
- src/widgets/shared/usage-percent-widget.ts: compat fix - pass RenderContext to getUsageProgressBarWidth (fork narrow/medium bar widths) and add fork short labels WS:/WO: that the extracted Sonnet/Opus widgets used to render; point the fable-weekly kind at the fork field weeklyFableUsage / resolveWeeklyFableUsageWindow (upstream's fableUsage / resolveFableUsageWindow do not exist in the fork and crashed the render)
- .fork-keep-deleted: drop llms.txt (points agents at the upstream package and at docs the fork deletes)

Conflict resolutions that deviate from upstream on purpose:
- src/types/Settings.ts: keep fork default flexMode full-minus-40 (upstream sirmalloc#590 switched to full)
- src/utils/terminal.ts: keep fork tmux $TMUX_PANE width probe, ported to execFileSync; upstream's CCSTATUSLINE_WIDTH override in getTerminalWidth replaces the fork copy
- src/ccstatusline.ts: keep getTerminalWidth() without the per-session width cache options (fork invariant); add upstream customCommandCacheTtlSeconds
- src/widgets/WeeklyFableUsage.ts (+ test): keep fork widget (Fable:/F: labels, 0% for accounts without Fable, weeklyFableUsage field) instead of upstream's shared-module FableWeeklyUsage
- src/utils/__tests__/usage-fetch.test.ts: adopt upstream sirmalloc#534 real-zero semantics on the fork field weeklyFableUsage
- docs/test-retirements.md: ledger entries for four tests upstream renamed or replaced (sirmalloc#542, sirmalloc#534) and one duplicate upstream test dropped
- src/utils/__tests__/usage-fetch.test.ts: compat - upstream's model-scoped real-zero test expects the fork field weeklyFableUsage
- src/widgets/__tests__/WeeklyFableUsage.test.ts: compat - set the shared suite's new required expectedWholePercentTime
- src/tui/components/__tests__/ImportPreviewDialog.test.ts: fork deviation - default flexMode is full-minus-40, so the non-default side is full
- src/utils/__tests__/usage-fetch.test.ts: drop upstream's duplicate "missing fable window" test that used the upstream-only fableUsage field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants