diff --git a/tests/test_browser_agent_regressions.py b/tests/test_browser_agent_regressions.py index 18914d9f6..d32e99ec3 100644 --- a/tests/test_browser_agent_regressions.py +++ b/tests/test_browser_agent_regressions.py @@ -803,7 +803,7 @@ def test_browser_entry_points_prefer_canvas_and_modal_dock_handoff(): assert "Alpine.store" not in js -def test_browser_and_desktop_surface_buttons_remember_latest_window_mode(): +def test_surface_buttons_keep_modal_and_canvas_entry_points_separate(): canvas_store = (PROJECT_ROOT / "webui" / "components" / "canvas" / "right-canvas-store.js").read_text( encoding="utf-8" ) @@ -852,8 +852,8 @@ def test_browser_and_desktop_surface_buttons_remember_latest_window_mode(): assert "this.mountedSurfaces = {}" not in open_modal_block assert "failed to close before modal open" not in open_modal_block - assert '@click="$store.rightCanvas.openLatest(surface.id)"' in canvas_html - assert '@click="$store.rightCanvas.open(surface.id)"' in canvas_html + assert '@click="$store.rightCanvas.openLatest(surface.id)"' not in canvas_html + assert canvas_html.count('@click="$store.rightCanvas.open(surface.id)"') == 2 assert "recordMode(metadata.surfaceId, SURFACE_MODE_FLOATING)" in surfaces_js assert "configureModalSurfaceSwitcher" in surfaces_js diff --git a/webui/components/canvas/AGENTS.md b/webui/components/canvas/AGENTS.md index 3ec1d5006..fed0637e5 100644 --- a/webui/components/canvas/AGENTS.md +++ b/webui/components/canvas/AGENTS.md @@ -14,6 +14,7 @@ - Keep registered surfaces compatible with WebUI extension hooks. - Preserve responsive layout and avoid overlapping the chat/sidebar shells. +- Right-canvas rail and tab buttons are explicit canvas entry points; they must open surfaces in the canvas even when the same surface was last used as a floating modal. ## Work Guidance diff --git a/webui/components/canvas/right-canvas.html b/webui/components/canvas/right-canvas.html index c9ece5644..3cba11a98 100644 --- a/webui/components/canvas/right-canvas.html +++ b/webui/components/canvas/right-canvas.html @@ -46,7 +46,7 @@ :class="{ 'is-active': $store.rightCanvas.isSurfaceActive(surface.id) && $store.rightCanvas.isOpen }" :title="surface.title" :aria-label="surface.title" - @click="$store.rightCanvas.openLatest(surface.id)" + @click="$store.rightCanvas.open(surface.id)" >