Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.
Rust agentai-agentapplecomputer-usecomputer-use-agentcontainerizationcuadesktop-automationhacktoberfestlumemacosmanusoperatorswiftvirtualizationvirtualization-frameworkwindowswindows-sandbox
docs(cua-driver): align cursor gallery with runtime badges (#2818)
Francesco Bonaccid21e3447f9b0
diff --git a/docs/content/docs/how-to-guides/driver/personalize-cursor.mdx b/docs/content/docs/how-to-guides/driver/personalize-cursor.mdxindex efa3301bcc..74d7c4fee0 100644--- a/docs/content/docs/how-to-guides/driver/personalize-cursor.mdx+++ b/docs/content/docs/how-to-guides/driver/personalize-cursor.mdx@@ -16,7 +16,7 @@ The cursor helps a person follow an agent. It is not a security indicator,consent prompt, or proof that an action succeeded.</Callout>-+## Select a theme for a session@@ -56,6 +56,8 @@ action is active and fade independently from the session name. They are drawnby Cua Driver, so their meaning stays consistent across themes and operatingsystems.++The old `set_agent_cursor_style` operation and its `cursor_id`, shape, color,label, size, opacity, image-path, gradient, and bloom styling fields have beenremoved. (`cursor_id` may still appear on input-delivery tools where it names a@@ -80,8 +82,6 @@ author, and license. It preserves paths and strokes as vectors, so the nativerenderer can draw them at the current display scale instead of enlarging afixed-resolution image.--Validate, compile, inspect, and preview the source:```bashdiff --git a/docs/public/img/cua-driver/cursor-themes/delivery-target-context.gif b/docs/public/img/cua-driver/cursor-themes/delivery-target-context.gifdeleted file mode 100644index bf72322bb8..0000000000Binary files a/docs/public/img/cua-driver/cursor-themes/delivery-target-context.gif and /dev/null differdiff --git a/libs/cua-driver/rust/crates/cursor-overlay/examples/export_gallery_frames.rs b/libs/cua-driver/rust/crates/cursor-overlay/examples/export_gallery_frames.rsindex 51657088ea..e0300b06a4 100644--- a/libs/cua-driver/rust/crates/cursor-overlay/examples/export_gallery_frames.rs+++ b/libs/cua-driver/rust/crates/cursor-overlay/examples/export_gallery_frames.rs@@ -2,106 +2,135 @@ use cursor_overlay::{render_frame, CursorAction, CursorConfig, DeliveryModifier, OverlayCommand, RenderStateCore,TargetModifier,};-use std::{fs, path::Path};+use std::{+ fs,+ path::{Path, PathBuf},+};const SIZE: u32 = 256;const FPS: u32 = 30;const DURATION_SECS: u32 = 4;const PREVIEW_BACKING_SCALE: f32 = 1.5;+const RUNTIME_SESSION_LABEL: &str = "Research";-fn main() {- let output = std::env::args()- .nth(1)- .expect("usage: export_gallery_frames <output-directory>");- let output = Path::new(&output);+#[derive(Clone, Copy)]+struct GalleryState {+ action: CursorAction,+ delivery: Option<DeliveryModifier>,+ target: Option<TargetModifier>,+ session_label: Option<&'static str>,+}- let mut states = Vec::new();- for action in CursorAction::ALL {- states.push((- output.join("actions").join(action.as_str()),- action,- None,- None,- ));+#[cfg(test)]+fn runtime_state() -> GalleryState {+ GalleryState {+ action: CursorAction::Observe,+ delivery: Some(DeliveryModifier::Background),+ target: Some(TargetModifier::Browser),+ session_label: Some(RUNTIME_SESSION_LABEL),}+}- for (name, delivery, target) in [- ("background", Some(DeliveryModifier::Background), None),- ("foreground", Some(DeliveryModifier::Foreground), None),- ("ax", None, Some(TargetModifier::Ax)),- ("pixel", None, Some(TargetModifier::Pixel)),- ("browser", None, Some(TargetModifier::Browser)),- ("desktop", None, Some(TargetModifier::Desktop)),- ] {- states.push((- output.join("modifiers").join(name),- CursorAction::Idle,- delivery,- target,- ));+const DELIVERIES: [Option<DeliveryModifier>; 3] = [+ None,+ Some(DeliveryModifier::Background),+ Some(DeliveryModifier::Foreground),+];++const TARGETS: [Option<TargetModifier>; 5] = [+ None,+ Some(TargetModifier::Ax),+ Some(TargetModifier::Pixel),+ Some(TargetModifier::Browser),+ Some(TargetModifier::Desktop),+];++fn delivery_slug(delivery: Option<DeliveryModifier>) -> &'static str {+ match delivery {+ None => "none",+ Some(DeliveryModifier::Background) => "background",+ Some(DeliveryModifier::Foreground) => "foreground",}+}- states.push((- output.join("combined").join("foreground-pixel-click"),- CursorAction::Click,- Some(DeliveryModifier::Foreground),- Some(TargetModifier::Pixel),- ));+fn target_slug(target: Option<TargetModifier>) -> &'static str {+ match target {+ None => "none",+ Some(TargetModifier::Ax) => "ax",+ Some(TargetModifier::Pixel) => "pixel",+ Some(TargetModifier::Browser) => "browser",+ Some(TargetModifier::Desktop) => "desktop",+ }+}++fn preview_slug(state: GalleryState) -> String {+ format!(+ "{}--{}--{}",+ state.action.as_str(),+ delivery_slug(state.delivery),+ target_slug(state.target),+ )+}++fn preview_states(output: &Path) -> Vec<(PathBuf, GalleryState)> {+ let mut states = Vec::with_capacity(CursorAction::ALL.len() * DELIVERIES.len() * TARGETS.len());+ for action in CursorAction::ALL {+ for delivery in DELIVERIES {+ for target in TARGETS {+ let state = GalleryState {+ action,+ delivery,+ target,+ session_label: Some(RUNTIME_SESSION_LABEL),+ };+ states.push((output.join("previews").join(preview_slug(state)), state));+ }+ }+ }+ states+}+fn export_states(states: Vec<(PathBuf, GalleryState)>) {+ let worker_count = std::thread::available_parallelism()+ .map(usize::from)+ .unwrap_or(4)+ .min(12)+ .min(states.len().max(1));+ let chunk_size = states.len().div_ceil(worker_count);std::thread::scope(|scope| {- for (path, action, delivery, target) in states {- scope.spawn(move || export_state(&path, action, delivery, target));+ for chunk in states.chunks(chunk_size) {+ scope.spawn(move || {+ for (path, state) in chunk {+ export_state(path, *state);+ }+ });}});- export_session_badge(&output.join("session").join("badge"));}-fn export_session_badge(output: &Path) {- fs::create_dir_all(output).expect("create session badge frame output");- for frame in 0..FPS * DURATION_SECS {- let mut config = CursorConfig::default();- config.cursor_id = "gallery-session".into();- let mut core = RenderStateCore::new(config);- core.motion.idle_hide_ms = 0.0;- core.pos = (- f64::from(SIZE) / (2.0 * f64::from(PREVIEW_BACKING_SCALE)),- 64.0,- );- core.apply_command_base(- OverlayCommand::SetSessionLabel("Research".into()),- false,- false,- );- core.apply_command_base(- OverlayCommand::BeginAction {- action: CursorAction::Observe,- delivery: Some(DeliveryModifier::Background),- target: Some(TargetModifier::Browser),+fn main() {+ let output = std::env::args()+ .nth(1)+ .expect("usage: export_gallery_frames <output-directory>");+ let output = Path::new(&output);++ let mut states = Vec::new();+ for action in CursorAction::ALL {+ states.push((+ output.join("actions").join(action.as_str()),+ GalleryState {+ action,+ delivery: None,+ target: None,+ session_label: None,},- false,- false,- );- core.tick_motion(f64::from(frame) / f64::from(FPS));- let pixmap = render_frame(&core, SIZE, SIZE, 0.0, 0.0, None, PREVIEW_BACKING_SCALE);- let pixels = unpremultiply_rgba(pixmap.data().to_vec());- image::save_buffer_with_format(- output.join(format!("{frame:04}.png")),- &pixels,- SIZE,- SIZE,- image::ColorType::Rgba8,- image::ImageFormat::Png,- )- .expect("write session badge frame");+ ));}+ export_states(states);+ export_states(preview_states(output));}-fn export_state(- output: &Path,- action: CursorAction,- delivery: Option<DeliveryModifier>,- target: Option<TargetModifier>,-) {+fn export_state(output: &Path, state: GalleryState) {fs::create_dir_all(output).expect("create frame output");for frame in 0..FPS * DURATION_SECS {let mut config = CursorConfig::default();@@ -113,11 +142,18 @@ fn export_state(f64::from(SIZE) / (2.0 * f64::from(PREVIEW_BACKING_SCALE)),);core.heading = f64::from(std::f32::consts::FRAC_PI_4);+ if let Some(session_label) = state.session_label {+ core.apply_command_base(+ OverlayCommand::SetSessionLabel(session_label.into()),+ false,+ false,+ );+ }core.apply_command_base(OverlayCommand::BeginAction {- action,- delivery,- target,+ action: state.action,+ delivery: state.delivery,+ target: state.target,},false,false,@@ -137,6 +173,36 @@ fn export_state(}}+#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn runtime_preview_uses_the_complete_production_composition() {+ let state = runtime_state();+ assert_eq!(state.action, CursorAction::Observe);+ assert_eq!(state.delivery, Some(DeliveryModifier::Background));+ assert_eq!(state.target, Some(TargetModifier::Browser));+ assert_eq!(state.session_label, Some(RUNTIME_SESSION_LABEL));+ }++ #[test]+ fn preview_inventory_covers_every_runtime_combination_once() {+ let root = Path::new("gallery");+ let states = preview_states(root);+ assert_eq!(states.len(), 12 * 3 * 5);++ let slugs = states+ .iter()+ .map(|(_, state)| preview_slug(*state))+ .collect::<std::collections::BTreeSet<_>>();+ assert_eq!(slugs.len(), states.len());+ assert!(slugs.contains("observe--background--browser"));+ assert!(slugs.contains("idle--none--none"));+ assert!(slugs.contains("system--foreground--desktop"));+ }+}+fn unpremultiply_rgba(mut pixels: Vec<u8>) -> Vec<u8> {for pixel in pixels.chunks_exact_mut(4) {let alpha = u16::from(pixel[3]);diff --git a/libs/cua-driver/scripts/cursor-gallery.sh b/libs/cua-driver/scripts/cursor-gallery.shindex 7241beba08..8ea10f6841 100755--- a/libs/cua-driver/scripts/cursor-gallery.sh+++ b/libs/cua-driver/scripts/cursor-gallery.sh@@ -28,7 +28,7 @@ export_assets() {--features theme-authoring \-- "$FRAMES_DIR"- for group in actions modifiers combined session; do+ for group in actions previews; domkdir -p "$GENERATED_DIR/$group"for state_dir in "$FRAMES_DIR/$group"/*; dostate=$(basename "$state_dir")@@ -121,11 +121,6 @@ export_docs() {"action-animations" \"$capture_dir/actions" \"$docs_dir/action-animations.gif"- make_gif \- "delivery-target-context" \- "$capture_dir/modifiers" \- "$docs_dir/delivery-target-context.gif"-echo "cursor-gallery: wrote documentation GIFs to $docs_dir"}diff --git a/libs/cua-driver/tools/cursor-gallery/README.md b/libs/cua-driver/tools/cursor-gallery/README.mdindex fe041c7506..8a811163bf 100644--- a/libs/cua-driver/tools/cursor-gallery/README.md+++ b/libs/cua-driver/tools/cursor-gallery/README.md@@ -15,6 +15,9 @@ From the repository root:ffmpeg. It regenerates the public documentation GIFs deterministically from thesame rendered frames.-The gallery keeps action animations and host-rendered delivery and target-badge chips in separate review sections. The generated modifier media is badge-output from the production renderer, not modifier artwork from the theme.+The gallery starts with an interactive production cursor configurator covering+all twelve actions, optional `background` / `foreground` delivery, and optional+`ax` / `pixel` / `browser` / `desktop` targets. It then shows all fifteen badge+context states and the twelve isolated theme-owned action animations. Delivery+and target glyphs appear only in their authoritative runtime location inside+the badge.diff --git a/libs/cua-driver/tools/cursor-gallery/app.js b/libs/cua-driver/tools/cursor-gallery/app.jsindex 1251717c44..8c571e4a38 100644--- a/libs/cua-driver/tools/cursor-gallery/app.js+++ b/libs/cua-driver/tools/cursor-gallery/app.js@@ -13,28 +13,62 @@ const actions = [['system', 'System', 'Managing sessions, permissions, or configuration'],];-const modifiers = [- ['background', 'Background', 'Delivering input without foreground focus'],- ['foreground', 'Foreground', 'Delivering input to the active foreground window'],- ['ax', 'AX', 'Using accessibility semantics'],- ['pixel', 'Pixel', 'Using exact pixel coordinates'],- ['browser', 'Browser', 'Using typed browser control'],- ['desktop', 'Desktop', 'Using native desktop control'],+const deliveries = [+ ['none', 'None'],+ ['background', 'Background'],+ ['foreground', 'Foreground'],];+const targets = [+ ['none', 'None'],+ ['ax', 'AX'],+ ['pixel', 'Pixel'],+ ['browser', 'Browser'],+ ['desktop', 'Desktop'],+];++const contexts = deliveries.flatMap(([delivery]) =>+ targets.map(([target]) => ({ delivery, target })),+);const tones = ['light', 'dark', 'blue'];let playing = true;-let backgroundMode = 'mixed';+let backgroundMode = 'dark';++function labelFor(options, value) {+ return options.find(([id]) => id === value)?.[1] ?? value;+}++function previewState(action, delivery, target) {+ return `${action}--${delivery}--${target}`;+}++function previewPath(action, delivery, target) {+ return `./generated/previews/${previewState(action, delivery, target)}.webm`;+}-function card([id, label, description], index, group) {+function contextLabel(delivery, target) {+ if (delivery === 'none' && target === 'none') return 'Session only';+ if (target === 'none') return `${labelFor(deliveries, delivery)} only`;+ if (delivery === 'none') return `${labelFor(targets, target)} only`;+ return `${labelFor(deliveries, delivery)} + ${labelFor(targets, target)}`;+}++function contextDescription(delivery, target) {+ if (delivery === 'none' && target === 'none') return 'No execution-context chips';+ if (target === 'none') return 'Filled delivery chip';+ if (delivery === 'none') return 'Outlined target chip';+ return 'Filled delivery · outlined target';+}++function actionCard([id, label, description], index) {const article = document.createElement('article');- article.className = `state-card card-${tones[index % tones.length]}`;+ article.className = `state-card gallery-card card-${tones[index % tones.length]}`;article.tabIndex = 0;article.dataset.index = String(index);article.innerHTML = `<div class="demo">- <video class="cursor-video" src="./generated/${group}/${id}.webm"- data-group="${group}" data-state="${id}"+ <video class="cursor-video" src="./generated/actions/${id}.webm"+ data-group="actions" data-state="${id}"autoplay loop muted playsinline aria-hidden="true"></video></div><div class="card-copy">@@ -45,50 +79,127 @@ function card([id, label, description], index, group) {return article;}-function render() {- const actionGrid = document.querySelector('#actions-grid');- const modifierGrid = document.querySelector('#modifiers-grid');- actions.forEach((state, index) => actionGrid.append(card(state, index, 'actions')));- modifiers.forEach((state, index) => modifierGrid.append(card(state, index, 'modifiers')));+function contextCard({ delivery, target }, index) {+ const state = previewState('observe', delivery, target);+ const article = document.createElement('article');+ article.className = `state-card context-card gallery-card card-${tones[index % tones.length]}`;+ article.tabIndex = 0;+ article.dataset.index = String(index);+ article.innerHTML = `+ <div class="demo">+ <video class="cursor-video" src="${previewPath('observe', delivery, target)}"+ data-group="previews" data-state="${state}"+ autoplay loop muted playsinline aria-hidden="true"></video>+ </div>+ <div class="card-copy">+ <h3>${contextLabel(delivery, target)}</h3>+ <p>${contextDescription(delivery, target)}</p>+ </div>+ `;+ return article;}function videos() {return [...document.querySelectorAll('.cursor-video')];}+function selectedSpeed() {+ return Number(document.querySelector('#speed').value);+}++function playAtCurrentSettings(video) {+ video.playbackRate = selectedSpeed();+ if (playing) void video.play().catch(() => {});+ else video.pause();+}++function updateRuntimePreview() {+ const action = document.querySelector('#preview-action').value;+ const delivery = document.querySelector('#preview-delivery').value;+ const target = document.querySelector('#preview-target').value;+ const actionLabel = labelFor(actions, action);+ const deliveryLabel = labelFor(deliveries, delivery);+ const targetLabel = labelFor(targets, target);+ const context = contextLabel(delivery, target);+ const state = previewState(action, delivery, target);+ const video = document.querySelector('#runtime-preview');+ const nextPath = previewPath(action, delivery, target);++ document.querySelector('#runtime-combination').textContent =+ `${actionLabel} · ${deliveryLabel} · ${targetLabel}`;+ document.querySelector('#runtime-preview-title').textContent = `${actionLabel} · ${context}`;+ document.querySelector('#anatomy-action').textContent = `${actionLabel} animation`;+ document.querySelector('#anatomy-delivery').textContent =+ delivery === 'none' ? 'No delivery chip' : `Filled ${deliveryLabel.toLowerCase()} chip`;+ document.querySelector('#anatomy-target').textContent =+ target === 'none' ? 'No target chip' : `Outlined ${targetLabel.toLowerCase()} chip`;+ video.dataset.state = state;+ video.setAttribute('aria-label', `${actionLabel} cursor with ${context.toLowerCase()}`);++ if (video.getAttribute('src') !== nextPath) {+ video.setAttribute('src', nextPath);+ video.load();+ }+ playAtCurrentSettings(video);+}++function updateCardTones() {+ document.querySelectorAll('.gallery-card').forEach((element) => {+ element.classList.remove('card-light', 'card-dark', 'card-blue');+ const index = Number(element.dataset.index);+ const tone = backgroundMode === 'mixed' ? tones[index % tones.length] : backgroundMode;+ element.classList.add(`card-${tone}`);+ });+}++function render() {+ const actionSelect = document.querySelector('#preview-action');+ actions.forEach(([id, label]) => {+ const option = document.createElement('option');+ option.value = id;+ option.textContent = label;+ option.selected = id === 'observe';+ actionSelect.append(option);+ });++ const contextGrid = document.querySelector('#contexts-grid');+ contexts.forEach((context, index) => contextGrid.append(contextCard(context, index)));++ const actionGrid = document.querySelector('#actions-grid');+ actions.forEach((state, index) => actionGrid.append(actionCard(state, index)));++ updateCardTones();+ updateRuntimePreview();+ document.documentElement.dataset.galleryVideoCount = String(videos().length);+}+document.querySelector('#play-toggle').addEventListener('click', (event) => {playing = !playing;event.currentTarget.textContent = playing ? 'Pause' : 'Play';- videos().forEach((video) => {- if (playing) void video.play();- else video.pause();- });+ videos().forEach(playAtCurrentSettings);});document.querySelector('#replay').addEventListener('click', () => {videos().forEach((video) => {video.currentTime = 0;- if (playing) void video.play();+ playAtCurrentSettings(video);});});-document.querySelector('#speed').addEventListener('change', (event) => {- const speed = Number(event.currentTarget.value);- videos().forEach((video) => {- video.playbackRate = speed;- });+document.querySelector('#speed').addEventListener('change', () => {+ videos().forEach(playAtCurrentSettings);});document.querySelector('#background-toggle').addEventListener('click', (event) => {- const options = ['mixed', 'light', 'dark', 'blue'];+ const options = ['dark', 'mixed', 'light', 'blue'];+ const labels = { dark: 'Dark', mixed: 'Mixed', light: 'Light', blue: 'Brand' };backgroundMode = options[(options.indexOf(backgroundMode) + 1) % options.length];- event.currentTarget.textContent = backgroundMode[0].toUpperCase() + backgroundMode.slice(1);- document.querySelectorAll('.state-card').forEach((element) => {- element.classList.remove('card-light', 'card-dark', 'card-blue');- const index = Number(element.dataset.index);- const tone = backgroundMode === 'mixed' ? tones[index % tones.length] : backgroundMode;- element.classList.add(`card-${tone}`);- });+ event.currentTarget.textContent = labels[backgroundMode];+ updateCardTones();+});++document.querySelectorAll('.preview-controls select').forEach((select) => {+ select.addEventListener('change', updateRuntimePreview);});render();diff --git a/libs/cua-driver/tools/cursor-gallery/capture-gallery.mjs b/libs/cua-driver/tools/cursor-gallery/capture-gallery.mjsindex 03657c594a..09f436ed88 100644--- a/libs/cua-driver/tools/cursor-gallery/capture-gallery.mjs+++ b/libs/cua-driver/tools/cursor-gallery/capture-gallery.mjs@@ -55,7 +55,6 @@ async function evaluate(expression, awaitPromise = false) {}await fs.mkdir(path.join(outputRoot, 'actions'), { recursive: true });-await fs.mkdir(path.join(outputRoot, 'modifiers'), { recursive: true });await command('Page.enable');await command('Runtime.enable');await command('Emulation.setDeviceMetricsOverride', {@@ -70,7 +69,8 @@ await evaluate(const deadline = Date.now() + 15000;const ready = () => {const videos = [...document.querySelectorAll(".cursor-video")];- if (videos.length === 19 && videos.every((video) => video.readyState >= 2)) resolve(true);+ const expected = Number(document.documentElement.dataset.galleryVideoCount);+ if (Number.isFinite(expected) && videos.length === expected && videos.every((video) => video.readyState >= 2)) resolve(true);else if (Date.now() > deadline) reject(new Error("Timed out waiting for videos"));else setTimeout(ready, 50);};@@ -93,7 +93,6 @@ await evaluate(`(() => {})()`);const clips = await evaluate(`(() => {- const sections = [...document.querySelectorAll(".gallery-section")];const clipFor = (section, bottomPadding) => {const heading = section.querySelector(".section-heading").getBoundingClientRect();const grid = section.querySelector(".state-grid").getBoundingClientRect();@@ -105,7 +104,9 @@ const clips = await evaluate(`(() => {height: Math.ceil(grid.bottom - heading.top + 28 + bottomPadding)};};- return { actions: clipFor(sections[0], 28), modifiers: clipFor(sections[1], 14) };+ return {+ actions: clipFor(document.querySelector('[data-capture-group="actions"]'), 28)+ };})()`);for (let frame = 0; frame < fps * duration; frame += 1) {diff --git a/libs/cua-driver/tools/cursor-gallery/index.html b/libs/cua-driver/tools/cursor-gallery/index.htmlindex f30a25b352..c652630ff2 100644--- a/libs/cua-driver/tools/cursor-gallery/index.html+++ b/libs/cua-driver/tools/cursor-gallery/index.html@@ -9,13 +9,17 @@</head><body><main class="page-shell">+ <div class="brand-bar" aria-label="Cua Driver cursor lab">+ <span class="brand-wordmark">cua</span>+ <span class="brand-surface">Driver · Cursor lab</span>+ </div><header class="hero"><div><p class="eyebrow">CUA.DEFAULT · EXACT RENDERER PREVIEW</p>- <h1>Session-colored semantic motion</h1>+ <h1>Session-colored <span class="accent">semantic motion.</span></h1><p class="lede">- Exact frames from the Cua Driver native renderer. Every state keeps the shared floating- motion, with its semantic animation layered on top.+ Exact frames from the Cua Driver native renderer. Build a production composition, compare+ every badge context, then inspect the action artwork that makes it up.</p></div><div class="controls" aria-label="Animation controls">@@ -30,80 +34,95 @@<option value="2">2×</option></select></label>- <button id="background-toggle" type="button">Mixed</button>+ <button id="background-toggle" type="button">Dark</button></div></header>- <section class="gallery-section" aria-labelledby="actions-title">+ <section id="runtime-preview-section" class="runtime-section" aria-labelledby="runtime-title"><div class="section-heading"><div>- <p class="section-count">12 states</p>- <h2 id="actions-title">Action animations</h2>- </div>- <p>Hover or focus a card to bring its motion forward.</p>- </div>- <div id="actions-grid" class="state-grid"></div>- </section>-- <section class="gallery-section" aria-labelledby="modifiers-title">- <div class="section-heading">- <div>- <p class="section-count">6 context chips</p>- <h2 id="modifiers-title">Delivery and target context</h2>+ <p class="section-count">Production runtime</p>+ <h2 id="runtime-title">Build the final cursor</h2></div>- <p>Host-rendered context chips can appear together with any action.</p>+ <p>Choose action, delivery, and target semantics to preview the exact native overlay.</p></div>- <div id="modifiers-grid" class="state-grid"></div>- <article class="combined-card">- <div>- <p class="section-count">Combined state</p>- <h3>Foreground click at an exact pixel</h3>- <p>The filled delivery chip comes first, followed by the outlined target chip.</p>+ <article class="runtime-card">+ <div class="runtime-copy">+ <p id="runtime-combination" class="section-count">Observe · Background · Browser</p>+ <h3 id="runtime-preview-title">One cursor, every combination</h3>+ <p>+ The action animates around the pointer while the attached badge carries session+ identity and optional execution context. Every selectable result below is exported+ by the production Rust renderer.+ </p>+ <div class="preview-controls" aria-label="Final cursor preview controls">+ <label>+ <span>Action</span>+ <select id="preview-action" aria-label="Preview action"></select>+ </label>+ <label>+ <span>Delivery</span>+ <select id="preview-delivery" aria-label="Preview delivery">+ <option value="none">None</option>+ <option value="background" selected>Background</option>+ <option value="foreground">Foreground</option>+ </select>+ </label>+ <label>+ <span>Target</span>+ <select id="preview-target" aria-label="Preview target">+ <option value="none">None</option>+ <option value="ax">AX</option>+ <option value="pixel">Pixel</option>+ <option value="browser" selected>Browser</option>+ <option value="desktop">Desktop</option>+ </select>+ </label>+ </div></div>- <div class="demo">+ <div class="runtime-demo demo"><video+ id="runtime-preview"class="cursor-video"- src="./generated/combined/foreground-pixel-click.webm"- data-group="combined"- data-state="foreground-pixel-click"+ src="./generated/previews/observe--background--browser.webm"+ data-group="previews"+ data-state="observe--background--browser"autoplayloopmutedplaysinline></video></div>- <div class="legend">- <span>○ Foreground delivery</span>- <span>□ Pixel target</span>+ <div class="runtime-anatomy" aria-label="Runtime cursor anatomy">+ <div><span class="anatomy-index">1</span><span><strong>Pointer and action</strong><span id="anatomy-action">Observe animation</span></span></div>+ <div><span class="anatomy-index">2</span><span><strong>Session</strong>Research</span></div>+ <div><span class="anatomy-index">3</span><span><strong>Delivery</strong><span id="anatomy-delivery">Filled background chip</span></span></div>+ <div><span class="anatomy-index">4</span><span><strong>Target</strong><span id="anatomy-target">Outlined browser chip</span></span></div></div></article>+ </section>- <article class="combined-card">+ <section id="badge-contexts" class="gallery-section context-section" aria-labelledby="contexts-title" data-capture-group="contexts">+ <div class="section-heading"><div>- <p class="section-count">Session identity</p>- <h3>Compact label on cursor reveal</h3>- <p>- The session-tinted badge holds for two seconds, then fades while the cursor remains.- </p>- </div>- <div class="demo">- <video- class="cursor-video"- src="./generated/session/badge.webm"- data-group="session"- data-state="badge"- autoplay- loop- muted- playsinline- ></video>+ <p class="section-count">15 badge states</p>+ <h2 id="contexts-title">Every delivery and target combination</h2></div>- <div class="legend">- <span>● Circular session marker</span>- <span>◒ Session-accent gradient</span>+ <p>None, single-chip states, and all eight paired states—always in runtime badge order.</p>+ </div>+ <div id="contexts-grid" class="context-grid"></div>+ </section>++ <section class="gallery-section" aria-labelledby="actions-title" data-capture-group="actions">+ <div class="section-heading">+ <div>+ <p class="section-count">12 states</p>+ <h2 id="actions-title">Action animations</h2></div>- </article>+ <p>Theme-owned action layers are isolated here for visual review.</p>+ </div>+ <div id="actions-grid" class="state-grid"></div></section><footer>diff --git a/libs/cua-driver/tools/cursor-gallery/styles.css b/libs/cua-driver/tools/cursor-gallery/styles.cssindex ba7c89dfbd..b49096b959 100644--- a/libs/cua-driver/tools/cursor-gallery/styles.css+++ b/libs/cua-driver/tools/cursor-gallery/styles.css@@ -1,8 +1,79 @@+@font-face {+ font-family: "Instrument Serif";+ src: url("https://fonts.gstatic.com/s/instrumentserif/v5/jizBRFtNs2ka5fXjeivQ4LroWlx-6zUTjnTLgNs.woff2") format("woff2");+ font-weight: 400;+ font-style: normal;+ font-display: swap;+}++@font-face {+ font-family: "Instrument Serif";+ src: url("https://fonts.gstatic.com/s/instrumentserif/v5/jizHRFtNs2ka5fXjeivQ4LroWlx-6zAjjH7Motmp5g.woff2") format("woff2");+ font-weight: 400;+ font-style: italic;+ font-display: swap;+}++@font-face {+ font-family: "JetBrains Mono";+ src: url("https://fonts.gstatic.com/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxDcwgknk-4.woff2") format("woff2");+ font-weight: 400 600;+ font-style: normal;+ font-display: swap;+}++@font-face {+ font-family: "Urbanist";+ src: url("https://fonts.gstatic.com/s/urbanist/v18/L0xjDF02iFML4hGCyOCpRdycFsGxSrqDyx4fFg.ttf") format("truetype");+ font-weight: 400;+ font-style: normal;+ font-display: swap;+}++@font-face {+ font-family: "Urbanist";+ src: url("https://fonts.gstatic.com/s/urbanist/v18/L0xjDF02iFML4hGCyOCpRdycFsGxSrqD-R4fFg.ttf") format("truetype");+ font-weight: 500;+ font-style: normal;+ font-display: swap;+}++@font-face {+ font-family: "Urbanist";+ src: url("https://fonts.gstatic.com/s/urbanist/v18/L0xjDF02iFML4hGCyOCpRdycFsGxSrqDFRkfFg.ttf") format("truetype");+ font-weight: 600;+ font-style: normal;+ font-display: swap;+}++@font-face {+ font-family: "Urbanist";+ src: url("https://fonts.gstatic.com/s/urbanist/v18/L0xjDF02iFML4hGCyOCpRdycFsGxSrqDLBkfFg.ttf") format("truetype");+ font-weight: 700;+ font-style: normal;+ font-display: swap;+}+:root {- --ink: #15171b;- --muted: #61646b;- --paper: #e9e9e5;- --line: rgba(21, 23, 27, 0.11);+ color-scheme: dark;+ --bg-base: #000000;+ --bg-card: #181818;+ --bg-card-hover: #222222;+ --bg-surface: #212121;+ --ink-strong: #f6f8fb;+ --ink-body: rgba(224, 230, 238, 0.84);+ --ink-muted: rgba(164, 173, 187, 0.82);+ --brand: #9fd7ff;+ --brand-soft: #ecf6ff;+ --brand-glow: rgba(159, 215, 255, 0.34);+ --line-soft: rgba(255, 255, 255, 0.12);+ --line-strong: rgba(255, 255, 255, 0.2);+ --radius-card: 10px;+ --radius-card-lg: 24px;+ --radius-pill: 999px;+ --font-display: "Instrument Serif", Georgia, serif;+ --font-body: Urbanist, Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;+ --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;}* {@@ -12,14 +83,13 @@html,body {margin: 0;- color: var(--ink);- background: var(--paper);- font-family:- Inter,- ui-sans-serif,- system-ui,- -apple-system,- sans-serif;+ color: var(--ink-body);+ background: var(--bg-base);+ font-family: var(--font-body);+}++body {+ min-width: 320px;}button,@@ -27,229 +97,442 @@ select {font: inherit;}+button,+select,+.state-card {+ outline: none;+}++button:focus-visible,+select:focus-visible,+.state-card:focus-visible {+ border-color: var(--brand);+ box-shadow: 0 0 0 3px var(--brand-glow);+}+.page-shell {- width: min(1480px, 100%);+ width: min(1280px, 100%);margin: 0 auto;- padding: 66px 62px 38px;+ padding: 30px 48px 42px;+}++.brand-bar {+ display: flex;+ align-items: baseline;+ justify-content: space-between;+ min-height: 54px;+ padding-bottom: 20px;+ border-bottom: 1px solid var(--line-soft);+}++.brand-wordmark {+ color: var(--ink-strong);+ font-size: 23px;+ font-weight: 650;+ letter-spacing: -0.06em;+}++.brand-surface {+ color: var(--ink-muted);+ font: 600 10px/1 var(--font-mono);+ letter-spacing: 0.12em;+ text-transform: uppercase;}.hero {display: grid;grid-template-columns: minmax(0, 1fr) auto;- gap: 44px;+ gap: 48px;align-items: end;- margin-bottom: 58px;+ padding: 76px 0 84px;}.eyebrow,.section-count {- margin: 0 0 12px;- font:- 700 11px/1 ui-monospace,- monospace;- letter-spacing: 0.14em;+ margin: 0 0 20px;+ color: var(--brand);+ font: 600 11px/1 var(--font-mono);+ letter-spacing: 3px;text-transform: uppercase;}+h1,+h2,+h3,+p {+ text-wrap: pretty;+}+h1 {- max-width: 760px;+ max-width: 820px;margin: 0;- font-size: clamp(40px, 5vw, 72px);- font-weight: 650;- letter-spacing: -0.055em;- line-height: 0.98;+ color: var(--ink-strong);+ font: 400 clamp(56px, 6.5vw, 94px) / 0.93 var(--font-display);+ letter-spacing: -3px;+}++.accent {+ color: var(--brand);+ font-style: italic;}.lede {- max-width: 750px;- margin: 22px 0 0;- color: var(--muted);- font-size: 17px;- line-height: 1.55;+ max-width: 720px;+ margin: 28px 0 0;+ color: var(--ink-muted);+ font-size: 18px;+ line-height: 1.65;}.controls {- display: flex;- flex-wrap: wrap;- justify-content: flex-end;- gap: 9px;+ display: grid;+ grid-template-columns: repeat(2, max-content);+ overflow: hidden;+ border: 1px solid var(--line-soft);+ border-radius: var(--radius-card);}.controls button,.controls label {- min-height: 42px;- border: 1px solid var(--line);- border-radius: 12px;- background: rgba(255, 255, 255, 0.62);+ min-height: 46px;+ border: 0;+ border-right: 1px solid var(--line-soft);+ border-bottom: 1px solid var(--line-soft);+ background: var(--bg-base);+}++.controls > :nth-child(2n) {+ border-right: 0;+}++.controls > :nth-last-child(-n + 2) {+ border-bottom: 0;}.controls button {- padding: 0 14px;+ padding: 0 18px;+ color: var(--ink-body);cursor: pointer;+ font-size: 13px;+ font-weight: 600;+ transition: color 180ms ease, background 180ms ease;+}++.controls button:hover {+ color: var(--ink-strong);+ background: var(--bg-card);}.controls label {display: flex;align-items: center;- gap: 8px;- padding: 0 8px 0 13px;- color: var(--muted);- font-size: 13px;+ gap: 10px;+ padding: 0 8px 0 16px;+ color: var(--ink-muted);+ font: 600 10px/1 var(--font-mono);+ letter-spacing: 1px;+ text-transform: uppercase;}.controls select {border: 0;- border-radius: 8px;- background: white;- padding: 6px 8px;+ background: var(--bg-surface);+ color: var(--ink-strong);+ padding: 7px 9px;+ font-family: var(--font-body);+ font-size: 12px;}-.gallery-section + .gallery-section {- margin-top: 52px;+.runtime-section,+.gallery-section {+ padding: 84px 0;+ border-top: 1px solid var(--line-soft);}.section-heading {display: flex;justify-content: space-between;- gap: 24px;+ gap: 36px;align-items: end;- margin-bottom: 18px;+ margin-bottom: 32px;}.section-heading h2 {margin: 0;- font-size: 24px;- letter-spacing: -0.025em;+ color: var(--ink-strong);+ font: 400 clamp(38px, 4.6vw, 64px) / 1.02 var(--font-display);+ letter-spacing: -1.5px;}-.section-heading p:last-child {- margin: 0 0 2px;- color: var(--muted);+.section-heading > p:last-child {+ max-width: 420px;+ margin: 0 0 6px;+ color: var(--ink-muted);font-size: 14px;+ line-height: 1.7;}-.state-grid {+.runtime-card {display: grid;- grid-template-columns: repeat(6, minmax(0, 1fr));- gap: 14px;+ grid-template-columns: minmax(280px, 1fr) 330px minmax(245px, 0.72fr);+ gap: 32px;+ align-items: center;+ min-height: 354px;+ padding: 34px;+ overflow: hidden;+ border: 1px solid var(--line-soft);+ border-radius: var(--radius-card);+ background: var(--bg-base);}-.state-card {- min-height: 282px;- border: 1px solid var(--line);- border-radius: 22px;- overflow: hidden;- transition:- transform 180ms ease,- box-shadow 180ms ease;+.runtime-copy h3 {+ max-width: 460px;+ margin: 0 0 16px;+ color: var(--ink-strong);+ font: 400 clamp(32px, 3.4vw, 48px) / 1.02 var(--font-display);+ letter-spacing: -1px;}-.state-card:hover,-.state-card:focus-visible {- transform: translateY(-4px);- box-shadow: 0 18px 44px rgba(25, 31, 38, 0.13);+.runtime-copy > p:last-of-type {+ max-width: 490px;+ margin: 0;+ color: var(--ink-muted);+ font-size: 14px;+ line-height: 1.7;}-.card-light {- background: #fafaf8;+.preview-controls {+ display: grid;+ grid-template-columns: 0.9fr 1.25fr 1fr;+ gap: 0;+ margin-top: 26px;+ overflow: hidden;+ border: 1px solid var(--line-soft);+ border-radius: var(--radius-card);}-.card-dark {- background: #181a1f;- color: white;+.preview-controls label {+ display: grid;+ gap: 7px;+ padding: 11px 12px 12px;+ border-right: 1px solid var(--line-soft);+ color: var(--ink-muted);+ font: 600 9px/1 var(--font-mono);+ letter-spacing: 1.2px;+ text-transform: uppercase;}-.card-blue {- background: #70c3e4;+.preview-controls label:last-child {+ border-right: 0;+}++.preview-controls select {+ width: 100%;+ min-height: 30px;+ border: 0;+ background: var(--bg-base);+ color: var(--ink-strong);+ padding: 0;+ font-family: var(--font-body);+ font-size: 13px;+ font-weight: 600;+ letter-spacing: 0;+ text-transform: none;}.demo {display: grid;place-items: center;- height: 206px;+ height: 190px;overflow: hidden;}.cursor-video {display: block;- /*- * Renderer frames preserve the full 256 px transparent capture canvas.- * The frame exporter renders at 1.5× backing scale. Scale its centered- * 164 px layout box to preserve the enlarged review size after the 256 px- * capture canvas is fitted into the card.- */width: 164px;height: 164px;object-fit: contain;- transform: scale(1.56);+ transform: scale(1.5);transition: transform 180ms ease;}+.runtime-demo {+ height: 286px;+ border: 1px solid var(--line-soft);+ border-radius: var(--radius-card-lg);+ background:+ radial-gradient(circle at 50% 42%, var(--brand-glow), transparent 66%),+ var(--bg-card);+}++.runtime-demo .cursor-video {+ width: 230px;+ height: 230px;+ transform: scale(1.5);+}++.runtime-anatomy {+ display: grid;+ border: 1px solid var(--line-soft);+ border-radius: var(--radius-card);+ overflow: hidden;+}++.runtime-anatomy > div {+ display: grid;+ grid-template-columns: 27px 1fr;+ gap: 11px;+ align-items: center;+ min-height: 64px;+ padding: 10px 13px;+ border-bottom: 1px solid var(--line-soft);+ color: var(--ink-muted);+ font-size: 12px;+}++.runtime-anatomy > div:last-child {+ border-bottom: 0;+}++.runtime-anatomy strong {+ display: block;+ margin-bottom: 3px;+ color: var(--ink-strong);+ font-size: 13px;+}++.anatomy-index {+ display: grid;+ place-items: center;+ width: 26px;+ height: 26px;+ border-radius: var(--radius-pill);+ background: var(--brand);+ color: #07131e;+ font: 600 10px/1 var(--font-mono);+}++.state-grid,+.context-grid {+ display: grid;+ gap: 14px;+}++.state-grid {+ grid-template-columns: repeat(6, minmax(0, 1fr));+}++.context-grid {+ grid-template-columns: repeat(5, minmax(0, 1fr));+}++.state-card {+ min-height: 262px;+ overflow: hidden;+ border: 1px solid transparent;+ border-radius: var(--radius-card);+ background: var(--bg-card);+ transition: border-color 180ms ease, background 180ms ease;+}++.state-card:hover,+.state-card:focus-visible {+ border-color: var(--line-strong);+ background: var(--bg-card-hover);+}+.state-card:hover .cursor-video,.state-card:focus-visible .cursor-video {- transform: scale(1.69);+ transform: scale(1.6);+}++.card-light {+ background: var(--brand-soft);+ color: #07131e;+}++.card-dark {+ background: var(--bg-card);+ color: var(--ink-strong);+}++.card-blue {+ background: var(--brand);+ color: #07131e;}.card-copy {- padding: 0 17px 17px;+ padding: 0 15px 18px;text-align: center;}.card-copy h3 {- margin: 2px 0 7px;- font:- 700 12px/1 ui-monospace,- monospace;- letter-spacing: 0.13em;+ margin: 2px 0 8px;+ color: inherit;+ font: 600 10px/1 var(--font-mono);+ letter-spacing: 1.3px;text-transform: uppercase;}.card-copy p {min-height: 34px;margin: 0;- opacity: 0.58;+ color: inherit;+ opacity: 0.62;font-size: 12px;- line-height: 1.4;+ line-height: 1.5;}-.combined-card {- display: grid;- grid-template-columns: minmax(280px, 1fr) 260px minmax(250px, 0.75fr);- gap: 32px;- align-items: center;- margin-top: 16px;- padding: 28px 34px;- border-radius: 22px;- background: #181a1f;- color: white;+.context-section {+ padding-top: 62px;+ padding-bottom: 84px;}-.combined-card h3 {- margin: 0 0 10px;- font-size: 22px;+.context-section .section-heading {+ margin-bottom: 24px;}-.combined-card p:last-child,-.legend {- color: rgba(255, 255, 255, 0.65);- font-size: 13px;+.context-card {+ min-height: 172px;}-.legend {- display: grid;- gap: 13px;+.context-card .demo {+ height: 118px;+}++.context-card .cursor-video {+ width: 168px;+ height: 168px;+ transform: translateY(-24px) scale(1.08);+}++.context-card:hover .cursor-video,+.context-card:focus-visible .cursor-video {+ transform: translateY(-24px) scale(1.15);+}++.context-card .card-copy {+ padding: 8px 12px 11px;+}++.context-card .card-copy h3 {+ margin-bottom: 6px;+ font-size: 9px;+}++.context-card .card-copy p {+ min-height: 0;+ font-size: 11px;}footer {display: flex;justify-content: space-between;- margin-top: 28px;- padding: 18px 22px;- border: 1px solid var(--line);- border-radius: 16px;- background: rgba(255, 255, 255, 0.56);- color: var(--muted);- font-size: 13px;+ padding: 28px 0 0;+ border-top: 1px solid var(--line-soft);+ color: var(--ink-muted);+ font: 400 10px/1.6 var(--font-mono);+ letter-spacing: 0.5px;}@media (max-width: 1160px) {@@ -257,31 +540,92 @@ footer {grid-template-columns: repeat(4, minmax(0, 1fr));}+ .context-grid {+ grid-template-columns: repeat(3, minmax(0, 1fr));+ }+.hero {grid-template-columns: 1fr;}.controls {- justify-content: flex-start;+ justify-self: start;+ }++ .runtime-card {+ grid-template-columns: minmax(260px, 1fr) 320px;+ }++ .runtime-anatomy {+ grid-column: 1 / -1;+ grid-template-columns: repeat(4, minmax(0, 1fr));+ }++ .runtime-anatomy > div {+ border-right: 1px solid var(--line-soft);+ border-bottom: 0;+ }++ .runtime-anatomy > div:last-child {+ border-right: 0;}}@media (max-width: 760px) {.page-shell {- padding: 40px 18px 26px;+ padding: 24px 20px 30px;+ }++ .brand-bar {+ min-height: 48px;+ }++ .hero,+ .runtime-section,+ .gallery-section {+ padding: 58px 0;}.state-grid {grid-template-columns: repeat(2, minmax(0, 1fr));}+ .context-grid,+ .preview-controls {+ grid-template-columns: 1fr;+ }+.section-heading,- .combined-card {+ .runtime-card {+ display: grid;grid-template-columns: 1fr;}.section-heading {align-items: start;+ }++ .preview-controls label {+ border-right: 0;+ border-bottom: 1px solid var(--line-soft);+ }++ .preview-controls label:last-child {+ border-bottom: 0;+ }++ .runtime-anatomy {+ grid-column: auto;+ grid-template-columns: 1fr;+ }++ .runtime-anatomy > div {+ border-right: 0;+ border-bottom: 1px solid var(--line-soft);+ }++ footer {flex-direction: column;+ gap: 8px;}}