Skip to content

feat(desktop): support Windows local workflows and x64 installers - #154

Open
tiammomo wants to merge 4 commits into
wfnuser:devfrom
tiammomo:tiammomo/issue-153-windows-desktop
Open

tiammomo wants to merge 4 commits into
wfnuser:devfrom
tiammomo:tiammomo/issue-153-windows-desktop

Conversation

@tiammomo

@tiammomo tiammomo commented Sep 5, 2026 •

Copy link
Copy Markdown

Refs #153. Keep the issue open until native Windows validation and CI/release integration are complete.

Windows users previously had no installer, and Agent startup mixed cmd.exe with PowerShell/POSIX arguments. Desktop and MCP could also select different metadata directories when HOME was absent.

This adds the application and installer support for Windows 10 1809+/11 x64: a per-user English/Chinese NSIS installer with WebView2 bootstrapping; shared USERPROFILE-based metadata discovery; native executable and standard npm shim discovery; literal Agent arguments through ConPTY and readiness probes; and native browser opening that preserves login URL query parameters. ESLint excludes Rust build output so generated Tauri assets do not break repeat lint runs.

Windows runtime checks also exposed backslash Source links, Node verbatim-path incompatibility, and Git core.autocrlf changing migration rollback/background snapshot bytes. These are fixed without changing users' Git configuration or staging index. Regression coverage includes Chinese/spaced paths, LF/CRLF preservation, migration rollback, and managed background changes.

The September 12 metadata fallback review is addressed: macOS/Linux with unavailable HOME retain the previous Tauri application-data path, including the application identifier and cowiki/.cowiki suffix. Desktop and MCP share that resolver without creating a GUI. Tests cover home precedence, legacy layout, unavailable/relative directory rejection, and a separate HOME-less Linux process that registers a Space and reopens it through MCP defaults.

Validation in isolated verifier containers: frontend tests/lint/production build, Rust formatting, 119 Linux Rust tests, Linux Clippy, Windows MSVC all-target cross-check/Clippy, 110 Windows Rust tests under Wine, and an x64 NSIS cross-build from locked dependencies. The direct dirs dependency reuses the already locked version without upgrading dependencies. A local-only integration of this head, #151 at e011665, #152 at b54e7a1 and maintainer #146 at 22fd28f also passed frontend checks, 140 Linux Rust tests, two real Poppler/Tesseract tests, Linux and Windows Clippy, Windows all-target checks and 129 compatible Wine tests. The three local conflict resolutions retain all test entries, both the raw-byte snapshot helper and Agent provenance imports, and both source lineage and extraction-caveat instructions. The integration branch is not published.

Wine's native ConPTY test remains intentionally ignored and must run explicitly on native Windows. The Wine command excludes one Node argument test because the official Windows Node 24.20 binary independently fails CSPRNG initialization in this Wine environment. The documented native Windows command has no such exclusion. Wine and cross-build results do not establish native installation, WebView2 rendering, ConPTY, ShellExecute, or real-provider login behavior.

This is an unsigned alpha. Native Windows smoke checks and CI/release automation remain outstanding acceptance criteria for #153. RepoSteward's current publication policy forbids workflow-file changes, so this PR contains application code, installer configuration and native validation instructions. The separately prepared CI patch remains for maintainer integration. WSL-only Agents and ARM64 are outside this change. Snapshot construction adds file reads proportional to Space size to preserve exact bytes. See docs/windows-desktop.md for prerequisites and the release checklist.

Includes dev at 661d3b2 through a clean merge on September 13. The NSIS installer is rebuilt from this revision and the final committed tree is independently verified before publication. Fresh upstream Actions may require maintainer approval.

Prepared with Codex assistance, reviewed through RepoSteward, and published after independent verification. tiammomo reviewed the final diff and takes responsibility for this contribution.

Signed-off-by: tiammomo <26957354+tiammomo@users.noreply.github.com>
@netlify

netlify Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cowiki-test ready!

Name Link
🔨 Latest commit 1d80896
🔍 Latest deploy log https://app.netlify.com/projects/cowiki-test/deploys/6aa67ff165b9ae00082d09a2
😎 Deploy Preview https://deploy-preview-154--cowiki-test.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@tiammomo
tiammomo force-pushed the tiammomo/issue-153-windows-desktop branch from d4fd021 to 0c0f037 Compare September 6, 2026 08:35
pub fn metadata_dir() -> Result<PathBuf, String> {
home_dir()
.map(|home| home.join("cowiki").join(".cowiki"))
.ok_or_else(|| {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] This also changes non-Windows startup behavior: the current desktop falls back to Tauri app-data when HOME is unavailable, while this helper now makes the whole app fail to launch. Since the PR is scoped to Windows support, please preserve a platform-native fallback for macOS/Linux (and use the same resolved directory for MCP), or call out and test this intentional compatibility break.

@wfnuser

wfnuser commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Review summary: the separation of native argv handling, npm-shim validation, byte-preserving snapshots, and the Windows release checklist is thoughtful. I ran the literal-argument unit test locally and it passes. I left one inline compatibility concern about removing the existing non-Windows app-data fallback. Separately, the only visible status is Netlify: it does not compile any cfg(windows) code, exercise ConPTY/ShellExecute, or build the NSIS artifact. Please have a maintainer approve/run the repository Actions at minimum, and keep #153 open until a native windows-latest build/test/installer job plus the documented smoke checks provide evidence for the Windows paths.

…dows-desktop

Signed-off-by: tiammomo <26957354+tiammomo@users.noreply.github.com>
Address review comments 3994914623 on PR wfnuser#154. Refs wfnuser#153.

Signed-off-by: tiammomo <26957354+tiammomo@users.noreply.github.com>
Signed-off-by: tiammomo <26957354+tiammomo@users.noreply.github.com>
@Coooder-Crypto

Copy link
Copy Markdown
Contributor

1 — Windows path separator breaks design-system tests

[P2] The design-system tests are not Windows-compatible. sourceFiles() returns relative paths such as lib\design.ts on Windows, but the allowlist uses lib/design.ts, so the lookup misses and valid color definitions are reported as violations. This causes two tests to fail and stops npm test on native Windows. Please normalize relative paths to / before comparing them with the allowlist, and add Windows path coverage.

3 — macOS-specific copy is shown on Windows

[P3] Several macOS-specific labels are still shown in the Windows UI. The Windows build displays ⌘O, ⌘K, “Start a new OKF knowledge space on this Mac,” and instructions referring to a “login shell.” These shortcuts and descriptions are misleading for Windows users. Please render platform-appropriate shortcut labels and copy, such as Ctrl+O and Ctrl+K, and replace the macOS-specific wording with platform-neutral or Windows-specific text.

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.

3 participants