Skip to content

wip: Windows preview build for PR #158 (do not merge) - #163

Closed
RealZST wants to merge 18 commits into
mainfrom
wip/pr-158-windows-preview
Closed

RealZST wants to merge 18 commits into
mainfrom
wip/pr-158-windows-preview

Conversation

@RealZST

@RealZST RealZST commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Testing branch for #158, not for merging.

Contents: the four commits of #158, eight maintainer follow-up commits that will be pushed to the #158 branch once verified, and one temporary workflow (windows-desktop-preview.yml) that builds an unsigned NSIS installer on a Windows runner for manual testing.

This draft exists so the PR checks, including the new Windows job, run on the follow-up commits before they land on the contributor's branch. It will be closed and the branch deleted afterwards.

🤖 Generated with Claude Code

XiaoLrrr and others added 18 commits October 19, 2026 09:52
…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
… 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
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.

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 outside macOS 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>
@RealZST RealZST closed this Oct 24, 2026
@RealZST
RealZST deleted the wip/pr-158-windows-preview branch October 24, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants