Skip to content

fix(markdown): render generated images with native Windows paths - #3709

Merged
kev1n77 merged 1 commit into
openBitFun:mainfrom
kev1n77:fmy/imagegen
Nov 3, 2026
Merged

kev1n77 merged 1 commit into
openBitFun:mainfrom
kev1n77:fmy/imagegen

Conversation

@kev1n77

@kev1n77 kev1n77 commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

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 .openbitfun directory.

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/api declarations in websocket-adapter.ts and ConfigAPI.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

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable (no copy changes).

@kev1n77
kev1n77 merged commit f306cb4 into openBitFun:main Nov 3, 2026
9 checks passed
@kev1n77
kev1n77 deleted the fmy/imagegen branch November 9, 2026 08:14
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