Galaxy Shell / docs
Docs / Decisões e planos

Visual effects, 3D and shaders (the part that did not land)

openspec/changes/visual-effects-3d-shaders/design.md · Editar no GitHub ↗

Esta página ainda não tem tradução em português. O conteúdo abaixo está em inglês.

Este documento registra decisões, planejamento ou evidências de uma etapa do projeto. Não implica que todos os itens estejam implementados ou validados na versão atual.

Nesta página

Visual effects, 3D and shaders (the part that did not land)

The landed part and the current rules are in openspec/specs/visual-effects-3d-shaders/spec.md. The sections below are the original text of the doc, unchanged.

Proposed experiments

  1. Discreet procedural background: an aurora or light field that responds to the waiting, working and finished states. This is the first experiment with a shader and a measured GPU cost.
  2. Overview with depth: web cards with perspective and parallax, accompanied by live thumbnails composited in Smithay. Share geometry and animation progress between the layers to avoid misalignment.
  3. Window to thumbnail transition: start with scale and opacity. Then investigate curvature or dissolve. Consuming the click to restore the window during the deformed presentation avoids forwarding wrong clicks to the application.

The suggested initial set is an aurora background, subtle depth in the overview and a fluid transition to the thumbnail. A fully 3D desktop is a later investigation, with a higher cost in rendering and interaction.

Future implementation and validation

Organize effects in modules with typed parameters for intensity, duration and colors. Respect reduced motion, pause invisible animations and offer a static presentation when needed. Measure GPU time, dropped frames and latency under real load before expanding the effects.

Compositor shaders are reviewed trusted code. Generated HTML stays in opaque iframes, with no privileged tools and no access to application textures. Changes to the trusted host require a rebuild. CSS customization keeps the existing read_ui/replace_ui flow and recovery.

In the initial record, no effect had been implemented and no benchmark had been run. The first aurora implementation is described below, with its evidence and limits. Proof in the browser does not validate the composition of real windows: keep browser, Electron and Smithay evidence separate. Future tests in the shared session follow the project's coordination and recovery rules.

Technical references

Later direction: workspace preview with the title below

After evaluating the card tilt, the project owner asked to replace it with a workspace preview with the title below. At first the owner chose to refresh on open, and then explicitly corrected the cadence to about one refresh per second while the overview is open. This direction replaces the parallax presentation described above.

The implementation must get real pixels of the applications from Smithay, without switching the user's workspace, focus or layout to capture them. The path is an on-demand, limited offscreen render of 384x216, with private transport to the core and delivery only to the authenticated host. The title and the controls stay web. Images are volatile. They do not enter the history, the profile or Git.

The refresh is limited to visible cards and does not overlap requests. Closing the overview or hiding the page stops new requests and discards late responses. The buffers used are the latest available from the applications. A client that suspends its own updates can keep showing the last frame. The geometry of an inactive workspace is the last known one. The shell conversation, bar, panels and cursor stay out of the image, to avoid showing a wrong conversation or recursively capturing the overview itself. Without applications, the UI shows an empty state.

The capability requires a new compositor process. Updating files and reloading only the host does not add this capability to the Smithay that is already open. The delivery must tell apart tested code, preparation for the next login and real activation. An existing session must not be ended without an explicit request.

Preview implementation and evidence

The private command workspace_preview requests an image of a specific workspace, without switching workspace, focus, client geometry or stacking. The compositor composites the latest real buffers into a 384x216 EGL renderbuffer. In the focus layout it uses the selected application. In the other layouts it keeps the composition by the known geometries. The wallpaper stays behind. The state reports capability, generation, workspace, dimensions and ready/pending/empty/error. There is a limit of one pending capture and twelve requests per second. A private PPM holds the workspace and generation in the header and is published by rename. The core validates size, file type, signature and generation before converting to PNG.

POST /api/workspace-previews requires the existing authentication, accepts up to twelve distinct IDs of open conversations and does not store images. The UI selects the visible cards and runs at a target cadence of one second with no overlapping requests. It keeps the last valid frame on transient failures and cancels/discards late responses when it closes, hides or leaves the page. The title sits below the 16:9 image. The previous tilt was removed. The protected field in the overview and the existing selection shortcuts were preserved.

2026-11-01 update (performance record): workspace_preview takes an optional if_changed, and the state reports capabilities.workspacePreviewUnchanged and workspacePreview.unchanged. The compositor keeps a scene signature (output size, focus selection and, for each non-shell window of the workspace in stacking order, its id, commit count with the commits of its popups, minimized and floating state, location, drawn size, buffer size, the surface and position of each popup and, while it lasts, the progress of the opening reveal; the wallpaper is not part of it) for the last image it published for each workspace. A request with if_changed for a workspace with the same signature renders and writes nothing and answers unchanged: true; the core then returns the image it cached for that workspace (same compositor instance, at most 30 s since the last real read of the image, also when that read gave the same pixels; dropped after any failed read, cancel, empty or closed workspace). An empty workspace renders and writes nothing. A request that ends unchanged does not count against the twelve requests per second. The core accepts a batch when at least 800 ms passed since the start of the last one, so the one second cadence of the host with timer jitter is not refused. The overview dialog and its backdrop have no backdrop-filter.

2026-11-01 update (phase 2 of canvas windows): while the compositor reports capabilities.overviewPlanes, the planes are not failed, the session is unlocked, the settings dialog is closed and the protected setting overviewPlanes is on (the default), the Electron host shows live planes instead of the PNG previews. The host reports the image slot of each visible card through POST /api/overview-planes, and the compositor draws each workspace into its slot behind the shell window, from a cached 384x216 texture. The PNG controller does not run then, and a card click zooms with no image: the selection happens at once, as for a card without a valid image. The PNG path above stays the fallback.

Verification: npm ci, format:check, check/build:check and 155 Node tests passed. The compositor passed cargo fmt, 31 Rust tests with session (two EGL tests ignored in the common suite), Clippy with warnings as errors and debug/release builds. The EGL preview test was run explicitly and passed, verifying layer order, pixel orientation and private publishing. The full preparer passed in the dedicated worktree, including installation/native proof of Electron, the host build, the release build for session, and hashes of sources/artifacts. --help and ldd of the release binary also passed.

In the browser, the host with explicitly marked synthetic images was inspected at 1280 and 390 pixels: 16:9 ratio, title below with ellipsis, shortcuts inside the cards and scrolling with no overlap. The requests stayed close to 1s between starts, with at most one in flight. Closing stopped the count, late responses did not reopen the overview and a click selected another conversation. The browser proof is not a capture of real windows. This acceptance still requires the new compositor in the authorized session and a later native inspection. No compositor, host or additional session was started for this implementation. These tests did not update the shared session.

Visual evolution list and next authorized items

The project owner asked to save this list and to implement items 1 and 2 now. Items 4 and 5 were authorized later and have an implementation recorded below. Item 6 has a first implementation, recorded at the end of this document. Item 3 was explicitly rejected on 2026-10-28 and must not be implemented:

  1. Preview zoom into the workspace: when a card is selected, the real preview image grows until it fills the desktop area and hands the presentation to the chosen workspace.
  2. Transition between workspaces: the surfaces slide during navigation, with continuous movement that follows the gesture. Shortcuts use an equivalent short transition.
  3. Rejected: dragging windows between cards. The project owner decided that this feature must never be implemented, because it does not fit the philosophy of the project. It is not a postponed feature and must not return to the future suggestions. See the product decision.
  4. Glass with real blur: translucent web panels, with the blur of the content behind them done by Smithay.
  5. Minimize to the thumbnail: the window visually collapses to its resting position.
  6. Activity on the cards: show agent work, pending approval and finished task based on the real state. See Activity on the overview cards.

The authorization of items 1 and 2 does not authorize ending the session in use. Publishing, preparing and activating the new compositor remain separate steps.

Zoom and slide implementation

The zoom lives in the protected host. A copy of the card's real PNG grows from the preview rectangle to the viewport in about 220 ms. The authenticated selection happens after this movement and keeps the image on screen until it finishes. Cards without a valid image, and reduced motion, go directly to the selection. Escape before sending, resize, scrolling and a hidden page cancel the movement. After sending, the visual cleanup does not simulate undoing a selection that is already confirmed. Message sending is blocked during the switch, and drafts stay linked to the original conversation.

In the initial implementation, the slide used real application buffers at output resolution, with source and destination planes clipped by the compositor. The chat, bar, web panels and cursor stayed shared and fixed. The fixed web layer was corrected on 2026-10-28, according to the updated contract below. The three-finger gesture follows the horizontal displacement. Only when it completes does it go through validation of origin, neighbor and order revision in the core. Shortcuts use a short transition. Reduced motion turns the animation off and keeps the navigation. The core keeps selection and persistence transactional. Selection failures restore the previous workspace, while a visual timeout never changes the persisted conversation on its own.

The order comes from the open conversations, including non-consecutive IDs, and has a revision to reject old gestures. The contract adds typed commands for order and for the motion preference. The capability announced by the compositor keeps compatibility with earlier versions. The host preference follows prefers-reduced-motion. The new compositor starts without animation until it receives it. None of these commands is exposed to generated HTML.

The project owner later confirmed to keep the current graphical session and to activate afterward. The delivery of this step is limited to code, validation, publishing and isolated preparation. The session in use and its applications must stay open.

Zoom and transition evidence

npm ci, format:check, check/build:check and the 166 Node tests passed. The Python suite for installation and recovery passed with 45 tests. Gesture selection is also tested with reduced motion, sparse order, an old revision and a persistence failure. The commands keep the previous format when the backend does not announce the new capability.

The host inspection in an isolated browser used synthetic PNGs that were explicitly marked. It confirmed expansion from the card area to the viewport, no selection before the end of the animation, the enlarged image kept during a late response and a single selection after repeated clicks. Escape, resize and hiding before sending canceled without a selection. An HTTP failure cleared the overlay and released sending. Reduced motion and a missing preview selected directly. Normal drafts and application search drafts kept sending blocked during the switch, and returning to the original conversation restored its draft. The QA processes were closed and the captures stayed outside Git.

This browser proof does not confirm Electron/Smithay in the physical session. The offscreen EGL tests verify composition and clipping with synthetic layers, without opening another compositor. Confirmation of the physical gesture, of the real windows and of the integrated zoom stays pending until the user authorizes a future activation.

Native validation passed with 44 tests in both the default configuration and with session. Four EGL tests that are ignored in the common suite were run explicitly and passed, including the split of the planes in both directions, pixel orientation, transparency and the fixed layer. Clippy with warnings as errors and the default/session builds passed. The full preparer produced the optimized release build with session, verified native Electron, the React bundle, the host checks and the hashes of sources/artifacts. The release binary answered --help and all shared libraries were resolved in the configured environment.

The active checkout and its processes were not replaced. The new source is published to main and prepared in this worktree. It does not automatically update the next configured login. A future activation must rediscover the session, get coordination.lock, synchronize the active folder only if it is clean, prepare the build and use supervision/rollback before any authorized shutdown. Until then, there is no physical proof of the gesture or of the new transitions in this session.