fix: open local file links with Ctrl/Cmd-click - #708
Merged
agegr merged 3 commits intoSep 5, 2026
Conversation
Zhangs-11
added a commit
to Zhangs-11/pi-web
that referenced
this pull request
Sep 4, 2026
Zhangs-11
added a commit
to Zhangs-11/pi-web
that referenced
this pull request
Sep 4, 2026
Zhangs-11
added a commit
to Zhangs-11/pi-web
that referenced
this pull request
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
file://Markdown destinations when Pi Web has an in-app file handlerCommand-clicks, and Windows/LinuxCtrl-clicksProblem
Pi Web already resolves local Markdown links into its allow-listed file preview, but two guards prevented the reported interaction:
file://destinations with an emptyhrefbefore Pi Web could resolve them.metaKeyandctrlKey, leaving the browser to navigate from an HTTP page to afile://URL, which browsers block.As a result,
Command-clicking a local HTML report on macOS orCtrl-clicking it on Windows/Linux appeared to do nothing.Behavior
A primary-modifier left click now uses the same in-app preview as a plain click.
Shift/Altclicks, middle clicks, already-prevented events, and external links remain unchanged.Security
file://destinations are preserved only when the renderer has Pi Web'sonOpenFilehandler. The existing file resolver and/api/filesallow-list remain the authorization boundary; this change does not grant access to additional filesystem paths.Testing
npm test— 847 tests passednode_modules/.bin/tsc --noEmitnpm run lint113dad6f1be8babb12a1b3f0bddae283d3995843Command-click opened the generated local HTML report in Pi Web's preview pane; unit coverage verifies bothmetaKeyandctrlKeyDemo
Recorded from commit
113dad6f1be8babb12a1b3f0bddae283d3995843using that worktree’s real Next.js development server, a fresh isolated agent directory, workspace, and browser context. A real GPT-5.6 Sol round ran through Pi Web’s normal RPC transport; no fixtures, mock transport, synthetic events, personal sessions, or project documents were used.