Skip auto-opening stat block panel when adding creatures on mobile

On desktop the panel has room alongside the combatant list, but on
mobile it covers the screen and disrupts the add-combatant flow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-03-24 23:22:54 +01:00
parent 64a1f0b8db
commit a9ca31e9bc

View File

@@ -279,7 +279,8 @@ export function ActionBar({
const handleAddFromBestiary = useCallback( const handleAddFromBestiary = useCallback(
(result: SearchResult) => { (result: SearchResult) => {
const creatureId = addFromBestiary(result); const creatureId = addFromBestiary(result);
if (creatureId && panelView.mode === "closed") { const isDesktop = globalThis.matchMedia("(min-width: 1024px)").matches;
if (creatureId && panelView.mode === "closed" && isDesktop) {
showCreature(creatureId); showCreature(creatureId);
} }
}, },