Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions PROGRESS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
# PROGRESS.md

## Last Updated
2026-11-09T17:00:00Z — Follow-up on button sizing (`feat/unify-notes-and-action-items`). Identical padding was not enough: action item labels contain emoji (✎ 🗑 ✓ ✕) which render in a fallback font and made those buttons taller than the plain-text note buttons, and the due-date input had its own padding. Shared `ITEM_CONTROL_SIZE` (fixed 28px height, `line-height: 1`, border-box, inline-flex, nowrap) now backs every button and the due-date input; note labels got matching icons (✎ Edit, 🗑 Delete, 📥 Archive). `ItemButtonConsistency.test.tsx` now also compares height/line-height/box-sizing/display/white-space and includes the ↑/↓ arrows and the date input. Frontend jest 130 suites / 1430 tests pass. Could NOT verify visually: the app sits behind OIDC sign-in and I had no session, so the real rendering is unchecked.

## Previously Updated
2026-11-09T16:00:00Z — UI consistency on `feat/unify-notes-and-action-items`. Frontend-only, TDD. (1) Action Item buttons had a different size/radius than the note buttons: extracted `components/ui/itemButtonStyle.ts` (padding `4px 10px`, small radius, mono caption; variants default/muted/primary/success/danger) and used it in both `MyNoteCard` and `ActionItemCard`, so My Notes, the side panel and Action Items match. (2) The "My action items" section on `/my-notes` only had Complete; it now also has Cancel and Delete (same by-id endpoints as `/action-items`). New `ItemButtonConsistency.test.tsx` asserts identical size props across all 9 buttons; 2 new MyNotesPage tests for cancel/delete. Not checked visually in a browser.

## Previously Updated
2026-11-09T14:00:00Z — Bugfix on `feat/unify-notes-and-action-items`: three regressions reported after the notes/action-items unification. TDD.

1. **Drag-drop reorder broken** — root cause: My Notes defaulted to the *All* filter, so the list included DONE/CONVERTED/ARCHIVED notes while the backend `reorder` renumbers only the INBOX ordering; the drop index no longer matched. Fix: default filter is now **Active (INBOX)**, and reordering is enabled only when `statusFilter === 'INBOX'` and no tag filter is active (a tag-filtered subset has the same index mismatch).
2. **Tags disappeared on "Make action item"** — action items had no tag. Fix: new `action_items.tag` column (migration `V20261109120000`, backfilled from the originating note), `ActionItem.tag`, carried over in `QuickNoteService.convertQuickNote`, exposed in `ActionItemResponse`, rendered as a chip on `ActionItemCard`.
3. **Notes shown twice** — a converted note stayed in the Notes list (All filter) while its action item showed under My action items. Fixed by the Active default above; *All* still shows converted notes on purpose.

**Verification:** Backend `./gradlew test` → BUILD SUCCESSFUL, **1679 tests, 0 failures** (+1: tag carried over on convert; the Testcontainers integration tests apply the new migration). Frontend `jest` → **129 suites / 1426 tests pass** (+5: default Active filter, no reorder under All / tag filter, tag chip on action item). Not verified in a browser (drag-drop re-checked via unit tests only; jsdom drag events).

## Previously Updated
2026-11-09T12:00:00Z — Feature: **unify Notes / My Notes / Action Items flow** on branch `feat/unify-notes-and-action-items`. User feedback: the three surfaces didn't feel like one flow, "Convert to TODO" felt like converting to an action item, notes couldn't be completed, and Action Items didn't separate "mine" from "my reports'". TDD throughout.

**Backend:** new `QuickNoteStatus.DONE`; `QuickNote.complete()` (INBOX only), `CompleteQuickNoteCommand`, `QuickNoteService.completeQuickNote` (userId-scoped via `findByIdAndUserId`, 404 on foreign notes), `POST /api/v1/quick-notes/{id}/complete`. No migration needed (`status` is an unconstrained VARCHAR).

**Frontend:** `MyNoteCard` gets a green `✓ Complete` button (same look as Action Item), "Convert to TODO" → "→ Make action item", friendly status labels (Note/Done/Action item/Archived), strikethrough for DONE. `/my-notes` has **Notes** and **My action items** sections (own OPEN items only, completable) plus a Done filter; side panel gets Complete. `/action-items` has **Mine / My team** tabs with counts, team items grouped by person name (names resolved via `listPersons`, so no new backend field was needed). `ActionItemCard` shows "You" / person name, "re: name", and a "📝 from note" badge. New client fn `completeQuickNote`.

**Known limits:** the tab split is client-side over the first 100 items (pagination on `/action-items` removed); person names resolve for the first 100 persons. Side panel intentionally does not show action items yet (per user).

**Verification:** Backend `./gradlew test` → **BUILD SUCCESSFUL, 1678 tests, 0 failures** (+6: domain `complete()` x2, service x2, controller x2). Frontend `jest` → **129 suites / 1421 tests pass** (+19). `tsc` shows no errors in touched files (remaining errors are the pre-existing settings/PdpGoal ones). README feature bullet + endpoint table updated. Not verified: visual check in a browser (layout/styling was not eyeballed).

## Previously Updated
2026-10-29T09:15:00Z — Bugfix: **dashboard duplication between "Today's Priorities" and the Overdue/Due Soon sections** on branch `fix/dashboard-priorities-dedup` (from `fix/action-items-page-404`). The priorities card unioned overdue + due-soon action items + self-assigned notes, but the dashboard also has dedicated Overdue and Due Soon sections, so every overdue/due-soon item showed up **twice** and overloaded the card. Per the user's preference, the split is now by ownership: priorities = **the manager's own** work, sections = **work tracked for reports**. Backend-only change (the frontend renders whatever the backend returns). TDD.

**Change (`DashboardService.getDashboard`):** overdue and due-soon action items are partitioned by `personId`. The `overdueActionItems` / `dueSoonActionItems` lists (the dedicated sections) now contain **person-assigned items only** (`personId != null`). "Today's Priorities" (`todayPriorities`) now contains **person-less items only** (`personId == null`, a manager's own TODO — e.g. a converted note) in the order person-less-overdue → person-less-due-soon → self-assigned INBOX notes, still capped at 7. Net effect: each action item appears in exactly one place; the card is no longer overloaded and surfaces only what the manager can act on directly. No change to stale-1:1s / anniversaries. The `TodayPriorityItem.personId`/`personName` for action-item rows are now always null (person-less), which is fine — the frontend already links those rows to `/action-items`. All queries remain `userId`-scoped.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ CrewCaptain is feature-rich. The full list is grouped below — expand each area
- **Kudos / Recognition** — Record positive feedback and achievements per person with date, Markdown text, and optional tags (e.g., "impact", "collaboration"). Full frontend with Kudos tab on person detail, inline create form, and delete. Immutable entries (create + delete only).
- **Quick Notes (Inbox)** — Global quick capture for thoughts, follow-ups, and observations. Notes can be unassigned (inbox), assigned to a person, or self-assigned (personal notes for the manager). Status workflow: INBOX → ATTACHED (to 1:1) / CONVERTED (to action item) / ARCHIVED. Supports a sensitive flag and an optional **tag** (≤30 chars) for organizing and filtering notes (`GET /api/v1/quick-notes?tag=…`). Self-assigned notes are accessible via "My Notes" in the user menu. Invariant: a note cannot be both self-assigned and assigned to a person — assigning to a person clears the self-assigned flag. Full frontend with dedicated Quick Notes page, My Notes page, status filter, and inline create form. Both the manager Quick Notes inbox and the My Notes page render a tag chip on tagged notes and support **inline edit** of a note's text and tag (via `PUT /api/v1/quick-notes/{id}`). **Quick Note Overlay** — Global floating overlay accessible from any page via `Ctrl+Shift+Q` or the floating action button (bottom-right). Cyberpunk glassmorphism design with neon glow fade-in animation, scan-line texture, and slide-up entrance. Supports `Ctrl+Enter` to save. Auto-closes after successful capture. Dismissible via Escape, backdrop click, or cancel button. Respects `prefers-reduced-motion`.
- **My Notes inbox & triage** — The "My Notes" page is a triage inbox for self-assigned notes: inline **tag chips** and a tag filter row, inline **edit** of a note's text and tag, **reorder** via **mouse drag-and-drop** or per-note **move up / move down** arrows (active list only — disabled under the Archived filter), plus per-note actions to **convert to a personal TODO** (with an optional due date), archive, or delete. Editing posts to `PUT /api/v1/quick-notes/{id}` (text + tag; sending `updateTag` clears a tag). Converting a note posts to `POST /api/v1/quick-notes/{id}/convert` — the body accepts an optional `personId` (omit it to create a person-less TODO owned by the manager) and an optional `dueDate`, so a captured thought becomes a tracked, dated action item in one click and flows onto the dashboard. The resulting action item keeps an `originatingQuickNoteId` backlink to the note it was converted from. The page and the slide-in side panel render the **same note card component** (`MyNoteCard`), so they look and behave identically everywhere.
- **Notes → action items flow (unified)** — Notes, the side panel and Action Items now share one vocabulary. A note is something to remember: it can be **completed** (`✓ Complete`, new `DONE` status, `POST /api/v1/quick-notes/{id}/complete`), archived, or **made an action item** (`→ Make action item`, formerly "Convert to TODO"). Converted notes stay visible (status shown as "Action item") and the resulting action item carries a "📝 from note" badge. The **My Notes** page has two sections: **Notes** (with an extra *Done* filter) and **My action items** (your own open items, completable inline). The **Action Items** page has two tabs: **Mine** (items you own) and **My team** (items owned by reports, grouped by person name); cards show "You" vs the person's name, and "re: <name>" for your items about a report. The tabs are split client-side on `ownerType` from the first 100 items of the manager-wide list. My Notes defaults to the **Active** filter so a note that became an action item appears only under "My action items" (the *All* filter still shows converted notes), and the note's **tag is copied onto the action item** (`action_items.tag`, shown as a chip). Drag-and-drop / arrow reordering is only available on the unfiltered Active list (not under All, Done, Archived or a tag filter), because the backend renumbers the full active ordering. All item buttons (Complete, Make action item, Archive, Edit, Cancel, Delete) share one size and shape via `components/ui/itemButtonStyle.ts`, and the "My action items" section on My Notes supports the same Complete / Cancel / Delete actions as the Action Items page.
- **My Notes side panel (slide-in)** — An accessible notes drawer that **slides/fades in from the left**, available on any page via a left-edge "NOTES" tab or `Ctrl+Shift+N`, alongside (not replacing) the full My Notes page. It lists your personal (self-assigned) notes and lets you capture, **tag**, inline-**edit**, delete, and **reorder** notes. Reordering works two ways: **drag-and-drop** with the mouse (native HTML5 DnD — grab a card and drop it anywhere in the list, with a live drop indicator) and per-note **move up / move down** arrow buttons that remain as a keyboard-accessible fallback. Personal notes default to **newest-on-top** and persist a manual order: each note carries a `displayOrder` (lower sorts higher) and new notes are inserted above the current top. The arrows do a single-step neighbor swap via `POST /api/v1/quick-notes/{id}/move` (`{"direction":"UP"|"DOWN"}`); a drag-drop drop sets an absolute position via `POST /api/v1/quick-notes/{id}/reorder` (`{"targetIndex":<0-based>}`, clamped into range) which renumbers the affected notes. Both are user-scoped (a cross-manager note returns 404). The panel renders the **same `MyNoteCard`** as the full My Notes page (identical look and actions — drag-drop, arrows, convert, archive, edit, delete). The panel is a `role="dialog"` with `aria-modal`, a labelled title, Escape-to-close, backdrop dismissal, focus moved into the panel on open and restored to the trigger on close, and a slide animation that respects `prefers-reduced-motion`.
- **Strategy Hub** — Strategic layer for managers to define high-level objectives and visualize team PDP goal alignment. Create strategy goals with title, description, target date, and sensitive flag. Link PDP goals to strategy goals to track alignment. Alignment scoring shows percentage of active PDP goals contributing to each strategy goal. Gap analysis panel highlights unlinked PDP goals and strategy goals without contributors. Full CRUD with status transitions (ACTIVE → ACHIEVED/DROPPED). AES-256-GCM encryption for sensitive strategy goals. Full-text search integration with GIN index. Comprehensive audit logging for all CRUD and link/unlink operations.

Expand Down Expand Up @@ -628,6 +629,7 @@ All endpoints require `Authorization: Bearer <jwt>` **except** the two public en
| POST | `/api/v1/quick-notes/{quickNoteId}/attach` | Attach to a 1:1 entry |
| POST | `/api/v1/quick-notes/{quickNoteId}/convert` | Mark as converted (to action item) |
| POST | `/api/v1/quick-notes/{quickNoteId}/archive` | Archive the quick note |
| POST | `/api/v1/quick-notes/{quickNoteId}/complete` | Mark the note done (INBOX → DONE) |
| POST | `/api/v1/quick-notes/{quickNoteId}/move` | Reorder a personal note up/down |
| POST | `/api/v1/quick-notes/{quickNoteId}/reorder` | Drag-drop a personal note to an index|

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class ActionItemEntity(
@Column(name = "originating_quick_note_id")
var originatingQuickNoteId: UUID? = null,

@Column(name = "tag", length = 30)
var tag: String? = null,

@Column(name = "snoozed_until")
var snoozedUntil: Instant? = null,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class JpaActionItemRepositoryAdapter(
status = ActionItemStatus.valueOf(this.status),
originatingEntryId = this.originatingEntryId?.let { OneOnOneEntryId(it) },
originatingQuickNoteId = this.originatingQuickNoteId?.let { QuickNoteId(it) },
tag = this.tag,
snoozedUntil = this.snoozedUntil,
createdAt = this.createdAt,
updatedAt = this.updatedAt
Expand All @@ -163,6 +164,7 @@ class JpaActionItemRepositoryAdapter(
status = this.status.name,
originatingEntryId = this.originatingEntryId?.value,
originatingQuickNoteId = this.originatingQuickNoteId?.value,
tag = this.tag,
snoozedUntil = this.snoozedUntil,
createdAt = this.createdAt,
updatedAt = this.updatedAt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@ class QuickNoteController(
return ResponseEntity.ok(QuickNoteResponse.from(quickNote))
}

@PostMapping("/quick-notes/{quickNoteId}/complete")
fun completeQuickNote(
@PathVariable quickNoteId: UUID
): ResponseEntity<QuickNoteResponse> {
val userId = AuthenticatedUser.getUserId()
val command = CompleteQuickNoteCommand(userId = userId, quickNoteId = QuickNoteId(quickNoteId))
val quickNote = quickNoteCommandPort.completeQuickNote(command)
return ResponseEntity.ok(QuickNoteResponse.from(quickNote))
}

@PostMapping("/quick-notes/{quickNoteId}/move")
fun moveQuickNote(
@PathVariable quickNoteId: UUID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ data class ActionItemResponse(
val status: ActionItemStatus,
val originatingEntryId: UUID?,
val originatingQuickNoteId: UUID?,
val tag: String?,
val snoozedUntil: Instant?,
val createdAt: Instant,
val updatedAt: Instant
Expand All @@ -33,6 +34,7 @@ data class ActionItemResponse(
status = item.status,
originatingEntryId = item.originatingEntryId?.value,
originatingQuickNoteId = item.originatingQuickNoteId?.value,
tag = item.tag,
snoozedUntil = item.snoozedUntil,
createdAt = item.createdAt,
updatedAt = item.updatedAt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ class QuickNoteService(
description = if (existing.text.length > 500) existing.text else null,
ownerType = ActionItemOwnerType.MANAGER,
dueDate = command.dueDate,
originatingQuickNoteId = existing.id
originatingQuickNoteId = existing.id,
tag = existing.tag
)
actionItemRepository.save(actionItem)

Expand All @@ -188,6 +189,12 @@ class QuickNoteService(
return quickNoteRepository.save(updated)
}

override fun completeQuickNote(command: CompleteQuickNoteCommand): QuickNote {
val existing = quickNoteRepository.findByIdAndUserId(command.quickNoteId, command.userId)
?: throw QuickNoteNotFoundException(command.quickNoteId)
return quickNoteRepository.save(existing.complete())
}

override fun deleteQuickNote(command: DeleteQuickNoteCommand) {
val deleted = quickNoteRepository.deleteByIdAndUserId(command.quickNoteId, command.userId)
if (!deleted) throw QuickNoteNotFoundException(command.quickNoteId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ data class ArchiveQuickNoteCommand(
val quickNoteId: QuickNoteId
)

data class CompleteQuickNoteCommand(
val userId: UserId,
val quickNoteId: QuickNoteId
)

data class DeleteQuickNoteCommand(
val userId: UserId,
val quickNoteId: QuickNoteId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface QuickNoteCommandPort {
fun attachQuickNote(command: AttachQuickNoteCommand): QuickNote
fun convertQuickNote(command: ConvertQuickNoteCommand): QuickNote
fun archiveQuickNote(command: ArchiveQuickNoteCommand): QuickNote
fun completeQuickNote(command: CompleteQuickNoteCommand): QuickNote
fun deleteQuickNote(command: DeleteQuickNoteCommand)
fun moveQuickNote(command: MoveQuickNoteCommand): QuickNote
fun reorderQuickNote(command: ReorderQuickNoteCommand): QuickNote
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/kotlin/com/peoplemanager/domain/ActionItem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ data class ActionItem(
val status: ActionItemStatus = ActionItemStatus.OPEN,
val originatingEntryId: OneOnOneEntryId? = null,
val originatingQuickNoteId: QuickNoteId? = null,
/** Tag carried over from the originating note, so it stays visible after "make action item". */
val tag: String? = null,
val snoozedUntil: Instant? = null,
val createdAt: Instant = Instant.now(),
val updatedAt: Instant = Instant.now()
Expand Down
7 changes: 7 additions & 0 deletions api/src/main/kotlin/com/peoplemanager/domain/QuickNote.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ data class QuickNote(
return copy(status = QuickNoteStatus.CONVERTED, updatedAt = Instant.now())
}

fun complete(): QuickNote {
require(status == QuickNoteStatus.INBOX) {
"Can only complete a quick note with status INBOX, current status is $status"
}
return copy(status = QuickNoteStatus.DONE, updatedAt = Instant.now())
}

fun archive(): QuickNote {
require(status == QuickNoteStatus.INBOX) {
"Can only archive a quick note with status INBOX, current status is $status"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ value class QuickNoteId(val value: UUID) {
}

enum class QuickNoteStatus {
INBOX, ATTACHED, CONVERTED, ARCHIVED
INBOX, ATTACHED, CONVERTED, ARCHIVED, DONE
}

@JvmInline
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- Carry a note's tag over to the action item made from it, so the tag is not lost on
-- "make action item". Mirrors quick_notes.tag (max 30 chars).
ALTER TABLE action_items ADD COLUMN tag VARCHAR(30);

-- Backfill items that were already made from a tagged note.
UPDATE action_items a
SET tag = q.tag
FROM quick_notes q
WHERE a.originating_quick_note_id = q.id
AND q.tag IS NOT NULL;
Loading
Loading