feat(webapp): browse the rules, stage 2 — the rules library and Browse on a pack (#1241) #1300

Merged
claude-bot merged 13 commits from feat/1241-rules-library into main 2026-11-01 04:06:09 +00:00
Collaborator

Closes #1241. Includes the design (lane 6f, D305–D309) from #1298, which this replaces.

What it adds

  • The rules library at /rules: everything the server's own packs hold, per game system, outside any campaign. Campaign packs are never included.
    • It has stage 1's kinds, filters, numbered pages and search.
    • A record opens in place.
    • Actions on a record:
      • "Use it in a campaign…" lists your campaigns that play that system and opens the entry there.
      • "Copy a link to it" copies a link that opens the library with that row open.
  • Its doors (D307):
    • Home's menu → This instance → Rules library, for everyone signed in (D305);
    • Browse on each pack in Admin → Content packs;
    • "The whole library" on each campaign's Rules page.
  • Admin, a pack → Browse (/admin/packs/:id/browse): that pack's records by kind, at any status. A switched-off pack says so and offers "Switch it on".
  • GM-only records outside a campaign (D306): shown to admins and to GMs of a live campaign of that system.
  • The open URL parameter works on the campaign Rules page too.

API

  • GET /api/reference/library
  • GET /api/admin/content-packs/{id}/browse/kinds, /browse/page and /browse/{entry_id} (admin)
  • The existing kinds, page and entry routes, called without campaign_id, are the library and now apply D306.

No migration. The bot contract is unchanged.

Checked so far

  • Backend: lint is clean, the checks pass, and 438 reference and content-pack tests pass, including 15 new ones.
  • Frontend: lint has 0 errors, and the full vitest suite passed apart from one test (5,599 passed, 1 failed). That test was a date-format expectation, which was then fixed, and the affected folders re-ran green (373 passed).
  • Not yet: the render check, and the full suites, which CI runs.

The new wording goes on the Wording Review page before this merges.

🤖 Generated with Claude Code

Closes #1241. Includes the design (lane 6f, D305–D309) from #1298, which this replaces. **What it adds** - **The rules library at `/rules`:** everything the server's own packs hold, per game system, outside any campaign. Campaign packs are never included. - It has stage 1's kinds, filters, numbered pages and search. - A record opens in place. - Actions on a record: - **"Use it in a campaign…"** lists your campaigns that play that system and opens the entry there. - **"Copy a link to it"** copies a link that opens the library with that row open. - **Its doors (D307):** - Home's menu → This instance → Rules library, for everyone signed in (D305); - Browse on each pack in Admin → Content packs; - "The whole library" on each campaign's Rules page. - **Admin, a pack → Browse** (`/admin/packs/:id/browse`): that pack's records by kind, at any status. A switched-off pack says so and offers "Switch it on". - **GM-only records outside a campaign (D306):** shown to admins and to GMs of a live campaign of that system. - The `open` URL parameter works on the campaign Rules page too. **API** - `GET /api/reference/library` - `GET /api/admin/content-packs/{id}/browse/kinds`, `/browse/page` and `/browse/{entry_id}` (admin) - The existing kinds, page and entry routes, called without `campaign_id`, are the library and now apply D306. No migration. The bot contract is unchanged. **Checked so far** - Backend: lint is clean, the checks pass, and 438 reference and content-pack tests pass, including 15 new ones. - Frontend: lint has 0 errors, and the full vitest suite passed apart from one test (5,599 passed, 1 failed). That test was a date-format expectation, which was then fixed, and the affected folders re-ran green (373 passed). - **Not yet:** the render check, and the full suites, which CI runs. The new wording goes on the Wording Review page before this merges. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
design: browse the rules, stage 2 -- the rules library and Browse on a pack (#1241)
Some checks failed
CI / Does this change touch the recording path? (pull_request) Successful in 19s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
CI / Which journeys does this change need? (pull_request) Successful in 19s
CI / Bot/backend version sync (pull_request) Successful in 30s
CI / Feedback site tests (pull_request) Successful in 53s
CI / Backend lint (ruff) (pull_request) Successful in 1m20s
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 2m38s
CI / Bot tests and audit (pull_request) Successful in 4m6s
CI / Docker image build (pull_request) Successful in 5m6s
CI / End-to-end journeys (desktop) (pull_request) Has been skipped
CI / Frontend (shard 1/2) (pull_request) Has been cancelled
CI / Backend migration, tests, and audit (pull_request) Has been cancelled
CI / Frontend (shard 2/2) (pull_request) Has been cancelled
5c81f1a416
Lane 6f: the server's rules library outside any campaign, Browse on each
pack in Admin, a switched-off pack, a phone, and nothing loaded, with four
questions for the owner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
design: lane 6f, a record opened in the rules library (#1241)
Some checks failed
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 1m6s
CI / Backend lint (ruff) (pull_request) Successful in 1m27s
CI / Bot/backend version sync (pull_request) Successful in 30s
CI / Does this change touch the recording path? (pull_request) Successful in 20s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
CI / Feedback site tests (pull_request) Successful in 2m8s
CI / Which journeys does this change need? (pull_request) Successful in 16s
CI / Bot tests and audit (pull_request) Successful in 4m46s
CI / Docker image build (pull_request) Successful in 6m24s
CI / End-to-end journeys (desktop) (pull_request) Has been skipped
CI / Frontend (shard 2/2) (pull_request) Successful in 8m27s
CI / Frontend (shard 1/2) (pull_request) Successful in 10m23s
CI / Backend migration, tests, and audit (pull_request) Has been cancelled
701b7bbf60
A creature's stat block and a spell's text open in place, as on a
campaign's Rules page, with Use it in a campaign and Copy a link to it;
a phone view; a fifth question, on links to a record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
design: rules library decided, D305-D309 (#1241)
All checks were successful
CI / Backend lint (ruff) (pull_request) Successful in 28s
CI / Feedback site tests (pull_request) Successful in 49s
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 54s
CI / Bot/backend version sync (pull_request) Successful in 27s
CI / Docker image build (pull_request) Successful in 12s
CI / Does this change touch the recording path? (pull_request) Successful in 13s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
CI / Which journeys does this change need? (pull_request) Successful in 18s
CI / End-to-end journeys (desktop) (pull_request) Has been skipped
CI / Bot tests and audit (pull_request) Successful in 2m3s
CI / Frontend (shard 2/2) (pull_request) Successful in 13m52s
CI / Frontend (shard 1/2) (pull_request) Successful in 18m6s
CI / Backend migration, tests, and audit (pull_request) Successful in 36m9s
47e33d8ba7
The owner's answers to Q194-Q198: anyone signed in; GM-only entries for
admins and the system's GMs; three doors, adding The whole library on a
campaign's Rules page; Use it in a campaign; Copy a link to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Merge branch 'feat/1241-frontend' into feat/1241-rules-library
Some checks failed
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 / Bot/backend version sync (pull_request) Successful in 25s
CI / Which journeys does this change need? (pull_request) Successful in 15s
CI / Feedback site tests (pull_request) Successful in 44s
CI / Backend lint (ruff) (pull_request) Successful in 1m10s
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 2m16s
CI / Bot tests and audit (pull_request) Successful in 3m39s
CI / Docker image build (pull_request) Successful in 4m47s
CI / Frontend (shard 2/2) (pull_request) Successful in 16m23s
CI / Frontend (shard 1/2) (pull_request) Successful in 19m48s
CI / End-to-end journeys (desktop) (pull_request) Has been cancelled
CI / Backend migration, tests, and audit (pull_request) Has been cancelled
ddfb8694d9
fix(webapp): the library's chosen game system shows pressed (#1241)
Some checks failed
CI / Which journeys does this change need? (pull_request) Successful in 15s
CI / Does this change touch the recording path? (pull_request) Successful in 16s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
CI / Bot/backend version sync (pull_request) Successful in 35s
CI / Backend lint (ruff) (pull_request) Successful in 40s
CI / Feedback site tests (pull_request) Successful in 55s
CI / Bot tests and audit (pull_request) Successful in 2m9s
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 2m16s
CI / Docker image build (pull_request) Successful in 4m49s
CI / End-to-end journeys (desktop) (pull_request) Has been cancelled
CI / Frontend (shard 1/2) (pull_request) Has been cancelled
CI / Backend migration, tests, and audit (pull_request) Has been cancelled
CI / Frontend (shard 2/2) (pull_request) Has been cancelled
2494ac3877
The render check showed both system buttons alike; they share the pack
filter's pressed style now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Collaborator

Render check (journeys stack, both starters loaded)

The run: 88 shots, signed in as Dana (admin) and Priya (player), at 1280×800 and 390×844, in light and dark.

Results

  • Every page returned HTTP 200, with 0 console errors and no horizontal overflow on a phone.
  • These all render:
    • the library's kinds grid, a kind opened, and a creature's stat block and a spell opened;
    • the "Use it in a campaign…" dialog (Priya: "The Blackfen Warrant · You play");
    • Home's "This instance → Rules library" for both people;
    • "The whole library ›" on a campaign's Rules page;
    • Browse on each pack, and the pack page, including switched off with its banner and "Switch it on";
    • a deep link with open=, which loads with that row open.
  • Axe found nothing new on these pages. It's clean on the library and the campaign Rules page at desktop width.

Fixed here: the chosen game system's button didn't look pressed. Both systems looked alike. Fixed in 2494ac38, which gives them the pack filter's pressed style.

Found, but already on main, so filed separately:

  • #1301: an opened entry shows its markdown literally (**bold**, ---). This comes from stage 1, and the fix covers both pages.
  • #1302: on Admin → Content packs, "ancestrys", the version showing as "vpf2e-8.6.1", the licence link marked by colour only, and on a phone the app bar's name not matching its visible text.

Not seen: "Link copied". The check ran over plain http, where the browser has no clipboard, so the fallback field showed, which is correct there. Dev and prod are https.

## Render check (journeys stack, both starters loaded) The run: 88 shots, signed in as Dana (admin) and Priya (player), at 1280×800 and 390×844, in light and dark. **Results** - Every page returned HTTP 200, with 0 console errors and no horizontal overflow on a phone. - These all render: - the library's kinds grid, a kind opened, and a creature's stat block and a spell opened; - the "Use it in a campaign…" dialog (Priya: "The Blackfen Warrant · You play"); - Home's "This instance → Rules library" for both people; - "The whole library ›" on a campaign's Rules page; - Browse on each pack, and the pack page, including switched off with its banner and "Switch it on"; - a deep link with `open=`, which loads with that row open. - Axe found nothing new on these pages. It's clean on the library and the campaign Rules page at desktop width. **Fixed here:** the chosen game system's button didn't look pressed. Both systems looked alike. Fixed in 2494ac38, which gives them the pack filter's pressed style. **Found, but already on main, so filed separately:** - #1301: an opened entry shows its markdown literally (`**bold**`, `---`). This comes from stage 1, and the fix covers both pages. - #1302: on Admin → Content packs, "ancestrys", the version showing as "vpf2e-8.6.1", the licence link marked by colour only, and on a phone the app bar's name not matching its visible text. **Not seen:** "Link copied". The check ran over plain http, where the browser has no clipboard, so the fallback field showed, which is correct there. Dev and prod are https.
fix(webapp): a rules entry's text is drawn from its markdown (#1301)
All checks were successful
CI / Bot/backend version sync (pull_request) Successful in 30s
CI / Backend lint (ruff) (pull_request) Successful in 39s
CI / Which journeys does this change need? (pull_request) Successful in 37s
CI / Does this change touch the recording path? (pull_request) Successful in 40s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
CI / Feedback site tests (pull_request) Successful in 52s
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 1m8s
CI / Bot tests and audit (pull_request) Successful in 2m6s
CI / Docker image build (pull_request) Successful in 5m41s
CI / Frontend (shard 2/2) (pull_request) Successful in 8m58s
CI / Frontend (shard 1/2) (pull_request) Successful in 10m26s
CI / End-to-end journeys (desktop) (pull_request) Successful in 13m16s
CI / Backend migration, tests, and audit (pull_request) Successful in 35m6s
80f26b9e5a
Opened entries showed pack markup literally (**bold**, ---). RuleText
draws it with react-markdown: no raw HTML, no pictures (alt text, so no
fetch from a pack's address, as D297), headings brought down to bold.

Closes #1301

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude-bot scheduled this pull request to auto merge when all checks succeed 2026-11-01 04:05:30 +00:00
Sign in to join this conversation.
No description provided.