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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
- 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>
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>
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>
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>
"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>
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>
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>
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>
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>
- 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>
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>
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>
- 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>
- 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>
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>
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>
- 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>