feat(app): open text file artifacts in the side panel with edit and save#2470
Open
benjaminshafii wants to merge 3 commits into
Open
feat(app): open text file artifacts in the side panel with edit and save#2470benjaminshafii wants to merge 3 commits into
benjaminshafii wants to merge 3 commits into
Conversation
Text-preview artifacts (txt, log, json, yaml, code) previously always opened in the OS default app even though the artifact panel already knows how to render and edit text. Add "text" to the sidebar preview set so they open inline like markdown/sheets/PDFs, with the existing Edit -> Save (optimistic concurrency) plumbing. Feedback from Jay: preview text files in a dedicated panel and tweak them before saving instead of bouncing to an external app. - keep genuinely unsupported files (e.g. .zip) opening externally and cover that boundary in tests - add dev-only eval seeds (seed_text, read_text_file witness) - add artifact-text-preview fraimz flow + approved voiceover
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Rerunning against an already-open panel served the previous run's saved content (staleTime: Infinity) and produced duplicate frames. The seed action now resets state (close tab + drop the cached artifact query) before reopening, frame 1 restores a neutral panel, and the script is tightened to four visually distinct frames.
Member
Author
fraimz — ✅ PASSED1 passed · 0 failed · 0 skipped — run Full frame proof with validated screenshots: ✅ artifact-text-preview — Text file artifacts open in the side panel and can be edited and savedUser-facing flow demo
|
When BLOB_READ_WRITE_TOKEN is set, --pr uploads each frame screenshot to Vercel Blob (fraimz/<run-id>/...) and embeds the images inline in the PR comment, so reviewers see the validated frames without checking out the run directory. Without a token (or on upload failure) the comment stays text-only and posting never fails. Also harden the text-preview flow boot: if the app restores a route that does not mount the session shell (e.g. settings), navigate home and wait for session.create_task to register before using it.
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
Text files (
txt,log,json,yaml,toml,xml,ts/js/css, …) now open in the artifact side panel — readable in place, editable via the CodeMirror text editor, and saveable back to disk — instead of always bouncing to the OS default app.Integrates user feedback from Jay (openwork-app feedback form):
How
The panel already rendered and edited text (
PlainText,ArtifactTextEditor, save with optimistic concurrency), and the server already classifies/gates these files (isSupportedWorkspaceTextFilePath). The production change is one line: add"text"toSIDEBAR_ARTIFACT_FILE_PREVIEWSinopen-target.ts. That unlocks the existing plumbing end to end: chat artifact chips, markdown-link "Open in panel", Cmd+K accessible items, the artifact rail, and panel tabs. It also resolves the latent inconsistency wherelink-action-menu.tsxalready offered "Open in panel" for text but the gate silently opened externally.Context: #2304 intentionally made unsupported files open externally so they wouldn't strand. That invariant is preserved — genuinely unsupported types (e.g.
.zip) still open externally, now covered by tests with that boundary type instead of.tsx.No server changes. Office formats (docx/pptx rendering) are deliberately out of scope — that needs real renderers and Jay was asked which formats he needs.
Changes
open-target.ts— add"text"to the sidebar preview set (the feature)open-target.test.ts/artifacts.test.ts— text is now collectible/previewable; external-open boundary re-pinned with.zipside-panel.tsx— dev-only eval control actions:eval.artifact_tabs.seed_text(seed a real.txtvia the server) andeval.artifact_tabs.read_text_file(disk witness for saves)evals/voiceovers/artifact-text-preview.md— approved 5-frame voiceover script (the spec)evals/flows/artifact-text-preview.flow.mjs— coded fraimz flow: seed → tab opens → readable preview → Edit (line numbers, fix a typo via CodeMirror) → Save → re-read file from workspace to prove persistenceTests run
pnpm --filter @openwork/app typecheck— passbun test scripts/open-target.test.ts scripts/artifacts.test.ts— 27 pass, 0 fail (55 assertions)node evals/runner/run.mjs --flow artifact-text-preview --cdp-url http://127.0.0.1:9826against the real Electron dev app — PASSED, all 5 frames + voiceover coverage (evals/results/2026-07-04T06-08-13-595Z/fraimz.html)Fraimz proof (frames + screenshots + assertions) posted as a comment below.
Known cosmetic follow-ups (pre-existing, also affect markdown at narrow widths)
Follow-up candidates from the same feedback