Repository navigation
feat(macos): edit native sidebar group defaults - #163162
Conversation
Add the custom-group defaults editor deferred from #163001. Browse the captured Gateway's folders, validate repository status, and save folder/worktree defaults through the existing group RPCs. The presented sheet owns initial loading and Retry because native menu contents do not mount appearance tasks. Preserve the existing agent workspace field through catalog decoding. Reuse the window's admitted menu connection and lease; leave iOS behavior, Gateway schemas, configuration and storage unchanged.
|
🦞👀 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: needs maintainer review before merge. Reviewed October 1, 2026, 9:58 PM ET / October 2, 2026, 01:58 UTC. ClawSweeper reviewWhat this changesAdds a native macOS editor for custom-group session folder and separate-working-copy defaults, with Gateway folder browsing, validation, retries, tests, and documentation. Merge readiness✅ Ready for maintainer review This PR remains useful: current main lacks the native group-defaults editor, and the earlier merged sidebar work explicitly deferred it. Source review found no concrete blocking defect. Priority: P2 Review scores
Verification
How this fits togetherThe native chat sidebar organizes sessions into custom groups. This editor sends folder and working-copy choices through the window’s Gateway connection to existing group-defaults owners, which apply them to new sessions. flowchart LR
A[Custom group menu] --> B[Native defaults editor]
C[Agent workspace] --> B
B --> D[Captured Gateway connection]
D --> E[Folder browsing and Git validation]
E --> B
D --> F[Existing group defaults owner]
F --> G[New session defaults]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceDocs +7, Other +787. Total +794 across 14 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep group authorization and persistence in the Gateway while the native editor owns presentation, validation state, and recoverable errors. Do we have a high-confidence way to reproduce the issue? Not applicable as a new native capability; source inspection confirms current main lacks this menu action and editor. Is this the best way to solve the issue? Yes. The branch adds presentation around existing Gateway operations and preserves the established connection, authorization, and persistence boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 715300989b5b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Add the custom-group defaults editor deferred from openclaw#163001. Browse the captured Gateway's folders, validate repository status, and save folder/worktree defaults through the existing group RPCs. The presented sheet owns initial loading and Retry because native menu contents do not mount appearance tasks. Preserve the existing agent workspace field through catalog decoding. Reuse the window's admitted menu connection and lease; leave iOS behavior, Gateway schemas, configuration and storage unchanged.
…163284) A relative draft cannot filter the folder listing, so the New Session place browser kept the current folder's children highlighted and Return browsed into the first one, replacing the typed text. Gate activate() on usablePath() first, matching the native group-defaults browser from #163162; empty and absolute drafts (including drive roots and UNC paths) keep their previous behavior.
…penclaw#163284) A relative draft cannot filter the folder listing, so the New Session place browser kept the current folder's children highlighted and Return browsed into the first one, replacing the typed text. Gate activate() on usablePath() first, matching the native group-defaults browser from openclaw#163162; empty and absolute drafts (including drive roots and UNC paths) keep their previous behavior.
What Problem This Solves
The native macOS sidebar cannot edit the folder and working-copy defaults for new sessions in a custom group. This completes the Group defaults action deferred from #163001 (native sidebar session menus).
User Impact
Right-click a custom-group header and choose Group defaults… to use the agent workspace or browse folders on the connected Gateway. Git-capable folders offer Separate working copy. Changing the folder resets that choice; failed reads, validation, and saves retain a visible retry path. iOS and palette behavior are unchanged. No configuration, dependency, protocol, schema, or storage changes are required.
Why This Change Was Made
The editor uses the existing write-scoped group-defaults RPCs, Gateway directory browsing and repository validation. It retains the window's admitted Gateway connection and rejects responses or writes from a retired lease. The shared agent catalog now preserves the existing optional workspace field through decoding and identity enrichment.
The sheet owns initial loading and Retry. Native menu contents do not mount SwiftUI appearance tasks reliably, so the menu opens the sheet directly rather than owning an asynchronous loader. This preserves the window-owned menu connection introduced by #163001 and removes the lane's obsolete menu-local loader.
Production LOC: +489/-13 (net +476). Tests: +297/-1. Generated localization: +20/-5; docs: +7/-0. Growth implements the requested editor, Gateway folder navigation, validation, and request lifecycle; existing Gateway owners continue to own authorization and persistence.
Evidence
Transplanted only this lane onto main
01d479d85e2ab933bebb69d7c0d87e2cca4337f7, preserving the previously landed sidebar rows, menus, people, and query work. The localization inventory was regenerated using its owner command.The native boundary test renders
NSHostingMenuusing synthetic Hello/socket traffic through the realGatewayConnection, for local and saved-profile targets. It checks the enabled Group defaults entry and exercises defaults loading, repository validation, folder browsing, and saving through the installed adapter. Shared tests cover failed-read retry, restored worktree mode, folder changes, save failures, duplicate submissions, stale validation/browser responses, retired connections, and remote path matching.Pre-repair proof: the load/retry regression failed on Save readiness and saved-worktree restoration before the sheet-loading owner repair (14.77 s), then passed. The existing rendered-menu test initially failed because its expected actions and advertised methods predated Group defaults (6.24 s); the fixture now exercises the new contract. The original lane's pre-change compile failure (23.96 s) showed absent editor APIs and the missing workspace field; it is feature-absence evidence, not a runtime regression assertion.
The shared/iOS lint configuration caught raw status colors before publication; those now use the existing theme token, which maps to macOS system red. Both lint configurations pass. The full native suite was not run on the operator desktop; hosted CI owns that isolated execution.
The supplied live synthetic-rig captures show the former sidebar and the Research defaults sheet in Agent workspace mode. Both images were visually inspected for unrelated or sensitive content. They predate the landing rebase and loader simplification; the current connection/menu and save path are covered by the fresh native boundary proof above. The images do not independently demonstrate save/reopen persistence or a selected Git working copy. No browser or browser automation was used.
Fresh independent Codex autoreview at P2 completed in 447.28 s and reported one actionable finding: Return on an invalid relative path could activate the first cached folder. The extended existing test reproduced it (17.17 s). Activation now validates the draft before selecting a destination, and the focused suite passes after the repair. This was an accepted finding and correction, not a clean initial review. No additional review was run for polish.
An indexed Periphery scan (4.86 s) found no superseded public initializer in the lane. Its two import-only reports concern protocol types still directly referenced in source; those imports remain.
Named follow-up: the web picker has the same relative-Return behavior in
ui/src/pages/new-session/place-browser-state.tsandplace-browser-view.ts. This PR repairs the native owner; the web path remains separate follow-up work.Local verification commands
SwiftLint used both
config/swiftlint.ymlandapps/ios/.swiftlint.yml, with explicit changed Swift paths and--no-cache. SwiftFormat lint usedconfig/swiftformatand explicitly unexcluded those same paths. All shells selected/Applications/Xcode.app/Contents/Developer.Screenshots
Before is main in light appearance; after is the Research defaults sheet in dark appearance. The appearance difference is incidental. All visible data is synthetic.
CI and review follow-through
Exact-head CI run 36953053413 completed successfully for
828baf8c91fb78a0efc24071bde880d13879d33f, including isolated macOS native tests and packages, iOS smoke and screenshot lanes, and applicable shared checks. No CI rerun, post-publication push, or branch update was used to obtain green.ClawSweeper’s exact-head review found no actionable or security findings and no before-merge actions. It accepted the inspected synthetic screenshots plus current native boundary evidence as sufficient. There are no rank-up moves to address.
The native review artifact is READY for preparation, with the independent P2 finding resolved and the proof limitations above retained. Both uploaded screenshot URLs were fetched successfully as HTTP 200
image/png; their bytes match the inspected originals.