feat(flow-chat): render view_image previews inline#1595
Open
wgqqqqq wants to merge 1 commit into
Open
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
view_imageresults as a compact, auto-expanded image attachment in Flow ChattoolCall.input.pathin the UI, so local, web, peer-device, and remote workspace flows share the same rendering pathCloses #1490
Prior contribution
This work builds on the product need reported by @liuxingyu521 in #1490 and the dedicated Flow Chat image-preview direction first implemented and demonstrated by @liuxingyu521 in #1491. That PR established the value of showing
view_imageoutput directly in the conversation and provided the first card/preview implementation.This PR carries that contribution forward on the latest
mainafter #1491 was closed for being stale. It preserves the dedicated-card UX while addressing the remote-workspace concern raised in that discussion: image bytes now come from the tool's existingToolImageAttachment, flow through the stable completed-event contract, and survive session history restoration instead of requiring the frontend to reopen a local path.Type and Areas
Type: Feature / UI/UX
Areas: Rust core, event contracts, session persistence, Web UI
Verification
pnpm run type-check:webpnpm --dir src/web-ui run test:run src/flow_chat/tool-cards/ViewImageToolCard.test.tsx src/flow_chat/services/flow-chat-manager/ToolEventModule.test.ts(13 tests passed)pnpm run i18n:auditcargo test -p bitfun-events -p tool-runtime completed(6 focused tests passed)cargo test -p bitfun-core view_image_reads_remote_workspace_relative_imagecargo check -p bitfun-core -p bitfun-events -p tool-runtime -p bitfun-services-core -p bitfun-acpReviewer Notes
image_attachmentsis optional on the event and persistence DTOs, preserving compatibility with existing tool results and saved sessions.