V1.13.1: add another, straight from the one just added

- A weapon, item, spell, monster or NPC added by hand opens its own
  pop-out, as before. That pop-out now has "+ Add another weapon" (or
  item, spell, monster, NPC) at its top, which goes straight back to an
  empty form: no closing it and pressing "+ Add" again.
- All packages at version 1.13.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 10:38:53 +02:00
co-authored by Claude Opus 5.5
parent 37c561c5d3
commit 3a867fd1a1
15 changed files with 131 additions and 81 deletions
+15 -5
View File
@@ -155,6 +155,8 @@ export function CampaignHomePage() {
const [query, setQuery] = useState('');
// The weapon, item, spell, monster or NPC whose pop-out is open.
const [opened, setOpened] = useState<EntryRef | null>(null);
// The list whose "add by hand" pop-out was asked for from the pop-out of the one just added.
const [addingKind, setAddingKind] = useState<EntryKind | null>(null);
const [newCharName, setNewCharName] = useState('');
const [newEncounterName, setNewEncounterName] = useState('');
const [newEncounterMode, setNewEncounterMode] = useState<EncounterMode>('BATTLE');
@@ -652,11 +654,11 @@ export function CampaignHomePage() {
</div>
)}
{isDM && show('npcs') && <NpcsSection campaignId={campaignId} entries={npcs} onOpen={setOpened} />}
{isDM && show('weapons') && <WeaponsSection campaignId={campaignId} entries={weapons} onOpen={setOpened} />}
{isDM && show('items') && <ItemsSection campaignId={campaignId} entries={items} onOpen={setOpened} />}
{isDM && show('spells') && <SpellsSection campaignId={campaignId} entries={spells} onOpen={setOpened} />}
{isDM && show('monsters') && <MonstersSection campaignId={campaignId} entries={monsters} onOpen={setOpened} />}
{isDM && show('npcs') && <NpcsSection campaignId={campaignId} entries={npcs} onOpen={setOpened} formRequested={addingKind === 'npc'} onFormClosed={() => setAddingKind(null)} />}
{isDM && show('weapons') && <WeaponsSection campaignId={campaignId} entries={weapons} onOpen={setOpened} formRequested={addingKind === 'weapon'} onFormClosed={() => setAddingKind(null)} />}
{isDM && show('items') && <ItemsSection campaignId={campaignId} entries={items} onOpen={setOpened} formRequested={addingKind === 'item'} onFormClosed={() => setAddingKind(null)} />}
{isDM && show('spells') && <SpellsSection campaignId={campaignId} entries={spells} onOpen={setOpened} formRequested={addingKind === 'spell'} onFormClosed={() => setAddingKind(null)} />}
{isDM && show('monsters') && <MonstersSection campaignId={campaignId} entries={monsters} onOpen={setOpened} formRequested={addingKind === 'monster'} onFormClosed={() => setAddingKind(null)} />}
{show('notes') && (
<div className="card">
@@ -883,6 +885,14 @@ export function CampaignHomePage() {
spells={spells ?? []}
monsters={monsters ?? []}
npcs={npcs ?? []}
onAddAnother={
opened.isNew
? () => {
setAddingKind(opened.kind);
setOpened(null);
}
: undefined
}
onClose={() => setOpened(null)}
/>
)}