Skip to content

(CODUX-119) Add desktop update and window-control bridge - #2697

Merged
numnx merged 1 commit into
feature/CODUX-187-fix-system-barfrom
task/feature-codux-187-fix-system-bar-t01-codex-mrc2soc1
Jul 8, 2026
Merged

(CODUX-119) Add desktop update and window-control bridge#2697
numnx merged 1 commit into
feature/CODUX-187-fix-system-barfrom
task/feature-codux-187-fix-system-bar-t01-codex-mrc2soc1

Conversation

@numnx

@numnx numnx commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Add desktop update and window-control bridge

Automated task PR opened by Code UX for T01.

📋 Summary

Sprint: Sprint 187 · Fix System Bar · Task: T01

Restore the Electron desktop system bar so it is visible in the app, shows the Code UX version, exposes an update action, and reliably supports maximize/restore by double-clicking the bar.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.5

⏱️ Timing

Started 2026-07-08 12:50:18 UTC
Finished 2026-07-08 12:57:57 UTC
Duration 7m 40s

📊 Token Usage

Metric Value
Input tokens 71,174
Cached input tokens 1,255,808
Output tokens 8,483
Total tokens 1,335,465
Invocations 1
Tool calls 47
Active time 4m 29s

Included usage estimate (subscription/local login): $1.24

✅ QA Review

⏳ QA review runs after this PR is opened. Check the task card in the dashboard for the outcome once it lands.

📝 Full Task Prompt
## Objective
Add the missing desktop bridge contract needed by the renderer system bar: a safe update action that opens the documented releases page and a testable maximize/restore helper used by Electron IPC.

## Scope
- Create `src/electron/window-controls.ts`
- Edit `src/electron/main.ts`
- Edit `src/electron/preload.ts`
- Edit `dashboard/src/electron-api.d.ts`
- Create `tests/backend/electron/window-controls.test.ts`
- Relevant symbols: `ipcMain.handle("codeux:window-toggle-maximize")`, `ipcMain.handle("codeux:window-state")`, `contextBridge.exposeInMainWorld("codeUxDesktop", ...)`, `CodeUxWindowApi`

## Implementation Requirements
1. Add a small testable helper module in `src/electron/window-controls.ts` that toggles a BrowserWindow-like target between maximized and restored states and returns the resulting `isMaximized` boolean.
2. Update `src/electron/main.ts` so the `codeux:window-toggle-maximize` IPC handler delegates to the helper, preserves current minimize/close/state behavior, and still returns `true` after maximizing and `false` after restoring.
3. Add an IPC handler such as `codeux:open-updates` that opens `https://github.com/codeux-ai/codeux/releases/latest` via Electron `shell.openExternal` and returns whether the request was accepted.
4. Expose the update action through `src/electron/preload.ts` on `window.codeUxDesktop.openUpdates()` without exposing arbitrary URL opening or Node/Electron access.
5. Update `dashboard/src/electron-api.d.ts` so dashboard code can call the new update action with strict TypeScript types.
6. Cover the maximize/restore helper and update URL helper/constant with focused backend tests that use fake window and shell-like objects rather than launching Electron.

## Constraints
- Do not add `electron-updater` or any new dependency; the current documented update flow is GitHub Releases.
- Do not expose a generic external URL opener to the renderer.
- Preserve existing window state persistence, fullscreen state reporting, zoom IPC, and directory picker behavior.
- Keep Electron renderer Node access disabled and continue using the narrow preload bridge.

## Verification
- Run `pnpm run test:backend -- tests/backend/electron/window-controls.test.ts tests/backend/electron/dashboard-network-policy.test.ts`.
- Run `pnpm run lint`.
- Success means the helper restores/maximizes deterministically, the update action targets the official releases URL, and existing Electron network policy tests still pass.
🌿 Branch Info

Base: feature/CODUX-187-fix-system-bar
Head: task/feature-codux-187-fix-system-bar-t01-codex-mrc2soc1


🤖 Generated by Code UX

@numnx
numnx merged commit e612613 into feature/CODUX-187-fix-system-bar Jul 8, 2026
6 checks passed
@numnx
numnx deleted the task/feature-codux-187-fix-system-bar-t01-codex-mrc2soc1 branch July 8, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant