Fix approval/question cards getting lost when multiple tabs are active - #104
Merged
Merged
Conversation
jmoraleda
force-pushed
the
fix/per-tab-pending-card
branch
from
August 29, 2026 20:17
80d5a2e to
ba8b3d5
Compare
pendingCard/pendingCardOwner were one shared global, but each tab runs its own CLI process and can raise its own approval/question/advisor card independently of any other tab. When a second tab's card arrived while a first tab's card was still awaiting an answer, showBottomCard unconditionally overwrote the single global slot: the first card's DOM disappeared with no cleanup (its keydown listener stays attached to a now-detached card, never removed), and its Java-side CompletableFuture was orphaned in QPENDING/PENDING — nothing could ever answer it, so that tab's tool stayed stuck on "pending" (e.g. "Asking" with no visible card) until the timeout preference lapsed or the user interrupted the session. Confirmed via repro: a question open on tab 1, switching to a different Eclipse view (not another Claude tab) while tab 2 independently raised its own unrelated question — tab 1's card vanished and tab 2's appeared, both legitimately relevant to their own conversations, ruling out a wrong-tabId routing bug (that would have put tab 2's question ON tab 1) in favor of eviction. Moves pendingCard onto the Tab object itself (Tab.pendingCard) so each tab's card is independent — showBottomCard/clearBottomCard now take an explicit owner tab (captured once per card, since rtab/activeTab() can change before the card resolves) rather than inferring it from rtab/activeTab() at call time, and renderBottomCard reads activeTab().pendingCard so switching tabs shows THAT tab's own card, never a stale one left over from whichever tab's card was shown last. Also guards each card's document-level keydown listener with card.isConnected: with cards now able to coexist per-tab instead of evicting each other, a background tab's card's listener was still live even though its card was never in the DOM — a number-key or Escape press meant for the tab actually on screen could silently resolve a completely different tab's pending decision.
jmoraleda
force-pushed
the
fix/per-tab-pending-card
branch
from
September 4, 2026 14:34
ba8b3d5 to
a558ca2
Compare
Owner
|
Hi @jmoraleda. Thanks for all these. I put off merging your other PRs because you indicated there checklists that haven't been fulfilled yet, so I assumed that there were still pending changes that you were going to commit. Let me know if your PRs are good to go so I can review and merge them. |
Contributor
Author
|
Hi @eilonwy06 .Thank you. Yes. The five I just opened are now fully ready to review and merge. |
Owner
|
@jmoraleda PRs merged and new release is up. Let me know if there are any issues with the new version. I've tested it and so far so good. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Keeps each conversation tab's own pending approval, question, or advisor card independent of every other tab's.
With several tabs running at once, a card opening in one tab could silently replace a card still waiting for an answer in another, leaving that tab stuck indefinitely. Makes multi-tab use reliable.