Edit name/amount on budget template entries (#21) #22

Merged
claude-code merged 12 commits from feat/21-edit-template-entries into main 2026-04-17 19:28:56 -06:00
Collaborator

Closes #21.

Summary

Adds inline edit for name, amount, and notes on budget template entries. Click the new ✎ icon on a row (visible on hover); the row cells are replaced by inputs in the same slot, with Save and Cancel. Notes live inside edit mode; empty notes render nothing in read mode, and a set note renders as a small italic badge after the name (Spotify · family plan).

Forward-only guarantee

The snapshot-over-mirror architecture already isolates months from the template at the data layer. This PR confirms that invariant in two dedicated tests:

  • tests/test_service.py::test_update_entry_does_not_mutate_existing_month_snapshot (unit-level assertion on all four snapshot fields)
  • tests/test_template_edit_isolation.py::test_template_edit_does_not_mutate_existing_month_and_applies_to_next (end-to-end: seed template, snapshot April, edit template, assert April unchanged, create May, assert May reflects the edit)

Editing Entry.name or Entry.amount never touches MonthEntry.planned, MonthEntry.name, MonthEntry.origin_name, or MonthEntry.origin_planned on existing months.

Notable changes

  • New service.update_entry (mirrors month_service.update_month_entry).
  • New routes: GET /entries/{id}/edit, POST /entries/{id}, GET /sections/{section} (cancel path).
  • Removed route: POST /entries/{id}/notes (notes now edited via the Save flow). Removed function: service.set_entry_notes (superseded by update_entry).
  • partials/section.html rewritten: read row with optional note badge, edit row with name/amount/notes inputs, Save, Cancel. Separate notes row is gone.
  • CSS: new .entry-row.reading / .entry-row.editing layouts. Target-card table layout kept scoped under .target-section.

Spec and plan

  • Spec: docs/superpowers/specs/2026-04-17-edit-budget-template-entries-design.md
  • Plan: docs/superpowers/plans/2026-04-17-edit-budget-template-entries.md

Test plan

  • uv run pytest -q → 137 passing (previously 117; net +20).
  • Manual UI walkthrough on localhost: add entry, hover for icons, click ✎, save name/amount/notes, cancel, multi-row toggle, debt-minimum target card refresh, existing-month isolation, new-month pickup.

Out of scope

  • No schema change, no migration.
  • No "apply change to current active month" affordance (existing workflow: edit the month row directly on the month view).
  • No bulk edit, undo, or edit history.
Closes #21. ## Summary Adds inline edit for name, amount, and notes on budget template entries. Click the new ✎ icon on a row (visible on hover); the row cells are replaced by inputs in the same slot, with Save and Cancel. Notes live inside edit mode; empty notes render nothing in read mode, and a set note renders as a small italic badge after the name (`Spotify · family plan`). ## Forward-only guarantee The snapshot-over-mirror architecture already isolates months from the template at the data layer. This PR confirms that invariant in two dedicated tests: - `tests/test_service.py::test_update_entry_does_not_mutate_existing_month_snapshot` (unit-level assertion on all four snapshot fields) - `tests/test_template_edit_isolation.py::test_template_edit_does_not_mutate_existing_month_and_applies_to_next` (end-to-end: seed template, snapshot April, edit template, assert April unchanged, create May, assert May reflects the edit) Editing `Entry.name` or `Entry.amount` never touches `MonthEntry.planned`, `MonthEntry.name`, `MonthEntry.origin_name`, or `MonthEntry.origin_planned` on existing months. ## Notable changes - New `service.update_entry` (mirrors `month_service.update_month_entry`). - New routes: `GET /entries/{id}/edit`, `POST /entries/{id}`, `GET /sections/{section}` (cancel path). - Removed route: `POST /entries/{id}/notes` (notes now edited via the Save flow). Removed function: `service.set_entry_notes` (superseded by `update_entry`). - `partials/section.html` rewritten: read row with optional note badge, edit row with name/amount/notes inputs, Save, Cancel. Separate notes row is gone. - CSS: new `.entry-row.reading` / `.entry-row.editing` layouts. Target-card table layout kept scoped under `.target-section`. ## Spec and plan - Spec: `docs/superpowers/specs/2026-04-17-edit-budget-template-entries-design.md` - Plan: `docs/superpowers/plans/2026-04-17-edit-budget-template-entries.md` ## Test plan - [x] `uv run pytest -q` → 137 passing (previously 117; net +20). - [x] Manual UI walkthrough on localhost: add entry, hover for icons, click ✎, save name/amount/notes, cancel, multi-row toggle, debt-minimum target card refresh, existing-month isolation, new-month pickup. ## Out of scope - No schema change, no migration. - No "apply change to current active month" affordance (existing workflow: edit the month row directly on the month view). - No bulk edit, undo, or edit history.
claude-code added 12 commits 2026-04-17 19:26:17 -06:00
archeious approved these changes 2026-04-17 19:28:21 -06:00
claude-code merged commit 4a51e64112 into main 2026-04-17 19:28:56 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: archeious/quartermaster#22
No description provided.