fix(desktop): load Mini Chat from the resolved HMR UI

Mini Chat used the API origin in HMR mode and could load the server auth page instead of the local application. Retain the resolved local UI URL and use it for Mini Chat windows.

Verified native menu zoom in main and Mini Chat windows in isolated HMR and bundled Electron profiles; Electron syntax checks passed.
This commit is contained in:
Bohdan Triapitsyn
2026-09-09 18:49:15 +03:00
parent 796eaa9546
commit 35635c0082
2 changed files with 7 additions and 1 deletions
+4
View File
@@ -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.
+3 -1
View File
@@ -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;