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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added

- **PLAYERS CHANGE GEAR.** A new switch on the GAME tab's house rules, on to start, for systems with their own item types. Switched off, only the GM changes the columns of a player's gear (a weapon's DAMAGE, a potion's HEALS): the player's card shows them but can't change them, and says "ONLY THE GM CHANGES THESE AT THIS TABLE". Players still name, count, move, add and remove their things, and the GM can always change anything.
- **UNIQUE on GEAR.** A thing changed from the item it is named after (the Cutlass made 2d8) now says UNIQUE on its line; hover it for the item's own value and who changed it, and when (a player by name, or the GM). In its card, each column made its own says UNIQUE with the item's value beside it and a THE ITEM'S button to put it back. Type unique in FIND to list them. SHEET.EXE and the sheet's own tab are the same.
- **FIND on GEAR.** A find box at the top of the sheet's GEAR tab, always there, keeps only the things that match as you type: a name, a type (GUNS), a value (2d6, 30 m) or a column (AMMO), in any case, every word somewhere on the line. Each band counts its matches and opens while you search, so nothing in a closed STASH is missed; clear it with its × or Esc and the bands are as you left them. When nothing matches, it says so. SHEET.EXE and the sheet's own tab are the same.
- **GEAR in bands.** The sheet's GEAR tab now sorts what you carry into EQUIPPED, USABLE and PACK, by each item type's ON THE SHEET, with a count on each band and what's in hand first. A fourth band, STASH, holds everything left in the stash whatever its type, and says each one's type; it starts closed. Click a band's head to close or open it, and the sheet remembers. The + buttons for adding a thing by hand sit in one row at the top, and the band it lands in opens. SHEET.EXE and the sheet's own tab are the same.
Expand Down Expand Up @@ -801,6 +802,7 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Changed

- **"THE GM GAVE YOU" notices in one box, gone after 5 seconds.** Gifts now share one box, newest first, instead of stacking a box each, and each fades away 5 seconds after it arrives. Hover over the box (or tab into it) to keep it while you read; ✕ closes them all.
- **Slot and install counters only where they are used.** On GEAR, a counter like ATTUNED 0 OF 3 or CYBERWARE · STRAIN 0 OF 2 shows only once something on that sheet needs it, worn, carried or stashed, or while anything is still counted against it. A character with no cyberware no longer sees STRAIN 0 OF 0.
- **One line a thing on GEAR.** Each thing on the sheet's GEAR tab is now a single line: its name, how many, its values with ROLL, FIRE and RELOAD beside them, and where it is carried, still changed with one click. The ✎ at the end of each line opens its card (a click on the line does too), with NAME, HOW MANY, every column, LOCATION, DONE and REMOVE; one card is open at a time. A line with nothing filled in at all shows a dashed FILL IN, which opens the card at its first box, ready to type; a column left blank beside others means it doesn't apply, so it says nothing. A pick-one box such as GRADE is now as wide as its words, not the whole card. Anything worn, attuned or installed now sits in EQUIPPED, whatever band its type is in, and goes back when taken off. When something lands in a closed band (worn, bought or given), its header pulses briefly and stays lit until you open it; with reduced motion turned on, it is only lit. SHEET.EXE and the sheet's own tab are the same.
- **Long shop shelves stay quick.** A shelf with hundreds of lines now shows 200 at a time, with more as you scroll down, or press SHOW MORE. A line says how many there are, and filtering and sorting still cover every line. Typing in the filter no longer waits for the list to redraw. On a 1000-line shelf, sorting went from about 0.4 s to 0.15 s, and opening it from 0.6 s to 0.26 s. Saving a big catalogue is about five times faster.
Expand Down
20 changes: 11 additions & 9 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions e2e/COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ panel), so a control that looks fine but does nothing is caught for all of them.
| The shops under load | 1000+ lines on a shelf, 200 items, a full cart, a long gear list (8n3); a long shelf drawn 200 rows at a time | `shop_stress`, `ShopWindow` | `shop-stress` | **AT THE TABLE** |
| An item type's SOLD AT | the kinds of shop that sell its lines (8a7a2), the General Store where unsaid; set in the builder in 8a7b | `shop_typed_lines`, `typedShelves` | `shop-typed-lines` (unsaid: the General Store) | **AT THE TABLE** unsaid; a kind of shop picked waits for 8a7b's box |
| An item type's ON THE SHEET band | EQUIPPED, USABLE or PACK (G1), PACK where unsaid; the sheet's GEAR tab in those bands plus STASH, closed to start, a band's head closing it, remembered (G2); a thing worn, attuned or installed in EQUIPPED whatever its type, a closed band something lands in lit until opened (G3) | `system_builder_item_types`, `itemTypes`, `ItemsPage`, `gearBands`, `GearTypeTables` | `builder-item-types` (the WEAPON preset EQUIPPED), `sheet-gear-bands` (a Sword, a Draught and a Rope in EQUIPPED, USABLE and PACK; the Sword stashed into STASH; USABLE kept closed; a Cloak of GEAR worn into a closed EQUIPPED, its head lit, taken off back into PACK) | **AT THE TABLE** |
| PLAYERS CHANGE GEAR | the GAME tab's switch, on to start, offered where a system makes its own item types (G6a, G6b): off, a player's gear columns are the GM's | `players_change_gear` setting, `switches.gear`, `uniqueLines.keepColumns`, `GearTypeTables` | `sheet-players-change-gear` (off: DAMAGE read only and said; the GM changes it, UNIQUE by the GM; on: the player changes it) | **AT THE TABLE** |
| An item's PRICE and IN SHOPS | priced and IN SHOPS, it sells itself at its type's shops (8a7a3a); off, never sold, not even from a file, but bought back at its price by a shop of its type (8a7a3c2); a type's PRICE column read as its price; set on ITEMS under TYPE, NOT SOLD in the list, a new item's price asked for (8a7a3b1); in the ITEMS import and downloads, price and in shops columns (8a7a3b2) | `shop_items_on_sale`, `itemPrice`, `ItemsPage`, `system_builder_items_import`, `itemsImport` | `shop-items-on-sale` (a type's PRICE column; a ring turned off; sold back from the window at 50%), `builder-item-price` (set by clicks), `builder-items-import` (imported priced and IN SHOPS) | **AT THE TABLE** |
| A catalogue file held against the game's items | an exact copy of an item left out, an item kept out of the shops left out, one of an item's name overruling it, ALSO ON SALE FROM ITEMS (8a7a3c1) | `shop_items_on_sale`, `CatalogueWindow` | `catalogue-and-items` | **AT THE TABLE** |
| ADD NEW LINES TO ITEMS | a catalogue's new lines made items in the draft (8a7a4a), off to start; on PUBLISH the lines now exactly an item leave the file (8a7a4b) | `catalogue_into_items`, `CatalogueWindow`, `catalogueItems`, `BuilderScreen` | `catalogue-and-items` (the Hand Cannon into the draft, then out of the file once published) | **AT THE TABLE** |
Expand Down
1 change: 1 addition & 0 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ kept; the job itself stops at 30 (`timeout-minutes`), for a hang outside the tes
| `tests/sheet-ranks-start.spec.ts` | Ranks making a character (7f1c2): a player in NEW CHARACTER types Grit, finds Lore under RANKS with UP TO TRAINED TO START and EXPERT off, picks TRAINED, and the server keeps the step 1 with Lore worth 2 |
| `tests/sheet-worn-items.spec.ts` | Items at the table (7e3b): two GEAR lines named like items get WEAR and ATTUNE; the ring worn does nothing yet, attuned it is WORKING, ATTUNED 1 OF 1, CON 14 → 16; the cloak worn with no slot free says so and can't attune; the GM, on the player's sheet, ATTUNES it ANYWAY (2 OF 1) and gives them 2 of their own; END frees the ring's slot and its +2 goes; the cloak taken off stays attuned and does nothing. A second test: the GM's GIVE.EXE lists the ring under ITEMS with NEEDS ATTUNED and its words, gives it to the player as a stowed gear line, the player is told and WEARS it; TERMINATE_SESSION closes GIVE.EXE while the session is still ending; and (2026-11-22) no ATTUNED bar on GEAR until the Ring's line is there |
| `tests/sheet-item-types.spec.ts` | The GEAR tab as a table per item type (8a3a): a player's sheet with WEAPONS and GEAR tables, each empty with its +; + WEAPON made A stick with DAMAGE 1d4 and GRADE HEAVY; a second line named Pistol showing 2d6 + @might faint, its RANGE typed over to 50 m; + GEAR made Rope at 10 lb; saved as made, each in its table after a reload; since 8a3b the stick's DAMAGE rolled with ROLL, "rolled A stick DAMAGE 1d4" in the dice tray's history; and (8a3c1) as compact lines: a line made by hand opened under ✎, DONE showing its words with ROLL, the Pistol's RANGE read as words after the reload, and no box on the GEAR tab scrolling sideways in SHEET.EXE; and (8a3c2) the Pistol's DAMAGE under ✎ said ON THIS CHARACTER: 2d6 + Might (12): 14 to 24, @strength flagged as not the system's, eˣ INSERT putting in @might; and (G2) in bands: PACK says "Nothing here." with no WEAPONS group before anything is carried, and things are added from the row of + at the top; and (G3) the Pistol's card opened by a click on its name; and (G5a) the Pistol, its RANGE its own, saved with who changed it and when; and (G5b) after the reload the Pistol says UNIQUE, its hover "RANGE 50 m, the item's: 30 m · changed by" the player, "unique" in FIND showing it and not the stick; THE ITEM'S on its DAMAGE and RANGE leaves a plain Pistol, saved so |
| `tests/sheet-players-change-gear.spec.ts` | PLAYERS CHANGE GEAR (G6a, G6b): a player names a Cutlass made by hand; the GAME tab's switch off at the table, its card shows DAMAGE read only and "ONLY THE GM CHANGES THESE AT THIS TABLE", the name still theirs; the GM makes it 2d8 on their sheet, and the line says UNIQUE, "changed by the GM"; on again, the player makes it 3d8, saved; the switch put back on whatever happens |
| `tests/sheet-gear-bands.spec.ts` | The GEAR tab in bands (G2): a game with WEAPONS EQUIPPED, POTIONS USABLE and GEAR unsaid; a player adds a Sword, a Draught and a Rope from the row of + at the top, each in its band and counted (EQUIPPED · 1, USABLE · 1, PACK · 1, STASH · 0 closed), saved as made; the Sword moved to the stash goes to STASH, which opens and says WEAPONS, EQUIPPED left at 0; USABLE closed by its head, and on the next visit USABLE is still closed and PACK open; and (G3) one line a thing: the Draught's HEALS blank, so FILL IN, which opens its card at that box, ready to type; 2d4 typed, DONE, the line says HEALS 2d4 and FILL IN is gone, saved; a Cloak, GEAR, made by hand sits in PACK, WEAR puts it in EQUIPPED (EQUIPPED · 1), taken off it is back in PACK; with EQUIPPED closed, WEAR lights its head (▸ EQUIPPED · 1), opened it is plain again; and (G4) FIND: 2d4 shows the Draught in USABLE, closed, opened while it shows (PACK · 0), lantern says nothing matches, cleared USABLE is closed again |
| `tests/sheet-gear-counts.spec.ts` | A gear line's COUNT at the table (8a4): a player's Pistol at AMMO 2 / 6 spends one with FIRE; RELOAD, with Pistol Rounds and AP Rounds both carried, asks which and takes all 3 AP Rounds, their line gone; RELOAD again takes 2 of the Pistol Rounds alone, full, RELOAD held; the Wand's CHARGES, with no RELOAD, filled by a SHORT REST from the sheet |
| `tests/sheet-standalone-tab.spec.ts` | The sheet in a new tab is the window (8s1a): a player makes two gear lines in SHEET.EXE, opens the tab with ⧉ (a `.crt-container`, so in the theme), WEARs the boots there and SHEET.EXE says WORKING too, and rolls the club's DAMAGE from the tab, said on it once the dice land; since 8s1b the roll from the tab opens DICE_TRAY.EXE in the main app's window; and (8s1c) a character being made: the flow left, SHEET.EXE says CREATING · CONTINUE, the tab says it too and opens NEW_CHARACTER.EXE on itself; and (8s1d) Cash on the tab opens BANK.EXE in the main window and the tab says so, then with the main window closed the tab says to open it; and (G2) gear added from the row of + at the top of GEAR |
Expand Down
5 changes: 2 additions & 3 deletions e2e/tests/sheet-new-character.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,10 +482,9 @@ test('a kit the GM gives: listed in GIVE, ticked, landing on the sheet with the
await expect(who.getByText('4 items, in the inventory')).toBeVisible({ timeout: 15_000 });
await who.getByRole('checkbox', { name: 'Wren' }).check();
await page.getByRole('button', { name: 'GIVE 1 × ROOK TO 1' }).click();
await expect.poll(async () => JSON.parse((await stored()).inventory ?? '[]').map((i: { name: string; qty: number }) => [i.name, i.qty]), { timeout: 15_000 }).toEqual([['Old sword', 1], ['Candles', 3]]);

// The player is told, and it is on their sheet without a reload.
// The player is told (looked for first: the notice goes after 5 seconds), and it is on their sheet without a reload.
await expect(theirs.getByText('THE GM GAVE YOU ROOK ×1: Old sword, 3x Candles')).toBeVisible({ timeout: 15_000 });
await expect.poll(async () => JSON.parse((await stored()).inventory ?? '[]').map((i: { name: string; qty: number }) => [i.name, i.qty]), { timeout: 15_000 }).toEqual([['Old sword', 1], ['Candles', 3]]);
await sheetTab(theirs, 'GEAR');
await expect(theirs.locator('[value="Candles"]')).toHaveCount(1, { timeout: 15_000 });
await theirs.context().close();
Expand Down
63 changes: 63 additions & 0 deletions e2e/tests/sheet-players-change-gear.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { test, expect } from '@playwright/test';
import { signInAsPlayer, gmToken, asGm, runningSystem, approvedPlayer, sheetTab } from './helpers';

// PLAYERS CHANGE GEAR (G6a, G6b; decided 2026-11-20, all A, the user: "the GM can still open, view and change things"): the
// GAME tab's switch off at the table, a player's GEAR card shows the Cutlass's DAMAGE but can't change it, and says so; the
// GM changes it on their sheet, which the player sees as UNIQUE, changed by the GM; on again, the player changes it.
// The table's settings are shared by the tests in a part: switched back on whatever happens.

test('PLAYERS CHANGE GEAR off: the player\'s DAMAGE shown not changed, the GM changes it, on again the player does (G6)', async ({ browser, request }, info) => {
test.setTimeout(120_000);
const again = info.retry ? `_${info.retry + 1}` : '';
const gm = await gmToken(request);
await runningSystem(request, gm, {
format: 1, name: `Gearlock${again}`, core: { health: { model: 'pool' } },
stats: [{ id: 'abilities', label: 'ABILITIES', stats: [{ id: 'might', label: 'Might' }] }],
items: {
types: [{ id: 'weapons', label: 'WEAPONS', one: 'Weapon', on_sheet: 'equipped', columns: [{ id: 'damage', label: 'DAMAGE', kind: 'damage' }] }],
list: [{ id: 'cutlass', label: 'Cutlass', type: 'weapons', values: { damage: '1d8' } }],
},
});
const player = { username: `e2e_gearlock${again}`, password: 'e2e-player-password' };
await approvedPlayer(request, gm, player);
const sheetOf = async () => (await asGm(request, gm, 'get', `/api/sheets/user/${player.username}`)).data;
const setting = (value: string) => asGm(request, gm, 'post', '/api/settings', { key: 'players_change_gear', value });

const context = await browser.newContext({ baseURL: info.project.use.baseURL, viewport: { width: 1280, height: 800 } });
const mine = await context.newPage();
try {
await signInAsPlayer(mine, player);
await mine.getByRole('button', { name: 'CHARACTER_CONTROLS', exact: true }).click();
await mine.getByRole('button', { name: 'CHARACTER_SHEET', exact: true }).click();
await sheetTab(mine, 'GEAR');
await mine.getByRole('group', { name: 'Add by hand' }).getByRole('button', { name: 'Add a Weapon by hand' }).click();
await mine.getByLabel('Item 1 name', { exact: true }).fill('Cutlass');
await expect.poll(async () => JSON.parse(String((await sheetOf()).inventory ?? '[]'))[0]?.name, { timeout: 15_000 }).toBe('Cutlass');
const card = mine.getByRole('group', { name: 'Item 1 columns' });
const damage = card.getByLabel('Item 1 DAMAGE', { exact: true });
await expect(damage).toHaveAttribute('placeholder', '1d8');
await expect(damage).not.toHaveAttribute('readonly', /.*/);

// Off: the card shows DAMAGE, can't change it, says so; the name is still theirs.
await setting('0');
await expect(card.getByRole('note', { name: 'Item 1 columns' })).toHaveText('ONLY THE GM CHANGES THESE AT THIS TABLE', { timeout: 15_000 });
await expect(damage).toHaveAttribute('readonly', /.*/);
await expect(card.getByLabel('Item 1 name', { exact: true })).not.toHaveAttribute('readonly', /.*/);

// The GM, on the player's sheet, makes it 2d8: the player sees it UNIQUE, changed by the GM.
await asGm(request, gm, 'put', `/api/sheets/user/${player.username}`, {
fields: { inventory: JSON.stringify([{ name: 'Cutlass', qty: 1, enc: '', bundled: false, carry: 'stowed', location: '', values: { damage: '2d8' } }]) },
});
const line = mine.getByTestId('gear-line-0');
await expect(line.getByRole('note', { name: 'Item 1 is unique' })).toHaveAttribute('title', /DAMAGE 2d8, the item's: 1d8 · changed by the GM, /, { timeout: 15_000 });

// On again: the player changes it.
await setting('1');
await expect(card.getByRole('note', { name: 'Item 1 columns' })).toHaveCount(0, { timeout: 15_000 });
await damage.fill('3d8');
await expect.poll(async () => JSON.parse(String((await sheetOf()).inventory ?? '[]'))[0]?.values?.damage, { timeout: 15_000 }).toBe('3d8');
} finally {
await setting('1');
await context.close();
}
});
5 changes: 2 additions & 3 deletions e2e/tests/sheet-worn-items.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,9 @@ test('GIVE.EXE hands out a system\'s item from ITEMS: a stowed line of its name,
await expect(who.getByText('an inventory line')).toBeVisible({ timeout: 15_000 });
await who.getByRole('checkbox', { name: 'Wren' }).check();
await give.getByRole('button', { name: 'GIVE 1 × RING OF MIGHT TO 1' }).click();
await expect.poll(async () => JSON.parse((await sheetOf()).inventory ?? '[]').map((i: { name: string; carry: string }) => [i.name, i.carry]), { timeout: 15_000 }).toEqual([['Ring of Might', 'stowed']]);

// The player is told, and it is that item: WEAR it there and then.
// The player is told (looked for first: the notice goes after 5 seconds), and it is that item: WEAR it there and then.
await expect(mine.getByText('THE GM GAVE YOU RING OF MIGHT ×1: NEEDS ATTUNED · A heavy iron band.')).toBeVisible({ timeout: 15_000 });
await expect.poll(async () => JSON.parse((await sheetOf()).inventory ?? '[]').map((i: { name: string; carry: string }) => [i.name, i.carry]), { timeout: 15_000 }).toEqual([['Ring of Might', 'stowed']]);
await sheetTab(mine, 'GEAR');
const ring = mine.getByTestId('gear-item-ring');
await ring.getByRole('button', { name: 'WEAR Ring of Might' }).click();
Expand Down
19 changes: 19 additions & 0 deletions frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,25 @@ button.choice-off:disabled {
.gear-band-news { animation: none; }
}

/* The GM's gifts (GiftNotices.tsx): each row fades in, and out over FADE_MS before it goes; the box with its last. */
@keyframes gift-fade-in {
from { opacity: 0; transform: translateY(-4px); }
to { opacity: 1; transform: none; }
}

.gift-row, .gift-box {
animation: gift-fade-in 200ms ease-out;
transition: opacity 400ms ease-in;
}

.gift-row.leaving, .gift-box.leaving {
opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
.gift-row, .gift-box { animation: none; transition: none; }
}

/* FIND on GEAR (G4) has its own × in the theme; the browser's is blue whatever the theme. */
.gear-find::-webkit-search-cancel-button {
-webkit-appearance: none;
Expand Down
Loading
Loading