Skip to content

fix(flowchat): preserve conversation image content and layout - #3606

Merged
bobleer merged 4 commits into
openBitFun:mainfrom
bobleer:bob/fix-conversation-image-export
Oct 29, 2026
Merged

bobleer merged 4 commits into
openBitFun:mainfrom
bobleer:bob/fix-conversation-image-export

Conversation

@bobleer

@bobleer bobleer commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

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.
  • Focused ESLint on changed production TypeScript files and git diff --check — passed.
  • Local rendering fixtures using the affected conversation data and production capture helper produced readable images in macOS WKWebView and Chromium. Private session data and images are not included in this PR.
  • A long text/code/SVG fixture with 1,500 inherited theme variables passed in both engines and light/dark themes; both engines rejected background-only captures.
  • Real conversation layout fixtures compare source DOM with the cloned SVG. The previous 16-round transcript accumulated roughly 120px of drift; containing margins removes that drift. System-font and actual bundled HarmonyOS/Fira-font fixtures cover light/dark themes and 900px/554px columns, with matching glyph layout and compact footer spacing.

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

  • 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.

@bobleer bobleer changed the title fix(flowchat): prevent blank conversation image exports fix(flowchat): prevent blank conversation and widget image exports Oct 29, 2026
@bobleer bobleer changed the title fix(flowchat): prevent blank conversation and widget image exports fix(flowchat): match transcript image layout and reject blank exports Oct 29, 2026
@bobleer bobleer changed the title fix(flowchat): match transcript image layout and reject blank exports fix(flowchat): preserve conversation image content and layout Oct 29, 2026
@bobleer
bobleer merged commit 47add29 into openBitFun:main Oct 29, 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