Skip to content

Fix/html image rendering#1653

Closed
Douglasymlai wants to merge 18 commits into
mainfrom
fix/html-image-rendering
Closed

Fix/html image rendering#1653
Douglasymlai wants to merge 18 commits into
mainfrom
fix/html-image-rendering

Conversation

@Douglasymlai
Copy link
Copy Markdown
Contributor

Related Issue

Closes #TODO

Description

This PR fixes local HTML asset rendering issues in project content, especially when assets are loaded through localfile:// URLs on Windows.

It normalizes Windows drive-letter localfile paths in the Electron protocol handler, extracts local HTML asset rewriting into shared helpers, inlines both <img> elements and quoted local project image paths, and avoids incorrectly rewriting JavaScript template-literal placeholders such as ${...}. It also injects a local base href so relative asset references resolve more reliably.

Testing Evidence (REQUIRED)

  • Automated:

    • npx vitest run test/unit/electron/main/index.test.ts test/unit/lib/htmlLocalAssets.test.ts test/unit/lib/htmlSanitization.test.ts
    • Result: 3 test files passed, 98 tests passed
  • Manual:

    • Attach screenshot(s) or screen recording showing local HTML/image rendering works correctly
    • Include any human-verified reproduction/verification notes here
  • I have included human-verified testing evidence in this PR.

  • This PR includes frontend/UI changes, and I attached screenshot(s) or screen recording(s).

  • No frontend/UI changes in this PR.

Screenshot 2026-05-25 at 12 29 16

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Contribution Guidelines Acknowledgement

4pmtong and others added 18 commits May 1, 2026 10:11
…separation foundations (#1597)

Co-authored-by: Douglas <douglas.ym.lai@gmail.com>
Co-authored-by: Douglas Lai <115660088+Douglasymlai@users.noreply.github.com>
Co-authored-by: Douglas <douglas.ym.lai@gmail.com>
Co-authored-by: Douglas Lai <115660088+Douglasymlai@users.noreply.github.com>
Co-authored-by: Douglas <douglas.ym.lai@gmail.com>
Co-authored-by: Douglas Lai <115660088+Douglasymlai@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
# Conflicts:
#	.github/workflows/build.yml
#	backend/app/agent/agent_model.py
#	backend/app/agent/factory/browser.py
#	backend/app/agent/factory/developer.py
#	backend/app/agent/factory/document.py
#	backend/app/agent/factory/mcp.py
#	backend/app/model/chat.py
#	backend/app/router.py
#	backend/app/service/chat_service.py
#	src/components/ChatBox/BottomBox/index.tsx
#	src/components/ChatBox/index.tsx
#	src/pages/Agents/Models.tsx
#	src/pages/Agents/index.tsx
#	src/store/chatStore.ts
Co-authored-by: Douglas Lai <115660088+Douglasymlai@users.noreply.github.com>
…aths and improve local HTML asset inlining for rendered project content.
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.

2 participants