v0.42.1: statusline shows cumulative project savings (fix bare [TP])#42
Merged
Conversation
…[TP]) On screen the badge rendered a bare `[TP]` with no number. Root cause: tp-statusline.sh filtered savedTokens by the CURRENT session_id, so a fresh session (nothing saved yet) showed an empty suffix. The `27k` the user saw on top was the removed sessionTitle's PROJECT-cumulative total — a different, always-meaningful number. Fix: sum ALL savedTokens in the events log (every session), not just the current session_id. Matches what users expect — a running project total that's non-zero after first use and grows live as the statusline re-renders each frame. Dropped the now-unused session_id filter. Tests updated: the badge now counts every session (a brand-new session with no events of its own still shows the project total — exactly the bare-[TP] case). Note: the `[TP] 27k saved` still visible at the TOP of the user's screen is the OLD sessionTitle from a pre-v0.41.1 plugin still loaded in that session — it disappears on restart. This fix is for the BOTTOM statusline badge. Tests: 1349/1349 pass.
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.
On screen the badge showed bare
[TP]with no number. Root cause:tp-statusline.shfiltered savedTokens by the CURRENT session_id → a fresh session (nothing saved yet) showed an empty suffix.Fix: sum ALL savedTokens (every session) = the running project total, always meaningful after first use, grows live as the statusline re-renders. Dropped the session_id filter.
(The
[TP] 27k savedat the TOP of screen is the old sessionTitle from a pre-v0.41.1 plugin still loaded — gone on restart. This fixes the BOTTOM statusline badge.)1349/1349 tests.