Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): inline HTML renders no longer trap the thread's scroll #16283

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/16283/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 5 changed files with 33 additions and 7 deletions (loading 2).

x
0 of 5 viewed, 5 left
2 additions and 2 deletionsapps/server/src/mcp/toolkits/html/tools.tsModified
View file
@@ -68,7 +68,7 @@
// touches no workspace, so plan mode and read-only sandboxes can use it.
// Open-world, since the page may load remote resources, as in a preview.
const HtmlRenderTool = Tool.make(HTML_RENDER_TOOL_NAME, {
- description: `Show a finished HTML page (chart, table, diagram, collage, mockup) inline in this thread, above your final text reply; call it before writing that reply. The reader already sees the page, so the reply should not announce it, say where it is, or restate it: add only what the page doesn't say. Preview with html_preview first. T3 fits the frame to the page's height at each reader's width, up to height; anything taller scrolls inside the frame. ${PAGE_RULES} ${HTML_RENDER_LAYOUT_GUIDE} ${HTML_RENDER_THEME_GUIDE}`,
+ description: `Show a finished HTML page (chart, table, diagram, collage, mockup) inline in this thread, above your final text reply; call it before writing that reply. The reader already sees the page, so the reply should not announce it, say where it is, or restate it: add only what the page doesn't say. Preview with html_preview first. T3 fits the frame to the page's height at each reader's width. A height below the page's contentHeight caps the frame there, and the rest scrolls inside it. ${PAGE_RULES} ${HTML_RENDER_LAYOUT_GUIDE} ${HTML_RENDER_THEME_GUIDE}`,
parameters: Schema.Struct({
html: Html,
title: Schema.String.check(
@@ -76,7 +76,7 @@
Schema.isMaxLength(HTML_RENDER_MAX_TITLE_LENGTH),
).annotate({ description: "Short name for the page." }),
height: Schema.Int.annotate({
- description: `The most the frame may take, in CSS pixels, ${HTML_RENDER_MIN_HEIGHT}-${HTML_RENDER_MAX_HEIGHT}. Use html_preview's contentHeight, or less to make long content scroll inside the frame.`,
+ description: `The frame height in CSS pixels, ${HTML_RENDER_MIN_HEIGHT}-${HTML_RENDER_MAX_HEIGHT}. Use html_preview's contentHeight, or less to make long content scroll inside the frame.`,
}),
}),
success: Schema.Struct({
13 additions and 4 deletionsapps/web/src/components/chat/HtmlRenderFrame.tsxModified
View file
@@ -20,8 +20,9 @@
​
/**
* An agent's HTML render inline in the thread: the page itself on the thread's
- * own background, at its measured height for this width (capped at the agent's
- * height). Loading and failure hold the same box so nothing below it moves.
+ * own background, at the server's measured height for this width until the