Repository navigation
feat(web): diff file tree, image zoom, and HTML/PDF file viewer (upstream ports) - #249
Merged
Merged
Conversation
The Files panel's collapse-all toggle kept its own flag, so it went stale once folders were opened or closed by hand. It now reads the tree's expansion state through shared fileTreeExpansion helpers and only shows when folders exist. Ported from pingdotgg#8889 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A long diff had no way to see its changed files as folders. A toolbar toggle in the diff panel now opens a Pierre file tree beside the diff; picking a file expands it if collapsed and scrolls the diff to it. The choice persists in localStorage. The Files panel now shares the tree theme via pierre-tree-theme.ts. The pull request Code tab half of the upstream change is skipped: the fork has no pullRequest/ surface. Also folds in two small upstream follow-ups to the same tree: a file-to-symlink type change no longer yields a duplicate path (pingdotgg#11075), and clicking the already-selected row reveals it again (pingdotgg#9951). Ported from pingdotgg#9330 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
An expanded screenshot was capped to the viewport with no way to read small text. The image dialog now hosts a ZoomableImage: scroll or click to zoom around the pointer, drag or use the arrow keys to pan, Enter/+/-/0 from the keyboard. Arrow keys still page between images unless there is horizontal room to pan (the guard from pingdotgg#11470). Modal dialogs now also block type-to-focus so zoom keys do not jump into the composer. Ported from pingdotgg#10869 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
HTML and PDF files could only be opened in the in-app browser; the file viewer showed HTML as source and tried to read a PDF as text. The viewer now frames the file from its signed workspace-file asset URL. HTML runs in an iframe sandboxed with allow-scripts allow-forms allow-popups allow-modals (no allow-same-origin, so an opaque origin), and a header toggle switches between page and source, remembered in localStorage. A link to a line still opens the source. PDFs skip the text read and use Chromium's viewer in an unsandboxed frame. The in-app browser button stays. The frame reloads when the thread checkpoints so agent edits show up. Packaged desktop served frame-src 'self' only, which blocks frames from the environment's HTTP origin, so the renderer CSP now allows frame-src blob: http: https: (matching upstream pingdotgg#11265). Only the workspace-file case is ported; the fork has no media-file resource for host files. Ported from pingdotgg#9143 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
What
Four hand-ported upstream features covering the changes panel and viewing files in the app, one commit each:
files/fileTreeExpansion.tshelpers.diffs/DiffFileTree.tsxbeside the diff; picking a file expands it if collapsed and scrolls to it. The choice persists (t3code.diffFileTreeOpen). The Pierre tree theme is now shared inpierre-tree-theme.ts(kept the fork's--foregroundcolor). Also includes two small upstream follow-ups to the same tree: dedupe of file-to-symlink type changes (fix(web): keep a file-to-symlink type change from crashing the diff view pingdotgg/t3code#11075) and re-reveal when you click the row that's already selected (fix(web): reveal reselected diff files pingdotgg/t3code#9951).chat/ZoomableImage.tsxgoes into the fork'sExpandedImageDialog, with the arrow-key guard from fix(web): move viewer controls outside media and restore arrow navigation pingdotgg/t3code#11470.ChatViewstops type-to-focus from stealing keys while a modal dialog is open.workspace-fileonly). HTML goes in an iframe with upstream's exact sandbox (allow-scripts allow-forms allow-popups allow-modals, noallow-same-origin). A toggle switches between the rendered page and the source. PDFs use Chromium's viewer in an unsandboxed frame, same as upstream. The in-app browser button is still there. Packaged desktop's renderer CSP hadframe-src 'self'only, which would block frames from the environment's HTTP origin, so it now allowsframe-src 'self' blob: http: https:(the value upstream shipped in feat: add inline file previews and attachment chips across surfaces pingdotgg/t3code#11265).Skipped
pullRequest/surface.media-filecase in feat(web): render HTML and PDF files in the file viewer pingdotgg/t3code#9143 (files outside the workspace): the fork has no media-file resource.docs/user/source-control.md,composer.md) don't exist in the fork.Verification
vp test runon fileTreeExpansion, diffFileTree.logic, FilePreviewPanel, ElectronProtocol, and parseChangelog: all passtsgo --noEmitfor apps/web and apps/desktop: clean (desktop prints only pre-existing effect suggestions)vp lint/vp fmton the touched paths: cleanvp run check:avicode: passesNeeds a manual pass in the desktop app: the diff tree toggle and reveal, the Files collapse-all button, zooming an expanded image, and an HTML file plus a PDF in the file viewer (packaged build, for the CSP change).
🤖 Generated with Claude Code