Skip to content

fix(chat): load image previews through the host file API - #2868

Merged
wgqqqqq merged 1 commit into
GCWing:mainfrom
wgqqqqq:wgq/fix-chat-image-preview
Sep 7, 2026
Merged

wgqqqqq merged 1 commit into
GCWing:mainfrom
wgqqqqq:wgq/fix-chat-image-preview

Conversation

@wgqqqqq

@wgqqqqq wgqqqqq commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

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.2 configuration files. This PR contains only the remaining image-preview fix and its regression coverage.

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 (existing localized error reused).

@wgqqqqq
wgqqqqq merged commit 02fa746 into GCWing:main Sep 7, 2026
9 checks passed
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