feat(web): home recency buckets (last hour / earlier today / yesterday / earlier this week)#256
feat(web): home recency buckets (last hour / earlier today / yesterday / earlier this week)#256mgabor3141 wants to merge 1 commit into
Conversation
|
| Filename | Overview |
|---|---|
| apps/gmux-web/src/store.ts | Replaces flat RECENT_WINDOW_MS/FLOOR/CAP constants with four recency buckets; DST is handled correctly via Date constructor for calendar boundaries; rolling weekAgo uses arithmetic (acceptable for a non-calendar window). |
| apps/gmux-web/src/home.tsx | Consumes new buckets array, maps each to a keyed Section, and updates anyActivity to use |
| apps/gmux-web/src/home-partition.test.ts | Old floor/window/cap tests replaced with bucket-boundary tests; NOW constructed from local date parts for timezone-independent calendar assertions; covers four-bucket grouping, last-hour priority, 7-day cutoff, empty-bucket omission, and within-bucket sort. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[idle-alive session] --> B{t > 0?}
B -- No --> X[dropped]
B -- Yes --> C{t >= hourAgo\nnow - 1h}
C -- Yes --> L[Last hour bucket]
C -- No --> D{t >= todayMidnight\nDate constructor}
D -- Yes --> T[Earlier today bucket]
D -- No --> E{t >= yesterdayMidnight\nDate constructor DST-safe}
E -- Yes --> Y[Yesterday bucket]
E -- No --> F{t >= weekAgo\nnow - 7x24h}
F -- Yes --> W[Earlier this week bucket]
F -- No --> X2[dropped — older than 7 days]
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
apps/gmux-web/src/home.tsx:1-5
The file-header comment still says "Three activity sections (Waiting / Active / Recent)" — "Recent" no longer exists, the count is no longer fixed at three, and the section names are now dynamic bucket labels.
```suggestion
// Home dashboard: activity-first overview of every session.
// Priority sections (Waiting / Active) are followed by recency
// buckets (Last hour / Earlier today / Yesterday / Earlier this week).
// Project configuration (add / reorder / remove) lives in Settings →
// Projects; project navigation lives in the sidebar. The home page is
// purely an overview surface.
```
Reviews (3): Last reviewed commit: "feat(web): home recency buckets (last ho..." | Re-trigger Greptile
Try this PRcurl -sSfL https://gmux.app/install-pr.sh | sh -s -- 256Built from |
e05468d to
61c1c7e
Compare
83bf5e3 to
4fc0682
Compare
|
@greptile review |
4fc0682 to
c614e25
Compare
61c1c7e to
5671994
Compare
…y / earlier this week)
c614e25 to
170d208
Compare
Closes #252.
Summary
Final slice of the home/settings restructure (#252): replace the home page's flat, capped Recent section with recency buckets, so recents can grow useful without truncation.
Changes
partitionForHomerewritten: the idle-alive remainder is grouped into ordered buckets instead of a singlerecentlist. Returns{ needsAttention, running, buckets }where each bucket is{ label, sessions }.RECENT_WINDOW_MS/RECENT_FLOOR/RECENT_CAPconstants are gone (replaced byRECENT_WINDOW_DAYS = 7).home.tsxmaps the buckets intoSections;anyActivityaccounts for buckets.Testing
NOWis built from local date parts so the calendar-boundary assertions are timezone-independent.partitionForProjecttests updated off the removedRECENT_CAP(itsrestis still uncapped/unwindowed).