Skip to content

feat(macos): edit native sidebar group defaults - #163162

Merged
steipete merged 1 commit into
mainfrom
steipete/mac-sidebar-group-defaults
Oct 2, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/mac-sidebar-group-defaults

Conversation

@steipete

@steipete steipete commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

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.

Check Result Wall time
Native macOS product build Passed 14.89 s
Plain macOS product build Passed 11.49 s
Native test compilation, index enabled Passed 22.10 s
Shared group-defaults, sidebar-menu and payload-codec tests 37 tests passed 11.72 s
Native WebChatManager/menu boundary tests 5 tests passed 15.35 s
iOS simulator OpenClawChatUI compile Passed 11.21 s
Explicit changed-file macOS / iOS-shared SwiftLint, without cache Passed 0.42 / 0.24 s
Explicit changed-file SwiftFormat lint Passed 0.28 s
Localization verification after baseline generation Passed, 4,384 entries 2.14 s
Changed documentation formatting Passed 0.33 s
Git whitespace and localized-string interpolation checks Passed —

The native boundary test renders NSHostingMenu using synthetic Hello/socket traffic through the real GatewayConnection, 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.ts and place-browser-view.ts. This PR repairs the native owner; the web path remains separate follow-up work.

Local verification commands
swift build --package-path apps/macos --build-system native --product OpenClaw
swift build --package-path apps/macos --product OpenClaw
swift build --package-path apps/macos --build-system native --build-tests --enable-index-store
swift test --package-path apps/macos --build-system native --skip-build --filter WebChatManagerTests
swift test --package-path apps/shared/OpenClawKit --filter 'ChatSessionGroupDefaultsTests|ChatSessionSidebarMenuTests|ChatGatewayPayloadCodecTests|ChatAgentCatalogTests'
# From apps/shared/OpenClawKit:
xcodebuild -scheme OpenClawChatUI -destination 'generic/platform=iOS Simulator' -derivedDataPath ../../../.local/landing/ios-derived CODE_SIGNING_ALLOWED=NO build
# From the repository root:
pnpm native:i18n:baseline
pnpm native:i18n:verify

SwiftLint used both config/swiftlint.yml and apps/ios/.swiftlint.yml, with explicit changed Swift paths and --no-cache. SwiftFormat lint used config/swiftformat and 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.

Before: main sidebar in light appearance, synthetic data

After: Research group defaults sheet in dark appearance, synthetic data

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.

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.
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: macos App: macos size: L labels Oct 2, 2026
@steipete
steipete marked this pull request as ready for review October 2, 2026 01:53
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 9:58 PM ET / October 2, 2026, 01:58 UTC.

ClawSweeper review

What this changes

Adds 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
Reviewed head: 828baf8c91fb78a0efc24071bde880d13879d33f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused feature with inspected visual evidence, useful boundary coverage, and no definite blocking correctness finding.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected native before/after screenshots directly show the new defaults sheet in a synthetic setup. They predate loader simplification; supplemental current native boundary tests exercise loading, browsing, validation, and saving through the installed Gateway adapter. Live save/reopen persistence is not claimed, and no stored-data format changes require migration proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected native before/after screenshots directly show the new defaults sheet in a synthetic setup. They predate loader simplification; supplemental current native boundary tests exercise loading, browsing, validation, and saving through the installed Gateway adapter. Live save/reopen persistence is not claimed, and no stored-data format changes require migration proof.
Evidence reviewed 8 items Introduced scope and merge ownership: Reviewed the pinned merge-base-to-head changes. The test merge records the supplied base followed by the exact PR head, and its resulting changed surface matches the introduced feature rather than unrelated base work.
Still necessary on main: Fetched main exposes Rename, New group, and Delete on custom-group headers, without Group defaults. The new editor file is also absent from latest release v2026.9.7.
Existing feature scope and routing history: GitHub verifies #163001 as merged at this commit. Its discussion and commit explicitly defer group defaults to a separate lane. The connection helper was added there; its raw recorded parent has no file at that path, and GitHub maps the commit author to steipete.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Docs +7, Other +787. Total +794 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 13 806 19 +787
Total 14 813 19 +794

Review metrics

Metric Value Why it matters
Production versus test growth production +489/-13; tests +297/-1 The body explains the production growth as the editor, folder navigation, validation, and request lifecycle while retaining existing Gateway owners.

Technical review

Best 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.

Labels

Label changes:

  • add P2: This is a bounded native chat improvement completing previously deferred functionality.
  • add proof: sufficient: Contributor real behavior proof is sufficient. Inspected native before/after screenshots directly show the new defaults sheet in a synthetic setup. They predate loader simplification; supplemental current native boundary tests exercise loading, browsing, validation, and saving through the installed Gateway adapter. Live save/reopen persistence is not claimed, and no stored-data format changes require migration proof.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected native before/after screenshots directly show the new defaults sheet in a synthetic setup. They predate loader simplification; supplemental current native boundary tests exercise loading, browsing, validation, and saving through the installed Gateway adapter. Live save/reopen persistence is not claimed, and no stored-data format changes require migration proof.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected native before/after screenshots directly show the new defaults sheet in a synthetic setup. They predate loader simplification; supplemental current native boundary tests exercise loading, browsing, validation, and saving through the installed Gateway adapter. Live save/reopen persistence is not claimed, and no stored-data format changes require migration proof.

Label justifications:

  • P2: This is a bounded native chat improvement completing previously deferred functionality.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected native before/after screenshots directly show the new defaults sheet in a synthetic setup. They predate loader simplification; supplemental current native boundary tests exercise loading, browsing, validation, and saving through the installed Gateway adapter. Live save/reopen persistence is not claimed, and no stored-data format changes require migration proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected native before/after screenshots directly show the new defaults sheet in a synthetic setup. They predate loader simplification; supplemental current native boundary tests exercise loading, browsing, validation, and saving through the installed Gateway adapter. Live save/reopen persistence is not claimed, and no stored-data format changes require migration proof.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected native before/after screenshots directly show the new defaults sheet in a synthetic setup. They predate loader simplification; supplemental current native boundary tests exercise loading, browsing, validation, and saving through the installed Gateway adapter. Live save/reopen persistence is not claimed, and no stored-data format changes require migration proof.

Evidence

What I checked:

  • Introduced scope and merge ownership: Reviewed the pinned merge-base-to-head changes. The test merge records the supplied base followed by the exact PR head, and its resulting changed surface matches the introduced feature rather than unrelated base work. (3f01b88cb54f)
  • Still necessary on main: Fetched main exposes Rename, New group, and Delete on custom-group headers, without Group defaults. The new editor file is also absent from latest release v2026.9.7. (apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSessionSidebar+GroupMenu.swift:6, 715300989b5b)
  • Existing feature scope and routing history: GitHub verifies feat(macos): complete the native sidebar session menus #163001 as merged at this commit. Its discussion and commit explicitly defer group defaults to a separate lane. The connection helper was added there; its raw recorded parent has no file at that path, and GitHub maps the commit author to steipete. (apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSessionSidebarActions.swift:54, 79e527335cd1)
  • Connection and authorization boundary: The installed browser uses the captured menu connection. Requests retain the exact server lease; the existing request owner checks currentness before dispatch and after completion. Gateway group updates retain existing write-scope, path-containment, and mutation-authorization checks. (apps/macos/Sources/OpenClaw/WebChatSwiftUI.swift:1294, 828baf8c91fb)
  • Editor lifecycle and regression coverage: Read the complete editor and tests. Generation checks reject stale validation and browser replies; invalid relative Return is rejected before folder activation; loading and submission guards prevent premature or duplicate saves. Tests cover retry, saved worktree restoration, folder changes, failed saves, retirement, and remote path spelling. Reported test runs were not rerun during this read-only review. (apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSessionGroupDefaultsSheet.swift:38, 828baf8c91fb)
  • Inspected native visual proof: Inspected both prepared PR screenshots: the former sidebar and the Research defaults sheet displaying Agent workspace, Browse, Cancel, and Save. The captured body identifies synthetic data and discloses that images predate loader simplification. Fresh native boundary coverage exercises the installed adapter with synthetic socket traffic; the images do not demonstrate save/reopen persistence or selected Git mode.

Likely related people:

  • Peter Steinberger: Raw commit 79e5273 adds apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSessionSidebarActions.swift:53 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 79e527335cd1; files: apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSessionSidebarActions.swift)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 0bcc0ec into main Oct 2, 2026
152 of 153 checks passed
@steipete
steipete deleted the steipete/mac-sidebar-group-defaults branch October 2, 2026 02:24
@steipete

steipete commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
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.
steipete added a commit that referenced this pull request Oct 2, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant