refactor: remove legacy Tauri desktop support

Electron updater now uses Electron release metadata only
Removed legacy Tauri package and migration workflow
Replaced Tauri shim usage with the desktop bridge
This commit is contained in:
Bohdan Triapitsyn
2026-06-03 02:42:00 +03:00
parent e80bd15dd9
commit c7bc026b4b
81 changed files with 269 additions and 16914 deletions
+5 -17
View File
@@ -152,7 +152,6 @@ const LOCAL_DESKTOP_CLIENT_KIND = 'desktop-local';
const LOCAL_DESKTOP_CLIENT_DEDUPE_KEY = 'desktop-local';
const ENV_OVERRIDE_HOST_ID = '__env';
const CHANGELOG_URL = 'https://raw.githubusercontent.com/openchamber/openchamber/main/CHANGELOG.md';
const UPDATE_METADATA_URL = 'https://github.com/openchamber/openchamber/releases/latest/download/latest.json';
const GITHUB_BUG_REPORT_URL = 'https://github.com/openchamber/openchamber/issues/new?template=bug_report.yml';
const GITHUB_FEATURE_REQUEST_URL = 'https://github.com/openchamber/openchamber/issues/new?template=feature_request.yml';
const DISCORD_INVITE_URL = 'https://discord.gg/ZYRSdnwwKA';
@@ -1681,7 +1680,6 @@ const createBrowserWindow = ({ label, restoreGeometry, url, runtimeConfig = {} }
backgroundColor: '#151313',
frame: process.platform === 'win32' ? false : undefined,
autoHideMenuBar: autoHidesNativeMenuBar,
// Tauri used an overlay title bar with explicit traffic-light placement.
// Electron's hiddenInset adds its own extra inset, which leaves the controls
// visibly lower than the app header. Use a plain hidden title bar instead.
titleBarStyle: usesCustomTitleBar ? 'hidden' : 'default',
@@ -1704,7 +1702,7 @@ const createBrowserWindow = ({ label, restoreGeometry, url, runtimeConfig = {} }
// sandbox must stay off: the preload uses contextBridge + ipcRenderer
// from Electron's Node layer. contextIsolation + nodeIntegration:false
// keep the renderer world walled off from Node. Do NOT flip to true —
// the preload would fail to load and __TAURI__ would go undefined.
// the preload would fail to load and the desktop bridge would be unavailable.
sandbox: false,
},
};
@@ -3028,9 +3026,8 @@ const handleInvoke = async (browserWindow, command, args = {}) => {
}
case 'desktop_set_vibrancy': {
// Vibrancy (macOS blur) is not supported in the Electron shell — the
// Tauri build used NSVisualEffectView via Tauri plugin, Electron has
// no equivalent for our titleBarStyle:'hidden' setup. Persist the
// Vibrancy (macOS blur) is not supported in the Electron shell for our
// titleBarStyle:'hidden' setup. Persist the
// disabled state so settings UI reflects it; args.enabled is ignored.
await mutateSettingsRoot((root) => {
root.desktopVibrancy = false;
@@ -3040,13 +3037,6 @@ const handleInvoke = async (browserWindow, command, args = {}) => {
case 'desktop_check_for_updates': {
const currentVersion = APP_VERSION;
let payload = null;
try {
const response = await fetch(UPDATE_METADATA_URL, { signal: AbortSignal.timeout(10_000) });
payload = await response.json();
} catch {
}
let updateResult = null;
try {
updateResult = await autoUpdater.checkForUpdates();
@@ -3056,14 +3046,12 @@ const handleInvoke = async (browserWindow, command, args = {}) => {
const updateInfo = updateResult?.updateInfo;
const nextVersion =
(typeof updateInfo?.version === 'string' && updateInfo.version) ||
(typeof payload?.version === 'string' && payload.version) ||
currentVersion;
const available = compareSemver(nextVersion, currentVersion) > 0;
const body =
(typeof payload?.notes === 'string' && payload.notes.trim() ? payload.notes : null) ||
(typeof updateInfo?.releaseNotes === 'string' && updateInfo.releaseNotes.trim() ? updateInfo.releaseNotes : null) ||
await parseRelevantChangelogNotes(currentVersion, nextVersion);
state.pendingUpdate = available ? { version: nextVersion, metadata: payload, electronUpdate: updateResult } : null;
state.pendingUpdate = available ? { version: nextVersion, electronUpdate: updateResult } : null;
return {
available,
currentVersion,
@@ -3071,7 +3059,7 @@ const handleInvoke = async (browserWindow, command, args = {}) => {
body: body || null,
date:
(typeof updateInfo?.releaseDate === 'string' && updateInfo.releaseDate) ||
(typeof payload?.pub_date === 'string' ? payload.pub_date : null),
null,
};
}
+8 -16
View File
@@ -24,8 +24,8 @@ const macosMajor = Number.parseInt(macosMajorRaw, 10);
// Remote UIs still need it so isDesktopShell() returns true and the
// window renders with desktop affordances (DesktopHostSwitcher,
// title bar offsets, etc.). Expose unconditionally.
// - __TAURI__ is the IPC channel to the main process. The compatibility
// shim is exposed broadly, but privileged commands are gated in main.mjs.
// - __OPENCHAMBER_DESKTOP__ is the IPC channel to the main process. It is
// exposed broadly, but privileged commands are gated in main.mjs.
// Local-only globals below stay limited to packaged UI / exact localOrigin.
// Everything driven by localOrigin (home dir, macOS hints) also stays
// local-only since it leaks info about the Electron host machine.
@@ -136,21 +136,13 @@ ipcRenderer.on('openchamber:emit', (_evt, payload) => {
dispatchNativeEvent(event, payload.detail);
});
// __TAURI__ is exposed on all pages; the main-process gate in
// The desktop bridge is exposed on all pages; the main-process gate in
// ipcMain.handle('openchamber:invoke') decides per-command what is safe
// for non-local callers (window/host-switcher ops yes, file/shell ops
// no). See COMMANDS_SAFE_FOR_REMOTE in main.mjs.
contextBridge.exposeInMainWorld('__TAURI__', {
core: {
invoke: (cmd, args) => ipcRenderer.invoke('openchamber:invoke', cmd, args || {}),
},
dialog: {
open: (options) => ipcRenderer.invoke('openchamber:dialog:open', options || {}),
},
shell: {
open: (url) => ipcRenderer.invoke('openchamber:invoke', 'desktop_open_external_url', { url }),
},
event: {
listen: async (event, handler) => addListener(event, handler),
},
contextBridge.exposeInMainWorld('__OPENCHAMBER_DESKTOP__', {
invoke: (cmd, args) => ipcRenderer.invoke('openchamber:invoke', cmd, args || {}),
openDialog: (options) => ipcRenderer.invoke('openchamber:dialog:open', options || {}),
openExternal: (url) => ipcRenderer.invoke('openchamber:invoke', 'desktop_open_external_url', { url }),
listen: async (event, handler) => addListener(event, handler),
});