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:
@@ -128,9 +128,12 @@ export function App() {
|
||||
|
||||
const handleAddFromBestiary = useCallback(
|
||||
(result: SearchResult) => {
|
||||
addFromBestiary(result);
|
||||
const creatureId = addFromBestiary(result);
|
||||
if (creatureId && sidePanel.panelView.mode === "closed") {
|
||||
sidePanel.showCreature(creatureId);
|
||||
}
|
||||
},
|
||||
[addFromBestiary],
|
||||
[addFromBestiary, sidePanel.panelView.mode, sidePanel.showCreature],
|
||||
);
|
||||
|
||||
const handleCombatantStatBlock = useCallback(
|
||||
|
||||
Reference in New Issue
Block a user