Repository navigation
fix(prompt-image): show the generated image in view after generation - #10
Merged
Merged
Conversation
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
|
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 |
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.
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.Imagebuilt directly from the image bytes. Previously oneft.Imagewas created withsrc=""and later handed adata:image/pngURI. The result section has aScrollKey, andscroll_toruns 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