Skip to content

Render HTML files and URLs in overlays - #659

Merged
umputun merged 39 commits into
masterfrom
html-overlay
Sep 27, 2026
Merged

umputun merged 39 commits into
masterfrom
html-overlay

Conversation

@umputun

@umputun umputun commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Adds session overlay open --html FILE and --url URL for generated reports, charts, explainers and running dev servers. Pages use the existing session-wide, floating and per-pane overlay slots, and close with Cmd-W, the close button or overlay close.

Every page sits under an app-drawn strip that names its file or origin, never its title, with the close button. --navigation adds back, forward, reload and open in browser. overlay reload loads the original file or URL; --current reloads the displayed page. overlay navigate back|forward|browser controls history and opening in the browser. tree reports page metadata and load state, and load failures appear in the panel. The overlay's result, copy and text commands refuse pages.

Local HTML is loaded as text with no file access unless --cwd DIR grants access to an asset directory; / and the home directory are refused as grants. URL pages keep browser styling and allow same-origin main-frame navigation; an off-origin redirect during a load nobody clicked fails visibly. Each overlay has its own in-memory browser storage and retains page state through session switches, pane moves and the close-undo window. Pages render on the serving Mac; opening one is refused while another Mac presents the session.

A page runs no JavaScript of its own unless opened with --js; the theme script agterm injects runs either way. Page-initiated browser opens require confirmation. Declining suppresses further prompts until the user clicks or types in the page. The toolbar and overlay navigate browser skip confirmation and use the default browser app; file overlays open their original file. Dropping or pasting file references is refused. Theme scripts run only at document start. The skill tells agents to treat title, page and error in tree as untrusted text.

File pages use the terminal theme by default and reload when it changes. Both sources expose CSS variables for background, foreground and the 16 ANSI colors; URL pages receive theme updates on their next load. The bundled skill teaches agents to create HTML explainers and reports as static HTML, CSS and SVG, display them in an overlay and build them from those variables, passing --js only when the requested interaction or web app requires JavaScript. The command reference and user guide document both modes.

Also resets the fresh-split test fixture and records another occurrence of the existing session-host attribution issue in its backlog item.

…, keep keys beside a pane ask

- refuse a --cwd naming the page file itself: WebKit widens a single-file grant to its folder
- a user-clicked http(s) link opens in the default browser whatever frame or window it targets,
  target=_blank included; script-opened windows stay blocked
- a click on a session-wide page beside a pane ask selects the uncovered pane, so a later refocus
  no longer hands the keys back to the ask
- HtmlOverlayTheme.stylesheet is internal
- predicate docs name coverOverlayActive as the input question
The description and triggers name HTML artifacts so the skill loads when an agent is asked to show
a page it generated, the command summary lists open --html, reload and navigate, and a new section
covers writing the file, the --cwd grant, --navigation, leaving the page up and reading its state.
reference.md and commands.html now state the overlay result refusal for a page.
Copilot AI lite review requested due to automatic review settings September 26, 2026 08:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Deploying agterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: e98855c
Status: ✅  Deploy successful!
Preview URL: https://0415ef6e.agterm.pages.dev
Branch Preview URL: https://html-overlay.agterm.pages.dev

View logs

@umputun
umputun merged commit 11fe64e into master Sep 27, 2026
8 checks passed
@umputun
umputun deleted the html-overlay branch September 27, 2026 00:04
nickalie added a commit to nickalie/agterm-linux that referenced this pull request Sep 29, 2026
Upstream umputun#659 and umputun#663 on GTK. libagterm-webkit.so is the one library linked
against WebKitGTK 6.0; the app dlopens it, so it runs without WebKitGTK and
refuses only --html/--url, naming the package. A file grant is served by a
private URI scheme that answers only under --cwd, each page gets an ephemeral
network session, and page JavaScript stays off unless --js. WebKitGTK names no
target frame, so the main frame's origin is pinned on its response.

Claude-Session: https://claude.ai/code/session_01Phfsdpubm1RJGzh7EtShyn
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