Files
openchamber/packages/electron/updater-check.test.mjs
502c96630e feat(desktop): Linux AppImage polish — window controls, updater UX, docs (#2144)
* feat(electron): add Linux AppImage releases

* ci: cache Linux OpenCode CLI artifacts

* fix(ci): await Linux release inventory check

* fix(electron): add frameless window controls on Linux desktop

Linux AppImages were created without native WM decorations and without
in-app controls, leaving users unable to close the window with a mouse.

Treat Linux like Windows: frameless BrowserWindow plus the existing
WindowsWindowControls header buttons and app-menu entry. macOS keeps
hidden title bar with traffic lights unchanged.

Shared usesFramelessElectronChrome() helper drives main window, mini
chat, header insets, and titlebar controls.

Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>

* feat(desktop): add configurable window controls position by OS

Add desktopWindowControlsPosition setting (auto/left/right) with OS-aware
defaults: Linux left, Windows right. Wire frameless chrome controls in
Header, TitlebarLeftControls, and MiniChatLayout, plus a Sessions settings
control for Windows and Linux desktop shells.

Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>

* fix(desktop): address Linux AppImage release review findings

Propagate updater capability errors to the UI, treat missing
latest-linux.yml feeds as no-update, stop installed-apps IPC spam on
Linux, document FUSE/AppImage limits, add CHANGELOG entry, migrate
remaining btriapitsyn URLs, and run Electron Linux unit tests on PRs.

Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>

---------

Co-authored-by: jibanez-staticduo <staticduo@gmail.com>
Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
2026-07-13 08:59:31 +03:00

48 lines
1.7 KiB
JavaScript

import assert from 'node:assert/strict';
import test from 'node:test';
import { checkForDesktopUpdate } from './updater-check.mjs';
const compareVersions = (left, right) => left.localeCompare(right, undefined, { numeric: true });
test('signals failed checks without replacing an existing pending update', async () => {
const pendingUpdate = { version: '2.0.0', electronUpdate: { id: 'existing' } };
await assert.rejects(
checkForDesktopUpdate({
autoUpdater: { checkForUpdates: async () => { throw new Error('feed unavailable'); } },
currentVersion: '1.0.0',
pendingUpdate,
compareVersions,
}),
/Unable to check for updates: feed unavailable.*network connection/,
);
assert.deepEqual(pendingUpdate, { version: '2.0.0', electronUpdate: { id: 'existing' } });
});
test('treats missing update feed (404) as no update available', async () => {
const result = await checkForDesktopUpdate({
autoUpdater: {
checkForUpdates: async () => {
throw new Error('HttpError: 404 Not Found "https://github.com/.../latest-linux.yml"');
},
},
currentVersion: '1.15.0',
pendingUpdate: { version: '1.16.0' },
compareVersions,
});
assert.equal(result.available, false);
assert.equal(result.pendingUpdate, null);
assert.equal(result.nextVersion, '1.15.0');
});
test('authoritative no-update result clears pending update', async () => {
const result = await checkForDesktopUpdate({
autoUpdater: { checkForUpdates: async () => ({ updateInfo: { version: '1.0.0' } }) },
currentVersion: '1.0.0',
pendingUpdate: { version: '2.0.0' },
compareVersions,
});
assert.equal(result.available, false);
assert.equal(result.pendingUpdate, null);
});