Recap
In the previous record of Kalamos's beginning, we spent three days turning this Typora-style, WYSIWYG Markdown desktop editor into an MIT open-source project at v0.1.1—at that time, the goal was simple: macOS only.
Unexpectedly, just a few days after going open source, the community sent a huge gift: external contributor @mingchuanhuang-xpc submitted PR #79, which single-handedly implemented the core engineering for the Windows port (drive paths, headless Edge PDF export, single instance, PATHEXT search, windows-latest CI).
This series of articles is divided into three parts to document the evolution during this period: The previous post (2026-11-23) discussed feature advancement, review processes, and handling external PRs after going open source, as well as release automation with Biome and Changesets; this post focuses specifically on "what to actually watch out for when porting a Tauri 2 desktop app, originally running only on macOS, to Windows 10/11 (x64)"; as for the final piece of the puzzle—in-app auto-updates (W5)—that will be left for the next post (2026-11-25).
Links to the project and the first version with a Windows installer are provided below:
- GitHub Repo: kkdai/Kalamos
- Product Page: www.evanlin.com/Kalamos
- First release with Windows installer: Release v0.4.0
I. Planning: Breaking Windows Support into W1–W6, Starting with a Non-conflicting Release Pipeline
After receiving external PR #79, we didn't rush to merge it and claim "Windows support."
At that time, the main branch was also advancing two major changes: #78 (Native menus and preference window) and #81 (Multi-document tabs), neither of which were accounted for in #79. More importantly, from v0.1.1 to v0.3.0, we were still manually packaging macOS .dmg files, without even a release pipeline capable of automatically producing Windows installers.
Instead of jamming "App porting, UX adjustments, packaging, documentation updates, auto-updates, and single-file exe" into one giant PR and getting stuck, we opened a master Epic (#86), breaking the entire Windows support into six clearly bounded stages, W1–W6:
| Stage | Issue / PR | Scope and Dependencies | Current Status |
|---|---|---|---|
| W1 | #87 → PR #93 | Release automation: release.yml, macOS dual-arch .dmg + Windows NSIS / MSI, SHA256SUMS.txt, Draft Release |
Completed |
| W2 | #88 → PR #94 | Windows App porting core: Based on @mingchuanhuang-xpc's PR #79, integrating #78 and #81 |
Completed |
| W3 | #89 → PR #97 | Windows UX: In-window menu bar, shortcut text, title bar and tab bar, Alt+F4 exit check, fonts (Depends on W2) |
Completed |
| W4 | #90 → PR #96 | Four-language README and product page with Windows installation instructions and platform-specific download buttons (Depends on W1, W2) | Completed |
| W5 | #91 | In-app auto-update tauri-plugin-updater (Depends on W1, scheduled last, see next post) |
Completed |
| W6 | #95 | Windows portable single-file exe (windows-gnu embedding WebView2Loader.dll, P2, split from #79) |
Open for tracking |
There were two critical arrangements in this sequence:
-
Do W1 first, then take over #79 (W2): The packaging settings for
release.ymlandtauri.conf.jsondo not conflict with the App code in #79 at all. By merging W1 first and usingworkflow_dispatchto confirm the CI can actually produce macOS.dmgand Windows NSIS / MSI, we had real installers to download after completing each subsequent stage, without fighting with #79. -
Finish W4 but don't merge until
v0.4.0is released: PR #96 was ready early, but we deliberately held off on merging until the firstv0.4.0with a real Windows installer was public, avoiding a situation where the Windows download button on the product page linked to a release without Windows assets.
We also explicitly stated in Epic #86 what was out of scope for this round: Windows code signing (e.g., Azure Trusted Signing), Apple notarization, Linux / ARM64 Windows, Microsoft Store / winget. Defining boundaries early prevents scope creep.
II. Reviewing External PR #79: Read build.rs Before Building, and Four Key Issues Identified
Conclusion first: @mingchuanhuang-xpc's PR #79 was a very sincere and high-quality porting effort (35 files, +1358 / −167). It didn't just handle C:/ and file:///C:/ paths, dunce::canonicalize to remove Windows \\?\ prefixes, headless Edge / Chrome PDF export, tauri-plugin-single-instance with File Explorer integration, PATHEXT searching, and CREATE_NO_WINDOW to prevent black window flashes; it also fixed a real UI bug—the "Papyros" option in the dark theme menu and the "Melan" option in the light menu were nearly invisible because the buttons had the wrong text color due to the data-theme attribute.
Security Review Discipline: Read build.rs first, build locally only after confirming safety
When reviewing a Rust / Tauri PR from an external fork, there is a hard security line: Never execute cargo test or npm run build locally before reading through build.rs.
Because Rust's build.rs executes arbitrary code with local permissions during the compilation phase. We checked three things in an independent read-only worktree before allowing local testing:
-
Read
src-tauri/build.rsline by line: Confirmed it only acts whentarget_os = "windows" && target_env = "gnu", and its content only outputs linker parameters and copiesWebView2Loader.dll—no network access, noCommandexecution, no download behavior, and no reading of environment secrets. -
Confirm no bundled binaries: Used
git diff --numstatto ensure no binary items were included.WebView2Loader.dllcomes fromwebview2-com-syson crates.io (which includes the official Microsoft NuGet package) andtauri-build, withCargo.lockchecksums locked. -
Verify new dependencies and CI workflow: The added
dunce 1.0.5andtauri-plugin-single-instance 2.5.5are well-known or official crates; CI changes did not usepull_request_target, didn't touch secrets, and didn't introduce new third-party actions.
Once the security check passed, we ran the full suite of vitest, cargo test, clippy, build, and Playwright on local macOS to ensure no functional regression.
Four Issues Found During Code Review
Next, we reviewed item by item against the main branch and security model, identifying four issues that needed addressing:
windows-gnusingle-file exebuild.rsdirectory depth error (Blocker): To produce a portable single-file exe, the PR hardcodedancestors().nth(4)insrc-tauri/build.rsto findWebView2Loader.dllfromOUT_DIR. However, in the stable Cargo directory structuretarget/<profile>/build/<pkg>-<hash>/out,ancestors().nth(4)points totarget/(ortarget/<triple>/), nottarget/<profile>/(it only matches in the nightly new structure). Failing to find the file causes compilation to fail; worse, if an old file remains, it might silently embed an outdated DLL. Additionally, GitHub Actions'windows-latestdefaults to MSVC, so thiswindows-gnubranch was never compiled by CI, and although the comment mentioned--allow-multiple-definition, it wasn't actually added to the code. → Solution: Split the GNU single-file exe logic inwebview2_embed.rsandbuild.rsinto a separate Issue W6 (#95). In the future, we will usefind(|p| p.file_name() == "build").parent()liketauri-buildto find the directory and add anx86_64-pc-windows-gnuCI job.DLL landing only compared file size (Should-fix):
webview2_embed.rsextracted the embeddedWebView2Loader.dllto%LOCALAPPDATA%\io.kalamos.app\. Before writing, it only compared the file size on disk to decide whether to overwrite, and would fall back totemp_dir()ifLOCALAPPDATAwasn't found. This means that under the same user permissions, if another program replaced it with a malicious DLL of the same size, Kalamos would load it viaLoadLibraryWevery time it started, becoming a persistence point. Although the threat model is low and it only compiles in the GNU branch, the fix is simple: change to comparing SHA-256 (or overwrite every time), use a temporary file with an atomic rename, and return an error instead of falling back totemp_dir()ifLOCALAPPDATAis missing—these specs were included in #95.README mentioned Windows downloads that didn't exist yet (Should-fix): The README in the PR said "Download the latest Windows installer from Releases," but there were no Windows release assets at the time. It also stated "Windows 10 / 11 has built-in WebView2," whereas only Windows 11 guarantees it; some Windows 10 environments (like LTSC or long-unupdated systems) might not have it. The English build requirements also missed Windows conditions and were out of sync with the Chinese version.
Floating buttons appeared in the top-left on macOS (Should-fix): The PR placed "Toggle Sidebar" and "Open File" floating buttons in the top-left corner, but they showed up on all platforms. After
#78was merged, macOS already had a full native top menu, so this changed the macOS UI without a product decision. We decided to show them only whenIS_WINDOWSis true, while also clarifying the new behaviors for dragging and dropping.mdfiles to open and.docxfiles to import, adding Playwright tests for them.
Since the main branch had already merged #78 and #81, we left detailed review comments on PR #79 and opened PR #94 (W2) to take over: the first commit cherry-picked @mingchuanhuang-xpc's original commit (preserving the original author field) and resolved conflicts with #78 and #81; the second commit focused on applying all the review fixes mentioned above (adding a Co-authored-by signature when finally squash-merging into main). Then we pushed it to GitHub Actions—and that's where the real fun began.
III. Five Pitfalls Encountered in Windows CI
After running 480+ unit tests, 100+ Rust tests, and 180+ Playwright E2E tests on local macOS with all green lights, we hit five very solid cross-platform landmines as soon as we entered the GitHub Actions windows-latest runner. Each of these pitfalls had a clear root cause and was almost impossible to anticipate just by working on macOS.
Pitfall 1: Path::new("/").is_absolute() is false on Windows
While reviewing #79, we added a !path.is_absolute() check to check_asset_dir in src-tauri/src/images.rs to prevent relative paths from being allowed based on the process cwd. Unit tests passed on macOS but failed on windows-latest.
Reason: The test used check_asset_dir(Path::new("/"), Some(&home)), expecting a TOO_BROAD_MESSAGE ("Image root directory range is too broad"). On Windows, "/" without a drive letter is a drive-relative path (relative to the current drive's root, e.g., relative to C: or D:), not a full absolute path. Therefore, the Rust standard library's Path::new("/").is_absolute() returns false! The test was blocked at the first "must be an absolute path" check and never reached is_too_broad.
Fix: Don't hardcode "/". Instead, derive the actual OS root directory from the home path used in the test (Unix gets /, Windows gets C:\), so both sides test the same thing:
// The filesystem root (`/` on Unix, `C:\` on Windows) is always too broad.
let fs_root = home.ancestors().last().expect("filesystem root");
let err = check_asset_dir(fs_root, Some(&home)).unwrap_err();
assert!(err.message.starts_with(TOO_BROAD_MESSAGE));
Pitfall 2: Headless Edge fails to output PDF with --blink-settings=scriptEnabled=false
This pitfall was particularly ironic—it was triggered by a change we requested ourselves during the review.
Reason: The macOS PDF export explicitly sets setAllowsContentJavaScript(false) in WKWebView. During the review of #79, we wanted the Windows headless Edge to follow suit, so we requested removing --allow-file-access-from-files and adding --blink-settings=scriptEnabled=false. Consequently, when running real headless Edge export tests on windows-latest, Edge exited normally with code 0 but wrote no PDF file at all! It turns out this Blink flag breaks the Chromium / Edge --print-to-pdf pipeline.
Fix: Remove --blink-settings=scriptEnabled=false. Instead, in the already isolated --user-data-dir temporary profile, pre-write Chromium's Content Settings (Default/Preferences), setting javascript to 2 (blocked). This, combined with the strict CSP (default-src 'none') already in src/export/html.ts, forms a double layer of protection. We also included the browser's exit code and the end of stderr in the error message to avoid guessing in the future:
pub(super) fn prepare_no_js_profile(profile: &Path) -> Result<(), AppError> {
let default_dir = profile.join("Default");
fs::create_dir_all(&default_dir)?;
fs::write(
default_dir.join("Preferences"),
r#"{"profile":{"default_content_setting_values":{"javascript":2}}}"#,
)?;
Ok(())
}
Pitfall 3: CodeMirror single-letter shortcuts ignore Shift; Ctrl+O hijacks Ctrl+Shift+O
After passing Rust tests, the Playwright E2E on windows-latest reported an error: the test pressed Ctrl+Shift+O (Open Folder), but Ctrl+O (Open File) was triggered instead!
Reason: Digging into the CodeMirror 6 keymap implementation revealed the truth. When handling single-character keys, CodeMirror intentionally ignores the Shift- modifier (internal logic is modifiers(name, event, !isChar)), because pressing Shift + o on a standard keyboard sends an uppercase event.key === "O", and character casing is enough to distinguish them. However, in two scenarios—the user has Caps Lock on, or synthetic keyboard events on Windows (like Playwright sending Control+Shift+o)—the browser sends a lowercase key: "o" but with shiftKey: true. In these cases, the Mod-o binding without Shift is matched because Shift- is ignored, and it consumes the event before Mod-Shift-O or an outer window listener can; the same happens with s, f, e, g, and other single-letter shortcuts.
Fix: Add a highest priority (Prec.highest) keydown handler in src/editor/keymaps.ts to record the event.shiftKey of the current event in a WeakMap<EditorView, boolean> before the CodeMirror keymap runs. Then, write a small wrapper function unshifted(cmd) to apply to all single-letter bindings that shouldn't consume Shift (Mod-o, Mod-s, Mod-n, Mod-b, Mod-i, Mod-k, Mod-f, Mod-g, etc.), and remove their original unconditional preventDefault: true (CodeMirror already calls preventDefault when a command returns true):
const lastKeydownShift = new WeakMap<EditorView, boolean>();
export const trackKeydownExtension = Prec.highest(
EditorView.domEventHandlers({
keydown(event, view) {
lastKeydownShift.set(view, event.shiftKey);
return false;
},
}),
);
export function unshifted(cmd: Command): Command {
return (view) => {
if (lastKeydownShift.get(view)) return false;
return cmd(view);
};
}
Finally, after adding regression E2E tests simulating the Win32 platform, Ctrl+Shift+O correctly opens the folder without being intercepted by Ctrl+O.
Pitfall 4: Changing UA isn't enough for Playwright E2E; navigator.platform is still Win32 on Windows runners
Moving to W3 (PR #97), we wrote a batch of Playwright E2E tests for the dual-platform interface, verifying both "Simulated macOS" and "Simulated Windows" scenarios in the same test file. All green on local macOS, but it failed again on windows-latest.
Reason: Looking at how src/platform.ts detects the platform explains it:
if (/Windows NT|Win64|WOW64/i.test(ua) || /^Win/i.test(plat))
return "windows";
The original test only called browser.newContext({ userAgent: macUA }). On local macOS, navigator.platform is already "MacIntel", so the flaw was hidden. But on a Windows runner, the "Simulated macOS" BrowserContext changed the User-Agent, but the underlying navigator.platform was still "Win32", so detectPlatform() still identified it as Windows!
Fix: Extract a shared newPlatformContext(browser, "macos" | "windows") in tests/e2e/helpers.ts. In addition to setting the userAgent, use ctx.addInitScript to overwrite both navigator.platform ("MacIntel" / "Win32") and navigator.userAgentData ("macOS" / "Windows"):
export async function newPlatformContext(
browser: Browser,
target: keyof typeof PLATFORM_PROFILES,
): Promise<BrowserContext> {
const profile = PLATFORM_PROFILES[target];
const ctx = await browser.newContext({ userAgent: profile.userAgent });
await ctx.addInitScript(({ platform, uaDataPlatform }) => {
Object.defineProperty(navigator, "platform", {
configurable: true,
get: () => platform,
});
Object.defineProperty(navigator, "userAgentData", {
configurable: true,
get: () => ({
brands: [],
mobile: false,
platform: uaDataPlatform,
getHighEntropyValues: async () => ({ platform: uaDataPlatform }),
}),
});
}, profile);
return ctx;
}
From then on, platform simulation behavior remained consistent regardless of whether the test ran on a macOS or Windows runner.
Pitfall 5: Biome flags every file as formatted incorrectly on Windows due to core.autocrlf
The final pitfall appeared when introducing Biome to the CI (PR #101, taking over the second part of external contributor @narumiruna's #85). We added npx biome ci to ci.yml. Zero errors on macOS, but on windows-latest, almost every file in the repo was flagged by Biome as a formatting error!
Reason: The windows-latest runner on GitHub Actions has Git's core.autocrlf enabled by default. When actions/checkout pulls the repo, it automatically converts all text file LF line endings to CRLF. Biome's line-ending style check immediately failed across the board. After checking the entire repo, no files actually needed to be stored with CRLF (tests verifying CRLF retention behavior all constructed strings in memory).
Fix: Add a .gitattributes file to the repo root, using * text=auto eol=lf to force all text files to LF. Simultaneously, explicitly mark images, icons, PDFs, and font files as binary to prevent Git from touching binary assets:
* text=auto eol=lf
# Binary assets (images, icons, fonts)
*.png binary
*.jpg binary
*.ico binary
*.icns binary
*.pdf binary
*.woff2 binary
*.ttf binary
Summarizing these five Windows CI pitfalls into a quick reference table:
| # | Symptom | Root Cause | Fix | PR |
|---|---|---|---|---|
| 1 |
check_asset_dir test error isn't "too broad" |
Path::new("/").is_absolute() is false on Windows (drive-relative) |
Use home.ancestors().last() to get the actual OS root |
#94 |
| 2 | Headless Edge exit 0 but no PDF |
--blink-settings=scriptEnabled=false breaks --print-to-pdf
|
Write to isolated profile Default/Preferences to disable JS, plus CSP |
#94 |
| 3 |
Ctrl+Shift+O triggers Ctrl+O
|
CodeMirror single-letter keys ignore Shift; hijacked by Caps Lock or synthetic events | Use Prec.highest to record shiftKey + unshifted() wrapper |
#94 |
| 4 | Simulated macOS E2E fails on Windows runner | UA change isn't enough; navigator.platform is still Win32
|
Use newPlatformContext to overwrite UA, platform, and userAgentData
|
#97 |
| 5 |
biome ci fails for all files on Windows |
windows-latest core.autocrlf converts LF to CRLF |
Add .gitattributes with * text=auto eol=lf to lock LF |
#101 |
IV. Windows UX Details: "Compilable" Doesn't Mean "Windows Supported" (W3)
After the core functionality turned green in Windows CI, we moved to W3 (#89 / PR #97). If we simply moved the macOS interface to Windows, users would be confused: "Services" and "Hide Others" appearing in the menu, hints showing ⌘S and ⌥⇧⌘←, and Alt+F4 closing unsaved drafts without asking.
We broke Windows UX into four specific items to complete:
1. Native Menus Generated per Platform, Sharing One Spec File
Kalamos's menu definitions are centralized in src/menu/menu-spec.json, shared by Rust (src-tauri/src/menu.rs) and the frontend. W3 added an optional "platforms" field (["macos"] or ["windows", "linux"]) to each menu node:
- macOS: Maintains the original system top App menu bar (including "About", "Preferences", "Services", "Hide", "Hide Others", "Show All", "Quit").
-
Windows: Presented as an in-window native menu bar, automatically filtering out macOS-specific items; following Windows user habits, "Preferences (
Ctrl+,)" and "Exit (Ctrl+Q)" were moved to the File menu, and "About" (and later "Check for Updates..." in W5) was moved to the Help menu. - For shortcuts originally triggered only by menu accelerators on macOS, the frontend added fallback
keydownlisteners and used the shared spec to deduplicate, preventing double triggers and ensuring all shortcuts are accessible on Windows.
2. Shortcut Text Changed to Ctrl / Alt / Shift, Paths Converted Back to Backslashes
All hint text in the frontend (Preferences, Find bar tooltips, tabs, sidebar, theme menu, table toolbar) was originally written with macOS symbols or terms (⌘, ⌥, ⇧, Cmd+Opt+T). We unified this via shortcutLabel() in src/platform.ts, which automatically rewrites them to Ctrl+Alt+Shift+... (e.g., ⌥⇧⌘← → Ctrl+Alt+Shift+←) when Windows / Linux is detected. The underlying CodeMirror Mod- bindings already map to Ctrl automatically.
For paths, we adopted a "Unified Internally, Converted at Boundaries" strategy: the frontend internal logic always operates on forward-slash paths (C:/Docs/note.md), converting at the IPC boundary via toSlashPath / toNativePath. User-facing display locations (e.g., showing parent paths for two files with the same name in different folders) are converted back to Windows-style backslashes. Regarding file line endings, new files remain LF, while files that were originally CRLF are preserved as-is.
3. Alt+F4, Close Button, and Ctrl+Q Unified Under Unsaved Check
There are three common ways to close an App on Windows: clicking the X in the top-right, pressing Ctrl+Q, or pressing Alt+F4.
To prevent any of these from bypassing the multi-tab draft protection, we hooked all three paths into the same unsaved confirmation process:
- The window close button is intercepted by Tauri's
onWindowCloseRequested. If the user clicks cancel in the "The following N documents have unsaved changes" dialog,event.preventDefault()is called to keep the window open. - Added a Windows-specific
Alt+F4keydowninterceptor insrc/main.ts, which, like the menu'sCtrl+Q, settles all unsaved changes across all tabs before actually exiting the program.
4. Font Fallbacks and Layout Tweaks
Added Windows Traditional Chinese and English font fallbacks in src/styles/tokens.css and print styles:
- Body and UI fonts now include
"Segoe UI","Microsoft JhengHei UI","Microsoft JhengHei". - Code monospace fonts now include
"Cascadia Mono","Cascadia Code",Consolas.
Additionally, since Windows uses a native title bar without the three macOS traffic lights in the top-left, we adjusted the alignment spacing for the tab bar and the top-right theme button, and ensured the top-left quick buttons (Toggle Sidebar, Open File) only show on Windows, keeping the macOS appearance and behavior 100% unchanged.
V. Release Strategy and the Honest Note on Lack of Physical Windows Verification
The release phase (W1 PR #93 and W4 PR #96) cleared the pain points of manual packaging: pushing a v* tag (or manually running workflow_dispatch) triggers .github/workflows/release.yml. It first checks that the tag matches the version in package.json, tauri.conf.json, and Cargo.toml, then runs three targets in parallel—macOS aarch64, macOS x86_64 (fixing the ad-hoc signature corruption issue mentioned in the previous post by setting bundle.macOS.signingIdentity: "-", and automatically running codesign --verify --deep --strict and .dmg content checks in CI), and Windows x86_64 (producing NSIS -setup.exe and WiX .msi). Finally, it aggregates SHA256SUMS.txt and creates a Draft Release, which a maintainer manually reviews before publishing. All third-party actions are pinned to commit SHAs, and only the final job creating the Release is granted contents: write permissions.
Three pragmatic choices were made for the Windows installer design:
-
WebView2 uses
downloadBootstrapper(Silent Mode): SetwebviewInstallMode: { "type": "downloadBootstrapper", "silent": true }insrc-tauri/tauri.conf.json. Windows 11 has WebView2 built-in; for Windows 10 systems without it (like LTSC or unupdated machines), the installer will automatically download and install it when needed, without bloating the installer with the full offline runtime. -
NSIS uses
currentUserInstallation Mode: SettinginstallMode: "currentUser"allows users to install without administrator privileges (no UAC elevation required) and includes English and Traditional Chinese (["English", "TradChinese"]). The installer automatically registers 7 Markdown extensions (.md,.markdown,.mdown, etc.) viafileAssociations. Combined withtauri-plugin-single-instanceand CLIargvparsing, double-clicking an.mdfile in File Explorer opens it directly in the running window. -
Unsigned and SmartScreen Warnings: We haven't purchased a Windows code signing certificate yet, so Windows users will definitely see a Windows Defender SmartScreen warning when running the
-setup.exeor.msi. Rather than letting people be scared off by the blue screen, we put "Experimental, Unsigned" at the very front of the four-language README, product page, and every Release Note, explicitly explaining to "Click 'More info' → 'Run anyway'" and providingSHA256SUMS.txtfor those who want to verify the checksum themselves.
One Thing to Be Honest About: Lack of Physical Windows Verification
Writing this, I must be clear about the verification boundaries:
From
v0.4.0to the latestv0.8.1, the Windows version of Kalamos has not yet been verified on a physical Windows machine by me.
I usually develop and test on macOS. All current Windows quality assurance comes from the windows-latest CI (Vitest, cargo test including real headless Edge PDF export tests, Clippy, Playwright E2E dual-platform simulation, and tauri build packaging NSIS / MSI). Automated CI helped us catch those five hard pitfalls in section three, which was extremely useful; but the "last mile" of desktop software—actually clicking through the NSIS install wizard on Windows 10 / 11, seeing the layout of the in-window native menu bar and high-DPI fonts, double-clicking .md in File Explorer to test the single instance, and verifying Windows in-app auto-updates—cannot be verified by headless CI.
This is why we honestly label the Windows version as "Experimental, Unsigned" in the README, product page, and Release Notes. If you happen to have a Windows computer, you are very welcome to download and try it from GitHub Releases. Whether it's smooth or you hit a snag, feel free to open an Issue and report it to us!
VI. Checklist for Porting a macOS Tauri App to Windows
I've summarized the lessons learned from W1 to W4 into a practical checklist for anyone building cross-platform Tauri desktop software:
- 1. Review external Rust PRs: Read
build.rsbefore running any build or test: Confirm no network access, subprocess execution, or bundled binaries before building locally. - 2. Split large cross-platform tasks into stages, prioritizing CI / release pipelines: Like W1, which had zero conflict with App code, getting Windows installers produced automatically provides feedback for every subsequent step.
-
3. Don't assume
Path::new("/")is an absolute path: On Windows, it's drive-relative; derive the root from a real path (likehome.ancestors().last()) for cross-platform tests. - 4. Use headless Edge / Chrome for PDF printing without
--blink-settings=scriptEnabled=false: It will silently exit 0 without producing a file; instead, write toDefault/Preferencesin an isolated--user-data-dirto disable JS, and use strict CSP. - 5. Watch out for Shift being ignored in CodeMirror single-letter shortcuts: Caps Lock or Windows synthetic events can cause
Mod-oto hijackMod-Shift-O; use a highest priority keydown to recordshiftKeyfor protection. - 6. Playwright cross-platform simulation requires more than just changing
userAgent: Be sure to useaddInitScriptto overwrite bothnavigator.platformandnavigator.userAgentData, otherwise it will be exposed on Windows runners. - 7. Dual-platform CI running formatters (Biome / Prettier) must use
.gitattributes: Use* text=auto eol=lfto suppress the false positives caused bycore.autocrlfconverting LF to CRLF. - 8. Honestly label as "Experimental" if not tested on physical hardware: CI can guard logic and packaging, but the install wizard, native menus, and SmartScreen experience require honest communication with users about the current status.
Summary
Looking back at the process of adding Windows support to Kalamos, the three most significant takeaways were:
-
The open-source community pushed the door wide open: Without
@mingchuanhuang-xpc's PR #79 laying a solid foundation (and subsequent help from@narumirunain #85 for Biome integration, which helped us block the CRLF pitfall in dual-platform CI), Windows support wouldn't have gone from zero to one in such a short time. -
Dual-platform CI is the most honest judge: No matter how carefully you write on macOS, the five landmines—
Path::new("/"), headless Edge flags, CodeMirror Shift,navigator.platform, andcore.autocrlf—only surfaced oncewindows-latestwas pulled into the CI. -
Cross-platform success relies on containing differences at the boundaries: Frontend internal unification of forward slashes, shared
menu-spec.jsonfor menus, unifiedshortcutLabel()for shortcuts, and Rust platform details tucked away inplatform.rsand#[cfg(target_os)]—keeping 90% of core functionality as a single implementation prevents maintenance costs from doubling with the number of platforms.
That's it for the Windows architecture, UX, and packaging; in the next post, we'll discuss the final piece of the puzzle—W5 in-app auto-updates (tauri-plugin-updater) and what to watch out for in design, key isolation, and physical upgrades.
- GitHub Repo: kkdai/Kalamos
- Product Page: https://www.evanlin.com/Kalamos/
- Download the latest version: GitHub Releases
Articles in this series:
- [Herdr in Action] Building a Typora-style macOS Markdown Editor Kalamos in Three Days
- [Kalamos Development] After Open Source: Feature Evolution from v0.2 to v0.7, and Reviewing/Taking Over External PRs with Multi-Agents
- [Kalamos Development] Things to Watch Out for with Auto-Updates: Private Key Isolation, Build/Signature Separation, Key Rotation, and CI Queue Pitfalls

Top comments (0)