Skip to content

Add DescWindowVisibility (ALWAYS/ON_DEMAND/NEVER) for description window - #123

Merged
bobbylight merged 1 commit into
masterfrom
feature/desc-window-visibility
Aug 17, 2026
Merged

Add DescWindowVisibility (ALWAYS/ON_DEMAND/NEVER) for description window#123
bobbylight merged 1 commit into
masterfrom
feature/desc-window-visibility

Conversation

@bobbylight

@bobbylight bobbylight commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Fixes #112.

Summary

  • Replaces the boolean AutoCompletion#setShowDescWindow()/getShowDescWindow() API with a new DescWindowVisibility enum: ALWAYS (current behavior), ON_DEMAND (only shown when explicitly toggled), and NEVER.
  • Adds AutoCompletion#setDescWindowToggleKey()/getDescWindowToggleKey(), a thin wrapper around the text component's InputMap/ActionMap (mirroring the existing setTriggerKey() pattern), so the ON_DEMAND toggle keystroke is customizable. Defaults to Ctrl+Shift+Space via getDefaultDescWindowToggleKey().
  • This is an intentional breaking API change, targeted at the upcoming 4.0.0 major version (bumped in gradle.properties).

Test plan

  • ./gradlew :AutoComplete:test — new and existing AutoCompletionTest cases pass, covering default visibility, NEVER never creating the desc window, ON_DEMAND toggle on/off, toggle key being a no-op outside ON_DEMAND, custom toggle keystrokes, and removing an installed keystroke via null.
  • ./gradlew compileJava compileTestJava across all modules, including AutoCompleteDemo, which was updated to use the new enum.

🤖 Generated with Claude Code

@bobbylight
bobbylight force-pushed the feature/desc-window-visibility branch 3 times, most recently from 6875044 to d734029 Compare August 17, 2026 00:59
… 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
bobbylight force-pushed the feature/desc-window-visibility branch from d734029 to 6707be3 Compare August 17, 2026 01:07
@bobbylight
bobbylight marked this pull request as ready for review August 17, 2026 01:10
@bobbylight
bobbylight merged commit 98140e6 into master Aug 17, 2026
4 checks passed
@bobbylight
bobbylight deleted the feature/desc-window-visibility branch August 17, 2026 01:11
@bobbylight bobbylight self-assigned this Aug 17, 2026
@bobbylight bobbylight added this to the 4.0.0 milestone Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On-demand trigger for Description Window

1 participant