Repository navigation
fix(wework): keep viewed images out of message artifacts - #2507
Conversation
📝 WalkthroughWalkthroughThe chat UI now treats only ChangesGenerated-image gallery filtering
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
🧹 Nitpick comments (1)
wework/e2e/desktop/task-flow.e2e.mjs (1)
2574-2581: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winScope the negative assertion to the target assistant message.
The selector on Line 2575 counts galleries across the whole document. If another assistant message in this flow contains a valid
image_generationresult, this test fails for an unrelated gallery. Reuse the stable container for the assistant message that ownsviewImageBlockSelectorand count only that container’s gallery.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@wework/e2e/desktop/task-flow.e2e.mjs` around lines 2574 - 2581, Update the generated-image gallery count assertion near viewImageBlockSelector to query only the stable assistant-message container that owns that selector, rather than the whole document. Reuse that container when calling getElementCount and preserve the expected count of zero and existing assertion message.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@wework/e2e/desktop/task-flow.e2e.mjs`:
- Around line 2574-2581: Update the generated-image gallery count assertion near
viewImageBlockSelector to query only the stable assistant-message container that
owns that selector, rather than the whole document. Reuse that container when
calling getElementCount and preserve the expected count of zero and existing
assertion message.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: c89baf18-7977-45b7-b461-274cf97d3524
📒 Files selected for processing (5)
docs/en/wegent/developer-guide/runtime-local-work.mddocs/zh/wegent/developer-guide/runtime-local-work.mdwework/e2e/desktop/task-flow.e2e.mjswework/src/components/chat/MessageList.test.tsxwework/src/components/chat/MessageList.tsx
What changed
view_imageresults inside expandable tool details instead of rendering them again in the assistant message's generated-image gallery.image_generationas the only tool source for final generated-image artifacts.Why
MessageListcollected bothimage_generationandview_imageblocks as final image artifacts. Sinceview_imagealready renders its preview inside the tool details, the same inspected image remained duplicated at the bottom of the assistant turn.Impact
Images inspected through
view_imageremain available in tool details, while the bottom-of-message gallery is reserved for images generated as final output.Validation
pnpm --filter wework exec vitest run src/components/chat/MessageList.test.tsxpnpm --filter wework typecheckpnpm --filter wework exec node e2e/desktop/task-flow.e2e.mjs --view-image-onlySummary by CodeRabbit
Bug Fixes
Tests