Skip to content

feat(web): open HTML files from chat in the default browser - #1

Open
risenxxx wants to merge 1 commit into
mainfrom
feat/open-html-in-default-browser
Open

risenxxx wants to merge 1 commit into
mainfrom
feat/open-html-in-default-browser

Conversation

@risenxxx

Copy link
Copy Markdown
Owner

Agents keep writing HTML reports and design drafts for me, and from chat I could open them in the file viewer, the integrated browser or the editor, but never in my actual browser. Upstream discussion: pingdotgg#18034

This adds "Open in default browser" to the right-click menu of HTML file links in chat and a matching button in the HTML file viewer toolbar. Option-click (Alt-click on Windows and Linux) on the link does the same thing. Cmd-click still opens the editor as before.

There's no server change. The server already knows how to open a file with the OS default app (open / xdg-open / Invoke-Item), the file tree's "Open" item and "Open app" for .app bundles use it, so this just calls that. The option only shows up when the client runs on the same machine as the environment, since on a remote connection the "default browser" would be the server's. While in there I folded the four copies of the open/reveal error handling in MarkdownFileLink into one helper.

Checked in a dev build with a test HTML file: the menu item, the toolbar button and Option-click all opened it in my default browser (Dia), and a plain click still opens the file viewer. check:changed passes apart from two browser tests in ChatMarkdown.permissions that fail on main too.

Before:

before

After:

after

🤖 Generated with Claude Code

Agents often write HTML reports and design drafts. A chat link to one could
open in the file viewer, the integrated browser, or the editor, but not in the
system browser. The right-click menu on HTML file links and the HTML file
viewer toolbar now offer "Open in default browser", and Option-click
(Alt-click elsewhere) does the same from chat. It reuses the server's existing
open-with-default-app launch and only shows when the client runs on the
environment's machine.
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.

1 participant