fix: dismiss active launcher window on Escape

This commit is contained in:
2026-10-17 00:05:20 +02:00
parent bc7e4fd013
commit a891d49bb1
10 changed files with 98 additions and 50 deletions
+1 -7
View File
@@ -26,7 +26,7 @@ import Testing
}
}
@Test @MainActor func translationCommandOpensToolAndEscapeRestoresSearch() throws {
@Test @MainActor func translationCommandBackNavigationRestoresSearch() throws {
_ = NSApplication.shared
let launcher = LauncherWindowController()
let content = try #require(launcher.window?.contentView)
@@ -42,12 +42,6 @@ import Testing
_ = launcher.control(search, textView: NSTextView(), doCommandBy: #selector(NSResponder.insertNewline(_:)))
#expect(search.stringValue.isEmpty)
#expect(search.accessibilityLabel() == "English text to translate into Japanese")
search.stringValue = "Good morning"
launcher.controlTextDidChange(Notification(name: NSControl.textDidChangeNotification, object: search))
_ = launcher.control(search, textView: NSTextView(), doCommandBy: #selector(NSResponder.cancelOperation(_:)))
#expect(search.stringValue == "translate")
#expect(table.numberOfRows == 1)
_ = launcher.control(search, textView: NSTextView(), doCommandBy: #selector(NSResponder.insertNewline(_:)))
let back = try #require(descendants(content).compactMap { $0 as? NSButton }.first {
!$0.isHidden && $0.accessibilityLabel() == "Back to applications"
})