ref(explorer): cleanup UI interrupt state and panel code#112446
Merged
Conversation
Removed timeout management from waiting and interrupt helpers.
shruthilayaj
approved these changes
Apr 13, 2026
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Premature polling stop when session data is null
- Added explicit check for filteredSessionData in useEffect condition to ensure waitingForResponse is only cleared when session data actually exists and is not loading.
Or push these changes by commenting:
@cursor push 0f6a2c5c44
Preview (0f6a2c5c44)
diff --git a/static/app/views/seerExplorer/hooks/useSeerExplorer.tsx b/static/app/views/seerExplorer/hooks/useSeerExplorer.tsx
--- a/static/app/views/seerExplorer/hooks/useSeerExplorer.tsx
+++ b/static/app/views/seerExplorer/hooks/useSeerExplorer.tsx
@@ -563,7 +563,7 @@
filteredSessionData.blocks.some((block: Block) => block.loading));
useEffect(() => {
- if (waitingForResponse && !isLoading) {
+ if (waitingForResponse && filteredSessionData && !isLoading) {
// Stop waiting once we see the response is no longer loading
setWaitingForResponse(false);
// Clear deleted index once response is complete
@@ -574,7 +574,7 @@
setWasJustInterrupted(true); // set persistent UI flag until next request
}
}
- }, [waitingForResponse, interruptRequested, isLoading]);
+ }, [waitingForResponse, interruptRequested, isLoading, filteredSessionData]);
return {
sessionData: filteredSessionData,This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5cc6add. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Code organization and cleanup for explorer chat UI, before implementing a polling timeout. Should not affect current functionality.
Refactors:
Use helpers
_onNewRequestand_onRequestErrorfor repeated interrupt/waiting state management inuseSeerExplorer. This will soon include timeout stateMoves the "response complete" detection from inline code (ran every render) into a
useEffect. In general we could use a lot less useEffect's but seems correct here - reducing effects is a larger refactor for another daySimplifies interrupt detection by removing the
prevInterruptRequestedRefapproach —wasJustInterruptedis now set directly when polling stops after an interrupt request.startNewSessiondelegates toswitchToRun(null)to deduplicate codeSimplifies the
readOnlycomputation inexplorerPanelby removing defensive type-checking arounduseUser(). The comment is not accurateSimplify props for disabled textarea in case of read-only
Cleanup:
Removes the always-poll-when-drawer-open (
isSeerDrawerOpen) condition. Chat is no longer embedded into seer drawer.Removes
clearWasJustInterruptedfrom hook API. Clearing on user request + switch session is sufficientRemoves
isPendingfrom the hook's return value (unused externally and not useful due to polling)