Repository navigation
Description
What
Build project pages (F-C01: "Pages (project pages): CRUD, lock, archive, access, favorites, labels"; entities Page, ProjectPage, PageLabel) behind the routes the stock React app calls, as a plain-save feature (D-012: no collaboration before P1). A project's Pages screen can list, create, rename, lock, archive, change the access of, favourite, duplicate and delete pages.
The description write (PATCH .../pages/{id}/description/, and the validated triple it stores) is #320. This issue is everything around it, and #320 builds on it.
Why
- Nothing of pages exists. No table, no port method, no use-case, no route. The only page-shaped thing in the code is the project flag
page_view(migration 0010, default true), which already makes the stock app show a Pages tab. - The plan schedules it nowhere.
PLAN.md:94and:102say pages are M3 ("Cycles, modules, views, pages, intake, webhooks, public spaces and exports are M3"), but the M3 row (PLAN.md:41) does not list them, the milestone table (:17) gives M3 only feat(jobs): exports and seeding as queue jobs with ajobstable (no workflow engine) #56, and the M5 row (:43) says "P0 pages open unchanged" as if P0 pages existed. feat(collab): oneyrsroom hosted on a Durable Object and on axum (spike 0005 first) #54 (the collab room, M5) needs them. Pages are also not on the M2 acceptance list, andDEVIATIONS.mdhas no stub row for any pages route, though the M2 rule (PLAN.md:94-96, FR-01, ADR-0034) is that every other route the shell calls gets the cheapest recorded answer. - F-C01 is a P0-phase feature (
FEATURES.md:66,TRACEABILITY.md:39, verified by "e2e + sanitiser XSS corpus").
Found while splitting the pages half out of #48 (#320).
The pin's surface
From tools/compat-inventory/out-pinned/ (server-routes.csv, join-matches.csv, join-unmatched.json), all under /api/workspaces/{slug}/projects/{project_id}/:
| Routes | What the pin does | Here |
|---|---|---|
GET and POST pages/ |
list; create | this issue |
GET, PATCH, DELETE pages/{id}/ |
retrieve (takes track_visit); update (PageDetailSerializer); delete |
this issue |
POST pages/{id}/access/ |
change access | this issue |
POST and DELETE pages/{id}/lock/ |
lock, unlock | this issue |
POST and DELETE pages/{id}/archive/ |
archive, restore | this issue |
POST and DELETE favorite-pages/{id}/ |
favourite, unfavourite (members and admins) | this issue |
POST pages/{id}/duplicate/ |
duplicate | this issue |
GET and PATCH pages/{id}/description/ |
the description (PageBinaryUpdateSerializer) |
#320 |
GET pages-summary/ |
served by the pin; the inventory finds no client call to it | check before building |
GET pages/{id}/versions/ and .../{version}/ |
page versions | out (F-C03, P1) |
GET archived-pages/, GET favorite-pages/ |
no route in the pin (the inventory marks both dead) | answer what the pin answers |
POST pages/{id}/move/, GET pages/{id}/mentions/, POST pages/{id}/versions/{v}/restore/ |
no route in the pin, and not dead: the app (or the collab server) calls them | answer what the pin answers, and record it |
Thirteen served routes are in scope here (the first seven rows); the two description routes are #320, which makes fifteen served routes with a client call. The pin has no v1 page routes, so /api/v1 is not touched.
Design decisions to make
- The shape.
PageSerializer(list) andPageDetailSerializer(retrieve, create, update) are read off the pin and recorded as fixtures; do not work them out from the app's types. This includes which request sets a page's labels (PageLabel) and whatowned_by,access,is_lockedandarchived_atlook like. - Who may do what. Visibility of a private page, who may change access, lock, archive or delete (the owner, an admin, any member), and what a guest sees. Read from the pin; none of it is stated in D-012 or ADR-0060.
- What
DELETEdoes. The pin's rules for deleting (for example whether the page must be archived first) and whether a deleted page is soft-deleted and swept by the daily retention cleanup (feat(jobs): daily hard-delete retention cleanup (F-D10, 30-day default per D-001) #59). - The pin's background tasks. The route table counts them: create 1, retrieve 1, update 1, description write 2, duplicate 2. Read what each is and decide, one by one, which has an effect a client can see (an activity row, a recent-visit, a version, a webhook) and which is dropped; record each drop.
- Duplicate. The pin copies the stored objects of the description and posts the HTML to
apps/live/convert-documentto get the JSON and the binary (research/0008line 43). P0 has noapps/live, and pages store the triple, so a copy of the three stored columns is the candidate; images inside the page are decision 6. - Images in a page.
PAGE_DESCRIPTIONis one of Plane's ten entity types that the compat asset route recognises, butAssetEntity(crates/core/ports/src/lib.rs:739) builds onlyProjectCover, so a page image upload is refused today (ISSUE_DESCRIPTIONhas the same gap for work items). Decide whether page images are in this issue or a follow-up, and what the page editor shows meanwhile. - The editor without a collab server. The stock app opens a page through the collab socket and uses the fallback (
use-page-fallback.ts, which builds the binary client side and PATCHes all three) only when the socket is down (research/0008lines 38 and 39). Whether the stock app falls back cleanly when the collab path is simply not served by the Worker is not verified here; the browser journey below is how to find out, and if it does not, that needs its own decision (D-012 says plain save at P0). - Pages and feat(pages): store a page description as the validated triple (sanitised HTML, a binary that decodes with yrs, JSON) #320. If
POST pages/orPATCH pages/{id}/can carrydescription_html(check the pin), it goes through the samethrust_html::describepath as feat(pages): store a page description as the validated triple (sanitised HTML, a binary that decodes with yrs, JSON) #320's write, never straight to a column. - Where it goes. Follow how projects and work items were built: types and a port method set in
crates/core, a use-case module, both adapters (memory and Postgres, with a new expand-only migration,scripts/check-migration-lint.sh), apages.rsincrates/api/compat-plane, and the contract suite on all targets.
Done when
- The thirteen routes answer as the pin does, with
parity_fixtures recorded from the pin, added to the acceptance list (crates/api/compat-plane/tests/parity/acceptance.csv); every deviation is a row inDEVIATIONS.md. - The routes with no pin route answer what the pin answers, and
DEVIATIONS.mdsays so. Thepages-summary/route is built or recorded as unused. - A
model_sequence test against a reference model covers create, update, lock, archive, access, favourite, duplicate and delete across the actors, and runs on every contract target (native-memory,native-pg,worker-cf). Control: a defect planted in one rule (for example an unlocked write to a locked page) makes it fail. - A Playwright journey on the stock app (one spec in
e2e/journeys/, with its must-fail control and the count guard): create a page, rename it, lock it, archive and restore it, favourite it, delete it, with no 404 in the network log. It runs with no collab server (decision 7). - The page HTML that arrives by any route is sanitised by the same path as work items (decision 8), shown by the nine payload classes of
research/0008§7. PLAN.mdlists pages in the M3 row and this issue in its tables, feat(collab): oneyrsroom hosted on a Durable Object and on axum (spike 0005 first) #54 is recorded as depending on it, anddocs/src/testing/status.mdhas a G-entry for it.
Not in this issue
- The description write and its validated triple (feat(pages): store a page description as the validated triple (sanitised HTML, a binary that decodes with yrs, JSON) #320).
- Page versions and history (F-C03, P1) and the
versions/routes. - Collaborative editing (feat(collab): one
yrsroom hosted on a Durable Object and on axum (spike 0005 first) #54, M5); page-to-work-item embeds and mentions beyond keeping the tag (F-C04, P1); nested pages (F-E19, P1); export to PDF (F-C05, P2); templates (F-E17, P2). Workspace pages (F-C06) are dropped. - Public spaces, which the plan lists as their own M3 item.
Blocks: #320, #54. Related: #48, #56, #59, #114.
🤖 Generated with Claude Code
Activity