Repository navigation
fix(flowchat): preserve conversation image content and layout - #3606
Merged
bobleer merged 4 commits intoOct 29, 2026
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
Conversation and Generative UI card image exports could save a PNG containing only the theme background. The shared capture helper now omits repeated inherited theme variables from the serialized SVG, rejects blank rasters before adding the logo, and retries failures at a lower scale. Both exporters reuse the verified canvas; timeouts release late results and failed captures never report success.
Conversation images also used the full pane width. They now follow the initiating transcript column and local font settings, with a responsive 16–32px image inset. Round wrappers contain their child margins before the screenshot library freezes computed heights: this prevents inter-round spacing from disappearing and accumulating above the footer. Long tool summaries respect the horizontal inset, and the footer uses compact spacing.
Capture waits for fonts and embeds used web-font faces, preserving Windows/Linux's bundled HarmonyOS/Fira metrics as well as macOS system-font layout. Logo geometry is measured after fonts settle and uses the actual raster scale.
Type and Areas
Type: bug fix
Areas: shared Web UI / FlowChat conversation and Generative UI card image export on Desktop
Motivation / Impact
The old data-URL length check accepted background-only PNGs, while switching PNG/Blob encodings retried the same rasterizer. Copying the entire theme catalog to every node made large SVGs expensive to decode. The export-specific width and collapsing-margin behavior also produced overly wide images and excessive whitespace; disabling font embedding could substitute a different face on bundled-font platforms.
Verification
pnpm --dir src/web-ui run test:run src/flow_chat/components/modern/exportImageLayout.test.ts src/flow_chat/utils/exportImageCapture.test.ts src/flow_chat/utils/captureElementToDownloadsPng.test.tsx src/flow_chat/components/modern/MessageExportControls.test.tsx src/flow_chat/tool-cards/GenerativeWidgetToolCard.test.tsx— 47 tests passed.pnpm run check:web— passed, including type checking and Appearance/theme governance.git diff --check— passed.Reviewer Notes
AI-assisted implementation and review. Verification covers automated DOM/raster tests and local rendering fixtures, not interactive application testing. Windows WebView2 and Linux WebKitGTK were not exercised on native hosts; their bundled font profile was rendered in both local engines. Remote workspace, Remote Control, Peer Device, and Detached Dispatch were not exercised on live hosts. This change adds no host commands, dependencies, persisted fields, or wire contracts. All desktop platforms share the capture implementation.
Checklist