Skip to content

Preview thread storage artifacts inline - #3163

Closed
IlyaM wants to merge 1 commit into
get-bb:mainfrom
IlyaM:bb/implement-inline-vis-thread-storage-support-thr_imr6cm7jsw
Closed

IlyaM wants to merge 1 commit into
get-bb:mainfrom
IlyaM:bb/implement-inline-vis-thread-storage-support-thr_imr6cm7jsw

Conversation

@IlyaM

@IlyaM IlyaM commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

The inline-vis plugin assumed every HTML artifact belonged to the thread workspace: its RPC always resolved the thread environment, and its frontend always used the worktree file route and workspace-open action. This prevented read-only artifacts stored in thread storage from being rendered inline. Fixes #3158.

What changed

Added source="workspace" | "thread-storage" to the inline-vis directive, with omitted source defaulting to workspace.

The backend now resolves thread-storage roots through bb.sdk.threads.storageLocation() and preflights files with the returned host and root confinement. The plugin-local RPC returns the validated file and authoritative normalized source.

The frontend uses the existing worktree or thread-storage route based on that returned source. Thread-storage previews retain the sandboxed iframe but omit the workspace-open action.

Updated the inline-vis README, plugin overview, package metadata, and bundled skill. The skill explains that thread-storage artifacts are written beneath $BB_THREAD_STORAGE while directive file paths remain storage-relative.

This changes only the plugin-local RPC contract. It does not change the server/daemon protocol and requires no HOST_DAEMON_PROTOCOL_VERSION increment.

How you verified

Added focused backend coverage for thread-storage resolution, host/root confinement, workspace bypass, source defaulting, and invalid-source validation.

Added focused frontend coverage for source-specific routes, segment encoding, iframe sandboxing, RPC validation errors, and suppression of the workspace-open action.

Ran:

pnpm exec turbo run test typecheck --filter=bb-plugin-inline-vis

Results:

  • 21 tests passed across 2 test files
  • Typecheck passed
  • 6 Turbo tasks succeeded
  • git diff --check passed

Fixes #3158

AGENT GENERATED

@SawyerHood

Copy link
Copy Markdown
Collaborator

Superseded by #3439, which integrates this PR with #3165 since the two conflicted in every file. The commits there credit @IlyaM as co-author. Thanks for both changes!

@SawyerHood SawyerHood closed this Sep 10, 2026
SawyerHood added a commit that referenced this pull request Sep 10, 2026
Integrates #3163 and #3165: inline-vis accepts source="workspace" | "thread-storage" and renders .md/.markdown files with the host Markdown renderer alongside sandboxed HTML previews.

Fixes #3158
Fixes #3159

Co-authored-by: Ilya Martynov <[email protected]>
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.

inline-vis cannot render HTML files from $BB_THREAD_STORAGE

2 participants