[Bug]: Text typed into an inline html_render page is lost when switching threads
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
- Have an agent render a page with a text field through
html_render. Mine was a question form with a "Note" textarea. - Type something into the field.
- Click another thread in the sidebar, then click back.
Expected behavior
The text I typed is still there.
Actual behavior
The page reloads empty and the text is gone.
Cause
Inline renders use a sandboxed iframe without allow-same-origin (apps/web/src/components/files/BrowserDocumentFrame.tsx), so the page can't use localStorage or sessionStorage. Switching threads unmounts HtmlRenderFrame and destroys the iframe, which holds the only copy of the input. The host message protocol only handles height, links, keys and images, so a page can't save state through the host either.
#17734 fixed this loss when the asset URL renews; this is the thread-switch path.
Possible fix
Add a host-backed state message keyed by attachment id, which the host posts back to the page on load. The sandbox can stay opaque.
Impact
Answers typed into agent question forms vanish before they're sent.
Version
T3 Code (Beta) 0.1.7, macOS. Checked against main at b18434e647.