fix: prevent stale popup background regions

This commit is contained in:
2026-10-18 01:22:16 +02:00
parent f12ef7e7a1
commit 75c9a329d6
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ The launcher, emoji picker, notes, and translation tool open immediately without
Right-click the launcher background for Settings and Quit. Actions include favorites, resetting usage ranking, revealing applications in Finder, quitting them, and uninstalling them.
The Actions surface crops the launcher’s full-size background at its own position, keeping the glows continuous without showing the results underneath.
Action and provider popups crop the launcher’s full-size background at their own position, keeping the glows continuous without showing the results underneath. They resolve their layout and invalidate the background before fading in, including when reopening or switching popup types.
### Global shortcuts and launch at login
@@ -214,6 +214,9 @@ final class ApplicationActionsController: NSViewController, NSSearchFieldDelegat
coveredPillAlpha = pill.alphaValue
}
coveredPill?.setAccessibilityHidden(true)
// Resolve the background crop before fading in a newly positioned popup.
host.layoutSubtreeIfNeeded()
background.needsDisplay = true
NSAnimationContext.runAnimationGroup { context in
context.duration = NSWorkspace.shared.accessibilityDisplayShouldReduceMotion ? 0 : 0.16
view.animator().alphaValue = 1
@@ -45,7 +45,6 @@ import Testing
var selections: [Bool] = []
popup.selectProvider = { selections.append($0) }
popup.showProviders(selectedOpenAI: true, relativeTo: anchor)
host.layoutSubtreeIfNeeded()
let rect = popup.view.convert(popup.view.bounds, to: host)
#expect(rect.maxY == pill.frame.maxY)
#expect(rect.minY < pill.frame.minY)
@@ -56,7 +55,6 @@ import Testing
// Reopen during the close animation, then switch modes without retaining the old anchor.
popup.showTranslation(relativeTo: anchor)
popup.showProviders(selectedOpenAI: false, relativeTo: anchor)
host.layoutSubtreeIfNeeded()
#expect(popup.view.convert(popup.view.bounds, to: host).maxY == pill.frame.maxY)
popup.moveSelection(by: 1)
_ = popup.handle(#selector(NSResponder.insertNewline(_:)))