Conversation
Validate saved placement before and after visibility changes or removal, restoring only a valid prior value when AppKit clears or corrupts it. Apply the same boundary to split-provider visibility and read only owned placement keys instead of snapshotting all defaults. Add corrupt-position regressions, lifecycle coverage, and offscreen Icon and Percent rendering checks without claiming a Sonoma runtime fix. Refs #3355 Refs #2580 Refs #1711
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 27, 2026, 11:34 PM ET / September 28, 2026, 03:34 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch validates saved menu-bar positions around status-item visibility and removal, routes split-provider visibility through that check, and adds placement and offscreen rendering tests. Merge readiness⛔ Blocked before merge - 3 items remain Current main still restores a corrupt saved position after a status item is hidden or removed, so this focused repair remains useful. The patch has no identified code defect, but its effect on existing persisted positions needs native upgrade evidence before merge. Priority: P2 Review scores
Verification
How this fits togetherCodexBar creates macOS menu-bar items for provider usage displays. AppKit saves their positions in app defaults, and the status-item controller uses those values when it shows, hides, removes, or recreates an item. flowchart LR
A[Saved menu position] --> C[Position validation]
B[Attached display widths] --> C
C --> D[Show hide or remove item]
D --> E[Validate and restore position]
E --> A
D --> F[Menu bar display]
Decision needed
Why: The earlier owner decision accepted this bound at item creation, but did not explicitly cover the new runtime clearing points. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the shared validation boundary while demonstrating that valid persisted placements survive upgrade, hide, removal, and display changes, and that only corrupt positions are cleared. Do we have a high-confidence way to reproduce the issue? Yes at source level: seed an invalid saved position and clear its key during the existing hide or removal helper; current main restores that invalid value. The original finite-coordinate writer has not been identified in a native trace. Is this the best way to solve the issue? Yes for the mutation-time defect: reusing the established validator in the shared helper is a narrow repair. Persisted-preference upgrade behavior still needs verification. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 579f68406855. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Status-item position preservation now validates the saved position before and after hide/remove/visibility mutations: an invalid value written during the operation is not kept, a valid replacement is retained, and an already-corrupt snapshot is never restored (bound: widest attached display + 512 pt). Split-provider visibility uses the same helper. Refs #3355.
Status-item hide/remove operations could restore a corrupt saved position or retain an invalid replacement written during the operation. Validate the owned position before and after these mutations, restore only a valid prior value, and route split-provider visibility through the same helper. Valid replacement positions remain intact. Reading only the relevant defaults keys removes the old whole-defaults snapshot; the patch reduces production code by two lines.
This is a bounded follow-up to #3355: the original finite-coordinate writer remains unknown and predates the preservation helper. The creation-time repair from #3825 remains unchanged. The new offscreen Icon and Percent tests investigate #2580; they do not establish Sonoma runtime visibility. The distinct macOS-owned Control Center mapping reports in #1711 remain unresolved.
Validation
CODEXBAR_SUPPRESS_TEST_KEYCHAIN_ACCESS=1 swift test \ --package-path /tmp/statusitem-2-placement-proof \ --scratch-path .build/placement-proof --build-system native \ --disable-index-store --jobs 2 \ --filter MenuBarStatusItemPlacementPreservationTests50%remain visible at small/regular size, light/dark appearance, tight/regular spacing, and 1×/2× scale. Measured widths are 47–58 points at 22-point height. This ran on macOS 27 using the shared macOS 14-compatible code path, not on Sonoma itself.TMPDIR=/Volumes/CBStatusItem2/tmp make check: passed. Process-cleanup checks: 102 tests, one skipped. SwiftFormat:0/2672 files require formatting, 6 files skipped.SwiftLint:0 violations, 0 serious in 2671 files.cae4291dc1ddae37bb8197e9f05a626bf0b12bcb.Two earlier SSD builds were interrupted during filesystem-write stalls before selected tests executed. An unchanged process-cleanup fixture also hit timing bounds on the busy SSD; it and the complete check passed unchanged with RAM-backed temporary storage. No production preferences, live account probes, or running-app relaunches were used.
Refs #3355
Refs #2580
Refs #1711