memos/web/src/hooks
Steven 8daef1dc89 feat(activity-calendar): aggregate by ViewContext.timeBasis
Fixes the inconsistency where switching the memo list to update_time
left the activity heatmap aggregating by created_time. The heatmap
now follows the same time basis as the list it sits next to.

Backend
- UserStats gains memo_updated_timestamps (additive proto field, tag 8).
- GetUserStats and ListAllUserStats populate it alongside the existing
  memo_created_timestamps. No DB migration; memo.updated_ts already
  exists on every row.

Frontend
- useFilteredMemoStats reads timeBasis from ViewContext and selects
  the matching timestamp source.
- StatisticsView and MonthNavigator forward timeBasis through to
  MonthCalendar / YearCalendar so tooltip text matches the basis
  ("X memos in DATE" vs "X memos updated on DATE").
- Falls back to memoCreatedTimestamps when an old server returns an
  empty memoUpdatedTimestamps array (detected by length divergence,
  since protobuf-es deserializes missing repeated fields as []).

Tests
- Backend: TestGetUserStats_MemoUpdatedTimestamps verifies the field
  is populated and reflects post-creation updates.
- Frontend: filtered-memo-stats covers create/update source switching
  and the old-server fallback path; activity-calendar-tooltip covers
  basis-aware label selection.

Spec and implementation plan committed under docs/superpowers/.
2026-05-02 00:26:53 +08:00
..
index.ts refactor: replace useResponsiveWidth with useMediaQuery across components 2025-12-26 23:44:52 +08:00
useAsyncEffect.ts chore: tweak refresh button 2024-06-01 23:27:35 +08:00
useAttachmentLibrary.ts refactor(attachments): simplify the attachment library 2026-04-06 17:39:58 +08:00
useAttachmentQueries.ts refactor(attachments): simplify the attachment library 2026-04-06 17:39:58 +08:00
useCurrentUser.ts feat: react query migration (#5379) 2025-12-24 22:59:18 +08:00
useDateFilterNavigation.ts fix(web): calendar navigation should use current page path (#5605) 2026-02-09 20:40:12 +08:00
useDialog.ts chore: tweak comments 2025-11-30 13:16:02 +08:00
useFilteredMemoStats.ts feat(activity-calendar): aggregate by ViewContext.timeBasis 2026-05-02 00:26:53 +08:00
useInstanceQueries.ts feat(stats): admin instance resource statistics 2026-05-01 23:15:56 +08:00
useLiveMemoRefresh.ts fix(api): improve SSE hub design and fix double-broadcast on comments 2026-03-29 07:33:40 +08:00
useLoading.ts chore: add i18n based with useContext 2022-08-07 22:48:22 +08:00
useMediaQuery.ts chore: clean up unused imports and parameters across components 2025-12-27 10:18:38 +08:00
useMemoDetailError.ts refactor(web): consolidate SharedMemo into MemoDetail (#5773) 2026-03-24 08:40:49 +08:00
useMemoFilters.ts feat(memos): choose created or updated time for memos (#5894) 2026-04-26 11:50:26 +08:00
useMemoQueries.ts feat: render link metadata cards 2026-04-29 23:23:52 +08:00
useMemoShareQueries.ts refactor(web): consolidate SharedMemo into MemoDetail (#5773) 2026-03-24 08:40:49 +08:00
useMemoSorting.ts feat(memos): choose created or updated time for memos (#5894) 2026-04-26 11:50:26 +08:00
useNavigateTo.ts fix(web): memoize useNavigateTo to prevent infinite view transition loop 2026-02-22 13:16:59 +08:00
useTokenRefreshOnFocus.ts fix: access token refresh on web app (#5681) 2026-03-05 19:29:21 +08:00
useUserLocale.ts feat: react query migration (#5379) 2025-12-24 22:59:18 +08:00
useUserQueries.ts feat(mentions): add memo mention parsing, notifications, and rendering (#5811) 2026-04-06 22:16:53 +08:00
useUserTheme.ts feat: react query migration (#5379) 2025-12-24 22:59:18 +08:00