Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

### Added
- **Tests only:** the UI flow tests in `src/Ui/e2e/` are split by feature (the 69 tests of `flow.e2e.tsx` into eight files, the 13 of `forms.e2e.tsx` into two, shared helpers in `helpers.tsx`); no test changed and no file is over 800 lines. The e2e files now run one after another against the shared DevHost. No app change.
- **Release assets:** each release now includes two CycloneDX software bills of materials, `tomestack-X.Y.Z-nuget.cdx.json` (the .NET packages) and `tomestack-X.Y.Z-npm.cdx.json` (the UI's npm runtime packages). They are listed in `SHA256SUMS` and attested like the installer (D101). No app change.
- **Content schema 13: creation guides and packs, engine only (D97, D98, [ADR-024](decisions/ADR-024-content-v13.md)):** content can now carry a creation guide for a class or background (starting equipment as picks and options, and primary abilities) and packs (an item that lists what it contains). The change adds the format, validation, kit expansion and a catalogue lookup; the bundled guides and gear are listed below. The one change a player can see is in saving for an older TomeStack. Characters never pin a guide. Saving for an older TomeStack leaves guides out, drops what a pack contains, and turns plain gear that release does not have into a custom item (the save is blocked if that would pass 50 custom items, if a quantity is outside 1 to 9,999, or if an item's name is blank or over 80 characters). A source pack or campaign pack that would hold only guides cannot be saved for an older TomeStack; a library backup is unaffected. Older versions refuse v13 content.
- **Easier to find your way around (D94):** the sidebar is grouped into Characters, Library and App. "+ Add a character" opens one screen with three ways in: make a new one, open a TomeStack file, or read a character sheet (PDF or text). Add-ons moved into Settings. The "TomeStack, your characters" button at the top takes you home. Every screen has one main heading, and the window title names where you are (a character's name shows in the taskbar). Esc closes an open "Why?"-style detail or the sidebar and never changes screen. In a narrow window, opening a character sheet tucks the sidebar away without changing your saved choice.
Expand Down
2 changes: 1 addition & 1 deletion docs/decisions/ADR-014-sheet-tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Note (2026-11-15): D96 (Wave 3 Group 4) replaced the Manage tab with the header'

## Context

The character sheet (`src/Ui/src/components/CharacterSheet.tsx`) was one page of about 25 sections, with the admin panels at the top and the core numbers at the bottom in collapsed field cards. The owner asked for a summary area with focused pages below, as paper sheets and other digital sheets have. SPEC P-03 forbids mimicking D&D Beyond's trade dress. There is no router: `App.tsx` keeps one `screen` in state, and the sheet is keyed by character so every play action replaces the view in place. The e2e flow (`src/Ui/e2e/flow.e2e.tsx`) queries every section by role and name and asserts focus on the sheet heading, on the gap-note text box after "Report a gap", and on buttons after Archive, Snapshot and Print.
The character sheet (`src/Ui/src/components/CharacterSheet.tsx`) was one page of about 25 sections, with the admin panels at the top and the core numbers at the bottom in collapsed field cards. The owner asked for a summary area with focused pages below, as paper sheets and other digital sheets have. SPEC P-03 forbids mimicking D&D Beyond's trade dress. There is no router: `App.tsx` keeps one `screen` in state, and the sheet is keyed by character so every play action replaces the view in place. The e2e flow (`src/Ui/e2e/*.e2e.tsx`) queries every section by role and name and asserts focus on the sheet heading, on the gap-note text box after "Report a gap", and on buttons after Archive, Snapshot and Print.

## Decision

Expand Down
2 changes: 1 addition & 1 deletion docs/decisions/ADR-018-play-mechanics.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ The engine is built in slices. Each slice is complete and tested before the next

## Evidence

- `tests/RulesCore.Tests/ToggleGroupTests.cs`, `ToggleGroupValidationTests.cs` and `Properties/ToggleGroupProperties.cs` (resolution, calculation, validation), `tests/AppService.Tests/ToggleGroupCommandTests.cs` (atomic switch, cost, refusals) and `SourcePackTests.cs` (references), `src/Ui/src/components/FormGroups.test.tsx`, `src/Ui/src/undo.test.ts`, and the e2e flow in `src/Ui/e2e/forms.e2e.tsx`. Fixture: `tests/RulesFixtures/fixture-pack-forms.json`.
- `tests/RulesCore.Tests/ToggleGroupTests.cs`, `ToggleGroupValidationTests.cs` and `Properties/ToggleGroupProperties.cs` (resolution, calculation, validation), `tests/AppService.Tests/ToggleGroupCommandTests.cs` (atomic switch, cost, refusals) and `SourcePackTests.cs` (references), `src/Ui/src/components/FormGroups.test.tsx`, `src/Ui/src/undo.test.ts`, and the e2e flows in `src/Ui/e2e/forms.e2e.tsx` and `forms-play.e2e.tsx`. Fixture: `tests/RulesFixtures/fixture-pack-forms.json`.
- [play-mechanics.md](../features/play-mechanics.md) lists the fields, codes and actions.
2 changes: 1 addition & 1 deletion docs/features/accessibility-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Status key: ✅ verified (how) · 🔧 found and fixed in this change · ⚠️

## Automated evidence

- `src/Ui/e2e/flow.e2e.tsx` (Vitest + Testing Library against the real DevHost) drives create → sheet → override → export → import **only through accessible roles and names**. A control without a usable label would fail the test.
- `src/Ui/e2e/core.e2e.tsx` (Vitest + Testing Library against the real DevHost) drives create → sheet → override → export → import **only through accessible roles and names**. A control without a usable label would fail the test.
- The same file checks keyboard-only access: Tab reaches "+ Add a character", and choosing "Make a new one" then Continue opens the form with focus on Name.
- M2 item 1: the builder test drives create → choices → cancelled level-up → level-up to 3 → "Make choices" by role and name only (radio groups, choice groups named by their legends), and asserts focus on the builder heading after a step change (2.4.3). Keyboard-only and Narrator passes of the builder are still owner checks (items 3 and 15).
- M2 item 2: the same test spends a resource, sets temporary hit points, takes damage, toggles a condition and rolls (feature and d20 with advantage), all by role and name. Panels are regions named by their headings; the summary is the exception, a region named "Summary" by `aria-label`, with no heading. The roll result is a polite live region (`aria-live`), not `role="status"`, so it does not compete with the app's status line. Its announcement by Narrator is not checked yet (item 15). Superseded by row 106 (Wave 3 G3): the region is now "Status" and the last roll is one `role="status"` node.
Expand Down
4 changes: 2 additions & 2 deletions docs/features/builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

SPEC C-01, C-07, S-02 · ROADMAP M2 · MVP "Builder" · status: implemented (M2 item 1).

`src/Ui/src/components/CharacterBuilder.tsx` over `src/AppService/Builder.cs`. Acceptance: `tests/AppService.Tests/BuilderDraftTests.cs` and the e2e test "builds an SRD 5.2.1 Barbarian as drafts" in `src/Ui/e2e/flow.e2e.tsx`.
`src/Ui/src/components/CharacterBuilder.tsx` over `src/AppService/Builder.cs`. Acceptance: `tests/AppService.Tests/BuilderDraftTests.cs` and the e2e test "builds an SRD 5.2.1 Barbarian as drafts" in `src/Ui/e2e/builder.e2e.tsx`.

## Drafts (SPEC C-07)

Expand Down Expand Up @@ -76,7 +76,7 @@ In the choices step each caster's picker has a search by name ([spellcasting.md]

### Tests

Vitest: `CharacterBuilder.test.tsx` (steps, methods, review). e2e: the `createCharacter(user, { name, family?, scores?, species?, cls?, background?, other? })` helper in `src/Ui/e2e/flow.e2e.tsx` walks the seven steps (it skips Gear unless `kit` is set). With `scores` it uses "Enter by hand"; without, it assigns the standard array in order.
Vitest: `CharacterBuilder.test.tsx` (steps, methods, review). e2e: the `createCharacter(user, { name, family?, scores?, species?, cls?, background?, other? })` helper in `src/Ui/e2e/helpers.tsx` walks the seven steps (it skips Gear unless `kit` is set). With `scores` it uses "Enter by hand"; without, it assigns the standard array in order.

## Accessibility (WCAG 2.2 AA, D05)

Expand Down
2 changes: 1 addition & 1 deletion docs/features/ddb-pdf-import-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ Dispatcher (`tests/AppService.Tests/PersistenceAndDispatchTests.cs`, extend): `d
- `falls back to a file input when the host has no dialog`
- `every table has a caption and row headers` (axe-style assertions as the existing component tests do; check `src/Ui/src/components/*.test.tsx` for the pattern)

`src/Ui/e2e/flow.e2e.tsx` (extend): `it('imports a D&D Beyond sheet, resolves a choice, keeps one sheet number as an override and creates the character', …)` reading `tests/RulesFixtures/pdf/fixture-ddb-sheet.pdf` through `ddb.readData` (the DevHost has no dialog), plus `it('cancelling the D&D Beyond import at each step leaves the character list unchanged', …)`.
`src/Ui/e2e/character-import.e2e.tsx` (extend): `it('imports a D&D Beyond sheet, resolves a choice, keeps one sheet number as an override and creates the character', …)` reading `tests/RulesFixtures/pdf/fixture-ddb-sheet.pdf` through `ddb.readData` (the DevHost has no dialog), plus `it('cancelling the D&D Beyond import at each step leaves the character list unchanged', …)`.

**Doc updates.** Spec: status to "built, awaiting owner checks"; `docs/features/gap-notes.md` "A note" gains the `import` kind and the refusal in `gap.add`; `docs/schemas/README.md`; `docs/features/accessibility-checklist.md` gains an item for the step view; `docs/CHANGELOG.md` "Unreleased / Added"; LIVING_SPECS change history (built; gap-note v2; no DB or package change). The companion edits below are listed for the owner, not made here.

Expand Down
8 changes: 4 additions & 4 deletions docs/features/play-mechanics.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ A cost, a `toHit` or a `damageBonus` that does not parse is the usual `validate.

## Slice 5: action details and named values (content v11 only)

Rules core: `RollEffect` (new fields), `RollSave`, `RollArea`, `RollPerUnit`, `ValueEffect` and `DiceRoller.TryPerUnitFormula` in `src/RulesCore/Effects.cs` and `Dice.cs`; `FormulaFeatures` and the `VALUE.` identifier in `Formulas.cs`; `RollDetailsOf`, `CollectValues`, `ResolveValue` and `FieldReads` in `Calculation.cs`; `FormulaPreview.cs`; the checks in `ContentValidation.cs`. Service: the roll-effect branch of `src/AppService/Rolling.cs`. UI: the actions panel and the roll record in `PlayPanels.tsx`; `RollFields.tsx`, `rollAuthoring.ts` and `HomebrewStudio.tsx`. Acceptance: `tests/RulesCore.Tests/ActionDetailContentTests.cs`, `ActionDetailTests.cs`, `NamedValueTests.cs` and `Properties/PerUnitProperties.cs`, `tests/AppService.Tests/RollCommandTests.cs` (including `The_acceptance_technique_rolls_and_spends_the_same_amount`), `src/Ui/src/components/ActionsPanel.test.tsx`, `HomebrewStudioRolls.test.tsx` and `rollAuthoring.test.ts`, and the e2e flow in `src/Ui/e2e/forms.e2e.tsx`. Fixtures: `tests/RulesFixtures/fixture-pack-action-details.json` and `characters/pm-wave-adept-l5.json`. There is no new character field, play action or version: everything here is content schema v11.
Rules core: `RollEffect` (new fields), `RollSave`, `RollArea`, `RollPerUnit`, `ValueEffect` and `DiceRoller.TryPerUnitFormula` in `src/RulesCore/Effects.cs` and `Dice.cs`; `FormulaFeatures` and the `VALUE.` identifier in `Formulas.cs`; `RollDetailsOf`, `CollectValues`, `ResolveValue` and `FieldReads` in `Calculation.cs`; `FormulaPreview.cs`; the checks in `ContentValidation.cs`. Service: the roll-effect branch of `src/AppService/Rolling.cs`. UI: the actions panel and the roll record in `PlayPanels.tsx`; `RollFields.tsx`, `rollAuthoring.ts` and `HomebrewStudio.tsx`. Acceptance: `tests/RulesCore.Tests/ActionDetailContentTests.cs`, `ActionDetailTests.cs`, `NamedValueTests.cs` and `Properties/PerUnitProperties.cs`, `tests/AppService.Tests/RollCommandTests.cs` (including `The_acceptance_technique_rolls_and_spends_the_same_amount`), `src/Ui/src/components/ActionsPanel.test.tsx`, `HomebrewStudioRolls.test.tsx` and `rollAuthoring.test.ts`, and the e2e flow in `src/Ui/e2e/forms-play.e2e.tsx`. Fixtures: `tests/RulesFixtures/fixture-pack-action-details.json` and `characters/pm-wave-adept-l5.json`. There is no new character field, play action or version: everything here is content schema v11.

### Content (schema v11, added)

Expand Down Expand Up @@ -348,7 +348,7 @@ A roll's editor has every field: Dice (clearing it makes an action that rolls no

## Slice 6: roll modes, fly speed and form-only damage defences (content v11 only)

Rules core: `RollModeEffect`, `GrantEffect.WhileToggle` and `FieldIds.FlySpeed` in `src/RulesCore/Effects.cs`; `RollModes.cs` (`RollModeReason`, `RollModeSummary`, `RollModes.Combine`); `CollectRollModes`, `GateOnToggle`, `CollectDamageDefences`, `IsPlayMechanicsOnlyField` and the `speed.fly` spec in `Calculation.cs`; the checks in `ContentValidation.cs`. Service: the field branch of `src/AppService/Rolling.cs`. UI: `rollModes.ts`, `rollText.ts`, the field buttons in `CharacterSheet.tsx` and `SheetSummary.tsx`, `RollResult` and `RollModePicker` in `PlayPanels.tsx`, and `RollModeFields.tsx` with `HomebrewStudio.tsx`. Acceptance: `tests/RulesCore.Tests/RollModeContentTests.cs`, `RollModeTests.cs`, `Properties/RollModeProperties.cs`, `FormOnlyDefenceTests.cs`, `DamagePipelineTests.cs` and `AbilityCapTests.cs`, `tests/AppService.Tests/RollCommandTests.cs`, `src/Ui/src/rollText.test.ts`, `components/CharacterSheet.test.tsx`, `SheetSummary.test.tsx` and `HomebrewStudioRollModes.test.tsx`, and the e2e flow in `src/Ui/e2e/forms.e2e.tsx`. Fixtures: `tests/RulesFixtures/fixture-pack-roll-modes.json` and `characters/pm-instinct-l4.json`. There is no new character field, play action or version: everything here is content schema v11.
Rules core: `RollModeEffect`, `GrantEffect.WhileToggle` and `FieldIds.FlySpeed` in `src/RulesCore/Effects.cs`; `RollModes.cs` (`RollModeReason`, `RollModeSummary`, `RollModes.Combine`); `CollectRollModes`, `GateOnToggle`, `CollectDamageDefences`, `IsPlayMechanicsOnlyField` and the `speed.fly` spec in `Calculation.cs`; the checks in `ContentValidation.cs`. Service: the field branch of `src/AppService/Rolling.cs`. UI: `rollModes.ts`, `rollText.ts`, the field buttons in `CharacterSheet.tsx` and `SheetSummary.tsx`, `RollResult` and `RollModePicker` in `PlayPanels.tsx`, and `RollModeFields.tsx` with `HomebrewStudio.tsx`. Acceptance: `tests/RulesCore.Tests/RollModeContentTests.cs`, `RollModeTests.cs`, `Properties/RollModeProperties.cs`, `FormOnlyDefenceTests.cs`, `DamagePipelineTests.cs` and `AbilityCapTests.cs`, `tests/AppService.Tests/RollCommandTests.cs`, `src/Ui/src/rollText.test.ts`, `components/CharacterSheet.test.tsx`, `SheetSummary.test.tsx` and `HomebrewStudioRollModes.test.tsx`, and the e2e flow in `src/Ui/e2e/forms-play.e2e.tsx`. Fixtures: `tests/RulesFixtures/fixture-pack-roll-modes.json` and `characters/pm-instinct-l4.json`. There is no new character field, play action or version: everything here is content schema v11.

### Content (schema v11, added)

Expand Down Expand Up @@ -432,7 +432,7 @@ mode: { automatic: "advantage" | "disadvantage" | "normal",

## Slice 7: damage responses (content v11 only; D45)

Rules core: `ResponseEffect`, `ResponsePhase`, `ResponseWhen` and `ResponseOutcome` in `src/RulesCore/Effects.cs`; `DamagePipeline.Plan` and `DamagePipeline.Apply` with their records in `src/RulesCore/DamagePipeline.cs`; `CollectResponses` and `CharacterSheet.Responses` in `Calculation.cs`; the checks in `ContentValidation.cs`. Service: `character.damagePreview` and the damage branch of `character.play` (`src/AppService/Damage.cs`, `Play.cs`). UI: `DamagePanel.tsx`, `PlayPanels.tsx`, `CharacterSheet.tsx` and `ResponseFields.tsx` with `HomebrewStudio.tsx`. Acceptance: `tests/RulesCore.Tests/ResponseContentTests.cs` and `DamageResponseTests.cs`, `tests/AppService.Tests/DamageResponseServiceTests.cs`, `src/Ui/src/components/DamagePanel.test.tsx` and `HomebrewStudioResponses.test.tsx`, and the e2e flow in `src/Ui/e2e/forms.e2e.tsx`. Fixtures: `tests/RulesFixtures/fixture-pack-responses.json` and `characters/pm-bulwark-l8.json`. There is no new character field or version: everything here is content schema v11. Benchmarks: [performance.md](../performance.md).
Rules core: `ResponseEffect`, `ResponsePhase`, `ResponseWhen` and `ResponseOutcome` in `src/RulesCore/Effects.cs`; `DamagePipeline.Plan` and `DamagePipeline.Apply` with their records in `src/RulesCore/DamagePipeline.cs`; `CollectResponses` and `CharacterSheet.Responses` in `Calculation.cs`; the checks in `ContentValidation.cs`. Service: `character.damagePreview` and the damage branch of `character.play` (`src/AppService/Damage.cs`, `Play.cs`). UI: `DamagePanel.tsx`, `PlayPanels.tsx`, `CharacterSheet.tsx` and `ResponseFields.tsx` with `HomebrewStudio.tsx`. Acceptance: `tests/RulesCore.Tests/ResponseContentTests.cs` and `DamageResponseTests.cs`, `tests/AppService.Tests/DamageResponseServiceTests.cs`, `src/Ui/src/components/DamagePanel.test.tsx` and `HomebrewStudioResponses.test.tsx`, and the e2e flow in `src/Ui/e2e/forms-play.e2e.tsx`. Fixtures: `tests/RulesFixtures/fixture-pack-responses.json` and `characters/pm-bulwark-l8.json`. There is no new character field or version: everything here is content schema v11. Benchmarks: [performance.md](../performance.md).

### The response effect

Expand Down Expand Up @@ -478,7 +478,7 @@ On a sheet with responses, "Take damage" and the summary's "Lose 1 hit point" op

## Slice 8: charging (content v11 only)

Rules core: `RollEffect.AlsoChange`, `RollEffect.DrawsDown` and `AlsoChange` in `src/RulesCore/Effects.cs`; `PoolChange` and `PoolChanges.Apply` in `src/RulesCore/Charging.cs`; `AlsoChangeValue` and the roll details in `Calculation.cs`; the checks in `ContentValidation.cs`. Service: the `useAction` and `endEncounter` branches of `src/AppService/Play.cs` and the draw-down check of the roll command in `Rolling.cs`. UI: the actions panel, the roll record and the Combat strip in `PlayPanels.tsx` and `CombatStrip.tsx`; `RollFields.tsx` with `HomebrewStudio.tsx`. Acceptance: `tests/RulesCore.Tests/ChargingContentTests.cs` and `Properties/ChargingProperties.cs`, `tests/AppService.Tests/ChargingTests.cs`, `src/Ui/src/components/ActionsPanel.test.tsx`, `CombatStrip.test.tsx` and `HomebrewStudioRolls.test.tsx`, and the e2e flow in `src/Ui/e2e/forms.e2e.tsx`. Fixtures: `tests/RulesFixtures/fixture-pack-charging.json` and `characters/pm-charger-l5.json`. There is no new character field or version: everything here is content schema v11.
Rules core: `RollEffect.AlsoChange`, `RollEffect.DrawsDown` and `AlsoChange` in `src/RulesCore/Effects.cs`; `PoolChange` and `PoolChanges.Apply` in `src/RulesCore/Charging.cs`; `AlsoChangeValue` and the roll details in `Calculation.cs`; the checks in `ContentValidation.cs`. Service: the `useAction` and `endEncounter` branches of `src/AppService/Play.cs` and the draw-down check of the roll command in `Rolling.cs`. UI: the actions panel, the roll record and the Combat strip in `PlayPanels.tsx` and `CombatStrip.tsx`; `RollFields.tsx` with `HomebrewStudio.tsx`. Acceptance: `tests/RulesCore.Tests/ChargingContentTests.cs` and `Properties/ChargingProperties.cs`, `tests/AppService.Tests/ChargingTests.cs`, `src/Ui/src/components/ActionsPanel.test.tsx`, `CombatStrip.test.tsx` and `HomebrewStudioRolls.test.tsx`, and the e2e flow in `src/Ui/e2e/forms-play.e2e.tsx`. Fixtures: `tests/RulesFixtures/fixture-pack-charging.json` and `characters/pm-charger-l5.json`. There is no new character field or version: everything here is content schema v11.

### Content (schema v11, added)

Expand Down
Loading
Loading