Fix: Hide the reset button on the embedded page that is in conversation - #18153
Conversation
📝 WalkthroughWalkthrough
ChangesConditional Reset Control
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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)
web/src/components/embed-container.tsx (1)
59-70: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd focused coverage for both reset states.
Render
EmbedContainerwithhideReset={true}andhideReset={false}. Assert that the Reset button is absent in the first case and present in the second case. Also assert thathandleResetstill runs when the button is present.As per coding guidelines: “Preserve still-valid behavior with focused tests, but remove tests that protect obsolete behavior.”
🤖 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 `@web/src/components/embed-container.tsx` around lines 59 - 70, Add focused tests for EmbedContainer covering both hideReset states: assert the Reset button is absent when hideReset is true, present when false, and invokes handleReset when clicked in the visible case. Remove or avoid any tests that only preserve obsolete behavior.Source: Coding guidelines
🤖 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 `@web/src/components/embed-container.tsx`:
- Around line 59-70: Add focused tests for EmbedContainer covering both
hideReset states: assert the Reset button is absent when hideReset is true,
present when false, and invokes handleReset when clicked in the visible case.
Remove or avoid any tests that only preserve obsolete behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 39acea69-5aa2-4120-9cdd-7262c976f1b3
📒 Files selected for processing (3)
web/src/components/embed-container.tsxweb/src/pages/agent/share/index.tsxweb/src/pages/next-chats/share/index.tsx
wangq8
left a comment
There was a problem hiding this comment.
Thanks for this fix! Clean and minimal change.
What I verified:
- The
hideResetprop defaults tofalse, so existingEmbedContainercallers are unaffected. sendLoadingis the right condition — it correctly hides the reset button only while a message is in flight, preventing accidental resets mid-conversation.- Applied consistently to both share pages (
agent/shareandnext-chats/share).
No issues found. LGTM 🚀
Summary
Fix: Hide the reset button on the embedded page that is in conversation