Add AC field (character, monster/npc, participant edit); layout polish
AC (Armor Class) optional field across all participant entry points: - shared: ac field on makeParticipant + buildMonsterParticipant + buildCharacterParticipant, defaults null - CharacterManager: defaultAc state + add form field + inline edit field + display in character list - Monster add form: AC field - EditParticipantModal: AC field next to Initiative - ParticipantManager (DM list): AC badge on name row (sky-blue, stylized, large value, small label) for at-a-glance reading - Player display: no AC (DM only) Layout polish: - Add participants form: 12-col grid, 5 fields single row (Init Mod, Initiative, AC, Max HP, HP Formula), shrunk from oversized fields - Character add form: 12-col grid, name grows (col-span-6), Init Mod/AC/HP small right-aligned, order matches add participants - Character inline edit: labels added (Name/HP/Init Mod/AC), name flex-grows - HP Formula: label trimmed (example moved to placeholder 'e.g. 2d6+9'), Reroll button in edit modal - ParticipantManager init input shrunk (w-8, centered) Tests: 6 new AC builder tests (turn.ac.test.js). Existing test labels updated for renamed fields.
This commit is contained in:
@@ -62,7 +62,7 @@ describe('Campaign -> Firebase', () => {
|
||||
|
||||
// CharacterManager form
|
||||
fireEvent.change(screen.getByPlaceholderText('Character name'), { target: { value: 'Brog' } });
|
||||
fireEvent.change(screen.getByLabelText(/Default HP/i), { target: { value: '25' } });
|
||||
fireEvent.change(screen.getByLabelText(/^HP$/i), { target: { value: '25' } });
|
||||
fireEvent.change(screen.getByLabelText(/Init Mod/i), { target: { value: '3' } });
|
||||
fireEvent.click(screen.getByRole('button', { name: /Add Character/i }));
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ async function addCharacterToEncounter(name = 'Hero', hp = 10) {
|
||||
await selectCampaignByName(`DS-${name}`);
|
||||
|
||||
fireEvent.change(screen.getByPlaceholderText('Character name'), { target: { value: name } });
|
||||
fireEvent.change(screen.getByLabelText(/Default HP/i), { target: { value: String(hp) } });
|
||||
fireEvent.change(screen.getByLabelText(/^HP$/i), { target: { value: String(hp) } });
|
||||
fireEvent.click(screen.getByRole('button', { name: /Add Character/i }));
|
||||
await waitFor(() => findCalls('updateDoc', '/campaigns/').find(c => c.data.players?.length === 1));
|
||||
const charId = findCalls('updateDoc', '/campaigns/').find(c => c.data.players?.length === 1).data.players[0].id;
|
||||
|
||||
Reference in New Issue
Block a user