diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 3be43eb..0ff14c9 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,7 +1,9 @@ # GitHub Actions twin of .gitea/workflows/macos.yml. # Deltas from the Gitea file (everything else is the same jobs/steps): -# - runs-on macos-14: github.com retired macos-12 (the Gitea runner label). -# The Gitea workflow already notes macos-14 works for this pipeline. +# - runs-on macos-14: github.com retired macos-12. Do not use +# macos-latest — in 2026 that is macos-26-arm64, where a 1280×800 +# window hangs off the virtual display and XCTest marks sidebar +# controls (x ≈ -116) as not hittable (run 34864198118). # - actions/upload-artifact@v4: v3 is shut down on github.com. Gitea act_runner # still uses v3. # - No NODE_EXTRA_CA_CERTS / System keychain bundle: that is only for the @@ -25,7 +27,7 @@ permissions: jobs: build-and-test: - runs-on: macos-latest + runs-on: macos-14 env: DERIVED: build/DerivedData-test steps: @@ -182,7 +184,7 @@ jobs: package: needs: build-and-test - runs-on: macos-latest + runs-on: macos-14 if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/v') permissions: contents: write diff --git a/Sources/ICCery/ICCeryApp.swift b/Sources/ICCery/ICCeryApp.swift index 8535ad9..29d2f5e 100644 --- a/Sources/ICCery/ICCeryApp.swift +++ b/Sources/ICCery/ICCeryApp.swift @@ -56,10 +56,41 @@ final class AppDelegate: NSObject, NSApplicationDelegate { } /// docs/21 §Shell: 1280×800 content, min 1100×700, centred. + /// GitHub-hosted Macs (and any display smaller than 1280×800) must + /// not get a window that hangs off-screen — XCTest then reports + /// sidebar controls at negative x as not hittable (run 34864198118). private func configureMainWindow(_ window: NSWindow) { - window.setContentSize(NSSize(width: 1280, height: 800)) - window.contentMinSize = NSSize(width: 1100, height: 700) + let desired = NSSize(width: 1280, height: 800) + let minimum = NSSize(width: 1100, height: 700) + let visible = (window.screen ?? NSScreen.main)?.visibleFrame + ?? NSRect(origin: .zero, size: desired) + + window.contentMinSize = NSSize( + width: min(minimum.width, visible.width), + height: min(minimum.height, visible.height) + ) + window.setContentSize(NSSize( + width: min(desired.width, visible.width), + height: min(desired.height, max(minimum.height, visible.height - 40)) + )) window.center() + + var frame = window.frame + if frame.width > visible.width { + frame.size.width = visible.width + } + if frame.height > visible.height { + frame.size.height = visible.height + } + frame.origin.x = min( + max(frame.origin.x, visible.minX), + visible.maxX - frame.width + ) + frame.origin.y = min( + max(frame.origin.y, visible.minY), + visible.maxY - frame.height + ) + window.setFrame(frame, display: true) } /// Dock-click reopen: let the WindowGroup re-show or recreate the