Skip to content

fix(tabs): hide the closing chat before it leaves the card deck - #70

Merged
serialexperimentslainnnn merged 6 commits into
developfrom
fix/last-chat-tab-already-disposed
Aug 30, 2026
Merged

serialexperimentslainnnn merged 6 commits into
developfrom
fix/last-chat-tab-already-disposed

Conversation

@serialexperimentslainnnn

Copy link
Copy Markdown
Owner

The bug

Closing the last chat tab logged java.lang.Throwable: Already disposed from JBCefOsrComponent's resize alarm — only when that chat's session had really been used.

ChatTabsPanel.close removed the card from the CardLayout while it was still visible. Container.remove runs removeNotify() first (disposing the browser's resize alarm), then CardLayout.removeLayoutComponent, which calls next(parent) if the card is still showing. With a single card, next() picks (i + 1) % 1 — the card being removed — makes it visible again and validates, so the layout reshapes a browser whose alarm is already gone.

With two or more chats, select(survivor) had already hidden the dying card via cards.show, so next() never ran. That is why only the last tab, on a realised browser, hit it.

The fix

Hide the card before it leaves the deck, so removeLayoutComponent never enters next(). A no-op on the multi-tab path.

Tests

Two new cases in ChatTabsCloseHeadlessTest; the last-tab one fails without the fix (13 tests completed, 1 failed) and passes with it. Full ./gradlew test green.

Also in this branch

  • CODEOWNERS: corrected the maintainer's contact address; CLAUDE.md and .gitignore now owned outright.
  • docs: FAQ and TROUBLESHOOTING still said settings are global; they are per IDE installation, per project since 5.7.0.
  • version bumped to 5.8.1 with CHANGELOG and RELEASE_NOTES entries, ready for the release cut.

Closing the last chat logged "Already disposed" from JBCefOsrComponent's
resize alarm. Container.remove runs removeNotify() on the card first, then
hands it to CardLayout.removeLayoutComponent, which calls next() when the
card is still visible. With one card left, next() picks that same card,
makes it visible again and validates, so the layout reshapes a browser
component whose alarm the removeNotify had already disposed.

With two or more chats the survivor's select() had already hidden the
dying card, so next() never ran — which is why only the last tab, on a
session whose browser had really been realised, hit it.
The listed address was wrong; the maintainer reads lain@digitalexperiments.dev.
Neither is a chore file. CLAUDE.md holds the standing directive over the
security code and its tests, and .gitignore is what keeps credentials and
local state out of the history; an edit to either changes the rules, so
both are listed rather than left to the default glob.
FAQ.md and TROUBLESHOOTING.md still described the 5.5.0 scope. Since 5.7.0
settings are one document per IDE installation, per project, with the old
global document kept as the seed — which README.md already says.
@serialexperimentslainnnn
serialexperimentslainnnn force-pushed the fix/last-chat-tab-already-disposed branch from eb89371 to 45184a6 Compare August 30, 2026 19:46
@serialexperimentslainnnn
serialexperimentslainnnn merged commit 3c0199f into develop Aug 30, 2026
11 checks passed
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.

1 participant