Skip to content

(touched): show images in the Touched panel (#1025) - #1030

Merged
devsuitup merged 4 commits into
mainfrom
wt/1025
Nov 8, 2026
Merged

devsuitup merged 4 commits into
mainfrom
wt/1025

Conversation

@devsuitup

@devsuitup devsuitup commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Closes #1025.

An image opened from a session's file link in the Touched panel now shows as a preview, instead of a refused binary file.

  • Formats: PNG, JPEG, GIF, WebP and BMP, up to the panel's 2 MiB read cap. The type comes from sniffing the bytes; the extension alone is not trusted. GIF and WebP must also contain a NUL byte, so a text file that happens to start with GIF89a still opens as text. SVG stays text.
  • Display: fit or actual size. The image travels as a data: URL; the CSP is unchanged.
  • Buttons: "Show in folder" uses the new show-item-in-folder IPC. Main runs its checks in this order: absolute path, raw .git segment, .git segment after realpath, sensitive path, regular file. "Open with the default app" goes through open-path with viewer: true, which applies an extension allowlist (the five image types plus PDF) in main as well as in the renderer. Both buttons now show a visible error when they fail.
  • Limit: the viewer allowlist protects against a renderer bug, not against a hostile renderer, which could leave the flag out. This is documented in .ai/contexts/ipc-bridge.md; the terminal-menu route is out of scope (spec §3).
  • Tests: the image cases moved to test/dom-file-panel-images.test.js, because dom-file-panel-touched was close to the 120 s cap.

Two follow-ups are not done here:

  • two quick failed clicks stack two identical error notices;
  • reason exposes the fs error message, an existence oracle limited to the caller's own path.

Harness-Claim: true
Agent: switchboard-dev
Host: ANCHOR
Base-Ref: origin/main
Base-SHA: 7b3a4b0
Claimed-At: 2026-11-07T22:15:04.8580104Z
Nonce: 1ce6b5e6c3b78333
A touched image file now opens as a preview in the file panel instead of a text editor.
…l actions

Show in folder and Open with the default app now say when they fail; a refused open clears on refresh; a stale image error no longer replaces a valid image; text files that start like GIF or WebP open as text.
@devsuitup
devsuitup merged commit d16856a into main Nov 8, 2026
6 checks passed
@devsuitup
devsuitup deleted the wt/1025 branch November 8, 2026 12:59
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.

(touched-files): images opened from a link cannot be viewed in the panel

1 participant