Skip to content

Sidebar Counts & Local-Today

The sidebar shows per-View and per-List Task counts, computed entirely on the client from the cached data and refreshed as data changes.

  • src/lib/offline/sidebar-counts.tscomputeCounts(...) derives SidebarCounts (perView + perList); emptyPerView() / EMPTY_COUNTS are the zero state.
  • src/lib/sidebar/counts-store.ts — an observable store: getSidebarCounts(), useSidebarCounts() (React hook), _resetSidebarCounts(). The CountBadge.tsx island renders the numbers and re-renders on change.
  • Counts respect the authorization boundary and the View definitions (owned + member Lists; “Important”/“Planned”/“Assigned to me”/“My Day”; see My Day & Owner-Scoped Views).
  • src/lib/date/local-today.tslocalTodayISO(d = new Date()) returns the user’s local calendar day (YYYY-MM-DD). This is the boundary that resets “My Day” each local midnight and that “Planned”/due-date logic compares against, so day-sensitive counts and views follow the user’s timezone, not UTC (Product Brief §5.2).

Related: My Day & Owner-Scoped Views, List Sidebar & Drag-Drop, Date/Number Format Utils.