Repository navigation
fix(markdown): render generated images with native Windows paths - #3709
Merged
Merged
Conversation
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.
Summary
Fix generated-image previews when Markdown contains a native Windows path such as
D:\Desktop\.openbitfun\generated-images\preview.jpg. Markdown parsing can encode backslashes and consume the separator before.openbitfun, after which URL sanitization removes the image source.Recover Windows image destinations from the original source before sanitization, normalize them to file references resolved by the existing owning-filesystem reader, and apply the same handling to the math and thinking-fragment renderers. Preserve existing file-link callback behavior.
Type and Areas
Type: Bug fix.
Areas: Web UI, Markdown image rendering.
Motivation / Impact
Generated images referenced in assistant replies can display as an alt-text fallback even when the file was saved successfully. Native Windows image paths now reach the existing image-loading pipeline. Add a regression fixture containing the
.openbitfundirectory.Verification
pnpm --dir src/web-ui run test:run src/infrastructure/markdown/MarkdownRenderer.test.tsx— 76/76 tests passed after rebasing onto upstream/main.git diff --check upstream/main...HEAD— passed.pnpm run check:web— Canvas SDK and Appearance/typography/theme checks passed; TypeScript checking was blocked by missing@/generated/apideclarations inwebsocket-adapter.tsandConfigAPI.ts.Reviewer Notes
Refreshed upstream/main and checked the relevant implementation and open PRs before rebasing. Main still lacks native-backslash source recovery; the open image-generation model-settings PR #3422 changes configuration and does not cover this renderer behavior.
Validation uses local DOM fixtures, including existing remote-connection, peer-switch and dispatch-observer cases. Live SSH/Docker workspaces, Peer Device Mode, Remote Control and Detached Dispatch were not exercised. Tool-card default expansion and file-backed tool-card previews are outside this PR.
Checklist