refactor: move category data behind server ownership #375

Merged
barrettruth merged 1 commit from issue-360-category-server-owner into main 2026-05-11 21:23:34 +00:00
Owner

Problem

Category color writes and category listing/count SQL were split across route/action adapters and core helpers.

Solution

  • replace the category color helper with a category data owner in src/core/categories.ts
  • route server actions through shared set/remove helpers
  • route GET /api/categories through shared listing and map back to the existing { name, count } response
  • keep dashboard color reads on the same category owner
  • add focused category persistence tests for color set/remove and count/color listing

Verification

  • nix develop --command pnpm exec vitest run tests/core/categories.test.ts tests/server/dashboard-data.test.ts
  • nix develop --command pnpm lint
  • nix develop --command pnpm typecheck
  • nix develop --command just ci

Closes #360

## Problem Category color writes and category listing/count SQL were split across route/action adapters and core helpers. ## Solution - replace the category color helper with a category data owner in `src/core/categories.ts` - route server actions through shared set/remove helpers - route `GET /api/categories` through shared listing and map back to the existing `{ name, count }` response - keep dashboard color reads on the same category owner - add focused category persistence tests for color set/remove and count/color listing ## Verification - `nix develop --command pnpm exec vitest run tests/core/categories.test.ts tests/server/dashboard-data.test.ts` - `nix develop --command pnpm lint` - `nix develop --command pnpm typecheck` - `nix develop --command just ci` Closes #360
refactor: centralize category data ownership
All checks were successful
quality / Test (pull_request) Successful in 16s
quality / Lint (pull_request) Successful in 20s
quality / Build (pull_request) Successful in 43s
a994d6f12c
barrettruth deleted branch issue-360-category-server-owner 2026-05-11 21:23:34 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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
barrettruth/delta!375
No description provided.