Skip to content

fix(macos): open NSOpenPanel for embedded Control UI file inputs (#94468)#94612

Merged
clawsweeper[bot] merged 1 commit into
openclaw:mainfrom
bbblending:fix/macos-file-picker
Jun 19, 2026
Merged

fix(macos): open NSOpenPanel for embedded Control UI file inputs (#94468)#94612
clawsweeper[bot] merged 1 commit into
openclaw:mainfrom
bbblending:fix/macos-file-picker

Conversation

@bbblending

@bbblending bbblending commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Wire WKUIDelegate on the macOS embedded Control UI WKWebView so <input type="file"> clicks (Personal Settings Choose image) open a native NSOpenPanel instead of doing nothing.
  • Apply the same delegate wiring to CanvasWindowController so canvas HTML pages with file inputs behave consistently.

Motivation

Closes #94468.

DashboardWindowController hosts Control UI in a WKWebView that only set navigationDelegate, not uiDelegate. WebKit routes file-input clicks through WKUIDelegate.webView(_:runOpenPanelWith:initiatedByFrame:completionHandler:); without a UI delegate, the request is dropped and Choose image never opens a panel — matching the investigation on the issue.

Verification

  • swift test --disable-keychain --filter DashboardWindowSmokeTests — 4 passed
  • SKIP_PNPM_INSTALL=1 ALLOW_ADHOC_SIGNING=1 bash scripts/package-mac-app.sh
  • pnpm format:swift — 0 files require formatting
  • Manual macOS app verification (see Real behavior proof)

Environment: macOS 26.x, Xcode 26.x / Swift 6.x, launchd gateway on 127.0.0.1:18789, branch fix/macos-file-picker @ 4f477c4ed0.

Real behavior proof

  • Behavior or issue addressed: macOS embedded Control UI Choose image (<input type="file">) did not open the native file picker because the hosting WKWebView had no WKUIDelegate.
  • Real environment tested: macOS 26.x, OpenClaw dist/OpenClaw.app built from fix/macos-file-picker at commit 27f06198e3, launchd-managed local Gateway on 127.0.0.1:18789.
  • Exact steps or command run after this patch:
    1. SKIP_PNPM_INSTALL=1 ALLOW_ADHOC_SIGNING=1 bash scripts/package-mac-app.sh
    2. pnpm openclaw gateway install && pnpm openclaw gateway start
    3. open dist/OpenClaw.app → open Dashboard
    4. Quick Settings → Personal → click Choose image
    5. Select a local PNG/JPEG in the native Open panel
    6. Settings → Developer → Debug → Canvas → Eval, run:
      (() => {
        document.body.innerHTML =
          '<p style="color:white;font:14px system-ui">Canvas file test</p>' +
          '<input type="file" id="f" accept="image/*">';
        document.getElementById('f').click();
        return 'injected';
      })()
  • Evidence after fix: after-fix-nsopenpanel canvas-file-picker
  • Observed result after fix: Clicking Choose image opens the native macOS Open panel as a sheet over the Control UI; after selecting an image the avatar preview updates in Personal settings; injecting the file input in the Canvas WKWebView and triggering it, the native macOS Open panel (NSOpenPanel) appears as expected.
  • What was not tested: Multi-file selection.

Risk checklist

  • User-visible behavior change: Yes (file picker now works)
  • Config/environment change: No
  • Security/auth/network/tool execution: No
  • Highest-risk area: WKUIDelegate / NSOpenPanel sheet presentation on Dashboard and Canvas windows
  • Mitigation: Manual verification on Dashboard avatar path; existing Dashboard smoke tests still pass

@openclaw-barnacle openclaw-barnacle Bot added app: macos App: macos size: S proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 18, 2026
@clawsweeper

clawsweeper Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed. Reviewed June 19, 2026, 1:31 AM ET / 05:31 UTC.

Summary
The PR wires the macOS Dashboard and Canvas WKWebViews to WKUIDelegate and presents NSOpenPanel for HTML file inputs.

PR surface: Other +61. Total +61 across 3 files.

Reproducibility: yes. at source level: current main renders the affected file inputs while the macOS Dashboard and Canvas WKWebViews lack WKUIDelegate open-panel handling. I did not rerun a before-fix packaged macOS app in this read-only review, but the after-fix screenshots show the real app path.

Review metrics: 1 noteworthy metric.

  • Open sibling fix candidates: 3 open PRs including this one. Multiple live branches close the same macOS file-picker issue, so maintainers need one canonical landing path and post-merge cleanup.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #94468
Summary: The canonical remaining problem is the macOS embedded Control UI avatar file-picker bug; this PR is a viable candidate fix among overlapping open branches.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

Risk before merge

  • [P1] Two sibling PRs still target the same linked macOS file-picker issue; after one canonical fix lands, maintainers should close or supersede the other branches.
  • [P1] This branch has strong real screenshot proof but does not include the focused Dashboard open-panel regression tests present in fix(macos): open native file picker for Control UI file inputs #94523.

Maintainer options:

  1. Decide the mitigation before merge
    Land one canonical WKUIDelegate open-panel fix for the macOS embedded WebViews, preferably with focused Dashboard regression coverage, then close the linked issue and sibling PRs after merge.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No ClawSweeper repair lane is needed because the automerge-opted PR appears correct and the remaining action is maintainer/automerge validation plus duplicate branch cleanup.

Security
Cleared: The diff adds user-mediated NSOpenPanel handling and does not change dependencies, package resolution, signing, CI, secrets, auth, or network execution paths.

Review details

Best possible solution:

Land one canonical WKUIDelegate open-panel fix for the macOS embedded WebViews, preferably with focused Dashboard regression coverage, then close the linked issue and sibling PRs after merge.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: current main renders the affected file inputs while the macOS Dashboard and Canvas WKWebViews lack WKUIDelegate open-panel handling. I did not rerun a before-fix packaged macOS app in this read-only review, but the after-fix screenshots show the real app path.

Is this the best way to solve the issue?

Yes: WKUIDelegate open-panel handling is the WebKit boundary for macOS HTML file inputs, and touching both Dashboard and Canvas covers the relevant embedded WebView owners. The only improvement would be preserving focused regression coverage from the sibling branch.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 712e69dd7479.

Label changes

Label changes:

  • add status: 🚀 automerge armed: This PR is in ClawSweeper's automerge lane. Sufficient (screenshot): The PR body includes exact packaged macOS app steps plus inspected screenshots showing native Open panels for Dashboard Personal settings and the Canvas file-input test after the patch.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: 🚀 automerge armed.

Label justifications:

  • P2: The PR fixes a user-visible macOS embedded Control UI file-picker regression with a bounded Dashboard and Canvas WebKit surface.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 🚀 automerge armed: This PR is in ClawSweeper's automerge lane. Sufficient (screenshot): The PR body includes exact packaged macOS app steps plus inspected screenshots showing native Open panels for Dashboard Personal settings and the Canvas file-input test after the patch.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes exact packaged macOS app steps plus inspected screenshots showing native Open panels for Dashboard Personal settings and the Canvas file-input test after the patch.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body includes exact packaged macOS app steps plus inspected screenshots showing native Open panels for Dashboard Personal settings and the Canvas file-input test after the patch.
Evidence reviewed

PR surface:

Other +61. Total +61 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 63 2 +61
Total 3 63 2 +61

What I checked:

  • Root policy read: Root AGENTS.md was read fully; no apps/macos scoped AGENTS.md was present, so the root review requirements controlled this read-only review. (AGENTS.md:1, 712e69dd7479)
  • Current Dashboard gap: Current main DashboardWindowController owns the embedded WKWebView and assigns navigationDelegate, but has no WKUIDelegate conformance, uiDelegate assignment, or open-panel callback. (apps/macos/Sources/OpenClaw/DashboardWindowController.swift:22, 712e69dd7479)
  • Current Canvas sibling gap: Current main CanvasWindowController owns a WKWebView and assigns navigationDelegate in setup, but has no WKUIDelegate conformance or file-picker bridge. (apps/macos/Sources/OpenClaw/CanvasWindowController.swift:8, 712e69dd7479)
  • Affected Control UI inputs: Personal settings renders hidden image file inputs behind the visible Choose image controls for user and assistant avatars, matching the linked issue's failing embedded Dashboard path. (ui/src/ui/views/config-quick.ts:754, 712e69dd7479)
  • Dependency contract: The WebKit WKUIDelegate header documents runOpenPanelWithParameters as the file upload panel hook and says that on macOS, if it is not implemented, the web view behaves as if the user selected Cancel.
  • PR diff surface: The PR diff adds WKUIDelegate conformance, assigns uiDelegate, and implements NSOpenPanel handling for both DashboardWindowController and CanvasWindowController. (apps/macos/Sources/OpenClaw/DashboardWindowController.swift, 4f477c4ed076)

Likely related people:

  • steipete: GitHub path history shows this account introduced the native macOS dashboard window and later maintained dashboard failure handling in the same controller affected by the missing UI delegate. (role: dashboard window feature-history owner; confidence: high; commits: 5b383af73604, bef33563756f; files: apps/macos/Sources/OpenClaw/DashboardWindowController.swift)
  • BunsDev: GitHub path history shows this account added and maintained the Personal settings avatar upload and override flows that render the affected file inputs. (role: Control UI avatar settings contributor; confidence: high; commits: 12bbb371d01a, c65aa1d2a6e5, 14249827928e; files: ui/src/ui/views/config-quick.ts, ui/src/ui/views/config-quick.test.ts)
  • ngutman: GitHub path history shows recent CanvasWindowController maintenance on the sibling WebView surface this PR also changes. (role: recent Canvas window contributor; confidence: medium; commits: 58a0b077c1c5; files: apps/macos/Sources/OpenClaw/CanvasWindowController.swift, apps/macos/Tests/OpenClawIPCTests/CanvasWindowSmokeTests.swift)
  • vincentkoc: The PR discussion requested their review and a member comment opted this head into automerge; GitHub history also shows adjacent Canvas trust-boundary work. (role: requested reviewer and adjacent Canvas contributor; confidence: medium; commits: 8e04d1fe156a; files: apps/macos/Sources/OpenClaw/CanvasWindowController.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Jun 18, 2026
@bbblending bbblending force-pushed the fix/macos-file-picker branch from 7feebff to 4f477c4 Compare June 19, 2026 01:56
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 19, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 19, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 19, 2026
@bbblending

Copy link
Copy Markdown
Contributor Author

@vincentkoc Hey Vincent, when you have a moment could you take a look? Thanks!

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 19, 2026
@vincentkoc

Copy link
Copy Markdown
Member

/clownfish automerge

@vincentkoc vincentkoc added the clownfish:automerge Maintainer opted this Clownfish PR into bounded ClawSweeper-reviewed automerge label Jun 19, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Clownfish is on the reef for this PR. 🐠

I tagged clownfish:automerge and sent ClawSweeper over this exact head. If the sweep finds rough coral, failing checks, or needs-human, I will take another bounded repair lap and ask for a fresh review.

A maintainer can call /clownfish stop any time and I will drift this back to human review.

@vincentkoc

Copy link
Copy Markdown
Member

/clownfish automerge

@openclaw-clownfish openclaw-clownfish Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label Jun 19, 2026
@openclaw-clownfish

Copy link
Copy Markdown
Contributor

Clownfish is on the reef for this PR. 🐠

I tagged clownfish:automerge and sent ClawSweeper over this exact head. If the sweep finds rough coral, failing checks, or needs-human, I will take another bounded repair lap and ask for a fresh review.

A maintainer can call /clownfish stop any time and I will drift this back to human review.

@clawsweeper clawsweeper Bot added status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 19, 2026
@clawsweeper clawsweeper Bot merged commit df261fa into openclaw:main Jun 19, 2026
100 of 104 checks passed
@clawsweeper

clawsweeper Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

🦞✅
ClawSweeper merged this PR after the passing review.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper verdict: pass (sha=4f477c4ed076da98c54fae9eafa8ca85fb5188f7)
Merge status: merged by ClawSweeper automerge
Merged at: 2026-06-19T05:32:45Z
Merge commit: df261fabb348

What merged:

  • The PR wires the macOS Dashboard and Canvas WKWebViews to WKUIDelegate and presents NSOpenPanel for HTML file inputs.
  • PR surface: Other +61. Total +61 across 3 files.
  • Reproducibility: yes. at source level: current main renders the affected file inputs while the macOS Dashboa ... fore-fix packaged macOS app in this read-only review, but the after-fix screenshots show the real app path.

Automerge notes:

  • No ClawSweeper repair was needed after automerge opt-in.

The automerge loop is complete.

Automerge progress:

  • 2026-06-19 05:31:59 UTC review passed 4f477c4ed076 (structured ClawSweeper verdict: pass (sha=4f477c4ed076da98c54fae9eafa8ca85fb518...)
  • 2026-06-19 05:32:48 UTC merged 4f477c4ed076 (merged by ClawSweeper automerge)

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 19, 2026
…nclaw#94468) (openclaw#94612)

Summary:
- The PR wires the macOS Dashboard and Canvas WKWebViews to WKUIDelegate and presents NSOpenPanel for HTML file inputs.
- PR surface: Other +61. Total +61 across 3 files.
- Reproducibility: yes. at source level: current main renders the affected file inputs while the macOS Dashboa ... fore-fix packaged macOS app in this read-only review, but the after-fix screenshots show the real app path.

Automerge notes:
- No ClawSweeper repair was needed after automerge opt-in.

Validation:
- ClawSweeper review passed for head 4f477c4.
- Required merge gates passed before the squash merge.

Prepared head SHA: 4f477c4
Review: openclaw#94612 (comment)

Co-authored-by: bbblending <li.mingkang@xydigit.com>
cxbAsDev pushed a commit to cxbAsDev/openclaw that referenced this pull request Jun 23, 2026
…nclaw#94468) (openclaw#94612)

Summary:
- The PR wires the macOS Dashboard and Canvas WKWebViews to WKUIDelegate and presents NSOpenPanel for HTML file inputs.
- PR surface: Other +61. Total +61 across 3 files.
- Reproducibility: yes. at source level: current main renders the affected file inputs while the macOS Dashboa ... fore-fix packaged macOS app in this read-only review, but the after-fix screenshots show the real app path.

Automerge notes:
- No ClawSweeper repair was needed after automerge opt-in.

Validation:
- ClawSweeper review passed for head 4f477c4.
- Required merge gates passed before the squash merge.

Prepared head SHA: 4f477c4
Review: openclaw#94612 (comment)

Co-authored-by: bbblending <li.mingkang@xydigit.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge clownfish:automerge Maintainer opted this Clownfish PR into bounded ClawSweeper-reviewed automerge 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. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: macOS embedded Control UI avatar image picker does not open native file picker

2 participants