Repository navigation
Conversation
|
Windows compatibility review — PR #1246, reviewed at Scope: the full diff, 6 new files, all under Windows-specific findings: none. Checks:
Verification (native Windows 11 10.0.26300, python 3.12.13, detached worktree
Coverage gaps: the Swift build and the macOS window itself cannot be exercised on this host, and are out of scope for a Windows review; the Node runtime on this host is currently crashing (see the separate reviews this run), so no JS checks were relevant or run. |
|
This PR adds a native macOS window around the existing This is a review conclusion, not a rejection. I found three things that should be addressed before merge, and a few smaller notes below them.
A few smaller things worth a look, not blocking:
This review was read-only; I did not change code or push anything. Happy to look at a revision. If the maintainers want to waive the test requirement for a macOS-only add-on, that is a reasonable call to discuss. |
Windows compatibility review —
|
Windows compatibility review —
|
|
Blocking: 1 finding needs correction before this revision can merge; it is described below because this PR has no raven/agent files to anchor an inline note on. Scope: this PR changes no files under What this PR does: a native macOS window (desktop/macos/) around the existing raven web UI -- a Swift WKWebView app, a launcher that asks the installed CLI for the one-time /auth# URL, a build script, and an additive Confirmed findings:
Verification:
Checked and deliberately not reported: the previous round's three blockers are addressed -- the shell bridge is implemented and matches the page (connection.ts, look.ts, shellWindow.ts), the launcher no longer stops a gateway and calls only |
LivXue
left a comment
There was a problem hiding this comment.
F1 (Blocker), desktop/macos/RavenDesktop.swift: the app does not implement the WKUIDelegate open-panel method, and on macOS that disables file uploads in a WKWebView. Apple documents that file uploads are disabled on macOS when webView(_:runOpenPanelWith:initiatedByFrame:completionHandler:) is not implemented; the app implements only the alert and confirm JS panels. Four page sites are affected: the composer's "+ -> upload a file" (ui-web/src/features/composer/mount.tsx:158-176, run from ui-web/src/chrome/PlusMenu.tsx), the subagent instance attach button (ui-web/src/features/subagents/SubagentsPage.tsx:608-612), the knowledge base Add file / Add folder (ui-web/src/features/knowledge/KnowledgePage.tsx:687-705, where the folder path relies on webkitdirectory), and the rail's package import dialog (ui-web/src/features/imported/store.ts:183-193). A click opens no panel and reports no error. Evidence: code-reading -- this host has no macOS to reproduce on, so the behavior rests on Apple's documented default plus the delegate list in the source. Remedy direction: conform to WKUIDelegate and present an NSOpenPanel from the runOpenPanelWith callback, honoring the parameters' multiple-selection and directory flags and calling the completion handler with the chosen URLs or nil.
Windows compatibility review —
|
The app runs scripts/launch.sh to make sure 'raven web' is up, reads the one-time auth URL from the gateway, and loads it into a WKWebView. BROWSER is pointed at /usr/bin/true so no browser tab opens alongside the window. launch.sh resolves the CLI from PATH (with a ~/.local/bin fallback for Finder launches), reads its shebang for the interpreter, and takes the page port from the gateway's own state. No user names, home directories or ports are baked in. build.sh compiles the Swift source, renders the mark already shipped in ui-web/src/assets/ into an .icns, assembles the bundle and signs it ad hoc. Everything lives under desktop/macos/; no upstream file is changed.
`raven web --print-url` makes sure the gateway is up and prints the one-time sign-in URL on stdout, with progress and errors on stderr. It opens no browser and refuses `--stop`, `--foreground` and `--supervise`, so a caller can read stdout as the whole answer. The desktop launcher will use it to leave the gateway lifecycle to the CLI instead of probing and stopping a gateway itself. Co-authored-by: Claude (claude-fable-5) <noreply@anthropic.com>
The page already expects a native host: it keys shell-only paths off `RavenShell` in the user agent, posts `ready` to lift the native splash, asks for `reauth` after a gateway restart, and reports theme, drag and zoom for the hidden title bar. The app now implements that bridge, hides its title bar so the page's header band is the drag surface, and shows a native splash until the page is painted. The launcher no longer probes and stops gateways. It calls `raven web --print-url`, which waits for a starting gateway instead of killing it, and the error page points at `~/.raven/web.log` with the launcher's own stderr. `build.sh` refuses a `RAVEN_DESKTOP_APP` that is not a `.app` path and stops claiming success when codesign fails. Co-authored-by: Claude (claude-fable-5) <noreply@anthropic.com>
No existing job compiles the Swift app, so a broken window could merge unseen. A macOS runner now typechecks both sources whenever `desktop/**` changes; it needs no simulator, signing identity or GUI. Co-authored-by: Claude (claude-fable-5) <noreply@anthropic.com>
`supervise_from_argv` hands `_web` the same keyword set as the command does, and the new option rides along as False. This was the one place outside the CLI tests that spelled the set out. Co-authored-by: Claude (claude-fable-5) <noreply@anthropic.com>
The help text said "for native windows", which reads as the Windows OS in a repository that reviews Windows compatibility. It now names the macOS desktop app the mode exists for. Co-authored-by: Claude (deepseek-flash) <noreply@anthropic.com>
…file A delivered file is a <a download> link, and WebKit reports it as a normal navigation with shouldPerformDownload set. The delegate allowed everything, so clicking download replaced the window with the file itself and the page's script context went with it -- the reader was left staring at the file with no way back. target=_blank had the same shape: createWebViewWith loaded it into the main view, so 'open in a new tab' navigated Raven away from itself. Navigation decisions now come from a NavigationPolicy value: a download becomes a WKDownload saved to Downloads (a second copy of the same name does not overwrite the first), a response the gateway marks as an attachment becomes a download even when the click did not say so, and a new-window request gets a real child window beside the main one. Back and Forward join the File menu because the window has no browser toolbar. A preview window shares the app's delegates, so the title, the error page, the reconnect path and the script bridge are now scoped to the main web view instead of reacting to a child's load. RAVEN_DESKTOP_SELFTEST=1 runs the navigation matrix without a window, a gateway or a click; the macOS job runs it after the typecheck. Co-authored-by: Claude (deepseek-flash) <noreply@anthropic.com>
commitlint.config.cjs already scopes a change that lives wholly in a top-level tree outside raven/ by that tree, and the desktop/ tree this PR adds is exactly that case -- but the list never learned the name. The scope enum rejected fix(desktop), so the message gate failed on a branch whose only offence was naming a directory that exists. The repo-layout page gains the matching Key directories line, which is the page the config's comment points readers at. Co-authored-by: Claude (deepseek-flash) <noreply@anthropic.com>
On macOS a WKWebView has no file panel of its own: unless the app answers webView(_:runOpenPanelWithParameters:initiatedByFrame:completionHandler:), clicking a file input opens nothing and reports no error. The window implemented the alert and confirm panels only, so four page sites were inert -- the composer's upload, a subagent's attach button, the knowledge base's add-file and add-folder, and the package import dialog. The panel now honours the parameters WebKit passes: multiple selection when the input asks for it, and directories when the input is a webkitdirectory picker. Cancelling answers nil, which is what the page expects for 'no file chosen'. The self-test checks that the delegate still implements the method, because the failure mode is silence.
The message names, the handler name and the user-agent token are written twice -- once in Swift, once in TypeScript -- and each half typechecks on its own, so a rename on either side stays invisible until a reader meets it in the app. A lost ready leaves the native splash up forever; a lost reauth sends a restarted gateway's stale session back to a terminal banner. The test reads both trees and fails when the sets drift apart. It is static, so it runs on the Ubuntu shards that already run the rest of the suite rather than waiting for a macOS runner. The desktop workflow also watches the page's half of the bridge now, so a change to connection.ts, look.ts or shellWindow.ts builds the window as well.
…ages The README still promised that no existing upstream file is modified. The branch has since grown a --print-url mode in the CLI, a commit scope, and the CI job that typechecks the window, so the sentence sent a reader looking for a purely additive change that is not there. The Chinese repo-layout page also gains the desktop/ line the English one already had; the two pages are paired, and a reader on one should not see a different tree than a reader on the other.
The compiler inherited the host deployment target, so a build on a newer macOS produced a binary with minos 26.0 even though the bundle declared macOS 12.0 support. Both build paths and the Desktop workflow now compile for the declared version, and CI inspects the resulting Mach-O load command. The regression test keeps the script, plist, and workflow versions aligned.
Windows compatibility review —
|
Summary
raven webalready serves the whole UI, but it opens in a browser tab. Thisadds a native macOS window around that same page, so Raven can be launched
from the Dock and kept separate from other tabs.
The app does not bundle a second frontend. On launch it runs
desktop/macos/scripts/launch.sh, which runs one command:The CLI attaches to a running gateway, waits for one that is starting, or
starts a resident one, then prints the one-time
/auth#<nonce>URL on stdout.Progress and errors go to stderr, and the launcher never stops a gateway: an
empty probe can mean "still booting", so stopping there would kill the launch
it was trying to join. Closing the window quits the app but leaves the gateway
running.
The app marks itself as
RavenShellin the user agent and implements thedesktop-shell bridge the web frontend already defines: the page lifts the
native splash with
ready, asks for a fresh sign-in link withreauthafter agateway restart, and reports
theme,dragandzoomfor the hidden titlebar. That bridge keeps an expired session inside the window instead of sending
the reader back to a terminal.
The Swift app, build script and launcher live under
desktop/macos/.raven web --print-urlis additive, and a macOS CI job typechecks the Swiftsources whenever
desktop/**changes.build.shrefuses aRAVEN_DESKTOP_APPthat is not a.apppath and fails when codesign fails.Type
Verification
Python:
Swift and the bundle (macOS, Xcode Command Line Tools):
End to end with an isolated home and a built page:
Two launchers started at the same time against a fresh home both printed a URL
for the same gateway, and
raven web --stopin that home then stopped it; thegateway that was still starting was not signalled.
Repository gates over the PR range (
af6e607d..HEAD):All four exit 0.
desktop/macos/README.md)Risk
http://127.0.0.1,http://localhostorhttp://[::1], over the gateway's own one-time authURL, and hands external links to the system browser.
NSAllowsLocalNetworkingis set for the local page. The app stores no credentials itself; WebKit
persists the gateway's HttpOnly session cookie in its default data store, as
a browser tab does, which keeps the window signed in across launches.
raven web --print-urlis a new,opt-in mode; the existing
raven webpaths keep their output and browserbehavior. The desktop sources are additive, and the gateway process is
untouched apart from the new flag.
--print-urlrefuses to combine with--stop,--foregroundor--supervise, so no existing mode changes shape.desktop bundle is self-contained under
desktop/macos/.Known limits: the app is ad hoc signed rather than notarized, so Gatekeeper may
require Right-click -> Open on a new machine. It assumes the gateway keeps
serving
/auth#<nonce>; if that contract changes,raven web --print-urlandlaunch.shchange together. A Finder-launched app does not inherit a shellprofile, so provider keys or a custom
RAVEN_HOMEexported from.zshrcdonot reach a gateway it starts.
Related Issues
N/A