Skip to content

test(cloud): re-enable the Cloud header width tests by measuring each row - #16590

Merged
teamleaderleo merged 1 commit into
mainfrom
test/cloud-header-width-reenable
Oct 2, 2026
Merged

teamleaderleo merged 1 commit into
mainfrom
test/cloud-header-width-reenable

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Two tests in CloudMachinesHeaderCountTests were disabled. They hosted CloudTeamPickerHeader in a bare NSHostingView and searched SwiftUI's accessibility tree, which an in-process test without an assistive client does not reliably publish. They found nothing, not even the button identifiers.
  • The header's ViewThatFits now builds both candidate rows through one internal actionsRow(_:picker:), with a CloudHeaderMachineActions value (.inline or .overflowMenu). This also removes the duplicated row code. Product behaviour does not change: it is the same two rows, in the same order, with the same modifiers and identifiers.
  • The re-enabled tests skip the accessibility tree. They measure each candidate's ideal width and compare it with the bar's content width (sidebar width minus the bar's horizontal padding). That is the comparison ViewThatFits makes:
    • Narrow: with the long team name, the inline row is too wide for 220 pt, so the header falls back to the overflow menu.
    • Wide: with a short team name, the inline row fits 420 pt, and the overflow row is never wider than the inline row.
  • The wide test now uses a short team name. The old version used the long fixture name, which by estimate does not fit 420 pt next to Invite and the buttons, so that test would likely have failed even with working hosting.

Testing

CI; app-host changed suites. No local build: swiftc -parse passes on both files, and python3 scripts/verify-local.py passed 17/17 (it does not compile natively or run app tests).

Resource check: test-only measurement plus a behaviour-neutral view refactor. It adds no loops, caches, logs or long-lived resources.

Changelog: none

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Re-enables the two Cloud header width tests by measuring each ViewThatFits candidate's ideal width instead of reading SwiftUI's accessibility tree, which a bare NSHostingView does not publish in-process.

The header now builds both candidate rows through one internal actionsRow(_:picker:) with a CloudHeaderMachineActions value (.inline or .overflowMenu), which also removes the duplicated row code. Product behavior is unchanged. The tests compare each row's ideal width against the bar's content width — the same comparison ViewThatFits makes — and the wide case now uses a short team name, since the old long fixture name does not fit 420 pt.

Written for commit edf547d. Summary will update on new commits.

Review in cubic

… row

The two header width tests read SwiftUI's accessibility tree from a bare
NSHostingView, which publishes nothing in-process, so they were disabled.
The header now builds both ViewThatFits candidates through one internal
actionsRow(_:picker:), and the tests measure each candidate's ideal width
against the bar's content width, the comparison ViewThatFits makes. The
wide case uses a short team name: the long fixture name cannot fit 420pt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: e528aef9-a93c-4034-b9dc-facb93371b3a

📥 Commits

Reviewing files that changed from the base of the PR and between 6090053 and edf547d.

📒 Files selected for processing (2)
  • Sources/Cloud/CloudTeamPickerHeader.swift
  • cmuxTests/CloudMachinesHeaderCountTests.swift
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Subagent review at edf547d: approve.

  • The actionsRow(.inline|.overflowMenu) refactor is behaviour-neutral: each arm matches the old row's views, modifiers, identifiers, Invite popover binding and confirmedTeamID gate, and ViewThatFits keeps the same two candidates in the same order.
  • The tests compare fittingSize of row.fixedSize() against width − 16pt, which matches the chrome bar's 8+8 padding.
  • Non-blocking: reordering the ViewThatFits candidates would still pass.
  • No new strings.

Resource check: one-time layout code with no new loops, caches or logs, so no CPU, memory or disk impact.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Dogfood tours of edf547da

cloud-machine-author-tour at edf547da: not run

skipped: CI built this head on a runner pool whose products the UI test Macs cannot load, and media never compiles one; gh workflow run pr-media.yml -f pr=&lt;n&gt; -f allow_compile=true does

Tours are picked by the paths globs in dogfood/scenarios/*.json; a Dogfood-tours: a, b line in the description picks them instead (none turns this off). Look at every frame before merging: a green tour only means no step failed.

@teamleaderleo
teamleaderleo merged commit 6c4b727 into main Oct 2, 2026
64 of 65 checks passed
@teamleaderleo
teamleaderleo deleted the test/cloud-header-width-reenable branch October 2, 2026 01:49
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Merge receipt for edf547da0c: every check was green at merge (14 verified; 18 skipped by policy). Full suite runs on main after merge.

rustybret pushed a commit to rustybret/bmux that referenced this pull request Oct 2, 2026
abdf121 fix: exclude unowned same-TTY processes from memory attribution (manaflow-ai#16559)
075dbef test: fix remote paste test failures on main from manaflow-ai#16523 (manaflow-ai#16596)
7d7a9d1 Stop US key positions from hijacking shortcuts on non-US layouts (manaflow-ai#16237)
134c9d9 Let AppKit cycle windows with the System Settings shortcut on ISO keyboards (manaflow-ai#16238)
d0dd457 iOS: prevent toolbar flash when switching primary tabs (manaflow-ai#15712)
6c4b727 test(cloud): re-enable the Cloud header width tests by measuring each row (manaflow-ai#16590)
51b60f3 fix(remote): keep reconnect cleanup fixture process-free (manaflow-ai#16586)
6090053 fix(ci): reserve only queued release slots (manaflow-ai#16588)
0440a5d fix: make browser import hint cover all supported browsers (manaflow-ai#16483)
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.

1 participant