Lane 8 page P3: the editor, a new page, Settings → Wiki, D72 (WIKI-7, WIKI-8, CAMP-14, #734) #911

Merged
claude-bot merged 8 commits from build/lane8-p3-editor into main 2026-09-29 01:56:21 +00:00
Collaborator

Part of #734 (lane 8). This adds the wiki editor, the new-page flow, name pages (D72) and Settings → Wiki. It's frontend, plus two backend tests.

A player's save never overwrites blocks she can't see

  • The server merges. PATCH /lore/:id takes text as the writer's own view, and merge_edit and _merge_hidden_items put back every block, fact and timeline row she can't see.
  • The editor keeps to that contract:
    • It always edits the server's text for this reader, never a "See it as" view.
    • It sends it back with base_version_id, and only the fields that changed.
    • Facts and timeline rows she didn't touch keep their audience exactly as the server gave it.
    • The name of an item not yet identified can't be edited by a player.
  • Tests:
    • Priya's save payload is her view plus her edit, and the test asserts it differs from Dana's.
    • Two new backend tests: "Keep mine" after Dana added a GM block mid-edit keeps both GM blocks, and saving the facts keeps a GM-only fact.
    • The same was confirmed on the real stack.

What was built

  • The editor (/wiki/:id/edit, /wiki/new):
    • Kind, Name, Pronouns, and "Who sees this page" (GM only, D166).
    • Split, Write and Preview.
    • A toolbar with shortcuts, the GM block, and ◐ opening lane 7's AudienceMenu for :::for.
    • [[ autocomplete and a live WikiText preview.
    • Pasting a picture uploads it to the page's private files. Pasting from a document converts it to Markdown, with an Undo.
    • Ctrl+S, a copy kept on the device per user, and a leave guard.
    • A 409 offers merge by hand, use theirs, or keep mine.
    • ?section=N edits one section alone.
    • D72's banner when a name is already taken.
    • Saves go to the suggestion queue where players suggest.
    • Relationships, "Who plays them", the page picture, the stat block and "Links you could add" moved in from the old edit page.
  • /wiki/name/:title (D72): every page with that name, and a GM can pick which one the name opens.
  • "See it as" can now pick a character (IS-128). A player sees "Suggest a change" where players suggest.
  • Settings → Wiki (CAMP-14 built): who may edit, each kind's starting template, and reputation levels.
  • WikiText renders [text](url) links, http(s) and mailto only, and ![alt](src) pictures, from the private files route or /media/ only.
  • Deleted: WikiArticle.jsx, WikiNewEntry.jsx, WikiSearch.jsx and their tests.

Departures

  • Saving is an explicit Save, not an autosave to the server. The drawing shows Save/Cancel and "Kept on this device as you type". Saving to the server every few seconds would add a History version, or a GM-queue suggestion, on every save.
  • Not built: the coloured copy under the text box; "Also called" and "One line" (no server endpoint); the Foundry import (lane 11); and ![[…]] embeds.
  • The stat block still saves on its own, with the old form, until lane 9 replaces it (D73).
  • "Only the GMs" replaces the drawing's "Only me", because a campaign can have more than one GM.

Follow-ups

  • The server doesn't refuse it when a player's PATCH renames an item that isn't identified yet. The editor prevents it; an issue is filed.
  • Owner questions go on the morning page: should pasted pictures be attachments, and should phones edit one section at a time by default?

Checks

  • vitest: 2789 passed. eslint: 0 errors.
  • Coverage: lane6b, lane6c and lane2b all print "unclassified: none".
  • Backend (targeted): 32 passed, ruff clean.
  • Real-stack render: 32 Playwright shots at 390×844 and 1440×900, light and dark, as Dana and Priya, with the scrollWidth check. It caught and fixed the phone toolbar overflow. I reviewed the shots myself.

🤖 Generated with Claude Code

Part of #734 (lane 8). This adds the wiki editor, the new-page flow, name pages (D72) and Settings → Wiki. It's frontend, plus two backend tests. ## A player's save never overwrites blocks she can't see - **The server merges.** `PATCH /lore/:id` takes `text` as the writer's own view, and `merge_edit` and `_merge_hidden_items` put back every block, fact and timeline row she can't see. - **The editor keeps to that contract:** - It always edits the server's text for this reader, never a "See it as" view. - It sends it back with `base_version_id`, and only the fields that changed. - Facts and timeline rows she didn't touch keep their audience exactly as the server gave it. - The name of an item not yet identified can't be edited by a player. - **Tests:** - Priya's save payload is her view plus her edit, and the test asserts it differs from Dana's. - Two new backend tests: "Keep mine" after Dana added a GM block mid-edit keeps both GM blocks, and saving the facts keeps a GM-only fact. - The same was confirmed on the real stack. ## What was built - **The editor (`/wiki/:id/edit`, `/wiki/new`):** - Kind, Name, Pronouns, and "Who sees this page" (GM only, D166). - Split, Write and Preview. - A toolbar with shortcuts, the GM block, and ◐ opening lane 7's `AudienceMenu` for `:::for`. - `[[` autocomplete and a live `WikiText` preview. - Pasting a picture uploads it to the page's private files. Pasting from a document converts it to Markdown, with an Undo. - Ctrl+S, a copy kept on the device **per user**, and a leave guard. - A 409 offers merge by hand, use theirs, or keep mine. - `?section=N` edits one section alone. - D72's banner when a name is already taken. - Saves go to the suggestion queue where players suggest. - Relationships, "Who plays them", the page picture, the stat block and "Links you could add" moved in from the old edit page. - **`/wiki/name/:title` (D72):** every page with that name, and a GM can pick which one the name opens. - **"See it as"** can now pick a character (IS-128). A player sees "Suggest a change" where players suggest. - **Settings → Wiki (CAMP-14 built):** who may edit, each kind's starting template, and reputation levels. - **`WikiText`** renders `[text](url)` links, http(s) and mailto only, and `![alt](src)` pictures, from the private files route or `/media/` only. - **Deleted:** `WikiArticle.jsx`, `WikiNewEntry.jsx`, `WikiSearch.jsx` and their tests. ## Departures - **Saving is an explicit Save, not an autosave to the server.** The drawing shows Save/Cancel and "Kept on this device as you type". Saving to the server every few seconds would add a History version, or a GM-queue suggestion, on every save. - **Not built:** the coloured copy under the text box; "Also called" and "One line" (no server endpoint); the Foundry import (lane 11); and `![[…]]` embeds. - **The stat block still saves on its own,** with the old form, until lane 9 replaces it (D73). - **"Only the GMs"** replaces the drawing's "Only me", because a campaign can have more than one GM. ## Follow-ups - **The server doesn't refuse it** when a player's PATCH renames an item that isn't identified yet. The editor prevents it; an issue is filed. - **Owner questions** go on the morning page: should pasted pictures be attachments, and should phones edit one section at a time by default? ## Checks - **vitest:** 2789 passed. **eslint:** 0 errors. - **Coverage:** lane6b, lane6c and lane2b all print "unclassified: none". - **Backend (targeted):** 32 passed, ruff clean. - **Real-stack render:** 32 Playwright shots at 390×844 and 1440×900, light and dark, as Dana and Priya, with the scrollWidth check. It caught and fixed the phone toolbar overflow. I reviewed the shots myself. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A backend test pins a player's Keep mine after a conflict: her own copy
saved over the version a GM changed keeps both GM blocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The editor's load moves onto useAsync (no setState from an effect), the
settings index and the Contents list Wiki now it is built, and a changelog
fragment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(webapp): the editor's toolbar stays inside a phone; no empty Stat block section (#734)
Some checks failed
CI / Backend lint (ruff) (pull_request) Successful in 30s
CI / Bot/backend version sync (pull_request) Successful in 27s
CI / Feedback site tests (pull_request) Successful in 46s
CI / Does this change touch the recording path? (pull_request) Successful in 15s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
CI / Docker image build (pull_request) Successful in 31s
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 1m45s
CI / Bot tests and audit (pull_request) Successful in 2m52s
CI / Backend migration, tests, and audit (pull_request) Has been cancelled
CI / End-to-end journeys (desktop, phone, keyboard-only) (pull_request) Has been cancelled
CI / Frontend tests, audit, and build (pull_request) Has been cancelled
e11c449adc
Found by the real-stack render check at 390x844: a wrapping column's line
took the toolbar's full width and pushed the page sideways.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into build/lane8-p3-editor
All checks were successful
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 2m0s
CI / Bot tests and audit (pull_request) Successful in 2m46s
CI / Backend lint (ruff) (pull_request) Successful in 50s
CI / Feedback site tests (pull_request) Successful in 1m12s
CI / Bot/backend version sync (pull_request) Successful in 37s
CI / Docker image build (pull_request) Successful in 1m4s
CI / Does this change touch the recording path? (pull_request) Successful in 29s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
CI / End-to-end journeys (desktop, phone, keyboard-only) (pull_request) Successful in 20m57s
CI / Frontend tests, audit, and build (pull_request) Successful in 46m30s
CI / Backend migration, tests, and audit (pull_request) Successful in 46m26s
a35bf0db57
# Conflicts:
#	webapp/frontend/src/App.jsx
Sign in to join this conversation.
No description provided.