Skip to content

Make @/lib/routes the single entry point for routes - #25

Merged
haroldadmin merged 1 commit into
claude/profiles-data-accessfrom
claude/routes-data-access
Oct 28, 2026
Merged

haroldadmin merged 1 commit into
claude/profiles-data-accessfrom
claude/routes-data-access

Conversation

@haroldadmin

Copy link
Copy Markdown
Owner

Stacked on #24. Applies the same data access cleanup to routes: everything goes through @/lib/routes (and @/lib/routes/shared for client components).

  • Reads are load* functions with a labelled filter and an AbortSignal. A single loadRoutes with activity and author filters replaces three list functions.
  • Route types narrow to RouteHeadline, RouteSummary and Route.
  • fetchRouteGpx returns typed failure reasons.
  • createRoute, saveRoute and deleteRoute own record writes, including the ownership check.
  • Route input is validated with a Zod schema.
  • labels.ts, route-search.ts and route-form.ts are folded into the module.
  • Focused tests, including PostGIS-backed nearby search and full-text search.

Generated by Claude Code

Routes are now read, validated, and written only through `@/lib/routes`
(server) and `@/lib/routes/shared` (client-safe), following the reviews
and profiles modules.

- Reads are `load*` functions with a `labelled` filter and an AbortSignal.
  `loadRoutes` takes activity and author filters, replacing
  `fetchRoutesPage`, `fetchRecentRoutes`, and `fetchRoutesByAuthor`.
- Route types narrow to RouteHeadline, RouteSummary, and Route.
- `fetchRouteGpx` returns typed failure reasons like `fetchAvatar`.
- `createRoute`, `saveRoute`, and `deleteRoute` own the record writes,
  including the ownership check.
- Route input is validated with a Zod schema. Reading the form moves next
  to the route forms.
- Folds in `labels.ts`, `route-search.ts`, and `route-form.ts`. The
  lexicon vocabulary stays server-side so it isn't bundled for the browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M9KZ6SDuRW4inA7dgB2nYh
@haroldadmin
haroldadmin added this pull request to stack #26 October 28, 2026 17:38
@haroldadmin
haroldadmin merged commit acc7aa1 into main Oct 28, 2026
4 checks passed
@haroldadmin
haroldadmin deleted the claude/routes-data-access branch October 28, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants