Commit graph

48 commits

Author SHA1 Message Date
ed048c5bb3 feat(auth): generated one-time passwords for new accounts 2026-09-16 11:25:52 +02:00
d1fdc72d29 feat(slug): URL-safe unique slugs for clients and projects 2026-09-16 11:25:36 +02:00
301af1f739 docs(plan): Phase 1d implementation plan for admin and accounts
Fourteen tasks covering clients, projects, manager accounts, column
management and the archive, so the owner can run the product without the
PocketBase console or the seed script.

Records why account creation must use a superuser connection: the users
write rules are locked because role is an ordinary field there, and both
the signup and self-promotion paths were verified exploitable. Adds a
verification step that re-runs the escalation guard, since this is the
phase most likely to reopen it.

Corrects Plan 1c's deferred list: the AI settings screen belongs to
Phase 3 per spec section 5.3, not here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 11:24:05 +02:00
2a8d6f2505 fix(security): lock the users collection against privilege escalation
The users collection kept PocketBase's defaults because the Plan 1a rules
migration covered eight collections and missed this one:

  createRule ""                      -> anyone could sign up
  updateRule "id = @request.auth.id"  -> anyone could edit their own record

`role` is an ordinary field here, so both were escalations. Verified
exploitable against the live instance: an anonymous request created an
account with role "owner", and a client manager promoted themselves to
owner by patching their own record. Either route yields read and write
access to every client's board.

Create, update and delete are now superuser-only; list and view are
owner-or-self. Adds four integration tests so a regression fails loudly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 11:18:13 +02:00
c966d7dcc9 test(actions): cover audit-log immunity and request flags 2026-09-16 11:06:38 +02:00
043d8ddc8c feat(board): add cards as owner, request features as client 2026-09-16 11:06:06 +02:00
07656a5bc7 feat(board): open a card without breaking drag 2026-09-16 11:05:33 +02:00
c4a8ad2860 feat(card): detail page with checklist, comments and history 2026-09-16 11:04:48 +02:00
0b60c791b5 feat(card): activity timeline visible to both roles 2026-09-16 11:00:02 +02:00
e567093b99 feat(card): comment thread with role-appropriate write path 2026-09-16 10:59:54 +02:00
dd9cbe6c24 feat(card): checklist with progress and owner editing 2026-09-16 10:59:45 +02:00
1f1f9854ff feat(actions): subtask and owner comment mutations 2026-09-16 10:59:37 +02:00
32927ed350 feat(actions): owner card create, update, accept and archive 2026-09-16 10:59:16 +02:00
e191b87c80 feat(data): card detail loader scoped by read rules 2026-09-16 10:58:55 +02:00
083fdd0ce5 feat(activity): superuser-backed audit log helper 2026-09-16 10:58:35 +02:00
d4bf5b5bb0 feat(activity): render audit rows as readable sentences 2026-09-16 10:58:16 +02:00
6f2d563b3d feat(time): relative timestamp formatting 2026-09-16 10:57:55 +02:00
0c6557b89d docs(plan): Phase 1c implementation plan for card detail and the Inbox flow
Fourteen tasks covering the card detail page, checklists, comments, a
readable activity timeline, card creation for both roles, and the accept
flow that stamps start_date.

Owner mutations are Server Actions on the caller's own token; client
mutations keep going through the whitelisted /api/client routes. Records
the constraint that activity.createRule is superuser-only, so audit rows
need a dedicated helper even for the owner.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 10:56:53 +02:00
f082670f8a fix(board): guard optimistic move against a refresh landing mid-save
activeId clears the instant the pointer is released, so gating the
focus-refresh on it alone left a window between drop and server
confirmation where a refresh could overwrite the optimistic position with
stale state and the card would appear to snap back. Tracks a separate
saving flag, and reverts on a thrown fetch as well as a non-ok response.

Also corrects a comment: sensors are created unconditionally; what keeps a
client manager from dragging is that they never render DndContext.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 10:51:35 +02:00
e419bc21db fix(login): use theme tokens instead of hardcoded neutral colours
The login page was still on Plan 1a's dark-only palette, so in light theme
it rendered a near-black card on a light page with the heading black-on-black
and effectively invisible. This is the first screen a client ever sees.

Plan 1b Task 13 required the hardcoded-colour grep to return nothing; it was
not run.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 10:36:01 +02:00
95346c5c82 docs: Coolify-only setup, and mark pb_migrations as non-executing
There is one PocketBase instance and it is hosted. Removes the `npm run pb`
script, which started a local server nothing used.

The schema had two apparent sources of truth. scripts/setup-remote.ts is the
one that actually runs; pb_migrations/ only executes on PocketBase server
start, which never happens here. Both now say so, so nobody edits a migration
and believes the schema changed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 10:32:26 +02:00
bb39519801 feat(board): refresh the board when the window regains focus 2026-09-16 10:03:41 +02:00
972d45d38b feat(board): owner drag and drop with optimistic persistence 2026-09-16 10:03:22 +02:00
4649c82432 feat(api): owner card move route using the caller's own token 2026-09-16 10:02:51 +02:00
f4568e4745 feat(board): column, card tile and client control presentation 2026-09-16 10:02:29 +02:00
a876ad6118 feat(home): role-aware project list with inbox badges 2026-09-16 10:02:02 +02:00
2eda3e7a39 feat(shell): floating panel layout with labelled icon rail 2026-09-16 10:01:45 +02:00
153484390f feat(data): board and project summary loaders scoped by read rules 2026-09-16 10:01:21 +02:00
5d3323e765 feat(board): drop position arithmetic with same-column handling 2026-09-16 10:00:57 +02:00
193fe5bd86 feat(board): whole-day due date classification and formatting 2026-09-16 10:00:37 +02:00
2949fdabb7 feat(ui): pill, icon button and dropdown primitives 2026-09-16 10:00:20 +02:00
a839c4f5ad feat(theme): light/dark/system toggle with no first-paint flash 2026-09-16 09:59:46 +02:00
99b465e402 feat(theme): semantic token system for light and dark 2026-09-16 09:59:25 +02:00
b08303b3b7 fix(seed): spread ColumnInput to satisfy Record type in upsert 2026-09-16 09:47:15 +02:00
5494f14f60 test(permissions): integration coverage for the client write boundary 2026-09-16 09:46:58 +02:00
857ef1a994 chore(seed): demo client, project, users and cards 2026-09-16 09:44:19 +02:00
76438f6e90 feat(api): client routes for inbox card creation and comments 2026-09-16 09:44:04 +02:00
72f9de6999 feat(api): client PATCH route for card priority and target date 2026-09-16 09:43:36 +02:00
91e53f150a feat(auth): PocketBase login, logout and signed-out redirect 2026-09-16 09:43:18 +02:00
30c1405f72 feat(activity): derive audit rows from card patches 2026-09-16 09:42:42 +02:00
6a6df8076b feat(cards): positive field whitelist for client-manager writes 2026-09-16 09:42:26 +02:00
d14694ceab feat(auth): pure access predicates for role and client scoping 2026-09-16 09:42:02 +02:00
f9e3e576f0 feat(pb): browser, server and superuser PocketBase clients 2026-09-16 09:41:46 +02:00
ba990f0109 feat(schema): all collections + role-scoped API rules on remote PB
- migrations/ documented in pocketbase/pb_migrations/ for local PB
- scripts/setup-remote.ts applies them via admin API to remote PB
- collections: clients, projects, columns, cards, subtasks, comments, activity, settings
- user extension: role (owner|client_manager), client (relation)
- writes: owner only for app collections, superuser-only for activity and settings
2026-09-16 09:41:20 +02:00
88a3761857 feat(ordering): fractional card positions with rebalance guard 2026-09-16 09:40:09 +02:00
d55103ae2d chore(scaffold): Next.js 16 + Tailwind 4 + vitest project skeleton 2026-09-16 09:37:43 +02:00
6cfc7ee7cf docs(plan): Phase 1a implementation plan for data layer and permissions
Eighteen tasks, 86 steps, covering the PocketBase schema, auth, the
field-level whitelist that PocketBase rules cannot express, the three
client routes, and all five acceptance tests from the spec.

Board UI is deferred to Plan 1b so the security boundary can be reviewed
on its own rather than inside a large UI diff.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 09:20:55 +02:00
bafe7ca970 docs(spec): Phase 1 design for the multi-client developer board
Covers the data model, the field-level permission model, card ordering,
pages, and acceptance criteria for the board spine. Records the decisions
carried into Phases 2-5 (commit linking, ingestion, effort inference, AI
publishing policy) so later specs do not relitigate them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 08:56:23 +02:00