Invalidate dashboard cache when leaving git/release menus#12
Merged
Conversation
The dashboard header cache (#11) reuses a render for up to 5s. The git and release menus can commit/stash/tag, so returning to the main loop could show a stale "Dirty (N)" header until the TTL expired. Invalidate the cache at the end of open_git_menu and open_release_menu so the next header re-renders fresh Git status immediately. Other, non-mutating menus keep relying on the TTL. Smoke test asserts both menus wire the invalidation on return. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Follow-up to #11
The dashboard header cache reuses a render for up to
MQ_DASHBOARD_CACHE_TTL(5s). The git and release menus can commit/stash/tag, so returning to the main loop could show a staleDirty (N)header until the TTL expired — the one correctness gap the cache left open.Fix
Call
mq_dashboard_cache_invalidateat the end ofopen_git_menuandopen_release_menu, so the nextprint_headerre-renders fresh Git status immediately on Back. Non-mutating menus keep relying on the TTL (no churn cost added).Guarded with
command -vso it's a no-op if the UI helper isn't sourced.Verification
tests/dashboard-header-cache-smoke.shextended: asserts both menus wire the invalidation on return.zsh -nclean onmqlaunch.sh; full selftest green; shell lint 108 files.🤖 Generated with Claude Code