101 Commits

Author SHA1 Message Date
765f692304 UI refresh Stage 5: redesign People & Locations pages
- Add badge color constants for relationships and location categories
- Compact h-16 headers with segmented filters replacing dropdowns
- Stat cards (Total, Upcoming Birthdays, With Contact Info / Categories)
- People search expanded to match name, email, and relationship
- Avatar initials with deterministic color hash on PersonCard
- Two-click delete via useConfirmAction on both entity cards
- Error toasts use getErrorMessage for meaningful messages
- Query invalidation includes dashboard and upcoming keys
- PersonForm migrated from Dialog to Sheet with Select dropdown
- LocationForm: import CATEGORIES from constants, invalidate dashboard/upcoming
- Normalize badge colors to text-*-400 pattern (was text-*-500)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 18:53:44 +08:00
4d5667a78a Fix migration 018: use DROP INDEX IF EXISTS for safety
The index may not exist if migration 017 partially failed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 04:07:51 +08:00
937118a528 Remove .claude directory from repository tracking
Local-only Claude Code context — not part of the UMBRA application.
Files remain on disk, just untracked per .gitignore.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 04:05:19 +08:00
e1e546c50c Add future roadmap and key features to CLAUDE.md
Document multi-user planning intent, reminder alerts pattern,
useConfirmAction hook, and naive datetime contract.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 04:01:59 +08:00
8aa662c096 Consolidate toast effects, extract useConfirmAction, extend index
- W3: Merge route-change and new-alert effects into single unified effect
- W6: Migration 018 extends due_lookup index with snoozed_until column
- S1: Extract useConfirmAction hook from TodoItem/ReminderItem
- S7: Update summary toast count on dismiss/snooze instead of dismissing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 04:01:50 +08:00
17f331477f Fix QA review issues: error handlers, validation, accessibility, cleanup
- C1: Add onError handlers to dismiss/snooze mutations in useAlerts
- C2: Clear snoozed_until when dismissing via update endpoint
- W1: Handle future dates in getRelativeTime
- W2+S3: Add Escape key, aria-expanded, role=menu to SnoozeDropdown
- W4: Remove redundant field_validator (Literal suffices)
- W7: Validate recurrence_rule with Literal['daily','weekly','monthly']
- S2: Clean up delete confirmation setTimeout on unmount
- S6: Cap AlertBanner height with scroll for many alerts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 03:52:28 +08:00
758e794880 Open snooze dropdown downward in AlertBanner
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 03:39:55 +08:00
0c767317ab Fix snooze dropdown clipping in toasts, add Dismiss label to banner
- SnoozeDropdown: added direction prop (up/down), toasts use 'down'
  so dropdown opens below the button instead of clipping off-screen
- AlertBanner dismiss button now shows X icon + 'Dismiss' text to
  match toast style

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 03:37:13 +08:00
6cd5b71d1c Add Dismiss label to toast button, reactivate on remind_at change
- Toast dismiss button now shows X icon + 'Dismiss' text to match
  the snooze button style
- Updating remind_at on a dismissed reminder clears is_dismissed
  and snoozed_until, making the reminder active again

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 03:31:29 +08:00
38bce21ac3 Polish toast actions and extend delete confirm timeout
- Toast: snooze/dismiss buttons side-by-side on the right, dismiss
  uses X icon, snooze shows clock icon + 'Snooze' label
- SnoozeDropdown trigger now shows text label alongside icon
- Delete confirm 'Sure?' lingers 4 seconds instead of 2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 03:24:40 +08:00
c609e374e7 Show 'Sure?' text on delete confirmation instead of silent icon change
Trash icon swaps to a red 'Sure?' label on first click, making the
two-click delete pattern discoverable. Applied to both TodoItem and
ReminderItem. Resets after 2 seconds if not confirmed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 03:16:32 +08:00
daf2a4d5f1 Fix snooze/due using container UTC instead of client local time
Docker container datetime.now() returns UTC, but all stored datetimes
are naive local time from the browser. Both /due and /snooze now
accept client_now from the frontend, ensuring snooze computes from
the user's actual current time, not the container's clock.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 03:12:31 +08:00
42e0fff40c Revert ReminderForm to single datetime-local input
Matches EventForm pattern used across UMBRA. Remind At and Recurrence
now sit side-by-side in a 2-column grid. Empty optional fields send
null instead of empty string.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 01:11:31 +08:00
89b4bd4870 Replace snooze button group with clock icon dropdown
Single clock icon opens a dropdown with 5/10/15 min options instead
of three inline buttons. Shared SnoozeDropdown component used in
both AlertBanner and toast notifications.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 01:09:17 +08:00
b7251b72c7 Address remaining QA items: index, validation, accessibility, guard
- S1: Add composite index (is_active, is_dismissed, remind_at) for
  /due query performance with multi-user scaling
- W3: Snooze endpoint rejects dismissed/inactive reminders (409)
- W4: Custom field_validator on ReminderSnooze for clear error message
- S2: aria-label on all snooze/dismiss buttons in banner and toasts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 01:02:19 +08:00
5b1b9cc5b7 Fix QA issues: single AlertsProvider, null safety, snooze cleanup
- C1: Replaced duplicate useAlerts() calls with AlertsProvider context
  wrapping AppLayout — single hook instance, no double polling/toasts
- C2: Added null guard on remind_at in Active Reminders card format()
- W2: Clear snoozed_until when dismissing a reminder
- W5: Extracted getRelativeTime to shared lib/date-utils.ts
- S3: Replaced inline SVG with Lucide Bell component in toasts
- S4: Clear snoozed_until when remind_at is updated via PUT

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 00:56:56 +08:00
b2e336ab4a Fix reminder alerts not firing and add AM/PM time picker
- Backend: /due endpoint now matches both NULL and empty string for
  recurrence_rule (form was sending '' not null, excluding all reminders)
- Form: sends null instead of '' for empty recurrence_rule
- ReminderForm: replaced datetime-local with date + hour/minute/AM-PM
  selects for 12-hour time format

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 00:50:08 +08:00
5080e23256 Add real-time reminder alerts with snooze/dismiss
- Backend: GET /api/reminders/due endpoint, PATCH snooze endpoint,
  snoozed_until column + migration
- Frontend: useAlerts hook polls every 30s, fires Sonner toasts on
  non-dashboard pages (max 3 + summary), renders AlertBanner on
  dashboard below stats row
- Dashboard Active Reminders card filters out items shown in banner

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 23:15:56 +08:00
e3ecc11a21 Redesign Reminders page to match Todos compact list pattern
- Compact h-16 header with segmented filter, search input
- Stat cards (Active/Overdue/Dismissed) with semantic colors
- New ReminderItem component: single-line rows with grouped sections
- Optimistic delete, 2-second confirm pattern, dismiss action
- Mark Stage 4 Reminders as completed in ui_refresh.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 21:40:29 +08:00
250cbd0239 Address remaining QA items: indexes, validation, UX improvements
Backend:
- [W1] Add server_default=func.now() on created_at/updated_at
- [W2] Add index on reset_at column (migration 016)
- [W7] Document weekly reset edge case in code comment

Frontend:
- [W4] Extract shared isTodoOverdue() utility in lib/utils.ts,
  used consistently across TodosPage, TodoItem, TodoList
- [W5] Delete requires double-click confirmation (button turns red
  for 2s, second click confirms) with optimistic removal
- [W6] Stat cards now reflect filtered counts, not global
- [S3] Optimistic delete with rollback on error
- [S4] Add "None" to priority segmented filter
- [S7] Sort todos within groups by due date ascending

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 21:24:59 +08:00
79b3097410 Fix QA review issues: transaction safety, validation, accessibility
Critical fixes:
- [C1] _reactivate_recurring_todos now uses flush + with_for_update
  instead of mid-request commit; get_todos commits the full transaction
- [C2] recurrence_rule validated via Literal["daily","weekly","monthly"]
  in Pydantic schemas (rejects invalid values with 422)

Warnings fixed:
- [W3] Clear due_time when due_date is set to null in update endpoint

Suggestions applied:
- [S2] Wrap filteredTodos in useMemo for consistent memoization
- [S6] Add aria-labels to edit/delete icon buttons

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 20:38:01 +08:00
cd868bd6ea Compact todo items to single-line rows, update stylesheet
- TodoItem: flatten to single-line row layout — checkbox, title,
  pills, date/reset info, actions all inline. Use hover:bg-card-elevated
  instead of bordered card with shadow.
- TodoList: tighten spacing from space-y-2 to space-y-0.5
- stylesheet.md: document list-view vs card-view convention —
  list pages use single-line rows, grid pages use multi-line cards

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 20:19:20 +08:00
66ad8902d7 Calculate recurrence schedule on todo update, not just toggle
When editing an already-completed todo to add/change recurrence or
due_date, recalculate reset_at and next_due_date so the reset info
displays immediately without needing to uncomplete and re-complete.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 20:09:42 +08:00
07cfbabcf0 Show due time in todo reset info line
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 20:05:54 +08:00
8e0af3ce86 Add optional due time to todos, fix date not being optional
Backend:
- Add due_time (TIME, nullable) column to todos model + migration 015
- Add due_time to Create/Update/Response schemas

Frontend:
- Add due_time to Todo type
- TodoForm: add time input, convert empty strings to null before
  sending (fixes date appearing required — Pydantic rejected '' as date)
- TodoItem: display clock icon + time when due_time is set

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 19:59:38 +08:00
46d4c5e28b Implement todo recurrence logic with auto-reset scheduling
Backend:
- Add reset_at (datetime) and next_due_date (date) columns to todos
- Toggle endpoint calculates reset schedule when completing recurring todos:
  daily resets next day, weekly resets start of next week (respects
  first_day_of_week setting), monthly resets 1st of next month
- GET /todos auto-reactivates recurring todos whose reset_at has passed,
  updating due_date to next_due_date and clearing completion state
- Alembic migration 014

Frontend:
- Add reset_at and next_due_date to Todo type
- TodoItem shows recurrence badge (Daily/Weekly/Monthly) in purple
- Completed recurring todos display reset info:
  "Resets Mon 02/03/26 · Next due 06/03/26"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 17:04:12 +08:00
aa6502b47b Refresh Todos page UI: compact header, stat cards, grouped list
- TodosPage: h-16 header with segmented priority filter, search, category
  dropdown, show-completed toggle, and stat cards (open/completed/overdue)
- TodoItem: hover glow, priority pills, category badges, overdue/today
  date coloring, edit + delete action buttons
- TodoList: grouped sections (overdue/today/upcoming/no date/completed)
  with section headers and EmptyState action button

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 15:13:13 +08:00
78a6ec3e99 Update CLAUDE.md and ui_refresh.md to reflect current state
CLAUDE.md:
- UI components count 12→16, list updated with Sheet, LocationPicker, etc.
- Calendar section lists all 5 components (CalendarSidebar, TemplateForm, etc.)
- Projects section lists all 8 components (KanbanBoard, TaskDetailPanel, etc.)
- Hooks section adds useCalendars
- API routes table adds /calendars, /event-templates, /weather, /locations search
- Settings description adds first day of week
- Fix ui_refresh.md authority link path, remove stale progress.md link

ui_refresh.md:
- Stage 3 additions: event template UX fixes, Sheet conversion, auto-prefill,
  template creation title, LocationPicker mount guard
- Updated current status line

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 13:58:08 +08:00
27003374e3 Fix QA review warnings: model server_default, calendar_id coercion
- EventTemplate model: add server_default=func.now() to created_at
  to match migration 011 and prevent autogenerate drift
- CalendarPage: use nullish coalescing for template calendar_id
  instead of || 0 which produced an invalid falsy ID

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 13:50:31 +08:00
f64e181fbe Fix template form: location picker auto-open and event title wording
- LocationPicker: skip initial mount effect so dropdown doesn't auto-open
  when form loads with an existing location value
- EventForm: separate templateData/templateName props from event prop so
  template-based creation shows "Create Event from X Template" title
  instead of "Edit Event", and correctly uses Create button + no Delete
- CalendarPage: pass templateName through to EventForm

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 13:10:31 +08:00
b21343601b Convert TemplateForm from Dialog to Sheet side panel
Matches the EventForm UI pattern for consistency — same slide-in panel,
same layout structure with scrollable content area and pinned footer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:58:55 +08:00
4a8c44ab80 Widen template form dialog from max-w-xl to max-w-2xl
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:51:59 +08:00
b1075d6ad4 Remove duration_minutes from event templates, auto-prefill event times
- Drop duration_minutes column from event_templates (model, schema, migration)
- Remove duration field from TemplateForm UI and TypeScript types
- EventForm now defaults start to current date/time and end to +1 hour
  when no initial values are provided (new events and template-based events)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 10:55:27 +08:00
87708ae195 Remove .claude directory from git tracking
Already in .gitignore but files were tracked from before.
Local files preserved, just untracked from the repository.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 03:13:51 +08:00
c67567e186 Resolve remaining QA suggestions: shared constants, query tuning, cleanup
- Extract duplicate statusColors/statusLabels to projects/constants.ts
- Add staleTime + select to sidebar tracked projects query to reduce
  refetches and narrow data to only id/name
- Gate TrackedProjectsWidget query on settings being loaded
- Remove unnecessary from_attributes on TrackedTaskResponse schema

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 03:10:48 +08:00
bb87bd3743 Fix issues from QA review: cache invalidation, model server_default, route comment
- Add ['tracked-tasks'] cache invalidation to toggle mutations in
  ProjectDetail and ProjectCard so dashboard widget stays fresh
- Add server_default=sa.false() to model for consistency with migration
- Add route ordering comment above /tracked-tasks endpoint

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 03:07:06 +08:00
819a4689b8 Add track project feature with sidebar nav and dashboard widget
Adds is_tracked boolean to projects, expandable tracked projects
in sidebar navigation, pin toggle on project cards/detail, and a
dashboard widget showing upcoming tasks from tracked projects.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 01:20:36 +08:00
7ae19a7cfe Add new project statuses to ProjectsWidget and ProjectCard
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 00:40:19 +08:00
b5ec38f4b8 Fix kanban subtask view, project statuses, column order
- Add blocked/review/on_hold to ProjectStatus (backend + frontend)
- ProjectForm: add new status options to dropdown
- ProjectDetail: add status colors/labels for new statuses
- KanbanBoard: reorder columns (review before completed)
- KanbanBoard: decouple subtask view from selectedTaskId via
  kanbanParentTaskId — closing task panel stays in subtask view,
  "Back to all tasks" button now works
- TaskDetailPanel: show status badge on subtask rows so kanban
  drag-and-drop status changes are visible

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 00:35:46 +08:00
3764d3e2ab Move TZ from docker-compose to .env, document in .env.example
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 00:15:24 +08:00
5c8b3f895d Fix template event creation, add location to templates, fix timestamps
- EventForm: check event?.id instead of event to decide PUT vs POST,
  fixes "unable to parse string as integer" when creating from template
- TemplateForm: add LocationPicker for setting location on templates
- docker-compose: set TZ=Australia/Perth on backend and db containers
  so datetime.now() and PostgreSQL NOW() return local time

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 19:11:48 +08:00
a144945077 Fix TS build errors: guard optional remind_at, add none priority to TodoItem
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 18:50:32 +08:00
80f3f3ed10 Calendar enhancements: scroll navigation, birthday color editing, event templates
- Add wheel scroll navigation in month view (debounced, prevents rapid scrolling)
- Allow editing color on system calendars (Birthdays) - name field disabled
- Event templates: full CRUD backend (model, schema, router, migration 011)
- Event templates: sidebar section with create/edit/delete, click to pre-fill EventForm
- Register event_templates router at /api/event-templates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 17:34:16 +08:00
a11fcbcbcc Projects enhancements: inline editing, extended statuses, subtask interactions, kanban subtask view
- Inline task editing in TaskDetailPanel (replaces sheet-based edit flow)
- Extended task statuses: blocked, review, on_hold with color maps everywhere
- Click subtasks to navigate, delete subtasks from detail pane
- Kanban shows subtasks when a task with subtasks is selected
- Subtask sorting follows parent sort mode (priority/due_date)
- Progress bar on task rows showing subtask completion
- Default due date inheritance from parent task or project
- New status options in TaskForm select dropdown

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 12:04:10 +08:00
4169c245c2 Global enhancements: none priority, optional remind_at, required labels, textarea flex, remove color picker
- Add "none" priority (grey) to task/todo schemas, types, and all priority color maps
- Make remind_at optional on reminders (schema, model, migration 010)
- Add required prop to Label component with red asterisk indicator
- Add invalid:ring-red-500 to Input, Select, Textarea base classes
- Mark mandatory fields with required labels across all forms
- Replace fixed textarea rows with min-h + flex-1 for auto-expand
- Remove color picker from ProjectForm
- Align TaskRow metadata into fixed-width columns

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 11:58:19 +08:00
bfe97fd749 Fix 5 testing bugs: priority badge width, recurring event errors, nested subtask UI, comment timestamps, close button
- Widen priority badge from w-10 to w-14 to fit "medium" text, add "none" case
- Guard against null end_datetime in event update validation
- Exclude current event from this_and_future DELETE to prevent 404
- Use Python-side datetime.now for comment timestamps (avoids UTC offset)
- Hide "Add subtask" button when viewing a subtask (prevents nested nesting)
- Add X close button to TaskDetailPanel header on desktop

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 11:53:09 +08:00
6e50089201 ProjectDetail overhaul: master-detail layout, comments, sorting, kanban
- Backend: TaskComment model + migration, comment CRUD endpoints,
  task reorder endpoint, updated selectinload for comments
- Frontend: Two-panel master-detail layout with TaskRow (compact)
  and TaskDetailPanel (full details + comments section)
- Sort toolbar: manual (drag-and-drop via @dnd-kit), priority, due date
- Kanban board view with drag-and-drop between status columns
- Responsive: mobile falls back to overlay panel on task select

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 03:22:44 +08:00
3a7eb33809 Fix unused imports in ProjectDetail
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 02:57:53 +08:00
d4ba98c6eb UI refresh: Projects pages (Phase 4)
- ProjectsPage: h-16 header, segmented pill filter, summary stat cards
- ProjectCard: sentence case, stylesheet status colors, hover glow, overdue dates
- ProjectDetail: summary progress card, compact task rows, overdue highlighting
- ProjectForm: Dialog → Sheet migration, 2-column layout, delete in footer
- TaskForm: Dialog → Sheet migration, 2-column grid layout, delete in footer

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 02:56:07 +08:00
bad1332d1b Update project docs: calendar phase complete, Stage 3 done
- ui_refresh.md: Stage 3 marked complete with full item list
- progress.md: Added Phase 8-10 milestones, updated file inventory

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 02:41:45 +08:00