Commit Graph
1304 Commits
Author SHA1 Message Date
g-butandClaude Sonnet 4.6 6b582ab474 fix: remove redundant name prop from SubscriptionActions, add delete button to CommitmentsCard
DRY fix: SubscriptionActions had both subName (required) and name (optional)
passed identically as sub.name — name was introduced alongside subName without
removing the original, making editName initialize from name ?? subName. Removed
name prop; editName now initializes from subName directly.

UX fix: CommitmentsCard had a fulfill button but no way to remove a commitment
added by mistake. DELETE /api/commitments/[id] existed but was unused. Added
DeleteCommitmentButton (confirm → Del/No pattern) next to the fulfill button.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 03:03:21 +02:00
g-butandClaude Sonnet 4.6 3dcf4de351 feat(people): quick-log interaction directly from grid card
Avoids the open-PersonDetail → scroll → Log friction for the most
common daily action. Hover the card, click Log, pick channel + direction,
optional note, Enter/Log saves instantly with a 1.2s "Logged ✓" flash.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:58:22 +02:00
g-butandClaude Sonnet 4.6 d2efefb043 feat(commitments): add POST/DELETE API and inline add form in CommitmentsCard
No way to record new commitments from the UI previously; only Ivy could create them.

- api/commitments: POST (description required, dueDate + financialImpact optional)
- api/commitments/[id]: DELETE
- AddCommitmentButton: client component — "+ Add commitment" expands inline form,
  POSTs then router.refresh() to rerender the server component with updated list
- CommitmentsCard: embeds AddCommitmentButton below the active commitments list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:53:18 +02:00
g-butandClaude Sonnet 4.6 e41569a21f refactor(utils): move HEALTH_LABEL to lib/utils.ts — eliminate local duplicate in PeopleGrid
HEALTH_FILTER_LABELS in PeopleGrid was a hardcoded duplicate of RelationshipHealth
display strings. Moving to lib/utils.ts alongside HEALTH_DOT_COLOR ensures a single
source of truth: adding a new health value only requires updating utils.ts.

PersonDetail's local HEALTH_LABEL has distinct semantics (lowercase + "no interactions"
for unknown) so it intentionally stays local.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:48:59 +02:00
g-butandClaude Sonnet 4.6 31e6e4c515 refactor(channels): derive CHANNEL_NAMES from CHANNEL_CONFIG — eliminate SSOT violation
PersonDetail had a hardcoded CHANNELS const duplicating CHANNEL_CONFIG keys.
Adding a new channel to CHANNEL_CONFIG would have left the dropdowns stale.

- config/channels.ts: export CHANNEL_NAMES derived by stripping "channel:" prefix
- PersonDetail: import CHANNEL_NAMES, remove local CHANNELS const and Channel type
- Both interaction-log and add-channel selects now driven from single source

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:46:57 +02:00
g-butandClaude Sonnet 4.6 dfca0033e1 feat(today): surface event deadlines on Today page and SummaryBar
getEventsDueSoon(30) — active events with deadline within 30 days.
EventsDueCard — Server Component, shows name/type/category, deadline
  with overdue colouring, external link, "Open Events →" footer.
SummaryBar — adds amber "N deadlines" pill from getTodaySummary.
getTodaySummary — runs 7th parallel query for event deadline count.
Today page — EventsDueCard in Suspense alongside GoalsDueCard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:42:14 +02:00
g-butandClaude Sonnet 4.6 033275c0d1 feat(events): add events page with search, type filters, and add/delete
14 events already in DB (workshops, accelerators, funding deadlines).

- db/queries/events.ts: getEvents() orders by deadline asc (nulls last)
- api/events: GET (list) + POST (create with name, type, url, deadline, category)
- api/events/[id]: DELETE
- EventsGrid: client-side search + type filter chips (derived from data, no hardcoding)
- EventCard: type/category badges, deadline with overdue colouring, external link, delete with confirm
- AddEventForm: inline expand form
- navigation.ts: events added to sidebar (mobile: false, 5-item mobile bar unchanged)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:37:11 +02:00
g-butandClaude Sonnet 4.6 f00f80a47f feat(goals): add client-side search bar to goals page
GoalsGrid client component wraps the goals list with a search input.
Filters active + completed goals by title and description (case-insensitive).
Tree structure is preserved: parent shown if any descendant matches.
Count display shows "N / total" when filtering, total otherwise.
No API round-trip needed — goal counts are small enough for client filter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:30:31 +02:00
g-butandClaude Sonnet 4.6 915432c5ec feat(projects): inline edit for status and maturity in ProjectDetail
status: click badge → text input (free-form, e.g. "Production / Active")
maturity: click bar → range slider 1–10, saves as "N/10" format

Both write via POST /api/projects/[id]/attrs (upsert). Header row now
always shown when data is loaded so missing fields can be added directly
without touching the generic attrs grid.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:27:44 +02:00
g-butandClaude Sonnet 4.6 7ca0fa0feb feat(money): inline edit for subscription name and vendor
PATCH endpoint already supported name/vendor; this wires up the UI.
Edit form now includes name (required) and vendor (optional) fields
above amount/currency. Initialises from current values so edits are
non-destructive. router.refresh() re-renders the server component.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:24:20 +02:00
g-butandClaude Sonnet 4.6 c5235350e9 refactor(people): derive health filter chips from RELATIONSHIP_HEALTH_VALUES SSOT
HEALTH_FILTERS array now built from the exported const, so new health statuses
are automatically included in the filter UI without a separate code change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 02:20:10 +02:00
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