Skip to content

web: rename a category inline with duplicate-name handling #223

Description

@rghvgrv

Parent

#196 — PRD: Angular web client for SubVora (parity minus reminders)

What to build

Renaming a user's own category inline, with the duplicate-name conflict handled in place. Renames must also propagate to anything already displaying the old name, since the subscription list groups by category name.

Implementation Steps

  1. API method — add rename(id, name) to core/api/categories-api.service.ts (200 with the updated category, 404 for a system default or another user's, 409 for a duplicate).
  2. Inline edit — in features/categories/categories.component.ts, make a user category's name editable in place with save and cancel, reusing the same validation as create (required, ≤100).
  3. Store method — rename(id, name) in categories.store.ts replaces the item on success; a 409 surfaces "A category with this name already exists." against the field and leaves the item unchanged; a 404 reports "Not found." and reloads the list.
  4. Propagate — after a successful rename, refresh the subscriptions list store if it holds data, so its group headings and category cells stop showing the old name.
  5. Spec — categories.store.spec.ts additions: rename replaces exactly one item; 409 leaves the list untouched and reports the duplicate message; a successful rename triggers the subscription refresh.

Agent Routing

agent_routing:
  complexity_hint: easy
  required_capability: balanced
  parallel_safe: true
  cost_preference: low
  speed_preference: balanced
  ownership_scope:
    - src/SubVora.Web/src/app/features/categories/**
    - src/SubVora.Web/src/app/core/api/categories-api.service.ts
  verification:
    - cd src/SubVora.Web && npx ng test --no-watch

Technical Context Snapshot

Current stack in scope

  • UI: Angular (20+) standalone components with signals and built-in control flow, Angular Material (Material 3) as the only component library, SCSS. Static SPA — no SSR, no service worker.
  • State: signal-backed injectable stores, one per domain area, mirroring the MAUI ViewModel split in src/SubVora.Mobile/ViewModels one-to-one. No NgRx.
  • API access: hand-written models plus one service per API controller under src/SubVora.Web/src/app/core/api. Enums travel as JSON strings (JsonStringEnumConverter in Program.cs), so TypeScript string-literal unions are exact.
  • Backend consumed unchanged: ASP.NET Core net10.0, /api/v1/, JWT bearer in the Authorization header, tokens in JSON bodies (no cookies).
  • Tests: Angular CLI unit-test builder (Vitest runner; Karma is deprecated) with HttpTestingController. Stores, interceptors, mappers and utils only — no component-DOM or browser automation.

Dependencies in scope

  • Reuse: @angular/*, @angular/material, rxjs, and the utilities already added under src/SubVora.Web/src/app/core. No chart library, no date library, no HTTP wrapper library.
  • New dependency additions allowed for this slice: no. If a dependency looks unavoidable, stop and raise it on the issue rather than adding it.

Architecture alignment

  • Preserve the repo's load-bearing rules (CLAUDE.md): burn-rate maths is server-side and counts cycles, never days; currency conversion is a read-time projection and stored amounts are never overwritten; nothing advances next_billing_date on a timer; provider matching stays one SQL query; the mobile SQLite cache stays a read-only mirror.
  • There is deliberately no shared DTO project. Web models mirror the API's JSON contract by convention — a contract change means editing both sides.
  • create-git-issue provides routing hints only and assigns no concrete agent or model.
  • run-with-it remains the final runtime routing authority.

Integration touchpoints

  • Consumes PUT /api/v1/categories/{id} — 200, 404 (system default or not owned), 409 (duplicate name).
  • Subscription DTOs carry categoryName denormalised, so a rename requires refreshing the subscriptions list rather than patching a local string.
  • System defaults must not offer a rename affordance at all.

Acceptance criteria

  • A user category can be renamed inline; system defaults offer no rename action.
  • A duplicate name shows the server message against the field and changes nothing.
  • After a rename, the subscriptions screen no longer shows the old name.

Blocked by

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentReady for autonomous agent execution

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions