Repository navigation
Fix stale cache refresh for updated session files - #4
Merged
Merged
Conversation
abasiri
self-requested a review
March 15, 2026 20:53
3 tasks done
vincentbattez
referenced
this pull request
in vincentbattez/wootonpad
Jul 30, 2026
The collapse initialiser stored a function in a ref and never invoked it, so the value was always truthy and the auto-collapse-stale logic was dead. Collapse is now computed as `filter active ? expanded : override ?? stale`, with the user's toggle held in a separate override ref — so clearing a filter restores the previous arrangement instead of overwriting it. Two deliberate notes: - `_projectMatchedOnly` still wins over the filter check. AC #4 reads as "filter always expands", but name-only search matches have no matching sessions inside, so expanding them would show empty groups. - `showTodayOnly` joins the filter predicate; it was already part of `visibleItems`'s `anyFilter` but missing from the collapse check. Stale detection extracted to `src/vue/project-collapse.mjs` as a pure `isStaleProject(project, maxAgeDays, now)` and covered by unit tests.
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.
Summary
.jsonlfilesWhy
Background refresh currently keys off the project directory mtime. Appending to an existing session file updates the file mtime but usually leaves the directory mtime unchanged, so long-running sessions can keep stale ordering, message counts, titles, and search data until a new file appears or the app restarts.
Verification