feat(app): give the time window the map's presets - #574
Open
khagele wants to merge 1 commit into
Open
Conversation
The filter sheet offered 10 min, 30 min, 1 h and All time, so a hunt that ran the whole afternoon had no window that fit (efiten#557). The map already had twelve quick ranges. Both surfaces now build their lists from one file, timewindows.js, copied byte-for-byte into app/src/ and web/ and pinned in web/parity.test.js. The app's select lists 5 minutes to 7 days in ten steps plus All time. The map's quick ranges are the same ten as "Last ...", plus Today and Last 30 days, which stay map-only: one is anchored to midnight, the other reaches past the app's 7-day retention. 10 min drops in favour of 5 and 15 minutes. The default stays 30 minutes. Verified: app 900 unit tests and build, web 511 unit tests, 199 e2e with --fail-on-flaky-tests, eslint clean on both. Every new test mutation-checked. Closes efiten#557 Co-Authored-By: Claude Fable 5.1 <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.
Closes #557
The problem
The filter sheet offered four windows: 10 min, 30 min, 1 h and All time. A hunt that ran the whole afternoon had no window that fit: 1 h cut it off, All time buried it under a week of history. The map already had twelve quick ranges.
My changes in this PR
timewindows.jsholds the ten rolling windows, 5 minutes to 7 days, as{ token, label }. It is copied byte-for-byte intoapp/src/andweb/, the same shape as the other shared modules, andweb/parity.test.jspins the two copies.QUICK_RANGESis built from the same list as "Last …", with Today and Last 30 days added where they were. Nothing changes on screen; the label pin now runs through the shared file.What stays map-only, as the issue decided: Today (anchored to midnight, the app's window rolls) and Last 30 days (past the app's 7-day retention). Absolute from/to stays map-only too.
Verification
--fail-on-flaky-testsSix mutation checks, each red on exactly one test: a hand-typed label in
timerange.js, a comment edited in one copy, 30 minutes dropped (the default), 30 days added (past retention), two entries swapped, andwindowMsreturning 0 for junk.Browser, 375x812: the sheet lists the eleven options, opens on 30 minutes, and picking 3 hours marks the row active.
Overlap with open PRs
#573 moves this select into
app/src/filtersheet.js. Whichever merges second moves one block; the list and the tests are untouched by that.🤖 Generated with Claude Code