Auto-open stat block panel when adding first bestiary creature
When the side panel is in its initial closed state (not user-collapsed), adding a combatant from the bestiary now opens the panel to show its stat block. This makes the panel discoverable without overriding a deliberate collapse. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -137,7 +137,9 @@ describe("useEncounter", () => {
|
||||
type: "humanoid",
|
||||
};
|
||||
|
||||
act(() => result.current.addFromBestiary(entry));
|
||||
act(() => {
|
||||
result.current.addFromBestiary(entry);
|
||||
});
|
||||
|
||||
expect(result.current.hasCreatureCombatants).toBe(true);
|
||||
expect(result.current.canRollAllInitiative).toBe(true);
|
||||
@@ -158,7 +160,9 @@ describe("useEncounter", () => {
|
||||
type: "humanoid",
|
||||
};
|
||||
|
||||
act(() => result.current.addFromBestiary(entry));
|
||||
act(() => {
|
||||
result.current.addFromBestiary(entry);
|
||||
});
|
||||
|
||||
const combatant = result.current.encounter.combatants[0];
|
||||
expect(combatant.name).toBe("Goblin");
|
||||
@@ -183,8 +187,12 @@ describe("useEncounter", () => {
|
||||
type: "humanoid",
|
||||
};
|
||||
|
||||
act(() => result.current.addFromBestiary(entry));
|
||||
act(() => result.current.addFromBestiary(entry));
|
||||
act(() => {
|
||||
result.current.addFromBestiary(entry);
|
||||
});
|
||||
act(() => {
|
||||
result.current.addFromBestiary(entry);
|
||||
});
|
||||
|
||||
const names = result.current.encounter.combatants.map((c) => c.name);
|
||||
expect(names).toContain("Goblin 1");
|
||||
|
||||
Reference in New Issue
Block a user