Skip to content

test(ui): pair every launch argument, and ask for a window when CI opens none - #110

Closed
Shepdesign wants to merge 2 commits into
mainfrom
claude/ui-test-window
Closed

Shepdesign wants to merge 2 commits into
mainfrom
claude/ui-test-window

Conversation

@Shepdesign

Copy link
Copy Markdown
Member

What

The UI tests have failed on their first assertion since they first ran. The diagnostic tree they now print says it was never the fixture:

app.state = 4 (runningForeground)
windows.count = 0, dialogs = 0, sheets = 0, alerts = 0
MenuBarItems: Apple, NetRelish, File, Edit, View, Bench, Jars, Tab, Window, Help
Window elements anywhere in the 545-line tree: 0

The app comes up, builds its whole menu bar, and has no window. Three things that tree proves:

  • The fixture ran to the end. The Jars menu lists Juniper Bakery and Meridian beside the seeded Read Later and Reference, so PantryStore(inMemory:) migrated, VaultStore was constructed past both fatalError sites, and both newJar calls ran. The crash theory is dead.
  • The app isn't hung. XCUITest logged Setting up automation session and both Wait for … to idle steps returned in 0.01–0.02s.
  • The scene can make a window, and never made one. File › New NetRelish Window is enabled; Close, Close All and Bring All to Front are disabled, as is every window-dependent command (Capture This Page, Seal, Close Tab).

Two changes, both in the test:

  1. Every launch argument is a -key value pair. macOS pairs each -key with the next token, so the bare -NRUITestFixture took -ApplePersistenceIgnoreState as its value and left YES dangling — state restoration was never actually off, and the second test method inherited the first one's scene. The fixture still switched on, because UITestFixture.isOn reads ProcessInfo.arguments.contains and never looks at the value. That is why the mistake stayed invisible.
  2. When no window appears, the test asks for one through File › New NetRelish Window — the item the tree proves is enabled, and a route VoiceOver reaches — before it fails. If that makes no window either, the failure prints the whole tree.

What this does not claim

Why macOS opens no initial window for a WindowGroup on that virtual Mac is still unexplained. Nothing in Sources/ closes, hides or defers a window; no path under -NRUITestFixture leaves the WindowGroup uninstantiated; .defaultSize(1440×900) on the runner's 1024×768 display is clamped, not dropped; and the app prints nothing at launch, which is the ceiling of what this log can say. Chasing it further needs the app to log its window count at launch, and this PR does not add that.

So this run is also the experiment: if the menu route produces a window, the missing initial window is the only anomaly left.

Demo

Launch the app from this branch — unchanged, because no app code changed. The demo for the path itself is ADR 0036's: ⌘L, the address, ⌘D, ⌃⌘1, Restore to Meridian, ⌘S. What this PR demos is CI: the UI tests job goes from red to green, or fails with a tree that says what is there.

Rule check

None touched. No models, no storage, no network, no intelligence, no new endpoint. The fixture stays #if DEBUG on both sides and still reads only ProcessInfo.arguments.

Brand check

None. No UI, no tokens, no marks, no drips.

Follow-up, not in this PR

BUNDLE_LOADER = "$(TEST_HOST)" is set on the NetRelishUITests target, which is a hosted-unit-test setting on a UI-testing bundle. TEST_HOST is unset so it expands to empty and is link-time only — untidy rather than broken. Removing it means a project.yml change and a project regeneration, so it is left for a tidy-up.


Generated by Claude Code

…ens none

The UI tests failed on their first assertion, and the tree they now print says why
it was never the fixture: the app reaches runningForeground, builds its whole menu
bar, and has no window. The Jars menu lists Juniper Bakery and Meridian beside the
seeded jars, so makeWorkbench() ran past both fatalError calls and the Keychain
VaultStore; File > New NetRelish Window is enabled while Close and Bring All to
Front are not, so the scene can make a window and none was ever made.

Two changes, both in the test:

- Every launch argument is a -key/value pair. macOS pairs each -key with the next
  token, so the bare -NRUITestFixture took -ApplePersistenceIgnoreState as its
  value and left YES dangling: state restoration was never actually off, and the
  second method inherited the first one's scene. The fixture still switched on,
  because UITestFixture.isOn reads ProcessInfo.arguments.contains and never looks
  at the value, which is why the mistake stayed invisible.
- When no window appears, the test asks for one through File > New NetRelish
  Window - the item the tree proves is enabled, and a route VoiceOver reaches -
  before it fails. If that makes no window either, the failure prints the tree.

Why macOS opens no initial window for a WindowGroup on that virtual Mac is still
unexplained. Nothing in Sources/ closes, hides or defers a window, no path under
-NRUITestFixture leaves the WindowGroup uninstantiated, and the app prints nothing
at launch - which is the ceiling of what this log can say. Chasing it further
needs the app to log its window count at launch; this does not add that.

No app code changes. Both traps are now on the accessibility page.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sz4R7gro65BtZ2JyqWVwvZ
@vercel

vercel Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
zest Ready Ready Preview Nov 21, 2026 8:55am UTC

Request Review

Copy link
Copy Markdown
Member Author

All four build jobs on cf4347c are red, and none of it is this PR. Every one of them stops at the same place:

Sources/Bench/TabStrip.swift:120:25: error: the compiler is unable to
type-check this expression in reasonable time
Job Configuration Outcome
UI tests Debug-AppStore type-check timeout
Test Debug-AppStore type-check timeout, Testing cancelled because the build failed
Build Direct Release-Direct, -O type-check timeout
Build AppStore Release-AppStore type-check timeout

The three companion errors name symbols that exist and always did — held (ShellRows.swift:105), shownTab (:243), order (TabStrip.swift:107). That is what a type-check timeout looks like from outside: the compiler gives up and reports whatever it never reached as missing, in whichever files shared the frontend command.

This PR's diff is two files, neither of which the compiler was looking at:

Tests/NetRelishUITests/CaptureJarSealUITests.swift | 43 ++++----
docs/subsystems/accessibility.md                   | 22 ++++-

The expression had compiled on 0877a33 immediately before, so it was sitting on the type-checker's limit and has now tipped over on every runner and every configuration.

The fix is #111, which breaks that expression up. It is deliberately a separate PR rather than widened into this one, since it is unrelated app code. This PR stays as it is and waits for #111 to land, then picks up main and re-runs.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Closing this: #109 does what it was for, and does it better, with a green run behind it.

The one thing this PR got right was the launch arguments — a bare -NRUITestFixture swallows the next key, which is why -ApplePersistenceIgnoreState never took effect. #109's 3dd63cc makes the same fix, and its CI run shows the mechanism I had only guessed at: the dangling YES is taken by AppKit for a file to open, and a launch that opens a file opens no window. That is why the app came up with a full menu bar and nothing else. Confirmed, not theorised — the next run found the window, the Shelf, the jars and the address field.

Which also means the File › New NetRelish Window fallback here was a workaround for a problem that no longer exists. Better gone than carried.

And #109 goes on to fix the step I would have hit next: every Pantry seeds Read Later and Reference, including an in-memory one, so the fixture's two jars are the Shelf's third and fourth. The fixture was putting Read Later in front, and the second test's ⌘2 was Reference, not Meridian.

My remaining note stands and is worth keeping somewhere: the held/shownTab/order errors on this PR's checks were real, not cascade as I said in the comment above. They come from #107 and are fixed in #109. I had verified those symbols against 0877a33, this branch's base, when a pull_request build compiles the branch merged with current main — so I was reading a different revision than the compiler was.

→ #109.


Generated by Claude Code

@Shepdesign Shepdesign closed this Nov 21, 2026
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.

2 participants