fix: discard active list on field discard#1049
Conversation
WalkthroughThe ChangesList Action Cleanup and State Tracking
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/run/InterpretationLog.tsx`:
- Around line 179-182: When cleaning up the active list in InterpretationLog,
call stopGetList() last to avoid races with pagination/limit toggles: currently
the block comparing actionId === currentListActionId calls stopGetList() before
stopPaginationMode() and stopLimitMode(), but stopPaginationMode() reads the
current render's getList and can re-emit setGetList:true; reorder so
stopPaginationMode() and stopLimitMode() execute first and then call
stopGetList() to ensure the socket-side list capture is truly disabled. Use the
existing symbols currentListActionId, stopPaginationMode, stopLimitMode, and
stopGetList to locate and change the call order.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3ae18304-cc3d-4be2-afe3-522ee5988daf
📒 Files selected for processing (1)
src/components/run/InterpretationLog.tsx
| if (actionId === currentListActionId) { | ||
| stopGetList(); | ||
| stopPaginationMode(); | ||
| stopLimitMode(); |
There was a problem hiding this comment.
Call stopGetList() last in this cleanup path.
stopPaginationMode() still consults the current render's getList value and can emit setGetList: true right after stopGetList() emits false, so discarding the active list can leave list capture re-enabled on the socket side. Reordering these calls avoids the conflicting emits.
Suggested fix
if (actionId === currentListActionId) {
- stopGetList();
stopPaginationMode();
stopLimitMode();
+ stopGetList();
setShowPaginationOptions(false);
setShowLimitOptions(false);
setCaptureStage('initial');
setCurrentListActionId('');
clientSelectorGenerator.cleanup();📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (actionId === currentListActionId) { | |
| stopGetList(); | |
| stopPaginationMode(); | |
| stopLimitMode(); | |
| if (actionId === currentListActionId) { | |
| stopPaginationMode(); | |
| stopLimitMode(); | |
| stopGetList(); | |
| setShowPaginationOptions(false); | |
| setShowLimitOptions(false); | |
| setCaptureStage('initial'); | |
| setCurrentListActionId(''); | |
| clientSelectorGenerator.cleanup(); |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/components/run/InterpretationLog.tsx` around lines 179 - 182, When
cleaning up the active list in InterpretationLog, call stopGetList() last to
avoid races with pagination/limit toggles: currently the block comparing
actionId === currentListActionId calls stopGetList() before stopPaginationMode()
and stopLimitMode(), but stopPaginationMode() reads the current render's getList
and can re-emit setGetList:true; reorder so stopPaginationMode() and
stopLimitMode() execute first and then call stopGetList() to ensure the
socket-side list capture is truly disabled. Use the existing symbols
currentListActionId, stopPaginationMode, stopLimitMode, and stopGetList to
locate and change the call order.
What this PR does?
When a user discards a capture list action by clicking the ✕ button on its tab in the output preview section (instead of the Discard button in the right panel), the right panel continues showing the capture list steps UI as if the action is still in progress.
When the ✕ button is clicked on the active capture list tab, the same cleanup logic that runs when clicking Discard in the right panel now also runs, resetting all related state so the right panel correctly disappears.
Summary by CodeRabbit