Skip to content

Fix approval/question cards getting lost when multiple tabs are active - #104

Merged
eilonwy06 merged 1 commit into
eilonwy06:masterfrom
jmoraleda:fix/per-tab-pending-card
Sep 4, 2026
Merged

Fix approval/question cards getting lost when multiple tabs are active#104
eilonwy06 merged 1 commit into
eilonwy06:masterfrom
jmoraleda:fix/per-tab-pending-card

Conversation

@jmoraleda

@jmoraleda jmoraleda commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

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.

@jmoraleda
jmoraleda force-pushed the fix/per-tab-pending-card branch from 80d5a2e to ba8b3d5 Compare August 29, 2026 20:17
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
jmoraleda force-pushed the fix/per-tab-pending-card branch from ba8b3d5 to a558ca2 Compare September 4, 2026 14:34
@jmoraleda jmoraleda changed the title Fix pending cards clobbering each other across tabs Fix approval/question cards getting lost when multiple tabs are active Sep 4, 2026
@eilonwy06

Copy link
Copy Markdown
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.

@jmoraleda

Copy link
Copy Markdown
Contributor Author

Hi @eilonwy06 .Thank you. Yes. The five I just opened are now fully ready to review and merge.

@eilonwy06
eilonwy06 merged commit 7d7563f into eilonwy06:master Sep 4, 2026
@eilonwy06

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants