Skip to content

feat(shell): frameless window chrome + custom titlebar + theming#390

Open
patschmittdev wants to merge 1 commit into
refactor/ui-foundationfrom
feat/app-chrome
Open

feat(shell): frameless window chrome + custom titlebar + theming#390
patschmittdev wants to merge 1 commit into
refactor/ui-foundationfrom
feat/app-chrome

Conversation

@patschmittdev

Copy link
Copy Markdown
Collaborator

What

The shell window-frame + theming chrome layer, split off feat/webgl-ambient-background onto the refactor/ui-foundation base (#389). Stacks as a sibling of voice (#387) and ambient (#386).

Contents (15 files, +356/-52)

Custom titlebar

  • AppTitlebar.tsx (new, +169): in-renderer min/max/close + animated day/night toggle for the frameless Windows window. macOS keeps native traffic lights.

Frameless window + window controls

  • main.ts: frame:false on non-mac (white bg, app menu hidden); window controls act on the sender window (fixes popout close-to-tray); set-theme IPC (no-op, renderer-driven).
  • ipc/mind.ts, preload.ts, ipc-channels.ts, env.d.ts: desktop.window (minimize/maximize/close) + desktop.setTheme typing and channels.

No-flash theming

  • index.html: pre-paint theme-init <script> resolves stored/system theme before first paint.
  • sessionSecurity.ts: CSP script-src allowlists that inline script by exact sha256 hash. Security note for review: this is the only CSP change; it is scoped to the theme hash and is INVARIANT-pinned by sessionSecurity.test.ts, which recomputes the hash against index.html (any drift fails the test). Voice CSP stays on the voice branch.

Store

  • lifecycleReducer + state.ts: previousView for the lens back-button (+ tests).

Polish: AuthScreen, A2ARelayView.

Intentional: mount wiring deferred

AppTitlebar is not mounted in AppShell here. The AppShell / ViewRouter / ActivityBar feature-mounts (AmbientCanvas / ChatroomSessionPanel / UpdateBanner / titlebar / ...) are the documented final reconciliation once the verticals land, so AppShell does not become a conflict magnet across every sibling slice.

Stack

master
 └─ refactor/ui-foundation #389
     |- voice    #387
     |- ambient  #386
     `- app-chrome  (this)

Validation

  • npm run lint -- green (tsc, eslint, dependency-cruiser 521 modules / 0 violations, yaml, md).
  • Tests -- 145 passed (sessionSecurity.test.ts CSP-hash invariant + lifecycle reducer.test.ts).

Split the feature-independent app-chrome out of feat/webgl-ambient-background
onto the ui-foundation base. This is the shell window-frame + theming layer,
without the AppShell/ViewRouter/ActivityBar feature-mount wiring (that is the
final integration step once the feature branches land).

- AppTitlebar: custom in-renderer titlebar (min/max/close + theme toggle) for
  the frameless Windows window; macOS keeps native traffic lights
- main.ts / ipc/mind.ts: frameless BrowserWindow on non-mac (frame:false,
  white background, app menu hidden); window controls act on the sender window
  (fixes popout close-to-tray); set-theme IPC (no-op, renderer-driven titlebar)
- sessionSecurity: inline theme-init <script> allowed by exact sha256 hash
  (INVARIANT-pinned by a test that recomputes it against index.html), so the
  pre-paint theme resolve doesn't trip the CSP. Voice CSP/permission lives on
  the voice branch; only the theme hash is here.
- index.html: pre-paint theme-init script (no light/dark flash)
- store: AppState.previousView + lifecycleReducer lens back-button (+ 4 tests)
- preload/env: desktop.setTheme + desktop.window typing
- polish: AuthScreen, A2ARelayView

Shared-infra (idempotent, also on feat/ambient-canvas): tsconfig.base module
commonjs -> esnext so the theme-hash test's import.meta.url type-checks.

Scope notes: MindSidebar is intentionally NOT included -- its final state pulls
in chatroom-session creation + agent accent color, so it belongs to the
integration step, not chrome. The AppShell/ViewRouter/ActivityBar feature mounts
(AmbientCanvas/ChatroomSessionPanel/UpdateBanner/AddAgentsView/UpdateIndicator)
are the documented final reconciliation when all branches merge.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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