Skip to content

fix(prompt-image): show the generated image in view after generation - #10

Merged
kekemao00 merged 1 commit into
mainfrom
claude/ux-audit-fixes-8ib387
Oct 2, 2026
Merged

kekemao00 merged 1 commit into
mainfrom
claude/ux-audit-fixes-8ib387

Conversation

@kekemao00

Copy link
Copy Markdown
Owner

Requested by ColeMao · project thread

Before: after a successful generation, the picture was saved to disk correctly but did not appear on the 提示词出图 page. It was placed in the "生成结果" section under the generate button, which at a normal window height is off screen, and the page did not scroll to it.

After: when generation finishes the page scrolls down to "生成结果". The picture, its size, time taken and save path, and the 下载 / 打开目录 / 复制提示词 / 重新生成 buttons all show without any manual scrolling. The preview fills the column width and is capped at 520 px tall.

How: each result now gets a new ft.Image built directly from the image bytes. Previously one ft.Image was created with src="" and later handed a data:image/png URI. The result section has a ScrollKey, and scroll_to runs after a short wait so the new layout is measured first. If the image cannot be decoded, the page shows a message pointing to 打开目录.

Verified in the web build with a stubbed generation result: a 2 MB, 1024² PNG returned after 5 s. ruff is clean and 40 tests pass. Not tested in the desktop client.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YT1bKjNw4KtaAURfwEArtp


Generated by Claude Code

The result section sits below the generate button, so on a normal window
height the preview rendered off screen. Scroll to it once the image is
shown, pass raw bytes to a fresh ft.Image instead of a data URI on an
image created with an empty src, and show a fallback message if decoding
fails.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YT1bKjNw4KtaAURfwEArtp
@cr-gpt

cr-gpt Bot commented Oct 2, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@kekemao00 kekemao00 self-assigned this Oct 2, 2026
@kekemao00
kekemao00 merged commit 71ef512 into main Oct 2, 2026
1 check 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.

2 participants