Fix Xcode Cloud UI tests by running TestAction in Debug (#672)
* Set cmux TestAction to Debug for UI tests * Broaden XCTest detection for debug launch gate * Fix AutomationSocketUITests launch hang in CI * Stabilize CI Swift package resolution for test jobs * Stabilize Xcode Cloud UI test focus and socket handling * Add Xcode Cloud pre-xcodebuild submodule bootstrap * Harden Xcode Cloud bonsplit bootstrap fallback
This commit is contained in:
parent
168e6b9b25
commit
7916b2d418
12 changed files with 552 additions and 144 deletions
|
|
@ -5048,7 +5048,26 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
|
|||
return true
|
||||
}
|
||||
|
||||
let isCommandP = normalizedFlags == [.command] && (chars == "p" || event.keyCode == 35)
|
||||
// Guard against stale browserAddressBarFocusedPanelId after focus transitions
|
||||
// (e.g., split that doesn't properly blur the address bar). If the first responder
|
||||
// is a terminal surface, the address bar can't be focused.
|
||||
if browserAddressBarFocusedPanelId != nil,
|
||||
cmuxOwningGhosttyView(for: NSApp.keyWindow?.firstResponder) != nil {
|
||||
#if DEBUG
|
||||
dlog("handleCustomShortcut: clearing stale browserAddressBarFocusedPanelId")
|
||||
#endif
|
||||
browserAddressBarFocusedPanelId = nil
|
||||
stopBrowserOmnibarSelectionRepeat()
|
||||
}
|
||||
|
||||
// Keep Cmd+P/Cmd+N inside the focused browser omnibar for Chrome-like
|
||||
// suggestion navigation, and avoid opening command palette switcher.
|
||||
// Scope the omnibar check to the shortcut's routed window context so a
|
||||
// focused omnibar in another window does not suppress Cmd+P here.
|
||||
let hasFocusedAddressBarInShortcutContext = focusedBrowserAddressBarPanelIdForShortcutEvent(event) != nil
|
||||
let isCommandP = !hasFocusedAddressBarInShortcutContext
|
||||
&& normalizedFlags == [.command]
|
||||
&& (chars == "p" || event.keyCode == 35)
|
||||
if isCommandP {
|
||||
let targetWindow = commandPaletteTargetWindow ?? event.window ?? NSApp.keyWindow ?? NSApp.mainWindow
|
||||
NotificationCenter.default.post(name: .commandPaletteSwitcherRequested, object: targetWindow)
|
||||
|
|
@ -5143,18 +5162,6 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
|
|||
return false
|
||||
}
|
||||
|
||||
// Guard against stale browserAddressBarFocusedPanelId after focus transitions
|
||||
// (e.g., split that doesn't properly blur the address bar). If the first responder
|
||||
// is a terminal surface, the address bar can't be focused.
|
||||
if browserAddressBarFocusedPanelId != nil,
|
||||
cmuxOwningGhosttyView(for: NSApp.keyWindow?.firstResponder) != nil {
|
||||
#if DEBUG
|
||||
dlog("handleCustomShortcut: clearing stale browserAddressBarFocusedPanelId")
|
||||
#endif
|
||||
browserAddressBarFocusedPanelId = nil
|
||||
stopBrowserOmnibarSelectionRepeat()
|
||||
}
|
||||
|
||||
// Chrome-like omnibar navigation while holding Cmd+N / Ctrl+N / Cmd+P / Ctrl+P.
|
||||
if let delta = commandOmnibarSelectionDelta(flags: flags, chars: chars) {
|
||||
dispatchBrowserOmnibarSelectionMove(delta: delta)
|
||||
|
|
@ -5707,6 +5714,16 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
|
|||
browserAddressBarFocusedPanelId
|
||||
}
|
||||
|
||||
private func focusedBrowserAddressBarPanelIdForShortcutEvent(_ event: NSEvent) -> UUID? {
|
||||
guard let panelId = browserAddressBarFocusedPanelId else { return nil }
|
||||
guard let context = preferredMainWindowContextForShortcutRouting(event: event),
|
||||
let workspace = context.tabManager.selectedWorkspace,
|
||||
workspace.browserPanel(for: panelId) != nil else {
|
||||
return nil
|
||||
}
|
||||
return panelId
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
func requestBrowserAddressBarFocus(panelId: UUID) -> Bool {
|
||||
focusBrowserAddressBar(panelId: panelId)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue