Skip to content

Fix inline Markdown links and images relative to their document - #3448

Merged
ymichael merged 1 commit into
mainfrom
bb/fixer-resolve-inline-markdown-links-and-images-f-thr_g2dwiv5exv
Sep 11, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/fixer-resolve-inline-markdown-links-and-images-f-thr_g2dwiv5exv

Conversation

@ymichael

@ymichael ymichael commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

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
Before: broken chart After: chart loaded

AGENT GENERATED

@ymichael
ymichael force-pushed the bb/fixer-resolve-inline-markdown-links-and-images-f-thr_g2dwiv5exv branch from e18194a to 5dd2481 Compare September 10, 2026 23:55
@ymichael
ymichael merged commit 0236cf8 into main Sep 11, 2026
16 checks passed
@ymichael
ymichael deleted the bb/fixer-resolve-inline-markdown-links-and-images-f-thr_g2dwiv5exv branch September 11, 2026 00:00
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.

1 participant