diff --git a/packages/electron/README.md b/packages/electron/README.md index 3c53f510..c4bcb7bd 100644 --- a/packages/electron/README.md +++ b/packages/electron/README.md @@ -170,6 +170,10 @@ Use an explicit override when testing a different OpenCode CLI build or when a u ## Native Features Owned Here - Floating Mini Chat windows. +- Mini Chat loads from the resolved local UI origin in HMR development, not the + API server origin. Bundled mode keeps `openchamber-ui://` assets. Native zoom + targets the focused window directly; composer focus adjusts interface scale, + while terminal and file-editor focus adjust their own font sizes. - New Mini Chat windows default to the managed Chats target. Explicit project/worktree drafts retain their target, existing managed chat sessions reopen in their own directory, and the compact header omits project/branch metadata for Chats. Opening a managed draft back in the main window preserves that target. - Multiple native windows. - Native notifications. diff --git a/packages/electron/main.mjs b/packages/electron/main.mjs index acc378d0..f65e2d90 100644 --- a/packages/electron/main.mjs +++ b/packages/electron/main.mjs @@ -258,6 +258,7 @@ const { autoUpdater } = updaterPkg; const state = { serverHandle: null, sidecarUrl: null, + localUiUrl: null, localOrigin: null, apiBaseUrl: null, clientToken: null, @@ -2755,7 +2756,7 @@ const createAdditionalWindow = async (url, runtimeConfig = {}) => { const buildMiniChatUrl = ({ mode, sessionId, directory, projectId }) => { const base = shouldUsePackagedUi() ? buildPackagedUiUrl('/mini-chat.html') - : state.localOrigin || state.sidecarUrl; + : state.localUiUrl || state.localOrigin || state.sidecarUrl; if (!base) { throw new Error('Local UI is not available'); } @@ -2970,6 +2971,7 @@ const resolveInitialUrl = async () => { : localUrl; state.sidecarUrl = localUrl; + state.localUiUrl = localUiUrl; const localAvailable = Boolean(localUrl); const localOrigin = localUrl ? new URL(localUrl).origin : null;