Repository navigation
feat(usage): let the reset timers hide their no-data placeholders - #542
Merged
Merged
Conversation
zachthedev
force-pushed
the
feat-reset-timer-hide
branch
from
August 14, 2026 23:03
f928d05 to
2f7b9bb
Compare
zachthedev
force-pushed
the
feat-reset-timer-hide
branch
2 times, most recently
from
September 3, 2026 15:21
655b912 to
f745027
Compare
Block Reset Timer and Weekly Reset Timer rendered [Loading] and the usage error placeholders with no way to turn either off, while the usage percentage widgets answer the same condition with a hideable state. Both now declare USAGE_NO_DATA_HIDEABLE_STATE and gate the whole no-window branch on it. The state is opt-in, so the default display is unchanged. aae5add is what widened this: it replaced a return null with a persistent placeholder, leaving no way back to the self-hiding behavior. Two keybinds move off 'h', which the shared hide checklist claims: - Weekly Reset Timer's '(h)ours only' becomes '(o)nly hours' - the shared '12/24 (h)our' toggle becomes '12/24 (f)ormat' The second is forced rather than cosmetic. It is offered in date mode only, so without the move the hide checklist would be unreachable there on exactly the two widgets this change gives a hide state to. Only these two widgets pass includeHourFormat, so nothing else is affected. The reservation test only called getCustomKeybinds() with no item, which sees one branch and cannot observe a mode-dependent bind. It now probes the display-mode metadata the usage and timer widgets branch on.
zachthedev
force-pushed
the
feat-reset-timer-hide
branch
from
September 4, 2026 13:58
f745027 to
8ded2fd
Compare
zachthedev
marked this pull request as ready for review
September 4, 2026 13:58
This was referenced Sep 18, 2026
Closed
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
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 #541.
Block Reset Timer and Weekly Reset Timer rendered
[Loading]and the[No credentials]family with no way to turn either off, while the usagepercentage widgets answer the same condition with a hide state. Both now declare
USAGE_NO_DATA_HIDEABLE_STATEand gate the whole no-window branch on it, so onestate covers the loading placeholder and the error text together. It is opt-in,
so nothing changes for anyone who does not enable it.
aae5add is what widened this: it replaced a
return nullwith a persistentplaceholder, leaving no way back to the self-hiding behavior.
Two keybinds move off
h, which the shared hide checklist claims:hhours onlyo(o)nly hoursusage-displayh12/24 hourf12/24 (f)ormatThe second one is forced rather than cosmetic, and it is the part worth a look.
HOUR_FORMAT_TOGGLE_KEYBINDis offered in date mode only, so an item-freegetCustomKeybinds()call never sees it. Without the move,hin date modewould toggle 12/24 instead of opening the checklist, making the state this PR
adds unreachable in that mode on exactly the two widgets it adds it to. Only
these two widgets pass
includeHourFormat, so nothing else is affected.That gap was invisible to the reservation test in #430, which called
getCustomKeybinds()with no item and therefore only ever saw one branch. It nowprobes the display-mode metadata the usage and timer widgets branch on. Putting
the toggle back on
hfails it, which is how I found the collision.oandfwere free against everything those widgets can offer (p,v,s,t,w,z,l) and against the editor's own binds (a,c,d,i,k,m,r).Tested:
bun run lintclean;bun test2072 pass, plus the oneglobal-command-resolutionfailuremainalready has on this host.