diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index 1ad84a3..6d89735 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -30,6 +30,13 @@ export function App() { const activeRowRef = useRef(null); const actionBarAnim = useActionBarAnimation(encounter.combatants.length); + // Close the side panel when the encounter becomes empty + useEffect(() => { + if (isEmpty) { + sidePanel.dismissPanel(); + } + }, [isEmpty, sidePanel.dismissPanel]); + // Auto-scroll to active combatant when turn changes const activeIndex = encounter.activeIndex; useEffect(() => {