feat(desktop): add Tauri v2 native desktop wrapper#65
Open
Myking1983 wants to merge 2 commits intoChesterRa:mainfrom
Open
feat(desktop): add Tauri v2 native desktop wrapper#65Myking1983 wants to merge 2 commits intoChesterRa:mainfrom
Myking1983 wants to merge 2 commits intoChesterRa:mainfrom
Conversation
Adds a minimal `desktop/` directory that wraps the existing CCCC Web UI (`http://localhost:8848/ui/`) in a Tauri v2 shell, producing native `.app` / `.exe` bundles without shipping any frontend code of its own. Key features - Transparent, chrome-free title bar on macOS (`titleBarStyle: Overlay`) - Native window drag via `NSWindow.setMovableByWindowBackground` — works even though the webview loads a remote origin, where `data-tauri-drag-region` and JS `startDragging()` are blocked by the renderer sandbox - CSS shim injected on every page load to push body content below the traffic-light buttons (28 px padding-top) - Zero frontend bundle: the wrapper is ~120 lines of Rust + config only - macOS-only Rust dependency (`objc = "0.2"`) behind a cfg gate so Windows and Linux builds are unaffected Docs - `desktop/README.md` (English) - `desktop/README.zh-CN.md` (Chinese) - Mention in main README.md and README.zh-CN.md under "Web UI > Desktop app" Tested on: macOS 15 (Sequoia), Tauri 2.10.3, Rust 1.77+ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace setMovableByWindowBackground (whole-window native drag) with a targeted approach: inject a fixed 28px overlay div and call startDragging() via Tauri IPC on mousedown. Add remote-localhost capability to authorize the IPC call from localhost:8848. Also add core:window:allow-start-dragging to default capability set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
|
This is a PWA application that naturally supports the desktop. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
desktop/directory containing a minimal Tauri v2 shell that wraps the existing CCCC Web UI (http://localhost:8848/ui/) into a native desktop applicationdesktop/README.md/desktop/README.zh-CN.md), plus a short mention in the root README under Web UI → Desktop appWhat it adds
.app/.exetitleBarStyle: Overlay— seamless, chrome-free lookNSWindow.setMovableByWindowBackground— works with remote-origin webviews wheredata-tauri-drag-regionand JSstartDragging()are blocked by the renderer sandboxon_page_load; pushes content 28 px below traffic-light buttonstauri buildproduces a signed-ready.appand.dmgWhy
setMovableByWindowBackgroundinstead ofdata-tauri-drag-regionTauri's attribute-based drag only works for locally-bundled content. Because the webview points at
http://localhost:8848, both the attribute and the JSstartDragging()IPC call are blocked by the renderer's CSP / sandbox. The native macOS API bypasses this entirely — any unobstructed background pixel becomes a drag handle regardless of content origin.Test plan
objcdep iscfg(target_os = "macos")gated)Quick start