Put the Cloud sidebar on the right sidebar's chrome columns
This re-lands #15307 on a clean branch because one commit there was authored by a bot address that CLA Assistant cannot accept. The code is unchanged apart from catching up to main.
Part of the Cloud right sidebar audit (manaflow-ai/cmuxterm-hq#853).
The Cloud surfaces live inside the right sidebar but cannot import the app target that owns RightSidebarChromeMetrics, so each of them carries its own copy of the sidebar's numbers. The copies drifted:
- The Cloud banners (free-access, tunnel, operation activity) sit on a 12pt outer horizontal inset. The chrome bar they sit under, the Cloud header, takes 8 on both edges, and so does the Feed control bar. So the Cloud surfaces visibly step in from the sidebar they are part of. (The sidebar's own header bars, the mode bar and the Vault bars, ask for a narrower 4/6; the Cloud header does not, and this PR does not move it.)
- Two of those banners use a 5pt vertical inset against the sidebar's 4, and the machines-unavailable notice uses 6. That notice draws a tinted background, so its height visibly changes.
- The Cloud tree reserves a 12pt trailing column against the 8 the Cloud header above it uses. Machine rows stop short of the header's refresh and + buttons, and titles truncate 4pt earlier than they need to. The row hover buttons and the header's buttons are the same control, so they should stop on the same column.
CloudSidebarChromeMetrics states those numbers once for the package. CloudTreeLayoutMetricsTests runs in the app target, where both types are visible, and fails if the copy ever disagrees with the original, so this cannot drift again silently.
It also removes the drift that this change would otherwise have introduced: CloudTreeLayoutMetrics.referenceInset and the spacing lab's referenceInset each restated 12 independently of CloudTreeRowGrid.trailingPadding. The outline document and the hosted row content compute their trailing reservation separately, so had only one moved, titles would truncate before the space they were given ran out. Both now follow the row grid.
Not in this PR. The operation activity row keeps its 8pt vertical padding: it carries a progress indicator rather than a line of text, so shortening it is a look, not a mismatch. The bigger Cloud alignment questions are taste calls and went to cmux#13742 with before/after shots instead: the tree reserves a disclosure-caret column before its icon (level 0 icon at x=26, text at x=46) so it structurally cannot sit on the shared content column of 12/30 without giving that column up, and section headers render with no icon slot so they sit on a different text column from their children.
Changelog
Fixed: Cloud sidebar banners and machine rows now line up with the rest of the right sidebar's columns instead of stepping in from them.
Verification
Red and green from the same focused command, cmuxTests/CloudTreeLayoutMetricsTests:
- red:
9764d00afbf(the pin, before the surfaces move onto it) - green:
8fb16647b0c, run also coveringCloudTreeCompactLayoutTests,CloudSidebarAttentionLayoutTests,CloudSidebarPinGeometryTests,CloudSidebarScaleTests
Those two SHAs are on #15307, where the runs happened. They are not on this branch. The replayed equivalents here are c6c6a800ba6 (the red pin) and 13c8d3b1d67 (the fix), whose contents are byte-identical to the originals.
python3 scripts/verify-local.py passes 5/5 selected checks on this branch. An earlier version of this description said it was blocked in this session; that was a missing TMPDIR directory, not a sandbox limit.
Before/after frames to follow.
A review subagent then found two bugs in the replayed work: the tree had been put on the wrong trailing column (6 rather than the header's 8), and the fleet status row was described as aligned but never was. Both are fixed in 5f480d560ee, with the details in a comment on this PR. What no test covers: nothing measures a rendered view's inset, so the banner, notice, error row and status row changes are pinned only by the metric they read.
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Cloud sidebar banners, the tree's trailing column, and the rows beneath (the team-change error row, the fleet status slot, and the machines-unavailable notice) now read the right sidebar's chrome metrics instead of carrying their own copies that had drifted.
CloudSidebarChromeMetrics states the sidebar's numbers once for the package as an Equatable/Sendable struct with a .sidebar instance; surfaces that need different numbers build their own value. A test running in the app target, where both types are visible, pins the copy to RightSidebarChromeMetrics so it cannot drift again. Cloud views that live in the app target read RightSidebarChromeMetrics directly. CloudTreeLayoutMetrics.referenceInset and the spacing lab's referenceInset now follow CloudTreeRowGrid.trailingPadding instead of restating 12, and the title-width test derives from the inset and states the clamp on its own case.
The tree's trailing column takes the Cloud header's own inset (barHorizontalPadding, 8) rather than the mode/Vault bars' 6, since the header sits on a plain rightSidebarChromeBar(). CloudTreeMachineBand's trailingPadding - 2 is clamped at 0 so the DEBUG spacing lab cannot pad negative.
The operation activity row keeps its 8pt vertical padding: it carries a progress indicator rather than a line of text.
🤖 Generated with Claude Code