Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

feat(ok): move the desktop runtime to Electron 43 (PRD-7847) (#3698)

Andrew Mikofalvy708d8e0ee863
diff --git a/.changeset/electron-43-runtime.md b/.changeset/electron-43-runtime.md
new file mode 100644
index 000000000..3cc8e5330
--- /dev/null
+++ b/.changeset/electron-43-runtime.md
@@ -0,0 +1,14 @@
+---
+"@inkeep/open-knowledge": minor
+---
+
+The desktop app now runs on Electron 43, moving off a runtime that reaches end of life and picking up two majors of upstream Chromium and Node fixes.
+
+Three known behavior changes come with it.
+
+On every platform, file and folder pickers now open in your Downloads folder rather than wherever you last browsed. The runtime no longer restores the last-used directory between pickers, so **Open Folder**, **Open file**, and the project pickers all start there until you navigate away.
+
+On Linux only — macOS and Windows are unaffected:
+
+- Dragging the divider to resize the terminal when it is docked to the right collapses the column instead of resizing it. Moving the terminal between the bottom and right docks still works, and so does resizing on the other platforms. If you hit it, move the terminal to the bottom dock.
+- Pickers no longer start with hidden files and folders visible, so a dot-directory such as `.claude/worktrees` is not shown until you navigate to it yourself. The runtime dropped the option this relied on, because the desktop environment now treats that visibility as the user's choice rather than the app's.
diff --git a/docs/content/features/editor.mdx b/docs/content/features/editor.mdx
index e93747c10..95d6bdea8 100644
--- a/docs/content/features/editor.mdx
+++ b/docs/content/features/editor.mdx
@@ -102,7 +102,7 @@ Select text in the WYSIWYG editor and the selection bubble menu shows a **Commen
## Terminal
-The desktop app on macOS and Linux has a built-in terminal with real interactive shells inside the editor window. On Linux, OpenKnowledge inherits Electron 41's supported distribution floor: the Ubuntu 20.04+ and Debian 11+ glibc generation. Toggle it with `Cmd+J` on macOS or `Ctrl+J` on Linux, with `` Ctrl+` `` on either platform (which also works from inside a focused terminal), or with **View ▸ Show / Hide Terminal**. It opens at the placement saved for this installation (the bottom dock by default). Right-click a bottom-dock tab and choose **Move to right panel**, use the matching command in the command palette or **Terminal** menu, or use the right-panel header button to move it back to the bottom. Moving or hiding the Terminal keeps its live shells, tabs, and scrollback intact.
+The desktop app on macOS and Linux has a built-in terminal with real interactive shells inside the editor window. On Linux, OpenKnowledge inherits Electron's supported distribution range: releases of the major distributions that both Chromium and the distribution vendor still support. Toggle it with `Cmd+J` on macOS or `Ctrl+J` on Linux, with `` Ctrl+` `` on either platform (which also works from inside a focused terminal), or with **View ▸ Show / Hide Terminal**. It opens at the placement saved for this installation (the bottom dock by default). Right-click a bottom-dock tab and choose **Move to right panel**, use the matching command in the command palette or **Terminal** menu, or use the right-panel header button to move it back to the bottom. Moving or hiding the Terminal keeps its live shells, tabs, and scrollback intact.
The terminal is also the editor's AI-chat surface: opening it starts your default CLI when no session is open, and the tab strip's **New chat** split button opens another CLI tab — its dropdown switches CLI (the pick sticks, shared with the Ask AI composer) or opens a plain shell tab. With text selected in the editor, `Cmd+J` on macOS, `Ctrl+J` on Linux, and `` Ctrl+` `` on either platform stage the passage into the active CLI's input (or open a new CLI tab when none is running) instead of toggling — they share one handler. `Cmd+Shift+J` on macOS or `Ctrl+Shift+J` on Linux always stages it into a new CLI tab; the passage sits in the input for you to add to, and nothing is submitted until you press Enter. **Terminal ▸ New Terminal Window** (see [Terminal menu](#terminal-menu)) opens a dedicated window with the same multi-session tabs, `Cmd+<number>` tab switching, and shells starting at the project root.
diff --git a/packages/app/src/globals.css b/packages/app/src/globals.css
index 170abfaed..261a1fedf 100644
--- a/packages/app/src/globals.css
+++ b/packages/app/src/globals.css
@@ -3337,7 +3337,7 @@ button:active:not(:disabled) {
with it. No drift, no cycle (we override background-color, NOT --sidebar).
Browser support: relative-color syntax is Chromium 119+ / WebKit 16.4+ /
- Firefox 128+. Electron 41 ships Chromium 134+ — fully supported.
+ Firefox 128+. Electron 43 ships Chromium 150+ — fully supported.
prefers-reduced-transparency has its own dedicated fallback path below
(the @media (prefers-reduced-transparency: reduce) block) and is
@@ -3370,9 +3370,13 @@ html.electron-mode {
Windows/Linux chrome (electron-platform-* classes come from the FOUC
script alongside electron-mode, read off `window.okDesktop.platform`).
No traffic lights on these platforms — collapse the left reserve back to
- the 1rem base padding. The OS window controls instead float top-RIGHT via
- Electron's titleBarOverlay (Window Controls Overlay), so reserve the right
- edge of the chrome row for them. The `titlebar-area-*` env() vars are live
+ the 1rem base padding. The OS window controls instead float via Electron's
+ titleBarOverlay (Window Controls Overlay), so reserve the chrome row's edge
+ for them. Windows always places them top-right; Linux follows the desktop
+ environment's own title-bar layout, so a DE configured to put them on the
+ left gets only the 1rem base reserve and can crowd whatever sits leftmost
+ in the row. Verify on a packaged build before assuming the left edge is
+ clear there. The `titlebar-area-*` env() vars are live
exactly when WCO is enabled; the fallbacks make the reserve 0 on darwin,
web, and any WCO-less window. Consumers use the precedent-#49 fallback
form `mr-[var(--ok-titlebar-reserve-right,0px)]`.
diff --git a/packages/desktop/electron-builder.yml b/packages/desktop/electron-builder.yml
index 8d3a71fdf..e5ead8f8a 100644
--- a/packages/desktop/electron-builder.yml
+++ b/packages/desktop/electron-builder.yml
@@ -9,7 +9,7 @@ copyright: Copyright © 2026 Inkeep
# "electron" devDep in packages/desktop/package.json — that devDep is
# pinned exact (no caret) so the packaged runtime and the version used by
# electron-rebuild / native-module ABI compilation cannot drift.
-electronVersion: "41.10.3"
+electronVersion: "43.4.0"
# @electron/rebuild stays enabled for mac and Windows from this config because
# other native modules still use that pass. node-pty's N-API prebuilds do not
diff --git a/packages/desktop/package.json b/packages/desktop/package.json
index 32b1d7633..f07d52d19 100644
--- a/packages/desktop/package.json
+++ b/packages/desktop/package.json
@@ -60,7 +60,7 @@
"@vitejs/plugin-react": "^6.0.1",
"babel-plugin-react-compiler": "0.0.0-experimental-a8e64ef-20260402",
"culori": "^4.0.2",
- "electron": "41.10.3",
+ "electron": "43.4.0",
"electron-builder": "^26.9.0",
"electron-vite": "^6.0.0-beta.1",
"ts-morph": "^28.0.0",
diff --git a/packages/desktop/src/main/dialog-helpers.ts b/packages/desktop/src/main/dialog-helpers.ts
index 0b32bf1ee..4b7c882e2 100644
--- a/packages/desktop/src/main/dialog-helpers.ts
+++ b/packages/desktop/src/main/dialog-helpers.ts
@@ -111,9 +111,14 @@ function readTestPickedPath(): string | null {
* `showHiddenFiles` flips the picker's initial dot-file/dir visibility on
* — necessary so users can navigate into folders like
* `.claude/worktrees/<name>` and pick a linked worktree as its own
- * project. macOS users can still toggle visibility with Cmd+Shift+. (this
- * property only changes the initial state). Routes through the E2E test
- * seam so smoke tests can drive the path without an OS picker.
+ * project. It is honored on macOS and Windows only; GTK treats that
+ * visibility as the user's choice, so Linux ignores it and starts hidden
+ * entries collapsed. macOS users can still toggle with Cmd+Shift+. (the
+ * property only sets the initial state). The picker's starting directory
+ * is whatever `defaultPath` says, and the runtime no longer restores the
+ * last-used one — omit it and the picker opens in Downloads. Routes
+ * through the E2E test seam so smoke tests can drive the path without an
+ * OS picker.
*/
export async function promptForExistingFolder(
dialogModule: DialogLike,
diff --git a/packages/desktop/tests/smoke/terminal-dock.e2e.ts b/packages/desktop/tests/smoke/terminal-dock.e2e.ts
index e3f0dacd3..3819fa92a 100644
--- a/packages/desktop/tests/smoke/terminal-dock.e2e.ts
+++ b/packages/desktop/tests/smoke/terminal-dock.e2e.ts
@@ -324,6 +324,31 @@ async function openTerminal(app: ElectronApplication, page: Page): Promise<void>
await revealTerminalSurface(app, terminalSection(page));
}
+/**
+ * Wait until the terminal panel has stopped resizing and the throttled PTY
+ * resize behind it has had its window to land.
+ *
+ * The panel width is the observable half: it stops changing once the panel
+ * group finishes reflowing. The PTY resize is coalesced behind a trailing
+ * throttle in the renderer, so it lands after the final fit — the settle beat
+ * covers that tail. Both matter because `tput cols` samples the winsize once,
+ * when the shell evaluates it.
+ */
+async function waitForTerminalWidthStable(page: Page): Promise<void> {
+ const panel = page.locator('#terminal-dock-panel');
+ let previous = Number.NaN;
+ let stable = 0;
+ await expect(async () => {
+ const width = await panel.evaluate((el) => Math.round(el.getBoundingClientRect().width));
+ stable = width === previous ? stable + 1 : 0;
+ previous = width;
+ expect(stable).toBeGreaterThanOrEqual(3);
+ }).toPass({ timeout: 15_000, intervals: [100] });
+ // Trailing PTY resize: the renderer coalesces on a ~100ms window, so give it
+ // several windows plus IPC and SIGWINCH delivery before sampling the winsize.
+ await page.waitForTimeout(500);
+}
+
async function waitForStatus(page: Page, status: string, timeoutMs = 20_000): Promise<void> {
await expect(terminalStatus(page)).toHaveAttribute('data-terminal-status', status, {
timeout: timeoutMs,
@@ -654,6 +679,16 @@ test.describe('Docked terminal — live Electron', () => {
win.setSize(w, h, false);
});
+ // Let the storm settle BEFORE asking the shell how wide it is. Two things
+ // are still in flight when the last `setSize` returns: the panel group is
+ // reflowing (a window step can cross a responsive breakpoint, which swings
+ // the terminal's width by far more than the step itself), and the PTY
+ // resize is throttled, so the final one lands after the final fit.
+ // `tput cols` is evaluated once, at the moment the shell runs it — ask too
+ // early and a mid-storm width is baked into the output, and no amount of
+ // re-reading the buffer afterwards can change it.
+ await waitForTerminalWidthStable(page);
+
// The shell still echoes (no wedged PTY, no dead renderer), and its
// winsize settled back to the pre-storm width — the trailing throttled
// resize landed. Polled: the trailing PTY resize lands within ~100ms of
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 908099f3e..ce038ae85 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1188,8 +1188,8 @@ importers:
specifier: ^4.0.2
version: 4.0.2
electron:
- specifier: 41.10.3
- version: 41.10.3
+ specifier: 43.4.0
+ version: 43.4.0
electron-builder:
specifier: ^26.9.0
version: 26.15.3([email protected])
@@ -7353,8 +7353,8 @@ packages:
resolution: {integrity: sha512-bO3y10YikuUwUuDUQRM4KfwNkKhnpVO7IPdbsrejwN9/AABJzzTQ4GeHwyzNSrVO+tEH3/Np255a3sVZpZDjvg==}
engines: {node: '>=8.0.0'}
- resolution: {integrity: sha512-MJuSODPw8siv/I8JjhctW/cS/XNldwI4gLRyyWZx6QkoZJUDgbEvitp7IVOnGrHENTQb6Udo+zMpKhFnhlIhdg==}
+ resolution: {integrity: sha512-3qxGF0CeQbiox5oWV1JlbWGQ1VerbmDhTFqW4sJ8h7uqTHniFYPObXJcDna0DMh32et0fFyKzz0YY8lJv3t5jg==}
engines: {node: '>= 22.12.0'}
hasBin: true
@@ -17703,7 +17703,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
'@electron-internal/extract-zip': 1.0.5
'@electron/get': 5.1.0
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index eca6cf144..5df9fbe91 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -18,7 +18,9 @@ minimumReleaseAgeExclude:
- '@visimer/*'
# Dependency build scripts are blocked by default under pnpm; only these run.
-# electron downloads its platform binary in a postinstall. The napi native addon
+# electron ships no install script of its own as of 43 — it fetches its platform
+# binary lazily on first use instead — but the entry stays so a future release
+# that reintroduces one is not silently blocked. The napi native addon
# (@inkeep/open-knowledge-native-config) builds via its own turbo `napi build`
# task, not a dependency install script, so it needs no entry here. node-pty
# publishes N-API prebuilds for the supported desktop platforms; its install