Repository navigation
Windows: Electron Node mode, loader packaging gate, and upstream sidebar collapse - #591
Merged
Merged
Conversation
(cherry picked from commit edb4398)
(cherry picked from commit 9167044)
(cherry picked from commit e92473c)
(cherry picked from commit 6a7b2ca)
Harness 0.1.7 reaches Node internals through node-addon-require-builtin, whose native binary accepts only the Electron builds it was compiled for (0.1.6: 43.0.0, 44.0.0, 45.0.0-alpha.6). An unsupported Electron passed every packaging step and failed only at Harness boot, as Electron 43.4.0 did on Windows CI. verify-target now runs the same five internal-module loads under the packaging Electron in Node mode and stops the build with the loader's own message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 4f023e87bcb02e31a0d07219697d95a252535673)
The loader gate proves the native resolver loads; it does not prove Harness boots. Add the probe from the RunAsNode assessment: it starts Harness from the repository through Electron Node mode with a disposable DSH_HOME, exchanges the launch token and requires an authenticated HTTP 200. The Windows CI job runs it before packaging. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two Desktop overrides still moved the Windows sidebar away from the upstream Desktop layout after switching to the Harness titlebar marker: - The caption row was 36px; upstream reserves 40 DIP, and Harness sizes the frame, sidebar toggle and right panels from that value. - The sidebar patch pads the expanded sidebar for non-macOS captions, and preload reduced that to 6px. With the marker Harness already starts every column below the caption, so the padding is now 0. The menu view, drag region and titlebar inset follow the shared height. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… popups Replace the separate WebContentsView dropdown at the top right with the upstream Desktop layout: an in-page "应用" / "编辑" menubar beside the sidebar toggle (following --dsh-windows-menu-start when the sidebar collapses) that opens native popup menus from the main process. - The application menu keeps every command the dropdown offered: phone pairing, Harness restart, Safe Mode, Harness log, session export, a View submenu (reload, developer tools, zoom with the current value, full screen), updates, about and exit. Popup accelerators are display only; the hidden application menu still owns the shortcuts. - Edit commands are sent as key events, as upstream does, so editors that keep their own history receive them. - Harness pages now rely on AppFrame's caption strip for dragging; Desktop's local pages keep their own strip. An open dialog releases both drag areas. - Drop patch hunks that only served the old caption: the conversation header marker, and the sidebar's non-macOS padding and brand spacing. - Remove the menu view, its preload, HTML resource and IPC channels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-node-main # Conflicts: # src/preload/windows-menu.ts
Preload can execute before the parser creates <html>, which left the Windows marker to DOMContentLoaded, after Harness scripts had run. Observe the document and mark <html> the moment it exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 29, 2026
yaojin3616
added a commit
that referenced
this pull request
Sep 29, 2026
Windows follow-up to #591: recovery UI smoke fix, PPT EPERM and zip path fixes
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
This is stage 1 of the roadmap in #589.
v0.10.0only. Its four commits are cherry-picked here without changes (git cherry-pick -x, no conflicts):.desktop-binnode.cmd/pnpm.cmdshims run through the packagedDSH Desktop.exewithELECTRON_RUN_AS_NODE=1.node.exeis excluded from Windows packages.node-addon-require-builtin. Its native binary accepts only the exact Electron fingerprints it was built for; for 0.1.6 these are 43.0.0, 44.0.0 and 45.0.0-alpha.6. An unsupported Electron used to pass every packaging step and fail only at Harness boot (Electron 43.4.0, CI run 35972303467).scripts/verify-target.mjsalready runs before every mac and Windows package build, locally and in CI. It now also loads the same five internal modules Harness uses, under the packaging Electron in Node mode, and stops the build with the loader's own error.--dsh-windows-menu-startwhen the sidebar collapses), opening native popup menus from main like the upstream Desktop. "应用" carries every former dropdown command (phone pairing, Harness restart, Safe Mode, log, session export, a View submenu with reload/devtools/zoom/full screen, updates, about, exit); "编辑" sends key events as upstream does. Harness pages drag through AppFrame's caption strip; Desktop's local pages keep their own strip; an open dialog releases both. The menu view, its preload, HTML and IPC channels are removed.scripts/probe-electron-node-runtime.mjs, taken from the RunAsNode assessment worktree, starts Harness from the repository through Electron Node mode with a disposableDSH_HOME, exchanges the launch token and requires an authenticated HTTP 200. The loader gate only proves the resolver loads; this proves Harness boots. The Windows CI job runs it after typecheck.docs/architecture.mdanddocs/development.mddescribe the Windows runtime and the new gate.codex/windows-sidebar-collapse(4f023e87bc). Preload marks<html data-windows-titlebar>and sets--dsh-windows-titlebar-heightbefore the first layout frame. Harness 0.1.7-rc.2 (dsh-client-ui-layout,dsh-client-ui-sidebar,dsh-client-ui-sidebar-right) reads that marker to reserve the caption row, so the sidebar collapses to zero width like upstream. The Desktop CSS that offset the right panel and conversation header is removed; the only override left keeps the drag area clear of the native caption buttons and the application menu view. Covered by the newtest/windows-sidebar-collapse.test.ts. A follow-up commit aligns two remaining overrides with upstream: the caption row is now 40 DIP (was 36px; upstreamwindows-layout.tsuses 40 and Harness sizes the frame, toggle and right panels from it), and the expanded sidebar no longer gets the sidebar patch's non-macOS top padding once the Windows marker is set (test/windows-sidebar-padding.test.tsfails on the old 6px and passes with 0).Why
The standalone
node.exerunning scripts under the user profile was one source of the antivirus flags, and it was a second Node runtime to ship and sign. Pinning Electron is now required for Harness to boot, so the pin should be enforced at build time, not discovered by users.Validation
npm ciwith full postinstall patch replay.npm run typecheck,npm run build,npm test(157 files / 1,281 tests, including the caption menu template and menubar tests); cleannpm cireplays the regenerated patches andgit diff --checkall pass.node scripts/probe-electron-node-runtime.mjspasses on macOS arm64 (HTTP 200);test/release.test.tspasses with the new workflow step.node scripts/verify-target.mjs darwin arm64passes with the locked Electron 43.0.0 (Node 24.17.0).unsupported Electron runtime fingerprint … (supported Electron versions: 43.0.0, 44.0.0, 45.0.0-alpha.6)message CI hit at Harness boot.test/electron-node-loader.test.tscovers four cases: the real pinned Electron passes, each of the five internal modules is requested from the loader Harness resolves, a loader rejection fails the probe, and an executable that cannot start fails the probe.v0.10.0by Windows dev package smoke and signed installer + upgrade smoke.Not yet verified
signeddispatch.Follow-ups (not in this PR)
ELECTRON_RUN_AS_NODEpropagates to Harness children such as Agent terminal commands.build/harness-node-entry.mjssets it for all children on both platforms..desktop-binshims to Electron Node mode.🤖 Generated with Claude Code