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:
@@ -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);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user