Show a Placeholder While the Assistant Generates an Image - #91
Show a Placeholder While the Assistant Generates an Image#91PSchmiedmayer wants to merge 1 commit into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟡 Changes recommended
There are confirmed build-blocking issues (an extension placed outside its #if canImport(GroveChat) guard and missing UIKit import) plus missing .png.license sidecars for newly referenced DocC screenshots.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR improves the chat and LLM user experience around assistant-generated images by introducing an in-chat “generating image” placeholder that preserves scroll position, enhancing image/file viewing interactions (including keyboard dismissal), and updating DocC documentation screenshots plus supporting tests.
Changes:
- Add a generating-image placeholder flow end-to-end (LLMContext placeholder storage/encoding → GroveChat placeholder UI → completion/removal APIs).
- Improve image viewing and zoom fitting behavior (fade-in reveal, viewer filtering of placeholders, refit-on-bounds-change).
- Refresh documentation + screenshot capture UI tests for chat and LLM onboarding, including a seeded documentation conversation.
File summaries
| File | Description |
|---|---|
| Tests/GroveLLMTests/UITests/TestAppUITests/DocumentationScreenshots.swift | Adds UI-walk to capture OpenAI onboarding screenshots for DocC. |
| Tests/GroveLLMTests/UITests/TestApp/LLMLocal/Onboarding/LLMLocalOnboardingWelcomeView.swift | Switches onboarding welcome to PageView. |
| Tests/GroveLLMTests/LLMContextImageTests.swift | Adds unit tests for announced/completed/removed generated images. |
| Tests/GroveChatTests/ZoomableImageViewTests.swift | Adds test ensuring refit on bounds change without image inflation. |
| Tests/GroveChatTests/UITests/TestAppUITests/DocumentationScreenshots.swift | Adds UI-walk to capture chat documentation screenshots. |
| Tests/GroveChatTests/UITests/TestApp/DocumentationConversation.swift | Adds seeded “Health Assistant” conversation and rendered chart images for docs. |
| Tests/GroveChatTests/UITests/TestApp/ChatTestView.swift | Adds documentation-mode responses + placeholder-to-image replacement behavior. |
| Tests/GroveChatTests/ChatEntityImageCodingTests.swift | Adds Codable round-trip tests for .generating and URL images. |
| Sources/GroveLLM/Models/LLMContextEntity.swift | Introduces _ImageContent.generating and isGenerating helper. |
| Sources/GroveLLM/Models/LLMContext.swift | Adds complete(assistantImage:) and removeGeneratingImages(for:). |
| Sources/GroveLLM/Helpers/LLMContext+Chat.swift | Maps generating images into GroveChat as .generating placeholders. |
| Sources/GroveLLM/GroveLLM.docc/GroveLLM.md | Documents generated-image placeholder behavior and adds screenshot. |
| Sources/GroveChat/Resources/Localizable.xcstrings | Updates follow-up string and adds “Generating image” localization key. |
| Sources/GroveChat/Models/PlatformImage.swift | Ensures .generating has no PlatformImage representation. |
| Sources/GroveChat/Models/ChatEntity.swift | Adds ChatEntity.Content.Image.generating + Codable support. |
| Sources/GroveChat/Message View/ZoomableImageView.swift | Prevents re-entrant fitting and avoids zoom/frame inflation issues. |
| Sources/GroveChat/Message View/SelectableMessageText.swift | Renames follow-up action and adjusts action prominence (Textual). |
| Sources/GroveChat/Message View/PlainMessageView.swift | Adds placeholder-to-image reveal transitions and blocks tapping placeholders. |
| Sources/GroveChat/Message View/GeneratingImageView.swift | Adds animated dot placeholder view for generating images. |
| Sources/GroveChat/Message View/ChatImageViewer.swift | Filters out generating placeholders and improves share-sheet behavior. |
| Sources/GroveChat/Message View/AttachedFilesView.swift | Dismisses keyboard before presenting Quick Look. |
| Sources/GroveChat/Helpers/ProgressiveBlur.swift | Removes progressive blur helper implementation. |
| Sources/GroveChat/Helpers/Keyboard.swift | Adds reusable keyboard dismissal helper for viewer presentation. |
| Sources/GroveChat/GroveChat.docc/Resources/ChatView~dark.png.license | Removes legacy DocC image license sidecar. |
| Sources/GroveChat/GroveChat.docc/Resources/ChatView+VoiceInput~dark.png.license | Removes legacy DocC image license sidecar. |
| Sources/GroveChat/GroveChat.docc/Resources/ChatView+VoiceInput.png.license | Removes legacy DocC image license sidecar. |
| Sources/GroveChat/GroveChat.docc/Resources/ChatView+TextInput~dark.png.license | Removes legacy DocC image license sidecar. |
| Sources/GroveChat/GroveChat.docc/Resources/ChatView+TextInput.png.license | Removes legacy DocC image license sidecar. |
| Sources/GroveChat/GroveChat.docc/Resources/ChatView.png.license | Removes legacy DocC image license sidecar. |
| Sources/GroveChat/GroveChat.docc/GroveChat.md | Updates overview to new screenshots and documents generated pictures + follow-up. |
| Sources/GroveChat/ChatView+Export.swift | Treats .generating like an image in text export description. |
| Sources/GroveChat/ChatView.swift | Adds DocC inline image to ChatView header docs. |
Review details
- Files reviewed: 32/52 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ffeba82 to
07dfa5b
Compare
07dfa5b to
dad1538
Compare
dad1538 to
993472a
Compare
4910529 to
b4ac639
Compare
b4ac639 to
9342bcc
Compare
9342bcc to
17e0c16
Compare
♻️ Current situation & Problem
While the assistant drew a picture the chat showed nothing until the image arrived, and the conversation lost its place when it did. Opening a picture or a file viewer left the keyboard standing on iOS, the image viewer did not build on macOS, and the chat and LLM pages had screenshots of an older chat.
⚙️ Release Notes
LLMContext.complete(assistantImage:)fills it in andremoveGeneratingImages(for:)drops what an interaction never delivered. The context encodes the placeholder, so a restored conversation shows it too.📚 Documentation
The chat page gets its images and a walk through the composer; the LLM page documents the placeholder and points at the chat.
✅ Testing
Unit tests for the placeholder's coding and the context's completion, the zoomable view's fitting, and the chat and LLM UI suites on an iPhone 17 Pro with iOS 26.5 plus the macOS unit legs.
Code of Conduct & Contributing Guidelines
By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: