Skip to content

fix(web): preserve local terminal image previews#253

Merged
skulidropek merged 3 commits intomainfrom
issue-250
May 9, 2026
Merged

fix(web): preserve local terminal image previews#253
skulidropek merged 3 commits intomainfrom
issue-250

Conversation

@skulidropek
Copy link
Copy Markdown
Member

Summary

  • Preserve local terminal image previews by caching successful image reads as browser Blob object URLs.
  • Render an unavailable terminal tile instead of a broken <img> when the local file is already deleted before first read.
  • Support safe file:///... image URLs by normalizing them to absolute project-container paths while keeping the existing project/session-scoped backend read path.

Fixes #250.

Proof / Evidence

Issue 250 local image proof

Verified with:

bun run --cwd packages/api vitest run tests/terminal-image-fetch-core.test.ts
bun run --cwd packages/api typecheck
bun run --cwd packages/app vitest run tests/docker-git/terminal-image-paths.test.ts tests/docker-git/terminal-inline-images-core.test.ts tests/docker-git/terminal.test.ts
bun run --cwd packages/app typecheck
bun run --cwd packages/api build
bun run --cwd packages/app build:web
./packages/api/node_modules/.bin/eslint packages/api/src/services/terminal-image-fetch-core.ts packages/api/tests/terminal-image-fetch-core.test.ts --ext .ts --format stylish
./packages/app/node_modules/.bin/eslint packages/app/src/web/terminal-image-paths.ts packages/app/src/web/terminal-inline-images.ts packages/app/src/web/terminal-panel-runtime-core.ts packages/app/src/web/terminal-panel-runtime-types.ts packages/app/tests/docker-git/terminal-image-paths.test.ts packages/app/tests/docker-git/terminal-inline-images-core.test.ts --ext .ts --format stylish
git diff --check

Playwright proof screenshot was generated with Chromium after installing Playwright browser dependencies in the container.

Mathematical Guarantees

  • Invariant: ∀ p, cached(p) -> preview(p) remains renderable even if the underlying file is later removed.
  • Invariant: ∀ p, invalid_or_missing(p) -> unavailable_tile(p) instead of broken browser image UI.
  • Safety boundary: file reads remain scoped to active project terminal sessions and project containers; no generic host filesystem route is added.

@skulidropek
Copy link
Copy Markdown
Member Author

skulidropek commented May 8, 2026

AI Session Backup

Commit: 5693970
Status: success
Files: 4 (3.38 MB)
Links: README | Manifest

git status

On branch issue-250
Your branch is up to date with 'origin/issue-250'.

nothing to commit, working tree clean

@skulidropek
Copy link
Copy Markdown
Member Author

skulidropek commented May 8, 2026

AI Session Backup

Commit: c61aaf9
Status: success
Files: 4 (3.87 MB)
Links: README | Manifest

git status

On branch issue-250
Your branch is up to date with 'origin/issue-250'.

nothing to commit, working tree clean

@skulidropek
Copy link
Copy Markdown
Member Author

skulidropek commented May 8, 2026

AI Session Backup

Commit: cb547dd
Status: success
Files: 4 (4.00 MB)
Links: README | Manifest

git status

On branch issue-250
Your branch is up to date with 'origin/issue-250'.

nothing to commit, working tree clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant