Repository navigation
feat: Windows desktop support (window config, no console flashes, cross-platform paths) - #158
Merged
Merged
Conversation
…ath/test fixes - add hk_core::home_dir() honoring HARNESSKIT_HOME (falls back to dirs::home_dir) - route adapters, sanitize, scanner, skills_cli through crate::home_dir() - openclaw: treat root-relative paths as resolved on Windows - make path assertions and launcher shims cross-platform; fix hk-web allowlist test
XiaoLrrr
force-pushed
the
windows-desktop
branch
from
October 19, 2026 02:03
ea0accf to
93dc4ae
Compare
… helpers - hk-web install handlers: use hk_core::command(git) (CREATE_NO_WINDOW) for clone/probe - hk-desktop/hk-web/hk-cli: resolve ~/.harnesskit via hk_core::home_dir() - kits test: compare against crate::home_dir() for HARNESSKIT_HOME isolation
Contributor
Author
|
@RealZST 你好,这个 PR 已基于最新上游
主要变更:Windows 桌面窗口配置与关窗行为、子进程加 |
Owner
感谢PR!我会尽快处理,之前手边没有Windows,这周末我会review,实机测试和release。再次感谢! |
The repository drives Tauri through `cargo tauri` (CONTRIBUTING.md and release.yml both `cargo install tauri-cli`), so the npm CLI added with the Windows window config is never invoked. Restore package.json and package-lock.json to their state on main. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`CREATE_NO_WINDOW` gives the child no console at all (Win32 docs: "the console handle for the application is not set"), so under the `hk` CLI or `hk serve` a child that needs the terminal, such as `git` prompting for credentials or `ssh` confirming a host key, could no longer prompt and would fail. Those console programs never flashed a window in the first place: their children inherit the existing console. Keep the shared `hk_core::command()` entry point but make the flag an opt-in (`hk_core::process::hide_console_windows()`) that the Tauri desktop app, the one GUI process, calls at startup. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… end The guard that undoes the test home put the *original HOME* back into `HARNESSKIT_HOME` (and `USERPROFILE`) instead of each variable's own previous value, so after the first kit test the override stayed set for the rest of the process. The two end_to_end tests still set only `HOME`, which `dirs::home_dir()` ignores on Windows, so they wrote kit zips into the real `~/.harnesskit/kits/` there. `RestoreHome` now records and restores `HOME` and `HARNESSKIT_HOME` separately, every kit test goes through `set_test_home`, and the `USERPROFILE` handling is dropped: dirs-sys resolves the Windows home via `SHGetKnownFolderPath(FOLDERID_Profile)` and never reads that variable. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`list_skill_files_rejects_file_outside_allowed_roots` set `HARNESSKIT_HOME` from inside a test binary whose other tests run on parallel threads and construct adapters (which read that variable), and never unset it. Rust 2024 marks `set_var` unsafe for exactly this reason. Carry the home directory in `WebState` (`hk_core::home_dir()` in `serve`, a fixture sibling in tests) and pass it to `is_path_allowed`. The test keeps its Windows coverage, where the OS temp dir sits under the user profile, without touching the process environment. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`Some(x).unwrap_or_else(...)` left over from replacing `dirs::home_dir()` (which returned an Option) with the infallible `crate::home_dir()`; extra blank lines in scanner.rs, copilot.rs and skills_cli.rs; missing final newline in lib.rs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Same steps as the macOS job on a windows-2025 runner, so the cross-platform path, process and home-directory handling added for the Windows desktop build is exercised on every pull request rather than only on a contributor's machine. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…verride Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`kits_dir_is_under_home` and the two `~` expansion tests in sanitize.rs read the home twice per run while the kit tests, on other threads, swap it out and back. They already raced on `HOME` on Unix; with `HARNESSKIT_HOME` in play on every platform, take the same `kit_env` lock. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ktop The page keeps html/body transparent and lays a 25% sidebar tint over it, which only looks right when the OS paints vibrancy behind the window. The Windows window is opaque (`tauri.windows.conf.json`), so in dark mode the tint sat on a white canvas and the sidebar came out washed out. The web build already paints the canvas via a `data-web` attribute; generalize it to `data-no-vibrancy`, set whenever the build is not the macOS desktop (`isDesktop() && isMac()`, with `isMac()` new in transport.ts). Also set `overscroll-behavior: none` on the root: the page never scrolls as a whole, and WebView2 otherwise rubber-bands the entire window on a horizontal trackpad swipe. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`set_app_icon` swaps the Dock icon through AppKit; on every other platform the command is a no-op that still reports success, so the Windows desktop showed a picker that did nothing. Windows has no runtime equivalent (the Start menu and shortcut icons come from the executable), so hide the setting, and the startup restore, outside the macOS desktop instead of pretending. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
With "Transparency effects" on, Windows 11 paints every window's caption with Mica, a tint derived from the desktop wallpaper, which clashes with the app's palette (a blue bar over a warm theme). An explicit caption color (`DWMWA_CAPTION_COLOR` / `DWMWA_TEXT_COLOR`, Windows 11 build 22000+) opts the window out of that tint whatever the user's transparency setting. New `set_title_bar_color` command (no-op outside Windows); the frontend calls it from the theme effect with the sidebar color as it actually renders (`bg-sidebar/25` over the canvas) and the sidebar foreground, so the title bar reads as part of the sidebar and follows theme changes. Windows 10 rejects the attributes and has no Mica either; the result is ignored. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Owner
|
感谢 PR!代码我过了一遍,也在 Windows 11 上安装实测了,在你的 4 个 commit 之上又推了下面这些:
Windows 11 上的效果,两套主题light和dark: 如果你那边运行时有和预期不一致的地方,欢迎再提issue Merged. Thanks! |
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
Adds first-class Windows desktop support plus Windows compatibility fixes across the core, desktop and web crates. Rebased onto current upstream
main(v1.14.0).Changes (4 commits)
fix: suppress console window flashes on Windows subprocess spawns
hk_core::command()setsCREATE_NO_WINDOWon Windows.where/ npm probing) through it, so noconhost.exewindows flash when the GUI probes for CLIs.feat: add Windows desktop support (window config + close behavior)
crates/hk-desktop/tauri.windows.conf.jsonso Windows builds don't inherit the macOS-only transparent window / vibrancy styling.fix(windows): resolve home dir via HARNESSKIT_HOME + cross-platform path/test fixes
hk_core::home_dir()honoringHARNESSKIT_HOME(falls back todirs::home_dir()), enabling home isolation in Windows tests.sanitize,scanner,skills_clithroughcrate::home_dir().openclaw: treat root-relative paths (e.g./srv/claw) as resolved on Windows.cmd /clauncher shims; fix thehk-webpath-allowlist test on Windows.fix(windows): route remaining git spawns and data dir through hk_core helpers
hk-webinstall handlers: usehk_core::command(git)(CREATE_NO_WINDOW) for clone/probe instead ofstd::process::Command.hk-desktop/hk-web/hk-cli: resolve~/.harnesskitviahk_core::home_dir().crate::home_dir()soHARNESSKIT_HOMEisolation works.Testing
cargo checkforhk-core,hk-web,hk-desktop,hk-cli— pass (warnings only)cargo test -p hk-core --lib— 728 passedcargo test -p hk-web— 12 passed (incl. previously failing allowlist test)