Skip to content

feat: My Notes panel with reordering + dashboard action-item fixes - #7

Merged
hechi merged 5 commits into
mainfrom
fix/dashboard-priorities-dedup
Oct 29, 2026
Merged

hechi merged 5 commits into
mainfrom
fix/dashboard-priorities-dedup

Conversation

@hechi

@hechi hechi commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a slide-in My Notes panel with drag-and-drop reordering, unifies the My Notes page and panel onto one shared note card, and fixes two dashboard issues that surfaced from the new flow. One linear stack of 5 commits off main; each builds on the previous.

What's included (in order)

  1. feat(notes): slide-in My Notes panel with personal-note reordering (7f7343f)
    New left-edge drawer (trigger + Ctrl+Shift+N) for personal (self-assigned) notes, alongside the existing /my-notes page. Capture, tag, inline-edit, delete, and reorder with ↑/↓ arrows. Backend: QuickNote.displayOrder (newest-on-top), a userId-scoped reorder (POST /api/v1/quick-notes/{id}/move, UP/DOWN neighbor swap), new migration V20251028120000__add_display_order_to_quick_notes.sql. Accessible dialog (role/aria, focus trap + restore, Escape, backdrop, prefers-reduced-motion).

  2. feat(notes): mouse drag-and-drop reordering (f233491)
    Native HTML5 drag-and-drop with a drop indicator, keeping the ↑/↓ arrows as a keyboard fallback. Backend gains an absolute-position reorder (POST /api/v1/quick-notes/{id}/reorder with a clamped 0-based targetIndex) for multi-position drops.

  3. refactor(notes): unify the page and panel on one shared card (ddea5d0)
    Extracts a single MyNoteCard used by both surfaces so they look and behave identically, and brings drag-and-drop + arrow reordering to the /my-notes page (active list only; disabled under the Archived filter).

  4. fix(dashboard): resolve 404 when opening a person-less TODO (5b7ee7f)
    The dashboard linked person-less (converted-note) TODOs to /action-items, which had no page. Adds the cross-person Action Items page (list + status filter + complete/cancel/delete via existing by-id endpoints), a top-nav link, and corrects ActionItem.personId to string | null.

  5. fix(dashboard): stop duplicating action items across Today's Priorities and the sections (4fecb85)
    Overdue/due-soon items appeared both in "Today's Priorities" and their own sections. Split by ownership in DashboardService: the Overdue/Due Soon sections show only person-assigned items; Today's Priorities shows only the manager's own person-less items plus self-assigned notes. Each item now appears exactly once.

Testing

  • Backend ./gradlew test → BUILD SUCCESSFUL, 1672 tests, 0 failures (domain, service, and Testcontainers integration tests for reorder/move/dedup; cross-user access returns 404).
  • Frontend jest → 129 suites / 1402 tests pass (new MyNoteCard, MyNotesPanel, ActionItemsPage suites + client tests). Feature files typecheck clean.
  • Scope: 39 files, +2971 / −373, one additive Flyway migration.

Security / data isolation

Every new query and endpoint is userId-scoped; cross-manager access to a note or action item returns 404 (integration-tested). No change to auth, and no cross-manager data boundaries crossed.

Notes for reviewers

  • The migration is additive (display_order INTEGER NOT NULL DEFAULT 0, per-user backfill by created_at); no existing migrations were modified.
  • Known small follow-ups (not blocking): page reorder operates within the current 20-item page; native DnD is mouse-only (arrows cover keyboard/touch); the cross-person Action Items card shows an owner badge but not the person's name.

hechi added 5 commits October 28, 2026 00:33
Add an accessible notes drawer that slides in from the left (left-edge trigger
or Ctrl+Shift+N), alongside the existing /my-notes page. Capture, tag, inline-edit,
delete, and reorder personal (self-assigned) notes with per-note move up/down.

Backend: QuickNote gains displayOrder (lower sorts higher) + withDisplayOrder; new
MoveDirection/MoveQuickNoteCommand and QuickNoteService.moveQuickNote swaps a note's
order with its adjacent self-assigned INBOX neighbor (userId-scoped, 404 cross-user,
no-op at edges). New self-assigned notes are placed on top; self-assigned list sorts
by displayOrder ASC, createdAt DESC. New migration adds display_order (per-user
backfill). POST /api/v1/quick-notes/{id}/move exposes the reorder.

Frontend: new MyNotesPanel (role=dialog, aria-modal, labelled title, Escape/backdrop
close, focus-in/restore, focus-trap, prefers-reduced-motion), moveQuickNote API client,
and displayOrder/MoveDirection types.

Tests: backend 1661 pass (+18); frontend 127 suites/1369 pass (+15). Docs: README +
api/ARCHITECTURE.md + PROGRESS.md updated.
Let personal notes be reordered by dragging a card and dropping it anywhere in
the list (native HTML5 drag-and-drop, no new dependency), with a live drop indicator
and a grab affordance. The up/down arrow buttons stay as a keyboard-accessible fallback.

Backend: new absolute-position reorder alongside the single-step /move swap.
ReorderQuickNoteCommand + QuickNoteService.reorderQuickNote removes the note and
reinserts it at a clamped 0-based targetIndex, renumbers the self-assigned INBOX list
contiguously, and persists only changed notes. POST /api/v1/quick-notes/{id}/reorder
(ReorderQuickNoteRequest, @min(0)); userId-scoped (cross-manager -> 404). Reuses
display_order, no schema change.

Frontend: draggable note cards (disabled while editing), drop-target styling, and
reorderQuickNote(token, id, targetIndex) API client + ReorderQuickNoteRequest type.

Tests: backend 1671 pass (+10: service top/bottom/middle/clamp/no-op/404, integration
absolute-move/clamp/negative-400/cross-user-404); frontend 127 suites/1373 pass (+4).
Docs: README + api/ARCHITECTURE.md + PROGRESS.md updated.
The /my-notes page and the slide-in side panel used two different note cards that
had drifted apart. Extract a single canonical MyNoteCard used by both so they look and
behave identically, and give the /my-notes page the same drag-and-drop + up/down
reordering the panel already had.

- New frontend/src/components/quick-notes/MyNoteCard.tsx: date, sensitive/tag/status
  badges, inline edit (text + tag), reorder (arrows + native HTML5 drag-and-drop with a
  drop indicator and grab handle), convert-to-TODO (+ due date), archive, edit, delete.
  Each action renders only when its callback is supplied.
- MyNotesPanel: drop bespoke PanelNoteCard, use MyNoteCard (now shows date/status and
  gains convert/archive actions it lacked). Panel chrome unchanged.
- /my-notes page: use MyNoteCard + drag-and-drop/arrow reordering for the active list
  (disabled under the Archived filter), wiring moveQuickNote and reorderQuickNote.
- Unify card testids to the my-note-* family; migrate panel/page tests; add MyNoteCard
  unit tests and page drag-drop/move/archived-disabled tests.

Frontend-only (reorder endpoints already exist). Verified: jest 128 suites / 1389 tests
pass; feature files typecheck clean. README + PROGRESS.md updated.
The Today's Priorities widget links a person-less action item (e.g. a note converted
to a personal TODO) to /action-items, but no page existed at that route, so the click
404'd. Create the cross-person Action Items page the link already targets.

- New frontend/src/app/action-items/page.tsx: manager-wide list of all action items
  including person-less TODOs, with a status filter (All/Open/Done/Canceled),
  pagination, and inline complete/cancel/delete. Reuses ActionItemCard.
- Add cross-person by-id client functions (getActionItemById, completeActionItemById,
  cancelActionItemById, deleteActionItemById) against the existing /action-items/{id}
  endpoints; the person-scoped helpers couldn't reach person-less items.
- Correct ActionItem.personId to string | null (person-less items are valid).
- Add an Action Items top-nav link so the page is discoverable.

Frontend-only (backend cross-person endpoints already existed). Verified: jest 129
suites / 1402 tests pass; feature files typecheck clean. README + PROGRESS.md updated.
…es and the sections

Today's Priorities unioned overdue + due-soon action items with self-assigned notes,
but the dashboard also has dedicated Overdue and Due Soon sections, so every
overdue/due-soon item appeared twice and overloaded the card.

Split by ownership in DashboardService.getDashboard: the Overdue/Due Soon sections now
list only person-assigned items (work tracked for reports), and Today's Priorities lists
only the manager's own person-less items (e.g. a converted note's TODO) plus self-assigned
notes. Each item now appears exactly once. Ranking (overdue -> due-soon -> notes) and the
cap of 7 are unchanged; all queries stay userId-scoped.

Backend-only (the frontend renders whatever the backend returns). Verified: gradle test
BUILD SUCCESSFUL, 1672 tests pass; frontend jest 129 suites / 1402 tests pass. README +
PROGRESS.md updated.
@hechi
hechi merged commit 11e28e3 into main Oct 29, 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