Commit Graph
1545 Commits
Author SHA1 Message Date
g-butandClaude Sonnet 4.6 325bb57fb1 refactor(utils): derive RelationshipHealth type from RELATIONSHIP_HEALTH_VALUES const
Previously the type was defined separately from any runtime value, so VALID_HEALTH
in the API route had to manually list the same values. Now the type is derived from
the const array, which is the SSOT. Adding a new health status requires one file change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:19:10 +02:00
g-butandClaude Sonnet 4.6 d2ae0d33ea feat(projects): delete attrs in ProjectDetail
AttrRow now has a trash icon (group-hover reveal) that calls
DELETE /api/projects/[id]/attrs and reloads the panel.
Matches the delete capability in PersonDetail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:14:31 +02:00
g-butandClaude Sonnet 4.6 5f9a0d9dca feat(people): delete generic attrs in PersonDetail
Add trash icon to attr edit mode in DetailAttrs — visible when editing a row,
calls DELETE /api/people/[id]/attrs and updates lifted attrs state immediately.
Matches the delete capability already in ChannelsSection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:13:22 +02:00
g-butandClaude Sonnet 4.6 1f0e2c60f9 fix(money): show '— CHF' for subscriptions with no amount set
Previously null amount rendered as nothing, making the row look broken.
Now shows a dimmed dash with the currency code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:09:47 +02:00
g-butandClaude Sonnet 4.6 4c5b6e73ac fix(money): correctly track EUR/GBP in monthly burn calculation
EUR and GBP subscriptions were being bucketed into the USD total.
Now each currency is tracked separately in MonthlyBurn.
Monthly Burn stat card shows all non-zero currency totals.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:04:08 +02:00
g-butandClaude Sonnet 4.6 6323676a1b feat(channels): add phone, in-person, other to CHANNEL_CONFIG
Previously these 3 channel types fell back to MessageCircle (the WhatsApp icon),
making them visually identical to WhatsApp. Now each has a distinct icon.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:01:13 +02:00
g-butandClaude Sonnet 4.6 0e1c6b771b fix(money): add paymentMethod to subscription edit form
Destructure paymentMethod prop properly and add its input field
to the inline edit form alongside amount/currency/notes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:00:20 +02:00
g-butandClaude Sonnet 4.6 0ed51bb776 feat(money): inline edit amount/currency/notes on subscriptions
- PATCH /api/subscriptions/[id] now also accepts name, vendor, paymentMethod
- SubscriptionActions gets an "Edit" button revealing an inline form for amount, currency, notes
- Amount and currency update immediately after save via router.refresh()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:57:07 +02:00
g-butandClaude Sonnet 4.6 8f3e207f6b feat(people): health-status filter chips on People page
Add multi-select filter chips (Active / Fading / Stale / Unknown) above the people grid.
Filters are OR-combined server-side via HAVING on last_interaction date thresholds,
so pagination works correctly across all 1,286 contacts.

Security: user search query stays parameterized via Drizzle sql tagged template;
health values come from validated RelationshipHealth enum (no injection surface).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:52:34 +02:00
g-butandClaude Sonnet 4.6 c3a570926b feat(goals): collapse completed goals section by default
Add CompletedGoals client component — starts collapsed, expands on click.
Completed goals are done; they shouldn't dominate the view on page load.
Header shows count so user knows how many are hidden.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:47:21 +02:00
g-butandClaude Sonnet 4.6 7046fc9456 feat(people): add/delete channel attrs in PersonDetail
- Switch Channels section to read from lifted `attrs` state (was `data.attrs`) so newly added channels appear immediately without a full reload
- Add ChannelsSection component with inline "Add channel" form: channel-type select + value input, saves to /api/people/[id]/attrs with key `channel:<type>`
- Per-channel delete via X button (group-hover reveal), calls DELETE /api/people/[id]/attrs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:45:24 +02:00
g-butandClaude Sonnet 4.6 cb6aeea0ec refactor(money): NewSubscriptionButton imports VALID_CURRENCIES/FREQUENCIES from config — third duplicate removed
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:39:43 +02:00
g-butandClaude Sonnet 4.6 7c732882dc refactor(money): extract VALID_FREQUENCIES/CURRENCIES to config/subscriptions — remove duplicate definitions
Both subscription route files defined the same constants. Moved to the
existing config/subscriptions.ts which is already the SSOT for subscription metadata.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:38:59 +02:00
g-butandClaude Sonnet 4.6 1fa35028d5 fix(goals): use Check icon for description save — Plus rotated 45° looked like X/close
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:35:52 +02:00
g-butandClaude Sonnet 4.6 347a2588a2 feat(projects): rename project — PATCH /api/projects/[id] name + click-to-edit title in ProjectDetail
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:32:18 +02:00
g-butandClaude Sonnet 4.6 5b5a9aa1ca feat(people): rename person — PATCH /api/people/[id] name + click-to-edit h2 in PersonDetail
Clicking the person's name in the detail panel opens an inline input.
Enter/blur saves, Escape cancels. 409 returned on duplicate name conflict.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:30:33 +02:00
g-butandClaude Sonnet 4.6 24b22467f4 refactor(people): extract HEALTH_DOT_COLOR to lib/utils — remove duplicate definitions
Same mapping was defined independently in PersonCard and PersonDetail.
Extracted to lib/utils.ts alongside deriveRelationshipHealth (its SSOT).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:28:07 +02:00
g-butandClaude Sonnet 4.6 1a9e2fb4fc feat(money): mark subscription as paid — PATCH /api/subscriptions/[id] + advance nextDue by billing period
"Mark paid" button advances nextDue by 1 month/quarter/year/week based on
frequency, then refreshes the page. One-time and cancelled subs excluded.
PATCH endpoint also supports updating amount, notes, currency, frequency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:25:22 +02:00
g-butandClaude Sonnet 4.6 5c3a1681a8 feat(goals): click-to-edit description on GoalCard
Matches the same pattern as PersonDetail and ProjectDetail. Clicking the
description area (or the italic placeholder) opens an inline textarea.
Meta+Enter saves, Escape cancels. Disabled on completed goals.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:23:07 +02:00
g-butandClaude Sonnet 4.6 c13b185504 feat(people): editable detail attrs — POST/DELETE /api/people/[id]/attrs + inline edit in PersonDetail
Also fixes inverted UUID guard in /api/projects/[id]/attrs (!!isValidUuid → !isValidUuid
was letting invalid UUIDs through and rejecting valid ones).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:21:39 +02:00
g-butandClaude Sonnet 4.6 36faf16e26 feat(goals): add milestone inline — add milestones to existing goals from GoalCard
PATCH /api/goals/[id] already supported milestones updates but there was
no UI to add new ones. AddMilestoneInline appends to the array on Enter.
Also shows the Add button even when milestone count is 0 (for active goals).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:18:05 +02:00
g-butandClaude Sonnet 4.6 8a0de32184 feat(money): delete subscriptions for all subs, not just meta-configured ones
DELETE /api/subscriptions/[id] endpoint added. SubscriptionActions now always
renders — delete button visible for every subscription; cancel-at-provider,
mark-cancelled, and free-alternatives only shown when SUBSCRIPTION_META exists.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:13:37 +02:00
g-butandClaude Sonnet 4.6 6a789be56f feat: delete person/project from detail panels — DELETE endpoints + inline confirm
- DELETE /api/people/[id] — cascades attrs, interactions, relations; sets goals.entityId=null
- DELETE /api/projects/[id] — same cascade behavior
- PersonDetail: Trash2 icon in header → inline "Delete? Yes / No" confirm → closes panel + refreshes list
- ProjectDetail: same pattern in header button row
- Matches DeleteGoalButton confirm pattern; no browser dialogs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:09:12 +02:00
g-butandClaude Sonnet 4.6 0f4ec46cd1 feat(projects): inline description edit in ProjectDetail + PATCH /api/projects/[id]
- PATCH /api/projects/[id] updates entity description (empty → null)
- ProjectDetail header description is now click-to-edit (textarea, Escape=cancel, ⌘Enter=save)
- descOverride state keeps panel in sync without reload
- Mirrors PersonDetail description edit pattern exactly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:04:21 +02:00
g-butandClaude Sonnet 4.6 c889ebdb93 feat(people): inline description edit in PersonDetail + PATCH /api/people/[id]
- PATCH /api/people/[id] updates entity description (empty string → null)
- PersonDetail shows description as click-to-edit field (textarea, Escape=cancel, ⌘Enter=save)
- Description was previously in the type but never rendered — now visible and editable
- State lifted so description updates immediately without panel reload

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:01:50 +02:00
g-butandClaude Sonnet 4.6 23563f7e2e feat(goals): show linked project badge on GoalCard
getGoals now left-joins entities to include entityName alongside entityId.
GoalCard renders a small FolderKanban icon + project name when a goal is linked,
making the goal→project connection visible from the Goals page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 00:55:26 +02:00
g-butandClaude Sonnet 4.6 18413d1322 refactor(people): extract deriveRelationshipHealth to lib/utils — SSOT
deriveHealth was defined identically in PersonDetail (client) and people.ts (server).
Extracted as deriveRelationshipHealth + RelationshipHealth type to lib/utils, which
is importable by both. Removed both local copies.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 00:52:51 +02:00
g-butandClaude Sonnet 4.6 91b1ced544 feat(people): show live health badge in PersonDetail header
- Lifted interactions state to PersonDetail so header and InteractionsSection share it
- Header now shows colored dot (green/yellow/red/gray) + label with last-contact tooltip
- Health updates immediately when a new interaction is logged (no reload needed)
- deriveHealth mirrors the same 14d/30d thresholds used in the people grid

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 00:49:54 +02:00
g-butandClaude Sonnet 4.6 f378f84c0a feat(projects): add new project — POST /api/projects + NewProjectButton modal
- POST /api/projects creates entities with type=project, handles duplicate (409)
- NewProjectButton modal: name (required, Enter-to-save) + description, Escape-to-cancel
- Wired into PageLayout right slot on /projects page
- Mirrors NewPersonButton/NewGoalButton/NewSubscriptionButton pattern

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 00:46:36 +02:00
g-butandClaude Sonnet 4.6 1287b1a134 feat(people): add new person — POST /api/people + NewPersonButton modal
- POST /api/people creates entities with type=person, handles duplicate name (409)
- NewPersonButton modal: name (required, Enter-to-save, Escape-to-cancel) + notes
- Wired into PageLayout right slot on /people page
- Follows same pattern as NewGoalButton and NewSubscriptionButton

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 00:43:34 +02:00
g-butandClaude Sonnet 4.6 b0e46e1ae2 refactor(api): centralize UUID_RE in lib/utils — remove 8 local copies
UUID_RE was defined identically in 8 separate API route files, violating DRY.
Extracted to lib/utils as UUID_RE + isValidUuid() helper; all routes now import
from the single SSOT.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 00:40:11 +02:00
g-butandClaude Sonnet 4.6 a6bc01b475 fix(money): correct monthly burn — exclude one-time, handle weekly frequency
calculateMonthlyBurn was including one-time payments in recurring burn totals
and treating weekly subscriptions as monthly (undercounting by 4.33×).
Now excludes one-time payments and applies 52/12 multiplier for weekly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 00:32:33 +02:00
g-butandClaude Sonnet 4.6 1b5a612c11 feat(money): add subscription creation, inline cancel confirm, parallelize queries
- New POST /api/subscriptions endpoint (name required, currency/frequency validated)
- NewSubscriptionButton modal form wired into money page header
- Replace confirm() in SubscriptionActions with inline confirmCancel state (matches DeleteGoalButton pattern)
- Parallelize getActiveSubscriptions/getAllSubscriptions/getFinancialCommitments with Promise.all

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 00:30:02 +02:00
g-but 82e40f23bc feat(projects): log activity from ProjectDetail — POST /api/projects/[id]/interactions + inline form with channel/date/note 2026-04-23 00:24:16 +02:00
g-but 9b6a43a27d feat(people): log interactions from PersonDetail — POST /api/people/[id]/interactions + inline form with channel/direction/date/note 2026-04-23 00:19:12 +02:00
g-but e18ceea52d feat(projects): link/unlink goals from ProjectDetail — GET /api/goals, entityId PATCH support, interactive GoalsTab 2026-04-23 00:14:33 +02:00
g-but efe0c71980 feat(goals): inline deadline editor on GoalCard — click to set/change/clear targetDate 2026-04-23 00:11:33 +02:00
g-but 641e810a33 feat(goals): allow editing title/description/targetDate via PATCH + inline click-to-edit title in GoalCard 2026-04-23 00:08:42 +02:00
g-but b705e5c336 feat(goals): add goal deletion — DELETE /api/goals/[id] with subtree cascade + inline confirm button 2026-04-23 00:07:36 +02:00
g-but 3d03db2e8e feat(goals): add goal creation — POST /api/goals + NewGoalButton modal with title/desc/date/parent fields 2026-04-23 00:04:23 +02:00
g-but 2065f37756 perf(people): parallelize count+rows in searchPeople and 4 queries in getPersonDetail 2026-04-22 23:57:35 +02:00
g-but 40ee2449e8 perf(projects): parallelize 4 independent DB queries in project detail route 2026-04-22 23:55:34 +02:00
g-but 6d2214bc15 fix(today): use composite key for CalendarCard events instead of array index 2026-04-22 23:53:09 +02:00
g-but 5d9d232a44 refactor(constants): move TELEGRAM_CHAT_ID to constants — was a magic string in crons route 2026-04-22 23:52:19 +02:00
g-but b70ed376ac refactor(constants): centralize CRON_FILE path — was duplicated in two API routes 2026-04-22 23:50:06 +02:00
g-butandClaude Sonnet 4.6 3844142777 perf(people): skip redundant API fetch on initial mount
PeopleGrid was fetching /api/people 300ms after mount with the same
q=""&sort=recent data the server already rendered. Skip it by flagging
the first effect with a ref — only real user interactions trigger a fetch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:44:37 +02:00
g-butandClaude Sonnet 4.6 71b29d7463 fix(today): render actionUrl from alerts as a navigable link
Alerts had an actionUrl column populated by Ivy ("/people", "/goals")
that AlertsCard silently ignored. Now renders a "View →" link in the
alert's accent color when actionUrl is set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:41:29 +02:00
g-butandClaude Sonnet 4.6 b9ff234052 feat(today): add GoalsDueCard showing goals due within 14 days
Added getGoalsDueSoon() query and a GoalsDueCard server component that
renders when active goals have target dates within 14 days. Shows goal
title, progress bar, and relative deadline. "Cockpit Phase 1 (85%, due
Apr 30)" now surfaces on the Today page without requiring nav to Goals.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:36:02 +02:00
g-butandClaude Sonnet 4.6 723fd04250 feat(today): surface goals due within 14 days in SummaryBar
Added goalsDueSoon count to getTodaySummary (parallel query) and an
amber pill in SummaryBar. "Cockpit Phase 1" (85%, due Apr 30) was
completely invisible on the Today page — now it shows "1 goal due soon".

Also removed getUpcomingEvents dead code: the events table has no date
data and CalendarCard covers real calendar events via the external tool.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:29:50 +02:00
g-butandClaude Sonnet 4.6 a5ed80529a perf(memory): parallelize getEntityStats entity/relation count queries
Two sequential DB queries → concurrent with Promise.all.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:23:18 +02:00