aaif-goose / aaif-goose/goose

MCP Apps: resizable PiP, detached full window, and split conversation layouts

Offen
#11,772 1 Kommentar 0 Reaktionen 1 zugewiesene Person Beansprucht von @alexhancock Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
54.2k
Forks
6.2k
Ø Merge
3 T. 2 Std.
Gemergte PRs (30 T.)
262

Beschreibung

**What problem would this solve?**

MCP Apps in Picture-in-Picture (PiP) mode are currently rendered at a fixed **400 × 300 px** size and can only be moved, not resized. This is too small for interactive apps. App authors cannot solve this from inside the iframe because the host owns the outer PiP container.

Users currently have no useful intermediate size, no detached full-window experience, and no structured way to work with an app and the Goose conversation at the same time.

This is distinct from #6818, which concerned an inline MCP App failing to grow back after the Goose window was resized. This request concerns user-controlled sizing and layout of the detached or docked MCP App surface itself.

**What would a good outcome look like?**

Users can resize an MCP App PiP window and quickly choose a useful size preset:

- **Small:** compact status or media-style view (approximately the current 400 × 300 px)
- **Medium:** forms and lightweight workspaces (for example 640 × 480 px)
- **Large:** detailed dashboards and review tools (for example 960 × 720 px, constrained to the available viewport)
- **Full:** open the MCP App in a **separate native window**, which can enter fullscreen through the operating system window manager, independently of the main Goose conversation window

Users should also be able to select either of these integrated workspace layouts:

- **Side-by-side:** conversation on the left using approximately **1/3 of the width**, MCP App on the right using approximately **2/3**
- **Stacked:** MCP App on top using approximately **2/3 of the height**, conversation below using approximately **1/3**

The split ratio should ideally be adjustable through a draggable divider and remembered. A quick reset to the default 1/3–2/3 ratio would also be useful.

A good experience would also:

- preserve the selected PiP size and layout when moving the window or switching temporarily between modes;
- clamp the PiP window to the available viewport and keep controls reachable;
- expose actual dimensions through MCP Apps `hostContext.containerDimensions` as the app surface is resized;
- support pointer resizing and keyboard-accessible sizing and split controls;
- remain responsive on small screens by reducing the maximum allowed size or falling back to a suitable layout;
- preserve the current draggable PiP behavior;
- keep the conversation usable while the app is docked;
- clearly indicate whether the app is inline, floating PiP, docked side-by-side, docked vertically, or in a detached native window.

**Possible approaches**

The current implementation defines fixed `PIP_WIDTH = 400` and `PIP_HEIGHT = 300` constants in `ui/desktop/src/components/McpApps/useDisplayMode.ts` and applies them directly in `McpAppRenderer.tsx`. The hook currently stores only `pipPosition` and provides drag handlers.

Possible approaches include:

1. Add `pipSize: { width, height }` state alongside `pipPosition`.
2. Add a visible resize handle with pointer and keyboard handlers.
3. Add a size/layout menu for Small / Medium / Large / Detached Full / Side-by-side / Stacked.
4. Clamp both position and dimensions after resize and when the Goose viewport changes.
5. Let the existing `ResizeObserver` propagate updated dimensions through `hostContext.containerDimensions`.
6. Model docked layouts at the Goose conversation-shell level, using an accessible resizable split pane rather than positioning the app over the conversation.
7. Use a separate Electron `BrowserWindow` (or equivalent) for Detached Full, with normal window-manager maximize, fullscreen, and resizing behavior, plus a safe lifecycle tied to the MCP App/session.
8. Consider persisting the last selected preset, custom PiP size, split orientation, and split ratio per user, or per app if appropriate.

The exact preset dimensions are illustrative; viewport-relative limits may be preferable. The app should not be allowed to force a host window size or layout without explicit user action.

**Additional context**

Observed in Goose Desktop with an MCP App that provides a design workspace. The PiP can be dragged but not resized. Adding more responsive layout inside the MCP App does not help because the host container remains fixed at 400 × 300 px.

Relevant source locations:

- `ui/desktop/src/components/McpApps/useDisplayMode.ts`
- `ui/desktop/src/components/McpApps/McpAppRenderer.tsx`
- the Goose conversation shell for docked split layouts
- Electron window creation and lifecycle code for a detached native app window

- [x] I have verified this does not duplicate an existing feature request

Do not begin implementation until the issue reaches **Ready** on the [Goose Issues board](https://github.com/orgs/aaif-goose/projects/1).

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.