ADFA-4318 Paper Cut: Change agent disclaimer to fire with onResume so adjacent tabs don't pre-fire it by accident#1389
Conversation
…pre-fire it by accident
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughRelease NotesAgent Disclaimer Dialog Timing Fix
Risks & Considerations
Code Quality
Walkthrough
ChangesDisclaimer Dialog Lifecycle Timing
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 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 |
… adjacent tabs don't pre-fire it by accident (#1389) Change agent disclaimer to fire with onResume so adjacent tabs don't pre-fire it by accident
The fix is a single change in AgentFragmentContainer.kt: moved showDisclaimerDialogIfNeeded() out of onViewCreated() and into a new onResume() override.
Why this works: ViewPager2 + FragmentStateAdapter creates adjacent pages through onViewCreated, but only the visible page reaches onResume. The disclaimer now only fires when the user actually lands on the Agent tab. SharedPreferences gating in showDisclaimerDialogIfNeeded already ensures one-shot behavior, so resuming the agent tab multiple times is safe.
Plugin robustness: The trigger is lifecycle-based, not position-based, so plugins inserting tabs adjacent to Agent (or removing Git, reordering, etc.) cannot resurface the bug.