feat: default history views to a 7-day window - #13
Merged
Conversation
The 90-day retention in record_at only prunes on write, so an install that hasn't changed an association in weeks kept showing months-old rows. Apply the window on read instead, via history::recent_within. Default is 7 days across all three surfaces (Profiles HISTORY panel, menu-bar popover, `openwith history`), settable in Settings -> Behavior and via --days/--all on the CLI. Nothing is deleted: the ledger keeps its 90-day / 500-event cap, the panel offers a session-only "Show all", and undo still reads the unwindowed ledger so a hidden event stays revertible.
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.
The Profiles HISTORY panel and the menu-bar popover were showing changes from over a month ago. Root cause: the 90-day retention in
record_atonly prunes on write, so an install that hasn't changed an association in weeks never prunes at all.Fixes it by applying the window on read (
history::recent_within), and makes the window a user-facing preference.Behavior
openwith history.historyWindowDays, shared by both windows).openwith history --days Nand--all.Nothing is deleted
This is a display window, not a retention change:
undo_changeandopenwith undostill read the unwindowed ledger, so an event hidden by the window stays revertible.A "3 months" segment was considered and dropped — the ledger's own 90-day cap makes it indistinguishable from "All".
Verification
Exercised against a running app, not just a compile:
Last 7 dayswith the correct empty state; Show all round-trips the hidden rows and flips the head label.Nothing in the last 7 days.; itsstoragelistener now refetches rather than only re-rendering, so widening in the main window pulls the extra rows.1 weekactive.--allshows all 24 retained events,--days 60shows 3,--all --days 3correctly rejected.cargo fmt --check,cargo clippy --all-targets --all-features -- -D warnings,cargo test(25, +2 new), andnpm run buildall clean.Full GUI smoke-test checklist against a built bundle still pending — see the release notes below.