Skip to content

feat(dashboard): add Today's Priorities focus widget - #6

Merged
hechi merged 1 commit into
mainfrom
feat/dashboard-today-priorities
Oct 20, 2026
Merged

hechi merged 1 commit into
mainfrom
feat/dashboard-today-priorities

Conversation

@hechi

@hechi hechi commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a single ranked "Today's Priorities" focus card at the top of the manager dashboard. It answers one question at a glance — what are the most important things I need to handle today? — by unifying the manager's most pressing items into one ordered list instead of leaving them spread across separate sections.

Motivation

The dashboard already surfaced overdue items, due-soon items, stale 1:1s, and anniversaries as separate panels, and self-assigned quick notes lived only in My Notes. There was no single "start here" view. This widget consolidates the time-sensitive, actionable items into one ranked list so nothing important gets lost.

What's included

Backend — /api/v1/dashboard now returns a pre-ranked todayPriorities list:

  • Unions three sources: overdue action items, due-soon action items, and the manager's self-assigned INBOX quick notes.
  • Ranked overdue → due-soon → notes, capped at 7.
  • Each item carries a kind (OVERDUE / DUE_SOON / INBOX_NOTE), title, nullable person, and nullable due date.
  • Reuses the already-computed overdue/due-soon data; adds a QuickNoteRepository dependency to DashboardService for the notes source.

Frontend — a read-only TodayPriorities widget, placed first in the dashboard grid:

  • Rows colored by urgency (overdue = alert, due-soon = warning, note = accent), with a due date for action items and an empty state.
  • Each row links to where you act: the person's page for person-scoped action items, /my-notes for notes.
  • Consistent with the existing dashboard card pattern; read-only with links (matches the other widgets).

Scope / design notes

  • Read-only by design, for consistency with the existing dashboard widgets. Inline complete/snooze is a possible future follow-up across all widgets, not in this PR.
  • Pinned "Remember" items were intentionally excluded — they're per-person sticky-note context, not time-bound priorities, so mixing them in would dilute the list.

Security

  • Every source query is userId-scoped (the self-assigned notes query scoping is unit-tested). No new write endpoints — the widget only reads.

Testing

  • Backend: ./gradlew test → 1643 tests pass, 0 failures. New DashboardServiceTest.TodayPrioritiesTests covers empty state, inbox-note mapping, ranking order, cap-at-7, person details, and userId scoping; DashboardControllerTest gains a populated-section test plus an empty-section assertion.
  • Frontend: jest → 126 suites / 1354 tests pass. New TodayPriorities.test.tsx; dashboard-page assertions extended.

Notes for reviewers

  • Folded in a small correctness fix: the frontend DashboardActionItem type's personId/personName were still non-null and out of sync with the backend (person-less TODOs); widened to nullable.
  • One existing dashboard-page test was scoped with within(...) because an item title can now legitimately appear in both the Priorities widget and the Overdue section.
  • Branched from main (which already contains the merged My Notes / quick-note-tags / person-less-TODO work), so this PR is independent of that one.
  • Pre-existing tsc drift on main (unrelated fixtures) is untouched and doesn't affect npm test.

A single ranked focus card leads the dashboard, unifying the manager's
most pressing items into one list.

- DashboardData.todayPriorities (PriorityKind: OVERDUE/DUE_SOON/INBOX_NOTE)
- DashboardService ranks overdue + due-soon action items + self-assigned
  INBOX quick notes (that order), capped at 7, all userId-scoped
- Exposed on /api/v1/dashboard as todayPriorities
- Read-only TodayPriorities widget, first in the dashboard grid, each row
  linking to where you act (person page / my-notes)
- Widen frontend DashboardActionItem person fields to nullable (backend parity)

Backend: 1643 tests pass. Frontend: 1354 tests pass.
@hechi
hechi merged commit dc76ee1 into main Oct 20, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant