Skip to content

v0.42.1: statusline shows cumulative project savings (fix bare [TP])#42

Merged
Shahinyanm merged 1 commit into
masterfrom
v0.42.1-statusline-cumulative
Jun 5, 2026
Merged

v0.42.1: statusline shows cumulative project savings (fix bare [TP])#42
Shahinyanm merged 1 commit into
masterfrom
v0.42.1-statusline-cumulative

Conversation

@Shahinyanm
Copy link
Copy Markdown
Member

On screen the badge showed bare [TP] with no number. Root cause: tp-statusline.sh filtered 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 saved at 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.

…[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.
@Shahinyanm Shahinyanm merged commit c61b019 into master Jun 5, 2026
@Shahinyanm Shahinyanm deleted the v0.42.1-statusline-cumulative branch June 5, 2026 12:50
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.

1 participant