feat(ui): WebGL ambient background with day/night crossfade#386
Open
patschmittdev wants to merge 1 commit into
Open
feat(ui): WebGL ambient background with day/night crossfade#386patschmittdev wants to merge 1 commit into
patschmittdev wants to merge 1 commit into
Conversation
Add a full-viewport WebGL ambient background that crossfades between a deep-forest night palette and a near-white day palette whenever the document theme flips, and gently breathes the genesis aurora while an agent is streaming. The render loop runs only during the ~450ms theme morph and the activity breathe, then parks, so an idle window costs nothing. Falls back to a static CSS .app-ambient gradient when WebGL is unavailable, and honors prefers-reduced-motion. - AmbientCanvas owns the GL context, theme observer, and parked rAF loop; ambientScene holds the shader and transition math (pure, unit-tested). - AppShell mounts the canvas behind a z-10 content layer and drives the breathe from streamingByMind / a2aStreamingByMind. - Align tsconfig.base.json module to esnext (tsc is --noEmit only; Vite owns emit) so the import.meta.hot HMR block type-checks under the root tsconfig. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
67e369d to
80ceb68
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a full-viewport WebGL ambient background to the app shell. It crossfades between a deep-forest night palette and a near-white day palette whenever the theme flips, and gently breathes the genesis aurora while an agent is streaming. The render loop runs only during the ~450ms theme morph and the activity breathe, then parks, so an idle window costs nothing. When WebGL is unavailable it falls back to a static CSS
.app-ambientgradient, and it honorsprefers-reduced-motion.Changes
AmbientCanvas.tsx): owns the GL context, the theme observer (watches the.darkclass), and a parked rAF loop; caps device-pixel-ratio at 1.5; disposes safely under React StrictMode.ambientScene.ts): pure shader + transition math (THEME_MS, vertex/fragment shaders,easeInOut,themeTarget), unit-tested in jsdom.z-10content layer and drives the breathe fromstreamingByMind/a2aStreamingByMind..app-ambientstatic fallback gradient (self-contained oklch, no token dependencies).vite/clientreference so theimport.meta.hotHMR block type-checks under the root tsconfig.module: commonjs->esnext. Required forimport.metato be legal undertsc --noEmit, andcommonjsalready conflicted with themoduleResolution: bundlerset in the same file.tscis--noEmitonly here (Vite/esbuild own all emit), so this affects type-checking semantics, not output.Test evidence
npm run lint: clean (tsc + eslint + dependency-cruiser 515 modules / 0 violations + yaml + markdown).npm run typecheck: clean (exit 0).npm test: 2001 passed / 1 failed. The single failure isMindProfileService > rejects symlinked profile files, which fails atfs.symlinkSync(...)withEPERM: operation not permitted. That is a Windows symlink-privilege limitation (requires Developer Mode), not a test assertion. The file is untouched by this branch and the test passes in CI on Linux.Notes