Skip to content

Inbox: Recent activity shows the last 3 hours - #4098

Merged
backnotprop merged 2 commits into
mainfrom
fix/recent-view-three-hours
Nov 26, 2026
Merged

backnotprop merged 2 commits into
mainfrom
fix/recent-view-three-hours

Conversation

@backnotprop

@backnotprop backnotprop commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

The owner wants the Inbox's Recent activity view to cover the last three hours instead of the last 30 days.

What changed

  • Before, one constant (INBOX_RECENT_ACTIVITY_DAYS = 30) set both what the view shows and what the store keeps. There are now two, in core inbox-types.ts:
    • INBOX_RECENT_ACTIVITY_HOURS = 3: how far back the view reaches. The window reads it as RECENT_ACTIVITY_HOURS in listFilterRecent.ts.
    • INBOX_ACTED_KEPT_DAYS = 30: how long acted.json keeps a time (shared inbox/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.
  • Words a person sees: the empty line "Nothing you acted in during the last month." is now "Nothing you acted in during the last 3 hours." No other visible words mentioned the window.
  • Doc changes: inbox-window.md (the span, the empty line, the age rule, the store's 30 days) and inbox-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.ts passed Date.now() to recentViewSections). 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 in useActedKeys at 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 real useListShown, 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.

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 backnotprop added the ci:e2e Run the full browser suite (Inbox window e2e) on this PR label Nov 26, 2026
@backnotprop
backnotprop marked this pull request as ready for review November 26, 2026 15:41
@backnotprop
backnotprop merged commit ff6bc84 into main Nov 26, 2026
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:e2e Run the full browser suite (Inbox window e2e) on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant