Repository navigation
Inbox: Recent activity shows the last 3 hours - #4098
Merged
Merged
Conversation
The owner asked for the Recent activity view to reach back three hours. INBOX_RECENT_ACTIVITY_DAYS = 30 becomes INBOX_RECENT_ACTIVITY_HOURS = 3, used by the window's view and by acted.json's pruning; the empty line now says "Nothing you acted in during the last 3 hours." With a three-hour line a row can now age out while the person looks at the list. The view read its rows at each redraw's clock, so a row acted in 2 h 59 min ago left under the pointer at the next list read. It now reads them at the clock of the last whole sort, as it already does for which rows come in, so such a row stays until the list settles.
What the view shows and what the store keeps were one constant, so the 3-hour view also pruned acted.json to 3 hours, losing the person's history if the reach widens again. INBOX_ACTED_KEPT_DAYS = 30 now sets acted.json's retention; INBOX_RECENT_ACTIVITY_HOURS = 3 sets only the view. A test guards that a 5-hour-old act stays stored but unshown.
backnotprop
marked this pull request as ready for review
November 26, 2026 15:41
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 owner wants the Inbox's Recent activity view to cover the last three hours instead of the last 30 days.
What changed
INBOX_RECENT_ACTIVITY_DAYS = 30) set both what the view shows and what the store keeps. There are now two, in coreinbox-types.ts:INBOX_RECENT_ACTIVITY_HOURS = 3: how far back the view reaches. The window reads it asRECENT_ACTIVITY_HOURSinlistFilterRecent.ts.INBOX_ACTED_KEPT_DAYS = 30: how long acted.json keeps a time (sharedinbox/acted.ts). It is longer than the view on purpose, so the view's reach can change later without losing the record. Retention is unchanged from main.inbox-window.md(the span, the empty line, the age rule, the store's 30 days) andinbox-foundation.md(acted.json's 30 days and why).Rows no longer leave under the pointer
Before this change, the view applied the age rule on every redraw at that redraw's time (
useListView.tspassedDate.now()torecentViewSections). With a 30-day span nobody noticed. With 3 hours, a row acted in 2 h 59 min ago would disappear under the pointer at the next list read. The view now applies the age rule at the time of the last whole sort (RecentActivity.at, taken inuseActedKeysat each whole sort). That is how the view already decides which rows come in, so a row that ages out stays until the list settles.Tests
packages/inbox/listFilterRecent.test.ts: just inside (2 h 59 min), just outside (3 h 1 min), exactly 3 h, yesterday, never; an act this window saw (noteActedHere) counts and one past 3 h does not.packages/inbox/listRecentView.test.tsx(DOM): through the realuseListShown, a row at 2 h 59 min stays through a list read 2 minutes later and leaves at the next whole sort. This test fails without the fix.packages/shared/inbox/store-acted.test.ts: 30-day retention as on main, plus a new test that an act 5 hours old stays in acted.json but the view's rule (rowRecentlyActed) does not show it. With the store pruned at 3 hours this test fails.packages/inbox/listRecentHolds.test.tsx: the harness now passes the sort's time, as App does.No mobile contract change: neither constant is in the wire contract.