Keep right-canvas surface rail docked

Route right-canvas rail clicks through the explicit canvas opener so Browser, Editor, Files, and Desktop open in the canvas even after a modal session. Preserve modal-header surface switches as floating modal entry points, and document/test the entry-point split.
This commit is contained in:
Alessandro 2026-06-23 11:28:20 +02:00
parent ffddc3ebcb
commit cc13586f7b
3 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -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

View file

@ -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)"
>
<template x-if="surface.image">
<img class="right-canvas-surface-image" :src="surface.image" alt="" aria-hidden="true">