Repository navigation
Preview thread-storage and Markdown artifacts inline - #3439
Merged
Merged
Conversation
Co-authored-by: Ilya Martynov <[email protected]>
Co-authored-by: Ilya Martynov <[email protected]>
This was referenced Sep 10, 2026
ymichael
added a commit
that referenced
this pull request
Sep 11, 2026
## Human comments ## What was wrong The inline Markdown preview added in #3439 passed only text to the message renderer, discarding the report’s directory and storage source. A nested `reports/report.md` linking to `sibling.md` or `chart.svg` therefore resolved from the workspace root, even when the report lived in thread storage. ## What changed Pass server-resolved document context through the private inline-vis response into `Markdown.experimental_document`. Reuse existing file-image routing and explicit file navigation so links and images resolve beside the document within the selected source. Preserve line ranges, message rendering without document context, and existing HTML sandbox behavior. Document the experimental SDK prop in the Plugin Guide and API audit, add an inline-vis example, and bump the Plugin SDK from `0.4.54` to `0.4.55` so consumers can require a host that supports the new surface. No daemon wire changes or new CLI commands; existing SDK/CLI message directives retain their delivery path. ## How you verified - Added real-renderer regressions for nested workspace/thread-storage links and images, conflicting ambient workspace context, line ranges, parent-directory references, missing destinations, and escape/absolute-path controls. Both destination cases and both RPC context assertions failed before the change and passed afterward. - Turbo test/typecheck passed for `bb-plugin-inline-vis`, `@get-bb/plugin-sdk`, and `@bb/plugin-api-map`; app build/typecheck and the Plugin Guide build passed. - Focused app tests passed, including 13 renderer/image checks after rebasing. The broad app suite was interrupted under load; all five observed failures passed focused reruns with two workers. No full-suite pass claimed. - Verified the actual source app with a connected daemon and synthetic reports: correct sibling documents and charts from both storage roots, desktop pointer activation, reload and keyboard activation at 390×844 with coarse pointer/no hover, and no horizontal overflow. - Source browser/filesystem fixtures covered loading, stale/error states, HTML sandbox preservation, and missing/binary/oversized/traversal/symlink controls. Safari, Electron, and remote authentication were not verified. - `node .github/workflows/check-plugin-sdk-version.mjs` passed after the `0.4.55` lockstep bump. ## Before and after Matching 1280×900 source-component fixtures for a thread-storage report. Before uses parent `1d20e5f9ccd9f85cf5e9f56461d8f5e4fc25c5f3`; After captures the UI behavior now present at final pushed head `5dd24812ac6a208688b6ed4d9a0f93af0c4d5c21`. The subsequent rebase and SDK-version correction did not change the rendered UI. Navigation/RPC are fixture adapters; the actual inline component and renderer are built from the compared revisions. After requests the chart beside the report and opens `reports/sibling.md` in thread storage. | Before — wrong workspace destination, broken chart | After — document-relative destination, chart loaded | | --- | --- | |  |  | > AGENT GENERATED
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.
Human comments
Integration of #3163 and #3165 by @IlyaM, which conflicted in every file of the inline-vis plugin. Both are credited as co-author on the commits.
What was wrong
The inline-vis plugin assumed every artifact was an HTML file in the thread workspace. Its RPC always resolved the thread environment, its frontend always used the worktree file route, and its extension check only accepted
.html/.htm. Read-only artifacts written to$BB_THREAD_STORAGEcould not be rendered inline (#3158), and Markdown reports had to be converted to HTML or pasted into the message (#3159).What changed
source="workspace" | "thread-storage"to the directive; omittedsourcedefaults toworkspace. Thread-storage previews resolve their root throughbb.sdk.threads.storageLocation(), confine the file under that root, and use the existing thread-storage file route. They omit the open-in-workspace action..mdand.markdownfiles alongside HTML. The plugin-private RPC was renamed fromprepareHtmlPreviewtopreparePreviewand returns a discriminatedhtmlormarkdownresult with the normalizedsource. Markdown results include the validated UTF-8 content, which the frontend renders with the hostMarkdowncomponent (raw HTML disabled) inside the same bounded, scrollable preview card. HTML keeps the sandboxed iframe.Only the plugin-local RPC contract changed. No server/daemon wire fields changed, so
HOST_DAEMON_PROTOCOL_VERSIONis unchanged. No new public plugin API surface.How you verified
Combined the tests from both PRs and added cross-feature coverage: Markdown from thread storage on the backend, and thread-storage Markdown suppressing the workspace action on the frontend.
bb plugin build plugins/inline-vissucceededgit diff --checkpassedFixes #3158
Fixes #3159
Supersedes #3163 and #3165.