fix(chat): load image previews through the host file API - #2868
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 chat image thumbnails and lightbox previews for path-backed attachments, including images pasted from Feishu on macOS. Load image bytes through the existing host file API instead of constructing a hard-coded
https://asset.localhost/URL.Type and Areas
Type: Bug fix
Areas: Web UI / chat attachments
Motivation / Impact
Images could be successfully sent to the model while their message previews failed to load. Both thumbnails and the lightbox now use the resolved data URL. Embedded clipboard data remains supported; failed file reads display an existing localized error, and stale asynchronous reads cannot replace a newer attachment.
Verification
Against latest upstream/main in an isolated worktree:
pnpm --dir src/web-ui exec vitest run src/flow_chat/components/modern/UserMessageImage.test.tsx— 4 tests passed (host reads/lightbox, embedded data, errors without local fallback, stale reads).pnpm --dir src/web-ui exec tsc --noEmit— passed, using existing local dependency and generated API artifacts.pnpm --dir src/web-ui exec eslint src/flow_chat/components/modern/UserMessageImage.tsx src/flow_chat/components/modern/UserMessageItem.tsx— passed.git diff --cached --check— passed before commit.The source checkout also passed appearance contract checks. UI interaction verification remains pending per the modern FlowChat guide. Remote workspace, remote control, Peer Device Mode, and Detached Dispatch were not exercised on real hosts; file reads use the existing transport, with no controller-local asset fallback.
Reviewer Notes
No configuration migration is included: latest upstream/main already removes the product-release version gate that rejected
1.0.0-beta.2configuration files. This PR contains only the remaining image-preview fix and its regression coverage.Checklist