Skip to content

Canvas pane next to the agent chat - #45

Merged
simonw merged 8 commits into
mainfrom
canvas
Oct 31, 2026
Merged

simonw merged 8 commits into
mainfrom
canvas

Conversation

@simonw

@simonw simonw commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Adds a canvas: an iframe beside the chat that shows Datasette pages.

  • New show_in_canvas tool for the agent. Same-site links in the chat also open in the canvas, and the page it's showing is sent with each message.
  • Wide screens: chat ⅓, canvas ⅔, with a close button. Narrow screens: a Chat | Canvas switch that slides between them.
  • /-/patterns/agent page with live previews of the header controls.
  • Fixes base_url handling across agent pages, links, fetches and save_query.
  • Fixes test_stream_endpoint_headers for newer Datasette.

Generated by Claude Code

claude and others added 8 commits October 31, 2026 01:28
The agent can open Datasette pages in a canvas iframe beside the chat
with the new show_in_canvas tool, and same-site links in the
conversation open there too. The page the canvas is showing is sent
with each message and added to that turn's system prompt.

Wide screens split chat one third / canvas two thirds with a hide
toggle; narrow screens get a Chat | Canvas switch that slides between
the two, with a badge when the agent opens a page in the background.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016BvfqAoimz6VgPtS5bmptT
The canvas now starts directly with the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016BvfqAoimz6VgPtS5bmptT
Only pages the agent opens load in a fresh frame. Links followed
inside the canvas, and links clicked in the chat, navigate the frame
that is showing, so the browser's Back and Forward move through the
canvas pages instead of leaving the conversation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016BvfqAoimz6VgPtS5bmptT
Templates and scripts now build every agent URL with Datasette's
urls.path() and static(), so pages, links, fetches and streaming work
under a base_url prefix. save_query built its analyze/store URLs with
str.format(), which dropped the PrefixedUrlString marker so
datasette.client added base_url a second time; show_in_canvas had the
same problem for paths that already included the prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016BvfqAoimz6VgPtS5bmptT
@simonw
simonw merged commit 23b858d into main Oct 31, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants