fix(sections): inserting from the section library closes the mobile Blocks sheet
The section library now calls closeSheet() after inserting a section (or a global section). It mounts in CanvasOverlays, beside EditorShell, so it could not reach the MobileChromeProvider inside the shell; the provider moves up to App around the shell and the overlays so both share one sheet state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
472e5e4d81
commit
eb401cd979
5 files changed
+85
-12
No files matched your search
@@ -10,7 +10,6 @@ import { ContextMenu } from '../panels/context-menu/ContextMenu';
|
||||
import { useContextMenu } from '../hooks/useContextMenu';
|
||||
import { useKeyboardShortcuts } from '../hooks/useKeyboardShortcuts';
|
||||
import { useIsMobile } from '../hooks/useIsMobile';
|
||||
import { MobileChromeProvider } from '../state/MobileChromeContext';
|
||||
import { LayerFocusProvider } from '../panels/left/LayerFocusContext';
|
||||
import { LoadGate } from './LoadGate';
|
||||
import { DirtyTracker } from './DirtyTracker';
|
||||
@@ -78,12 +77,10 @@ const EditorShellBody: React.FC = () => {
|
||||
}, [query, showMenu]);
|
||||
|
||||
return (
|
||||
// Mobile-A2: shared sheet/modal-open state (see MobileChromeContext) --
|
||||
// provided around the whole shell so TopBar's Templates/Head Code modal
|
||||
// state and MobilePanelBar's sheet state live in one place. Desktop
|
||||
// doesn't render MobilePanelBar and TopBar's desktop branch behaves
|
||||
// identically to before (same booleans, just sourced from context).
|
||||
<MobileChromeProvider>
|
||||
// Mobile-A2: shared sheet/modal-open state (MobileChromeContext) is
|
||||
// provided in App.tsx, around this shell AND CanvasOverlays, so overlays
|
||||
// (section library, command palette) share it with TopBar/MobilePanelBar.
|
||||
<>
|
||||
<LayerFocusProvider>
|
||||
<div className="editor-app">
|
||||
<LoadGate />
|
||||
@@ -112,6 +109,6 @@ const EditorShellBody: React.FC = () => {
|
||||
/>
|
||||
</div>
|
||||
</LayerFocusProvider>
|
||||
</MobileChromeProvider>
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user