feat(events): add time range filter to events page - #214
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
jared | 1bd8478 | Sep 19 2026, 06:46 PM |
|
CI green (lint/typecheck/test/build). self-review clean. ready for review. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7989d32. Configure here.
|
re: cursor bugbot review #pullrequestreview-5256153084 — the one issue it flagged (time window freezing on auto-refetch) is fixed in 5a1daa7 and answered on the inline thread. no other issues outstanding. |
|
thanks bugbot — the one issue (stale/expanding time window from the memoized `from`) is fixed in 5a1daa7. `from` is now derived at fetch time inside the `useEvents` queryFn from a relative `windowSeconds`, so auto-refetches keep a sliding window. detail in the inline thread replies. |
Adds a time-range Select to the events filter bar with presets (last hour, 6 hours, 24 hours, 7 days, all time), synced to the URL via ?timeRange=. The backend GET /api/events now accepts from/to unix-second query params and filters webhook_events.created_at accordingly. Fixes #200
The from cutoff was memoized on timeRange and baked into a stable react-query key, so the 10s auto-refetch kept reusing the timestamp captured at selection time and a 'last hour' window silently widened while the page stayed open. Pass the window size instead and derive from at fetch time inside the query function, keeping the cache key stable while each refetch gets a current cutoff.
5a1daa7 to
1bd8478
Compare

adds a time-range dropdown to the events filter bar with presets (last hour, 6 hours, 24 hours, 7 days, all time), placed after the repo search and synced to the url via
?timeRange=. the backendGET /api/eventsnow acceptsfrom/tounix-second query params and filterswebhook_events.created_atserver-side.the selected range is stored as a stable token (e.g.
24h) in the url; thefromboundary is recomputed relative to now on each render so "last hour" stays accurate without polluting the url. "all time" clears the param.Testing
pnpm --filter @jared/server run test events-time-filter(4 tests, pass)pnpm tsc --noEmit(apps/server, clean)pnpm biome checkon changed files (clean)Closes #200