Add DescWindowVisibility (ALWAYS/ON_DEMAND/NEVER) for description window - #123
Merged
Conversation
bobbylight
force-pushed
the
feature/desc-window-visibility
branch
3 times, most recently
from
August 17, 2026 00:59
6875044 to
d734029
Compare
… popup Replaces the boolean setShowDescWindow()/getShowDescWindow() API with a DescWindowVisibility enum, adding an ON_DEMAND mode where the description window is only shown when explicitly toggled. The toggle keystroke is customizable via the new setDescWindowToggleKey()/getDescWindowToggleKey() wrapper around the text component's InputMap/ActionMap. Also fixes a bug where a disposed description window could be silently resurrected by the JDK: java.awt.Window#hide() cascades to owned windows still visible at the moment their owner is hidden, hiding them too and flagging them (via a package-private showWithParent field) to be automatically re-shown the next time the owner is shown again - even if that owned window was dispose()d in the meantime. Since AutoCompletePopupWindow hid itself before explicitly hiding the description window, a description window that was visible when the choices popup lost focus would get this flag set; disposing it afterward (e.g. by switching to NEVER) didn't clear it, so the next time the choices popup reopened, the JDK silently recreated the disposed window's native peer and showed it again with stale content, bypassing all of our own visibility logic. Fixed by hiding the description window before hiding the choices popup, so it's already invisible by the time the JDK's cascade runs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
bobbylight
force-pushed
the
feature/desc-window-visibility
branch
from
August 17, 2026 01:07
d734029 to
6707be3
Compare
bobbylight
marked this pull request as ready for review
August 17, 2026 01:10
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.
Fixes #112.
Summary
AutoCompletion#setShowDescWindow()/getShowDescWindow()API with a newDescWindowVisibilityenum:ALWAYS(current behavior),ON_DEMAND(only shown when explicitly toggled), andNEVER.AutoCompletion#setDescWindowToggleKey()/getDescWindowToggleKey(), a thin wrapper around the text component'sInputMap/ActionMap(mirroring the existingsetTriggerKey()pattern), so theON_DEMANDtoggle keystroke is customizable. Defaults to Ctrl+Shift+Space viagetDefaultDescWindowToggleKey().gradle.properties).Test plan
./gradlew :AutoComplete:test— new and existingAutoCompletionTestcases pass, covering default visibility,NEVERnever creating the desc window,ON_DEMANDtoggle on/off, toggle key being a no-op outsideON_DEMAND, custom toggle keystrokes, and removing an installed keystroke vianull../gradlew compileJava compileTestJavaacross all modules, includingAutoCompleteDemo, which was updated to use the new enum.🤖 Generated with Claude Code