Skip to content

feat(app): give the time window the map's presets - #574

Open
khagele wants to merge 1 commit into
efiten:masterfrom
khagele:feat/557-time-windows
Open

feat(app): give the time window the map's presets#574
khagele wants to merge 1 commit into
efiten:masterfrom
khagele:feat/557-time-windows

Conversation

@khagele

@khagele khagele commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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

  • One list for both surfaces. timewindows.js holds the ten rolling windows, 5 minutes to 7 days, as { token, label }. It is copied byte-for-byte into app/src/ and web/, the same shape as the other shared modules, and web/parity.test.js pins the two copies.
  • App. The select is built from that list plus All time. 10 min drops in favour of 5 and 15 minutes. The default stays 30 minutes.
  • Map. QUICK_RANGES is 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.
  • Changelog entry in both copies.

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

Suite Result
app vitest 900 passed, build clean
web vitest 511 passed
web e2e, --fail-on-flaky-tests 199 passed, exit 0
eslint app + web clean

Six 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, and windowMs returning 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

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>
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.

app: the time window offers nothing between 1 hour and all time

1 participant