Skip to content

Conversation

lucasmotta
Copy link

@lucasmotta lucasmotta commented Sep 29, 2025

Summary

CleanShot.2025-09-29.at.19.15.38.mp4

Fixes intermittent visibility problems where the code completion window would not appear visually despite functioning correctly for keyboard navigation.

Fixes #351

Changes Made

  • Window Style Mask: Replaced problematic .nonactivatingPanel and .utilityWindow with .borderless
  • Window Hiding Behavior: Changed hidesOnDeactivate from true to false
  • Window Properties: Added canHide = false and acceptsMouseMovedEvents = true
  • Window Ordering: Improved window showing sequence in showWindow(attachedTo:)
  • Resource Cleanup: Added proper cleanup of notification observers in close()

Root Cause

The .nonactivatingPanel style mask was preventing the window from becoming key, which caused:

  • The console warning: canBecomeKeyWindow returned NO
  • Inconsistent window visibility despite functional keyboard navigation

Solution

Using .borderless provides the clean appearance needed for code completion while ensuring reliable window display. This style mask is ideal for popover-style UI elements as it gives full control over positioning and appearance without the activation issues.

Test Plan

  • Code completion window appears consistently when triggered
  • Keyboard navigation (up/down arrows, Tab, Escape) works correctly
  • Window positioning and sizing work as expected
  • No more canBecomeKeyWindow console warnings
  • Window closes properly when focus is lost

🤖 Generated with Claude Code

lucasmotta and others added 3 commits September 29, 2025 19:11
Resolves intermittent visibility problems where the code completion window would not appear visually despite functioning correctly for keyboard navigation.

Changes:
- Replace problematic window style masks (.nonactivatingPanel, .utilityWindow) with .borderless
- Set hidesOnDeactivate to false to prevent unexpected hiding
- Add canHide = false and acceptsMouseMovedEvents = true for better window behavior
- Improve window showing sequence in showWindow(attachedTo:)
- Add proper cleanup of notification observers in close()

The .nonactivatingPanel style was preventing the window from becoming key, causing the "canBecomeKeyWindow returned NO" warning and inconsistent visibility. Using .borderless provides the clean appearance needed for code completion while ensuring reliable display.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Removes .nonactivatingPanel from BezelNotification window style mask to eliminate console warnings while maintaining non-activating behavior through .hudWindow style.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@thecoolwinter
Copy link
Collaborator

thecoolwinter commented Sep 29, 2025

I haven't had a chance to play with this yet but we do want to allow the user to resize the window horizontally. Can we make sure that's still happening after removing the .resizable flag?

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.

🐞 Suggestion window fails to draw
2 participants