diff --git a/.claude/skills/maui-devflow-debug/SKILL.md b/.claude/skills/maui-devflow-debug/SKILL.md index b5d378c9..001a3409 100644 --- a/.claude/skills/maui-devflow-debug/SKILL.md +++ b/.claude/skills/maui-devflow-debug/SKILL.md @@ -1,7 +1,12 @@ --- name: maui-devflow-debug description: >- - Run DevFlow inspect-and-fix loops for MAUI apps. USE FOR: launch, device selection, agent recovery, broker/port/adb, tree/screenshot, Blazor CDP, iterative UI debugging. DO NOT USE FOR: first-time setup or non-MAUI automation. INVOKES: `maui devflow`, `dotnet`, `adb`, `simctl`. + Run DevFlow inspect-and-fix loops for MAUI apps. USE FOR: launch, device + selection, agent recovery, broker/port/adb, tree/screenshot, Blazor CDP, and + iterative UI debugging. DO NOT USE FOR: first-time setup or non-MAUI + automation. INVOKES: DevFlow `maui_*` MCP tools when available; `maui + devflow` CLI as fallback; `dotnet`, `adb`, and `simctl` for build, deployment, + and connectivity work. --- # DevFlow Debug diff --git a/.claude/skills/maui-devflow-debug/references/ios-and-mac.md b/.claude/skills/maui-devflow-debug/references/ios-and-mac.md index 362dcbe4..09d3cf18 100644 --- a/.claude/skills/maui-devflow-debug/references/ios-and-mac.md +++ b/.claude/skills/maui-devflow-debug/references/ios-and-mac.md @@ -229,12 +229,14 @@ the standard error envelope: ### Pre-grant permissions (prevents dialogs from appearing) **Prefer the `maui` CLI** — `maui apple simulator privacy` now wraps `simctl privacy` -(the `bundle-id` is optional, so you can grant for all apps), and `maui devflow ui permission` -drives it for the agent-detected simulator: +(the `bundle-id` is optional, so you can grant for all apps). For +`maui devflow ui permission`, pass `--udid` to target the intended simulator. +Without it, the command selects the first booted simulator, not the simulator +associated with the connected agent. ```bash maui apple simulator privacy grant location --bundle-id com.company.appid maui apple simulator privacy grant photos # all apps (no bundle id) -maui devflow ui permission grant location --bundle-id com.company.appid +maui devflow ui permission grant location --udid --bundle-id com.company.appid ``` Raw `xcrun simctl` fallback (only if the `maui` CLI is unavailable): diff --git a/.claude/skills/maui-devflow-debug/references/linux.md b/.claude/skills/maui-devflow-debug/references/linux.md index e6feabd4..5da6192f 100644 --- a/.claude/skills/maui-devflow-debug/references/linux.md +++ b/.claude/skills/maui-devflow-debug/references/linux.md @@ -1,10 +1,10 @@ # Linux / GTK Platform Guide -Platform-specific setup and usage for .NET MAUI apps running on Linux via Maui.Gtk (GTK4). +Platform-specific setup and usage for .NET MAUI apps running on Linux via Microsoft.Maui.Platforms.Linux.Gtk4. ## Overview -Maui.Gtk apps target `net10.0` (not a platform-specific TFM like `net10.0-ios`) and use +Microsoft.Maui.Platforms.Linux.Gtk4 apps target `net10.0` (not a platform-specific TFM like `net10.0-ios`) and use GTK4 via GirCore bindings. MAUI DevFlow provides dedicated Linux packages that work with this architecture. @@ -45,18 +45,20 @@ builder.AddMauiBlazorDevFlowTools(); // Blazor Hybrid only ### Application Startup -The agent must be started after the MAUI Application is available. In your GTK app -startup (e.g., `GtkMauiApplication.OnActivate` or equivalent): +`AddMauiDevFlowAgent()` starts automatically on the GTK thread after the first window is +created. Use the current `Microsoft.Maui.Platforms.Linux.Gtk4` backend, not the superseded +`Platform.Maui.Linux.Gtk4` packages. No manual call is required. + +An explicit hook is available in a `GtkMauiApplication.OnStarted()` override: ```csharp +protected override void OnStarted() +{ + base.OnStarted(); #if DEBUG -app.StartDevFlowAgent(); - -// For Blazor Hybrid, wire CDP to the agent: -var blazorService = app.Handler?.MauiContext?.Services - .GetService(); -blazorService?.WireBlazorCdpToAgent(); + this.StartDevFlowAgent(); #endif +} ``` ## Building and Running @@ -131,7 +133,7 @@ Only the driver backend should reach for `xdotool` or `ydotool`. | NuGet packages | `Agent`, `Blazor` | `Agent.Gtk`, `Blazor.Gtk` | | TFM | `net10.0-` | `net10.0` | | Build command | `dotnet build -f $TFM -t:Run` | `dotnet run --project ` | -| Agent startup | Automatic (lifecycle hook) | Manual (`app.StartDevFlowAgent()`) | +| Agent startup | Automatic (lifecycle hook) | Automatic (first GTK window created) | | Network | Varies by platform | Direct localhost | | Screenshots | `VisualDiagnostics` | GTK `WidgetPaintable` → `Texture.SaveToPng()` | | Native tap | Platform gesture system | `Gtk.Widget.Activate()` | @@ -143,8 +145,8 @@ Only the driver backend should reach for `xdotool` or `ydotool`. ### Agent Not Starting -1. Ensure `app.StartDevFlowAgent()` is called after the app is activated -2. Check that `Application.Current` is available when `StartDevFlowAgent()` runs +1. Ensure `builder.AddMauiDevFlowAgent()` is called and the host uses `Microsoft.Maui.Platforms.Linux.Gtk4` +2. For explicit startup, call `this.StartDevFlowAgent()` from `GtkMauiApplication.OnStarted()`, not `CreateMauiApp()` 3. Verify the port isn't in use: `lsof -i :` or `ss -tlnp | grep ` ### xdotool / ydotool Not Working diff --git a/.claude/skills/maui-devflow-debug/references/setup.md b/.claude/skills/maui-devflow-debug/references/setup.md index 2c51cc68..4ba2e8c6 100644 --- a/.claude/skills/maui-devflow-debug/references/setup.md +++ b/.claude/skills/maui-devflow-debug/references/setup.md @@ -105,16 +105,9 @@ builder.AddMauiBlazorDevFlowTools(); // Blazor Hybrid only #endif ``` -After the MAUI app is activated (e.g., in `OnActivate` or after `Application.Current` is available): - -```csharp -#if DEBUG -app.StartDevFlowAgent(); -// For Blazor, wire CDP to agent: -var blazorService = app.Handler?.MauiContext?.Services.GetService(); -blazorService?.WireBlazorCdpToAgent(); -#endif -``` +With `Microsoft.Maui.Platforms.Linux.Gtk4`, builder registration starts the agent automatically +after the first window is created. For an explicit host hook, call `this.StartDevFlowAgent()` +from `GtkMauiApplication.OnStarted()`. See [linux.md](linux.md). **Agent options:** - `Port` — HTTP port for the agent REST API (default: 9223). Also configurable via `.mauidevflow` or `-p:MauiDevFlowPort=XXXX`. @@ -300,7 +293,7 @@ For an AI agent setting up MAUI DevFlow in a new project: 5. [ ] Chobitsu auto-injected via JS initializer (Blazor Hybrid — no manual step needed) 6. [ ] Mac Catalyst entitlements include `network.server` (Mac Catalyst only) 7. [ ] `adb reverse tcp:19223` for broker + `adb forward tcp:` for agent (Android only) -8. [ ] Linux/GTK: `app.StartDevFlowAgent()` called after app activation +8. [ ] Linux/GTK: current `Microsoft.Maui.Platforms.Linux.Gtk4` backend and GTK agent registered 9. [ ] macOS (AppKit): `UseMauiAppMacOS()`, `AddMacOSEssentials()`, `MacOSBlazorWebView` — see [macos.md](macos.md) 10. [ ] Verify with `maui devflow list` and `maui devflow ui status` diff --git a/.claude/skills/maui-devflow-debug/references/troubleshooting.md b/.claude/skills/maui-devflow-debug/references/troubleshooting.md index 4ac272f7..d8af0e87 100644 --- a/.claude/skills/maui-devflow-debug/references/troubleshooting.md +++ b/.claude/skills/maui-devflow-debug/references/troubleshooting.md @@ -14,7 +14,7 @@ Always pass `--json` to any `maui` command an agent will parse, and `--ci` for non-interactive failure-fast runs. The full `--json` error envelope contract (schema, code categories, worked examples, PowerShell and Bash consumers) is documented in -[`src/Cli/README.md` — Error envelope](../../../../../src/Cli/README.md#error-envelope). +[`src/Cli/README.md` — Error envelope](https://github.com/dotnet/maui-labs/blob/main/src/Cli/README.md#error-envelope). **Quick reference** — when a non-DevFlow command fails with `--json`, stdout is a top-level JSON object (no `"error"` wrapper). Note: `maui devflow ...` uses a different JSON error shape and writes errors to stderr. diff --git a/.claude/skills/maui-devflow-onboard/SKILL.md b/.claude/skills/maui-devflow-onboard/SKILL.md index 98531f96..7a387ae6 100644 --- a/.claude/skills/maui-devflow-onboard/SKILL.md +++ b/.claude/skills/maui-devflow-onboard/SKILL.md @@ -1,7 +1,14 @@ --- name: maui-devflow-onboard description: >- - Add DevFlow to a MAUI app. USE FOR: package refs, `MauiProgram` registration, Blazor WebView/GTK variants, verification after `maui devflow init`. DO NOT USE FOR: troubleshooting, debugging, UI inspection, or build failures. INVOKES: `maui devflow`, `dotnet`. + Add MAUI DevFlow to a .NET MAUI project with agent package references, + MauiProgram.cs registration, Blazor WebView support, GTK variants, Central + Package Management guidance, and verification commands. USE FOR: first-time + DevFlow setup, reviewing what files to edit, choosing DevFlow packages, or + continuing after `maui devflow init` installs skills. DO NOT USE FOR: + troubleshooting an already-integrated app that cannot connect, iterative app + debugging, UI inspection, or generic MAUI build failures (use + maui-devflow-debug). INVOKES: maui devflow CLI and dotnet CLI. --- # DevFlow Onboard @@ -21,13 +28,6 @@ Use this skill to add MAUI DevFlow to a project after `maui devflow init` has in - If package references and `AddMauiDevFlowAgent()` are already present but the CLI cannot connect, use `maui-devflow-debug`. - If an agent is reachable and the user wants to inspect, tap, screenshot, or debug UI, use `maui-devflow-debug`. -## Optional Session Feedback Nudge - -If onboarding required repeated DevFlow attempts, unclear package/version -workarounds, or a long setup session, ask whether the user wants to run -`maui-devflow-session-review` to summarize friction for MAUI DevFlow product -feedback. Do not run it automatically. - ## Workflow 1. Optionally run `maui devflow skills check` and update bundled skills before editing if it reports `update-available-from-current-cli`. @@ -70,7 +70,7 @@ If verification fails after integration, switch to `maui-devflow-debug` for conn Blazor WebView indicators include a `Microsoft.AspNetCore.Components.WebView.Maui` package reference or `AddMauiBlazorWebView()` in `MauiProgram.cs`. -GTK indicators include package references such as `Maui.Gtk`, `Platform.Maui.Linux.Gtk4`, `GirCore.Gtk-4.0`, or `Platform.Maui.Linux.Gtk4.BlazorWebView`. +GTK indicators include `Microsoft.Maui.Platforms.Linux.Gtk4` or `Microsoft.Maui.Platforms.Linux.Gtk4.BlazorWebView`. Migrate superseded `Platform.Maui.Linux.Gtk4*` references before adding the current GTK DevFlow packages; do not mix the two backends. ## Central Package Management @@ -114,7 +114,7 @@ builder.AddMauiBlazorDevFlowTools(); #endif ``` -For GTK, use the `.Gtk` namespaces and packages. GTK apps also need to start the agent after app activation, for example `app.StartDevFlowAgent()` in the platform app activation flow. +For GTK, use the `.Gtk` namespaces and packages. `AddMauiDevFlowAgent()` starts automatically when `GtkMauiApplication` creates its first window. An explicit `this.StartDevFlowAgent()` hook is also available inside a `GtkMauiApplication.OnStarted()` override; builder registration is still required. For Mac Catalyst, ensure the Debug entitlements allow the in-app HTTP server: @@ -128,12 +128,10 @@ For Mac Catalyst, ensure the Debug entitlements allow the in-app HTTP server: - `MauiProgram.cs` registers DevFlow only in Debug builds. - The app project references the package flavor that matches the target platform. - Blazor DevFlow tools are added only when the app uses Blazor WebView. -- GTK apps start the DevFlow agent after app activation. +- GTK apps use the current backend and start the DevFlow agent automatically after the first window is created. - Mac Catalyst Debug entitlements include `com.apple.security.network.server`. - `dotnet build` succeeds. -- Important controls in the flows you plan to automate have stable `AutomationId`s. - A running app appears in `maui devflow list`. -- `maui devflow agent status` returns the expected app name and platform. - `maui devflow ui tree --depth 1` returns a visual tree. ## References diff --git a/.claude/skills/maui-devflow-onboard/references/package-selection.md b/.claude/skills/maui-devflow-onboard/references/package-selection.md index 13a92649..7c8b8902 100644 --- a/.claude/skills/maui-devflow-onboard/references/package-selection.md +++ b/.claude/skills/maui-devflow-onboard/references/package-selection.md @@ -13,7 +13,7 @@ MAUI indicators: - `true`; - platform TFMs such as `net10.0-android`, `net10.0-ios`, `net10.0-maccatalyst`, or `net10.0-windows10.0.19041.0`; -- GTK package references such as `Maui.Gtk`, `Platform.Maui.Linux.Gtk4`, or `GirCore.Gtk-4.0`. +- GTK package references such as `Microsoft.Maui.Platforms.Linux.Gtk4` or `Microsoft.Maui.Platforms.Linux.Gtk4.BlazorWebView`. Superseded `Platform.Maui.Linux.Gtk4*` references must be migrated, not mixed with the current backend. Blazor WebView indicators: diff --git a/AGENTS.md b/AGENTS.md index d80aa244..493e100d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -264,23 +264,42 @@ Use `@bind:event="oninput"` on inputs for this to work (requires `input` events, The project uses [MAUI DevFlow](https://github.com/dotnet/maui-labs/tree/main/src/DevFlow) from the unified `Microsoft.Maui.Cli` tool for AI-assisted debugging. Broker discovery is preferred; no `.mauidevflow` file is committed in this repo. +Use the current upstream [debugging skill](https://github.com/dotnet/maui-labs/blob/main/.github/skills/maui-devflow-debug/SKILL.md) +and [onboarding skill](https://github.com/dotnet/maui-labs/blob/main/.github/skills/maui-devflow-onboard/SKILL.md) +as the source of truth. The local copies were refreshed from upstream revision +`e626474c39ffa234b88200f8ee5aea99c999d853`; only the troubleshooting link is +adapted to point back to the upstream repository. `maui devflow skills check` +compares against the installed CLI bundle, which may lag upstream `main`. +Prefer DevFlow `maui_*` MCP tools when available; otherwise use the CLI. +Discover the intended app with `wait`/`list`, verify its identity with +`agent status`, and pass its explicit port on subsequent commands. + ```bash -# Always run CLI commands from src/MauiSherpa/ for auto port detection +# Discover the intended Sherpa instance, then use its returned port cd src/MauiSherpa +dotnet maui devflow wait --wait-platform macOS --timeout 30 +dotnet maui devflow list +dotnet maui devflow agent status --agent-port -# Check agent connectivity -dotnet maui devflow ui status - -# Take screenshots -dotnet maui devflow ui screenshot --output screen.png +# Keep genuine HiDPI pixels (the default screenshot command downsamples to 1x) +dotnet maui devflow ui screenshot --agent-port --scale native --output screen.png # Blazor DOM snapshot (best for AI) -dotnet maui devflow webview snapshot +dotnet maui devflow webview snapshot --agent-port -# Inject dark/light mode for testing (avoids navigating to Settings) -dotnet maui devflow webview Runtime evaluate "document.body.classList.remove('theme-light'); document.body.classList.add('theme-dark'); document.querySelector('.main-layout').classList.remove('theme-light'); document.querySelector('.main-layout').classList.add('theme-dark');" +# Screenshot Mode: switch the actual app theme, including native chrome +dotnet maui devflow webview Runtime evaluate \ + "window.sherpaScreenshot.setAppearance('dark')" --agent-port ``` +For website captures, follow [docs/SCREENSHOTS.md](docs/SCREENSHOTS.md). +Once the isolated fixture app is ready, ask the user whether they are ready to +leave it alone for the complete set. Wait for an explicit yes, then wait five +seconds before focusing the window and capturing uninterrupted. Close that +isolated app afterward. Never skip the readiness question or close another +session's app. The runner rejects focus loss instead of publishing an +inconsistent set. + ## CI/CD - **GitHub Actions runner:** `macos-26` (NOT `macos-26-arm64`) diff --git a/build/capture-screenshots.mjs b/build/capture-screenshots.mjs index 8bd1ceea..11bb6b67 100644 --- a/build/capture-screenshots.mjs +++ b/build/capture-screenshots.mjs @@ -1,6 +1,7 @@ #!/usr/bin/env node import { spawn, spawnSync } from 'node:child_process'; import { createInterface } from 'node:readline'; +import { createInterface as createPrompt } from 'node:readline/promises'; import { mkdirSync, readFileSync, writeFileSync } from 'node:fs'; import { dirname, join, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; @@ -18,6 +19,8 @@ const { values } = parseArgs({ timeout: { type: 'string', default: '30' }, width: { type: 'string', default: '1440' }, height: { type: 'string', default: '960' }, + 'pixel-ratio': { type: 'string', default: '2' }, + confirmed: { type: 'boolean', default: false }, 'check-only': { type: 'boolean', default: false }, help: { type: 'boolean', default: false } } @@ -102,6 +105,8 @@ const stateExpression = `JSON.stringify((()=>{ return { diagnostics:diagnostics?{...diagnostics.dataset}:null, route:location.pathname,title:document.querySelector('h1')?.innerText.trim(), + tabs:text('.tabs .tab'), + activeTab:text('.tabs .tab.active')[0]??null, loading:text('.loading-state,.loading-inline,.loading-card,.loading-indicator,.fa-spin,[aria-busy]:not([aria-busy=false])').length, errors:text('.error-bar,.error-message,.error-banner,.environment-error,.alert-danger,#blazor-error-ui'), blurred:Array.from(document.querySelectorAll('.demo-blur')).some(visible), @@ -114,7 +119,7 @@ const stateExpression = `JSON.stringify((()=>{ async function main() { if (values.help) { - console.log('node build/capture-screenshots.mjs --agent-port PORT --platform macos|windows|linux --output DIRECTORY [--theme dark|light|both] [--shots dashboard,doctor] [--check-only] [--width 1440 --height 960]'); + console.log('node build/capture-screenshots.mjs --agent-port PORT --platform macos|windows|linux --output DIRECTORY [--theme dark|light|both] [--shots dashboard,doctor] [--check-only] [--confirmed] [--width 1440 --height 960 --pixel-ratio 2]'); return; } if (!/^\d+$/.test(values['agent-port'] ?? '') || !['macos', 'windows', 'linux'].includes(values.platform) @@ -122,8 +127,11 @@ async function main() { throw new Error('Provide --agent-port, --platform, --output and a valid --theme. Use --help for usage.'); const timeout = Number(values.timeout) * 1000; const width = Number(values.width), height = Number(values.height); + const pixelRatio = Number(values['pixel-ratio']); if (!Number.isFinite(timeout) || timeout <= 0 || !Number.isInteger(width) || !Number.isInteger(height) || width < 800 || height < 600) throw new Error('Use a positive timeout and integer dimensions of at least 800 x 600.'); + if (!Number.isFinite(pixelRatio) || pixelRatio < 1 || !Number.isInteger(width * pixelRatio) || !Number.isInteger(height * pixelRatio)) + throw new Error('Use a pixel ratio of at least 1 that produces integer pixel dimensions.'); const manifest = JSON.parse(readFileSync(join(root, 'website', 'screenshots.json'), 'utf8')); const requested = values.shots?.split(','); const shots = manifest.shots.filter(shot => shot.platforms.includes(values.platform) && (!requested || requested.includes(shot.id))); @@ -139,7 +147,8 @@ async function main() { const report = { revision: git('rev-parse', 'HEAD'), dirty: !!git('status', '--porcelain'), fixture: 'website-v1', platform: values.platform, theme: values.theme, - capturedAt: new Date().toISOString(), requestedDimensions: { width, height }, shots: [] + capturedAt: new Date().toISOString(), requestedDimensions: { width, height }, + pixelRatio, pixelDimensions: { width: width * pixelRatio, height: height * pixelRatio }, shots: [] }; const flow = new DevFlow(values['agent-port'], Math.max(timeout, 30000)); const verify = state => { @@ -147,6 +156,8 @@ async function main() { throw new Error(`Not the requested Screenshot Mode app: ${JSON.stringify(state.diagnostics)}`); if (state.diagnostics.violations !== '0' || state.errors.length || state.remoteResources.length || state.blurred || state.debugMenu || state.sidebarOverflow) throw new Error(`Unsafe capture state: ${JSON.stringify(state)}`); + if (state.diagnostics.interrupted === 'true') + throw new Error('The capture window lost focus. This set is interrupted; rerun it after the user is ready.'); }; const waitFor = async (predicate, label) => { const deadline = Date.now() + timeout; @@ -161,23 +172,59 @@ async function main() { } throw new Error(`Timed out waiting for ${label}: ${JSON.stringify(state)}`); }; + const getCaptureProcessId = async () => { + const response = await fetch(`http://localhost:${values['agent-port']}/api/v1/agent/status`, { signal: AbortSignal.timeout(timeout) }); + if (!response.ok) throw new Error(`Agent status failed (${response.status}).`); + const processId = (await response.json()).app?.processId; + if (!Number.isInteger(processId)) + throw new Error('The DevFlow agent did not report the capture process ID.'); + return processId; + }; + let ownsCapture = false; + let captureProcessId; try { await waitFor(() => true, 'Screenshot Mode initialization'); await flow.command(`MAUI resize ${width} ${height}`); - // The GTK agent's screenshot omits the native header bar, so capture the X11 window instead. - const gtkProcessId = values.platform === 'linux' && !values['check-only'] - ? (await (await fetch(`http://localhost:${values['agent-port']}/api/v1/agent/status`)).json()).app?.processId - : null; - if (values.platform === 'linux' && !values['check-only'] && !Number.isInteger(gtkProcessId)) - throw new Error('The DevFlow agent did not report the GTK process ID.'); + if (values.platform === 'windows') { + captureProcessId = await getCaptureProcessId(); + const result = spawnSync('python', [ + join(root, 'build', 'capture-windows-window.py'), '--pid', String(captureProcessId), + '--prepare', '--width', String(report.pixelDimensions.width), + '--height', String(report.pixelDimensions.height), '--pixel-ratio', String(pixelRatio) + ], { encoding: 'utf8' }); + if (result.status !== 0) throw new Error(result.stderr || result.error?.message || 'Windows window preparation failed'); + } + if (!values['check-only']) { + if (!values.confirmed) { + if (!process.stdin.isTTY) + throw new Error('The app is ready. Ask the user to leave it untouched until capture finishes, then rerun with --confirmed only after they agree.'); + const prompt = createPrompt({ input: process.stdin, output: process.stdout }); + try { + const answer = await prompt.question('The app is ready. Leave the focused window untouched until the full set finishes; it will close afterward. Ready? [yes/no] '); + if (answer.trim().toLowerCase() !== 'yes') + throw new Error('Capture cancelled; no screenshots were taken.'); + } finally { + prompt.close(); + } + } + ownsCapture = true; + captureProcessId ??= await getCaptureProcessId(); + console.log('Starting in 5 seconds. Please leave the app untouched until it closes.'); + await delay(5000); + await flow.evaluate('window.sherpaScreenshot.beginCapture().then(()=>true)'); + } const screenshot = async path => { - if (gtkProcessId === null) { - await flow.command(`MAUI screenshot --output "${path}" --overwrite`); + if (values.platform === 'macos') { + await flow.command(`MAUI screenshot --scale native --output "${path}" --overwrite`); return; } await delay(500); - const result = spawnSync('python3', [join(root, 'build', 'capture-gtk-window.py'), '--pid', String(gtkProcessId), '--output', path], { encoding: 'utf8' }); - if (result.status !== 0) throw new Error(result.stderr || result.error?.message || 'GTK window capture failed'); + const windows = values.platform === 'windows'; + const result = spawnSync(windows ? 'python' : 'python3', [ + join(root, 'build', windows ? 'capture-windows-window.py' : 'capture-gtk-window.py'), + '--pid', String(captureProcessId), '--output', path + ], { encoding: 'utf8' }); + if (result.status !== 0) throw new Error(result.stderr || result.error?.message || 'Native window capture failed'); }; for (const theme of values.theme === 'both' ? ['dark', 'light'] : [values.theme]) { const directory = join(resolve(values.output), values.platform, theme); @@ -188,11 +235,20 @@ async function main() { await waitFor(state => state.diagnostics.theme === theme, 'native and web appearance'); for (const shot of shots) { await flow.evaluate(`(()=>{const a=document.createElement('a');a.href='/${shot.route}';document.body.appendChild(a);a.click();a.remove();return true})()`); - const state = await waitFor( - state => state.route.replace(/\/$/, '') === `/${shot.route}`.replace(/\/$/, '') && state.title?.includes(headings[shot.id]), + let state = await waitFor( + state => state.route.replace(/\/$/, '') === `/${shot.route}`.replace(/\/$/, '') + && state.title?.includes(headings[shot.id]) + && (shot.id !== 'android-sdk' || state.tabs.some(tab => tab.startsWith('Installed ('))), shot.id); + if (shot.id === 'android-sdk') { + const clicked = JSON.parse(await flow.evaluate(`(()=>{const tab=Array.from(document.querySelectorAll('.tabs .tab')).find(e=>e.textContent.trim().startsWith('Installed ('));if(tab)tab.click();return JSON.stringify({clicked:!!tab})})()`)); + if (!clicked.clicked) + throw new Error('The Android SDK Installed tab is unavailable.'); + state = await waitFor(state => state.activeTab?.startsWith('Installed ('), 'Android SDK Installed tab'); + } await flow.evaluate(`document.querySelector('main.content')?.scrollTo(0,0)`); const entry = { id: shot.id, route: shot.route, heading: state.title, diagnostics: state.diagnostics }; + if (shot.id === 'android-sdk') entry.activeTab = state.activeTab; if (!values['check-only']) { const path = join(directory, `${shot.id}.png`); await screenshot(path); @@ -200,8 +256,8 @@ async function main() { if (image.subarray(0, 8).toString('hex') !== '89504e470d0a1a0a') throw new Error(`Not a PNG: ${path}`); entry.width = image.readUInt32BE(16); entry.height = image.readUInt32BE(20); - if (entry.width !== width || entry.height !== height) - throw new Error(`Native screenshot is ${entry.width} x ${entry.height}, not ${width} x ${height}. Check display size/scaling.`); + if (entry.width !== report.pixelDimensions.width || entry.height !== report.pixelDimensions.height) + throw new Error(`Native screenshot is ${entry.width} x ${entry.height}, not ${report.pixelDimensions.width} x ${report.pixelDimensions.height} (${width} x ${height} at ${pixelRatio}x). Use the requested display scale; do not upscale the image.`); entry.file = `${shot.id}.png`; } verify(JSON.parse(await flow.evaluate(stateExpression))); @@ -211,7 +267,26 @@ async function main() { } } } finally { - await flow.close(); + try { + if (ownsCapture) await flow.evaluate('window.sherpaScreenshot.closeCapture().then(()=>true)'); + } finally { + await flow.close(); + } + if (ownsCapture && captureProcessId) { + const deadline = Date.now() + 10000; + let running = true; + while (running && Date.now() < deadline) { + try { + process.kill(captureProcessId, 0); + await delay(100); + } catch (error) { + if (error.code !== 'ESRCH') throw error; + running = false; + } + } + if (running) throw new Error(`The isolated capture app (${captureProcessId}) did not exit after closing.`); + console.log('The isolated capture app has closed.'); + } } } diff --git a/build/capture-windows-window.py b/build/capture-windows-window.py new file mode 100644 index 00000000..98fa9967 --- /dev/null +++ b/build/capture-windows-window.py @@ -0,0 +1,164 @@ +#!/usr/bin/env python3 +"""Capture the foreground Windows compositor frame for an isolated Sherpa process.""" +import argparse +import ctypes +from ctypes import wintypes + +from PIL import ImageGrab + + +class MonitorInfo(ctypes.Structure): + _fields_ = [ + ("size", wintypes.DWORD), + ("monitor", wintypes.RECT), + ("work", wintypes.RECT), + ("flags", wintypes.DWORD), + ] + + +def validate_window(expected_pid, foreground_pid, frame, work_area): + if foreground_pid != expected_pid: + raise RuntimeError("The isolated capture window is not in the foreground.") + left, top, right, bottom = frame + work_left, work_top, work_right, work_bottom = work_area + if (left >= right or top >= bottom or left < work_left or top < work_top + or right > work_right or bottom > work_bottom): + raise RuntimeError("The capture window does not fit within the display's usable area.") + + +def window_placement(outer, frame, work_area, width, height): + work_left, work_top, work_right, work_bottom = work_area + work_width, work_height = work_right - work_left, work_bottom - work_top + if width <= 0 or height <= 0 or width > work_width or height > work_height: + raise RuntimeError("The requested capture frame does not fit within the display's usable area.") + outer_width = width + (outer[2] - outer[0]) - (frame[2] - frame[0]) + outer_height = height + (outer[3] - outer[1]) - (frame[3] - frame[1]) + if outer_width <= 0 or outer_height <= 0: + raise RuntimeError("The capture window has invalid frame dimensions.") + left = work_left + (work_width - width) // 2 - (frame[0] - outer[0]) + top = work_top + (work_height - height) // 2 - (frame[1] - outer[1]) + return left, top, outer_width, outer_height + + +def find_window(user32, pid): + callback_type = ctypes.WINFUNCTYPE(wintypes.BOOL, wintypes.HWND, wintypes.LPARAM) + user32.EnumWindows.argtypes = [callback_type, wintypes.LPARAM] + user32.EnumWindows.restype = wintypes.BOOL + windows = [] + + @callback_type + def visit(window, _): + window_pid = wintypes.DWORD() + if (user32.IsWindowVisible(window) and not user32.GetWindow(window, 4) + and user32.GetWindowThreadProcessId(window, ctypes.byref(window_pid)) + and window_pid.value == pid): + windows.append(window) + return True + + if not user32.EnumWindows(visit, 0): + raise ctypes.WinError(ctypes.get_last_error()) + if len(windows) != 1: + raise RuntimeError(f"Expected one visible capture window for process {pid}, found {len(windows)}.") + return windows[0] + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--pid", type=int, required=True) + mode = parser.add_mutually_exclusive_group(required=True) + mode.add_argument("--output") + mode.add_argument("--prepare", action="store_true") + parser.add_argument("--width", type=int) + parser.add_argument("--height", type=int) + parser.add_argument("--pixel-ratio", type=float) + args = parser.parse_args() + if args.prepare and (args.width is None or args.height is None or args.pixel_ratio is None): + parser.error("--prepare requires --width, --height, and --pixel-ratio") + + user32 = ctypes.WinDLL("user32", use_last_error=True) + dwmapi = ctypes.WinDLL("dwmapi", use_last_error=True) + user32.SetProcessDpiAwarenessContext.argtypes = [wintypes.HANDLE] + user32.SetProcessDpiAwarenessContext.restype = wintypes.BOOL + user32.GetForegroundWindow.restype = wintypes.HWND + user32.GetWindowThreadProcessId.argtypes = [wintypes.HWND, ctypes.POINTER(wintypes.DWORD)] + user32.GetWindowThreadProcessId.restype = wintypes.DWORD + user32.IsWindowVisible.argtypes = [wintypes.HWND] + user32.IsWindowVisible.restype = wintypes.BOOL + user32.GetWindow.argtypes = [wintypes.HWND, wintypes.UINT] + user32.GetWindow.restype = wintypes.HWND + user32.GetWindowRect.argtypes = [wintypes.HWND, ctypes.POINTER(wintypes.RECT)] + user32.GetWindowRect.restype = wintypes.BOOL + user32.GetDpiForWindow.argtypes = [wintypes.HWND] + user32.GetDpiForWindow.restype = wintypes.UINT + user32.IsIconic.argtypes = [wintypes.HWND] + user32.IsIconic.restype = wintypes.BOOL + user32.IsZoomed.argtypes = [wintypes.HWND] + user32.IsZoomed.restype = wintypes.BOOL + user32.SetWindowPos.argtypes = [ + wintypes.HWND, wintypes.HWND, ctypes.c_int, ctypes.c_int, + ctypes.c_int, ctypes.c_int, wintypes.UINT, + ] + user32.SetWindowPos.restype = wintypes.BOOL + user32.MonitorFromWindow.argtypes = [wintypes.HWND, wintypes.DWORD] + user32.MonitorFromWindow.restype = wintypes.HANDLE + user32.GetMonitorInfoW.argtypes = [wintypes.HANDLE, ctypes.POINTER(MonitorInfo)] + user32.GetMonitorInfoW.restype = wintypes.BOOL + dwmapi.DwmGetWindowAttribute.argtypes = [ + wintypes.HWND, wintypes.DWORD, ctypes.c_void_p, wintypes.DWORD, + ] + dwmapi.DwmGetWindowAttribute.restype = ctypes.c_long + + if not user32.SetProcessDpiAwarenessContext(wintypes.HANDLE(-4)): + raise ctypes.WinError(ctypes.get_last_error()) + window = find_window(user32, args.pid) if args.prepare else user32.GetForegroundWindow() + if not window: + raise RuntimeError("No foreground window is available.") + window_pid = wintypes.DWORD() + if not user32.GetWindowThreadProcessId(window, ctypes.byref(window_pid)): + raise ctypes.WinError(ctypes.get_last_error()) + if window_pid.value != args.pid: + raise RuntimeError("The isolated capture window is not in the foreground.") + monitor = user32.MonitorFromWindow(window, 0) + info = MonitorInfo(size=ctypes.sizeof(MonitorInfo)) + if not monitor or not user32.GetMonitorInfoW(monitor, ctypes.byref(info)): + raise ctypes.WinError(ctypes.get_last_error()) + work = (info.work.left, info.work.top, info.work.right, info.work.bottom) + + def frame_bounds(): + frame = wintypes.RECT() + result = dwmapi.DwmGetWindowAttribute(window, 9, ctypes.byref(frame), ctypes.sizeof(frame)) + if result: + raise OSError(f"Could not read the native window frame (HRESULT {result:#x}).") + return frame.left, frame.top, frame.right, frame.bottom + + bounds = frame_bounds() + if args.prepare: + dpi = user32.GetDpiForWindow(window) + if not dpi: + raise ctypes.WinError(ctypes.get_last_error()) + if abs(dpi / 96 - args.pixel_ratio) > 0.000001: + raise RuntimeError(f"The capture window uses {dpi / 96:g}x display scaling, not {args.pixel_ratio:g}x.") + if user32.IsIconic(window) or user32.IsZoomed(window): + raise RuntimeError("Restore the isolated capture window before preparing it.") + outer = wintypes.RECT() + if not user32.GetWindowRect(window, ctypes.byref(outer)): + raise ctypes.WinError(ctypes.get_last_error()) + placement = window_placement( + (outer.left, outer.top, outer.right, outer.bottom), bounds, work, args.width, args.height) + if not user32.SetWindowPos(window, None, *placement, 0x0214): + raise ctypes.WinError(ctypes.get_last_error()) + bounds = frame_bounds() + validate_window(args.pid, window_pid.value, bounds, work) + if (bounds[2] - bounds[0], bounds[3] - bounds[1]) != (args.width, args.height): + raise RuntimeError("Could not resize the native capture frame to the requested dimensions.") + return + + validate_window(args.pid, window_pid.value, bounds, work) + image = ImageGrab.grab(bbox=bounds, all_screens=True, include_layered_windows=True) + if user32.GetForegroundWindow() != window: + raise RuntimeError("The capture window lost focus during the screenshot.") + image.save(args.output) + + +if __name__ == "__main__": + main() diff --git a/build/export-screenshots.py b/build/export-screenshots.py new file mode 100644 index 00000000..14187283 --- /dev/null +++ b/build/export-screenshots.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 +"""Export native screenshots as lossless WebP without resizing. Requires Pillow.""" +import argparse +from pathlib import Path + +from PIL import Image, ImageChops, ImageDraw + + +def clean_windows_frame(image, pixel_ratio): + """Remove the compositor desktop fringe around the Windows 11 window.""" + image = image.convert("RGBA") + width, height = image.size + inset = pixel_ratio + radius = 8 * pixel_ratio + samples = 4 + mask = Image.new("L", (width * samples, height * samples)) + ImageDraw.Draw(mask).rounded_rectangle( + (inset * samples, inset * samples, + (width - inset) * samples - 1, (height - inset) * samples - 1), + radius=radius * samples, fill=255) + mask = mask.resize(image.size, Image.Resampling.BOX) + alpha = ImageChops.multiply(image.getchannel("A"), mask) + # Partially covered compositor pixels already contain desktop color. Replace + # only those edge colors with the adjacent window surface before masking. + for y in range(height): + xs = range(width) if y < inset + radius or y >= height - inset - radius else (0, width - 1) + for x in xs: + coverage = mask.getpixel((x, y)) + if 0 < coverage < 255: + inner_x = min(max(x, inset + radius), width - inset - radius - 1) + inner_y = min(max(y, inset + radius), height - inset - radius - 1) + image.putpixel((x, y), image.getpixel((inner_x, inner_y))) + image.putalpha(alpha) + return image + + +def export_image(source, destination, platform, pixel_ratio=2, logical_size=(1440, 960)): + with Image.open(source) as original: + expected = tuple(value * pixel_ratio for value in logical_size) + if original.size != expected: + raise ValueError(f"{source}: expected {expected} for {pixel_ratio}x, got {original.size}. " + "Recapture at native display scale; do not upscale.") + image = original.convert("RGBA") + if platform == "windows": + image = clean_windows_frame(image, pixel_ratio) + destination.parent.mkdir(parents=True, exist_ok=True) + image.save(destination, "WEBP", lossless=True, exact=True, method=6) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--input", type=Path, required=True) + parser.add_argument("--output", type=Path, required=True) + parser.add_argument("--platform", choices=("macos", "windows", "linux"), required=True) + parser.add_argument("--pixel-ratio", type=int, choices=(1, 2, 3), default=2, + help="Native source scale; 1 is only for cleaning existing legacy assets.") + parser.add_argument("--width", type=int, default=1440) + parser.add_argument("--height", type=int, default=960) + args = parser.parse_args() + sources = sorted(path for path in args.input.iterdir() if path.suffix.lower() in (".png", ".webp")) + if not sources: + parser.error("The input directory contains no PNG or WebP captures.") + if args.width <= 0 or args.height <= 0: + parser.error("Logical dimensions must be positive.") + for source in sources: + destination = args.output / f"{source.stem}.webp" + export_image(source, destination, args.platform, args.pixel_ratio, (args.width, args.height)) + print(f"Exported {destination}") + + +if __name__ == "__main__": + main() diff --git a/docs/SCREENSHOTS.md b/docs/SCREENSHOTS.md index 00fd2b99..24cd05c9 100644 --- a/docs/SCREENSHOTS.md +++ b/docs/SCREENSHOTS.md @@ -29,6 +29,9 @@ All heads start at **1440 × 960 logical pixels**, with a **250-pixel sidebar**, without scrolling. **Debug UI is hidden in Screenshot Mode only.** Ordinary Debug launches retain it. Use a display/workspace large enough for this size; the runner rejects incorrectly sized captures rather than cropping or stretching. +Use **2× native display scale**, producing **2880 × 1920 image pixels** for this +logical window. Increasing the window size or upscaling a 1× file is not a +substitute for high-DPI rendering. Screenshot Mode is separate from **Demo Mode**, which blurs real data. The fixture settings keep Demo Mode off. Fictional labels stay readable; normal @@ -44,47 +47,90 @@ node build/capture-screenshots.mjs --agent-port --platform macos \ --output --theme both ``` +The runner waits for fixture readiness, then asks whether the user is ready to +leave the app untouched until the entire set finishes. After an explicit `yes`, +it waits **five seconds**, focuses the native window, captures the set without +further prompts, and closes the isolated app. Losing focus aborts the set; +do not publish a mixture of active and inactive window chrome. + +An agent must ask with its user-question tool once the app is ready. Only after +the user agrees may it pass `--confirmed` to avoid asking twice. For preparation, +`--check-only --shots dashboard` verifies readiness without taking images, +prompting, or closing the app. Do not pass `--confirmed` based on an earlier run. + Use `windows` or `linux` for those native heads. `--theme both` captures dark and light in one persistent DevFlow batch, avoiding competing mutation leases. `--shots dashboard,doctor` selects views; `--check-only` verifies without saving PNGs. The runner consumes the manifest, verifies the fixture/platform, route, heading, appearance, settled loading, no errors or privacy blur, no remote web resources, no Debug UI link, and no overflowing HTML sidebar before every shot. -Native sidebar visibility must also be reviewed in the actual PNG. +It selects the Installed tab for Android SDK packages. Native sidebar visibility +must also be reviewed in the actual PNG. On Linux, DevFlow's GTK screenshot omits the native header bar, so the runner captures the full X11 window with `build/capture-gtk-window.py` (Python 3 and -Pillow), cropping GTK's client-side shadow. Run the app with `GDK_BACKEND=x11`. +Pillow), cropping GTK's client-side shadow. Run the app with +`GDK_BACKEND=x11 GDK_SCALE=2` and a workspace large enough for 2880 × 1920 +physical pixels. On Windows, the runner uses Python 3 and Pillow to capture the +foreground compositor frame, including the native title bar and WebView2. It +invokes Python as `python`, compensates for invisible Windows resize borders when +sizing the visible frame, and rejects another process's window or a window +outside the display's usable area. +Use 200% display scaling and a sufficiently large display. On macOS, use a Retina +display. Results are `///.png` plus `capture.json`, recording revision, dirty-worktree status, fixture version, platform, theme, and actual -dimensions. Review both appearances; export the dark set as lossless 1× WebP -for the current website. Retain the PNGs and reports outside the repository. +logical dimensions, pixel ratio, and actual pixel dimensions. DevFlow captures +use `--scale native`; its default otherwise downsamples to 1×. +Review both appearances; export the dark set as lossless 2× WebP: + +```bash +python3 build/export-screenshots.py --platform macos \ + --input /macos/dark --output website/images/screenshots/macos +``` + +The exporter preserves full resolution and alpha. For Windows 11 compositor +captures, it removes the one-logical-pixel desktop fringe and masks the native +eight-logical-pixel rounded corners, including decontaminating partially covered +edge pixels. It does not color-key the app content or draw fake window chrome. +`--pixel-ratio 1` is available only for cleaning existing legacy assets; new +website captures must use 2×. Retain the PNGs and reports outside the repository. Do not force-take another DevFlow client's mutation lease. ### Current assets and earlier captures The seventeen macOS website assets now use the reviewed dark `website-v1` -fixture set, captured at 1440 × 960 from the real AppKit window through MAUI -DevFlow. Both dark and light PNG originals were reviewed. Platform capture +fixture set. These captures retain the full 2880 × 1920 Retina pixels from the real +1440 × 960 logical AppKit window through MAUI DevFlow. Both dark and light PNG +originals were reviewed before export. The complete set was captured with the +window focused after user confirmation and the five-second countdown. Platform capture metadata records the base revision and honestly marks the worktree as dirty: -the Screenshot Mode implementation was not committed when captured. +the capture changes were not committed when captured. Older images in the parent screenshots directory remain for the README and detailed guides; they are not substituted for other platforms in the gallery. The fifteen Windows assets use the reviewed dark `website-v1` fixture set from -revision `14c31c1` with a clean worktree. Both dark and light PNG originals -were reviewed. On this Windows setup, the DevFlow screenshot omitted the -WebView and native title bar; capture therefore used the foreground Windows -compositor at 100% display scale, with the DWM visible frame measured at -1440 × 960. DevFlow still provided navigation, appearance, and readiness -checks. The Android SDK capture uses the Installed tab. - -The fifteen Linux assets use the dark `website-v1` fixture set, captured at -1440 × 960 from the real GTK window on Ubuntu 26.04.1 / GNOME Wayland, with the -app running through XWayland (`GDK_BACKEND=x11`) at 1× scale. Both appearances -were reviewed. In the light review set, the Doctor toolbar glyph is not retinted -after the runtime theme switch; the dark website set is unaffected. +revision `94fd78b` with a dirty worktree. Both dark and light PNG originals +and the exported dark images were reviewed. DevFlow provided navigation, +appearance, and readiness checks; capture used the foreground Windows +compositor at 200% display scale, with a 2880 × 1920 DWM visible frame. +The Android SDK capture uses the Installed tab. The exported 2× lossless +WebP assets retain transparent native edges. + +The Windows app was built with the explicitly approved, build-only override +`-p:WindowsSdkPackageVersion=10.0.19041.87`: the default reference pack on +the capture machine supplied WinRT.Runtime 2.2.0, while Sentry.Maui 7.0.1 +required 2.3.1. No repository package versions were changed. + +The fifteen Linux assets use the reviewed dark `website-v1` fixture set, with +the native GTK sidebar and theme-aware toolbar icons from current `main`. +The real GTK window was rendered on Ubuntu 26.04.1 using `GDK_SCALE=2` on an +isolated 3840 × 2160 X11 virtual display (Xvfb, Openbox, and xcompmgr). Both +appearances were reviewed; the exported images retain all 2880 × 1920 native +pixels and the GTK window's transparent edges. The complete set was captured +after user confirmation and the five-second countdown. Capture metadata records +the revision and the dirty worktree used for the runner changes. ## Feature audit @@ -124,8 +170,9 @@ runner captures every cross-platform view at the requested native size. - Use the `id` from the manifest as the filename: `website/images/screenshots//.webp`. Platform keys are `macos`, `windows`, and `linux`. -- Keep PNG originals outside the repository. Export lossless WebP at 1× logical - resolution so text stays sharp without large Retina files. +- Keep PNG originals outside the repository. Export lossless WebP at **2× native + resolution**, preserving alpha and all 2880 × 1920 pixels. Never resize a 1× + source to claim 2× quality. - Use **Screenshot Mode**, not Demo Mode, for new captures. Do not add redaction CSS or replace DOM text. For exceptional captures outside Screenshot Mode, enable Demo Mode and irreversibly mask every identifying label, native account @@ -188,7 +235,7 @@ dotnet maui devflow agent status --agent-port dotnet maui devflow ui resize 1440 960 --agent-port dotnet maui devflow webview Runtime evaluate \ "document.querySelector('a[href=\"dotnet-sdk\"]').click()" --agent-port -dotnet maui devflow ui screenshot --agent-port --output +dotnet maui devflow ui screenshot --agent-port --scale native --output ``` Prefer one persistent `dotnet maui devflow batch --agent-port ` session @@ -204,7 +251,7 @@ operations; it is absent from ordinary launches. ## Adding platform captures -The shared integration branch is **`redth-website-refresh`**. Both platform +The shared integration branch is **`redth-website-screenshot-quality`**. Both platform handoffs should add their captures to that branch and its existing pull request, not open competing website-refresh PRs. Pull the latest branch before starting and rebase your platform-only commits onto its latest remote state before @@ -237,7 +284,7 @@ messages. No website code change is needed when new assets are registered. ```text Capture the Windows equivalent of MAUI Sherpa's refreshed macOS website set. -Check out the existing shared branch redth-website-refresh and pull its latest +Check out the existing shared branch redth-website-screenshot-quality and pull its latest changes. Add your platform-only changes to that branch and its existing PR. Use docs/SCREENSHOTS.md and website/screenshots.json from the website refresh, with website/images/screenshots/macos/ as the visual reference. @@ -265,7 +312,17 @@ send notifications, or delete anything. Record unavailable or loading views as blockers rather than publishing an error screen. Do not inspect someone else's running app to populate the inspector. -Save lossless 1x WebP files as: +Wait until the isolated app is ready, then ask the user whether they are ready +to leave the focused window untouched for the complete set. Wait for an explicit +yes and five seconds before capturing. Use --confirmed only after that answer. +Close the isolated app when done. If focus is lost, discard and repeat the set +after a new readiness confirmation. + +Use 200% Windows display scaling: the 1440x960 logical window must produce +2880x1920 native pixels. Keep those pixels; do not upscale a 1x capture. +Export lossless 2x WebP files with build/export-screenshots.py --platform windows. +It preserves transparency and removes the Windows 11 compositor desktop fringe. +Save files as: website/images/screenshots/windows/.webp Keep PNG originals private and outside the repository. Preserve aspect ratio and full native window chrome. Add only the reviewed Windows paths to each @@ -276,7 +333,7 @@ Close the isolated app and clear both environment variables when finished. Run: node --test tests/website.test.mjs Return a contact sheet, the exact captured/missing IDs, dimensions, and any blockers. Commit only your Windows assets and manifest entries, rebase onto the -latest origin/redth-website-refresh, and push to that existing shared branch. +latest origin/redth-website-screenshot-quality, and push to that existing shared branch. Do not force-push, overwrite another platform's entries, or open another PR. ``` @@ -284,14 +341,14 @@ Do not force-push, overwrite another platform's entries, or open another PR. ```text Capture the Linux equivalent of MAUI Sherpa's refreshed macOS website set. -Check out the existing shared branch redth-website-refresh and pull its latest +Check out the existing shared branch redth-website-screenshot-quality and pull its latest changes. Add your platform-only changes to that branch and its existing PR. Use docs/SCREENSHOTS.md and website/screenshots.json from the website refresh, with website/images/screenshots/macos/ as the visual reference. Build and run the actual GTK head: dotnet build src/MauiSherpa.LinuxGtk -GDK_BACKEND=x11 MAUI_SHERPA_SCREENSHOT_MODE=website-v1 MAUI_SHERPA_ENABLE_DEVFLOW=1 dotnet run --project src/MauiSherpa.LinuxGtk --no-build +GDK_BACKEND=x11 GDK_SCALE=2 MAUI_SHERPA_SCREENSHOT_MODE=website-v1 MAUI_SHERPA_ENABLE_DEVFLOW=1 dotnet run --project src/MauiSherpa.LinuxGtk --no-build The compatible Debug GTK DevFlow agent and Blazor bridge are enabled. Verify agent connectivity on Linux; do not use browser mockups or Computer Use as a substitute. Discover this Sherpa instance's port from a second terminal and run: @@ -314,7 +371,16 @@ devices, create/revoke signing assets, publish secrets, send notifications, or delete anything. Record blocked/loading views instead of publishing them. Do not inspect another session's app to populate the inspector. -Save lossless 1x WebP files as: +Wait until the isolated app is ready, then ask the user whether they are ready +to leave the focused window untouched for the complete set. Wait for an explicit +yes and five seconds before capturing. Use --confirmed only after that answer. +Close the isolated app when done. If focus is lost, discard and repeat the set +after a new readiness confirmation. + +Use GDK_SCALE=2: the 1440x960 logical window must produce 2880x1920 native pixels. +Keep those pixels; do not upscale a 1x capture. +Export lossless 2x WebP files with build/export-screenshots.py --platform linux. +Save files as: website/images/screenshots/linux/.webp Keep PNG originals private and outside the repository. Preserve aspect ratio and the full native window. Add only reviewed Linux paths to each matching @@ -325,6 +391,6 @@ Close the isolated app when finished. Run: node --test tests/website.test.mjs Return a contact sheet, captured/missing IDs, dimensions, and blockers. Commit only your Linux assets and manifest entries, rebase onto the latest -origin/redth-website-refresh, and push to that existing shared branch. Do not +origin/redth-website-screenshot-quality, and push to that existing shared branch. Do not force-push, overwrite another platform's entries, or open another PR. ``` diff --git a/src/MauiSherpa/Components/ScreenshotDiagnostics.razor b/src/MauiSherpa/Components/ScreenshotDiagnostics.razor index f221e407..edc49fc5 100644 --- a/src/MauiSherpa/Components/ScreenshotDiagnostics.razor +++ b/src/MauiSherpa/Components/ScreenshotDiagnostics.razor @@ -9,6 +9,7 @@ data-fixture="@ScreenshotMode.FixtureVersion" data-platform="@(Platform.IsWindows ? "windows" : Platform.IsMacOS || Platform.IsMacCatalyst ? "macos" : "linux")" data-ready="@ready.ToString().ToLowerInvariant()" + data-interrupted="@interrupted.ToString().ToLowerInvariant()" data-theme="@(Theme.IsDarkMode ? "dark" : "light")" data-violations="@ScreenshotMode.Current.Violations.Count" data-errors="@string.Join("; ", ScreenshotMode.Current.Violations)" @@ -17,6 +18,62 @@ @code { private bool ready; private DotNetObjectReference? reference; + private Microsoft.Maui.Controls.Window? captureWindow; + private bool interrupted; + + [JSInvokable] + public async Task BeginCapture() + { + if (!ScreenshotMode.Current.IsEnabled) + throw new InvalidOperationException("Capture requires Screenshot Mode."); + var app = Microsoft.Maui.Controls.Application.Current + ?? throw new InvalidOperationException("The MAUI application is unavailable."); + await app.Dispatcher.DispatchAsync(() => + { + captureWindow = app.Windows.Single(); +#if MACOSAPP + AppKit.NSApplication.SharedApplication.ActivateIgnoringOtherApps(true); + ((AppKit.NSWindow)captureWindow.Handler!.PlatformView!).MakeKeyAndOrderFront(null); +#elif WINDOWS + ((Microsoft.UI.Xaml.Window)captureWindow.Handler!.PlatformView!).Activate(); +#elif LINUXGTK + ((Gtk.Window)captureWindow.Handler!.PlatformView!).Present(); +#else + app.ActivateWindow(captureWindow); +#endif + interrupted = false; + captureWindow.Deactivated += OnCaptureDeactivated; + }); + await InvokeAsync(StateHasChanged); + } + + [JSInvokable] + public void CloseCapture() + { + if (!ScreenshotMode.Current.IsEnabled) + throw new InvalidOperationException("Closing a capture requires Screenshot Mode."); + var app = Microsoft.Maui.Controls.Application.Current + ?? throw new InvalidOperationException("The MAUI application is unavailable."); + // Let the interop response reach the runner before closing its connection. + app.Dispatcher.DispatchDelayed(TimeSpan.FromMilliseconds(250), () => + { +#if MACOSAPP + AppKit.NSApplication.SharedApplication.Terminate(AppKit.NSApplication.SharedApplication); +#elif WINDOWS + ((Microsoft.UI.Xaml.Window)app.Windows.Single().Handler!.PlatformView!).Close(); +#elif LINUXGTK + ((Gtk.Window)app.Windows.Single().Handler!.PlatformView!).Close(); +#else + app.CloseWindow(app.Windows.Single()); +#endif + }); + } + + private void OnCaptureDeactivated(object? sender, EventArgs e) + { + interrupted = true; + _ = InvokeAsync(StateHasChanged); + } protected override void OnInitialized() { @@ -56,6 +113,8 @@ private void OnViolationsChanged() => _ = InvokeAsync(StateHasChanged); public void Dispose() { + if (captureWindow is not null) + captureWindow.Deactivated -= OnCaptureDeactivated; ScreenshotMode.Current.ViolationsChanged -= OnViolationsChanged; Theme.ThemeChanged -= OnViolationsChanged; reference?.Dispose(); diff --git a/src/MauiSherpa/wwwroot/js/screenshotMode.js b/src/MauiSherpa/wwwroot/js/screenshotMode.js index d251d921..93b90df3 100644 --- a/src/MauiSherpa/wwwroot/js/screenshotMode.js +++ b/src/MauiSherpa/wwwroot/js/screenshotMode.js @@ -1,6 +1,8 @@ window.sherpaScreenshot = { initialize(reference) { this.setAppearance = theme => reference.invokeMethodAsync('SetAppearance', theme); + this.beginCapture = () => reference.invokeMethodAsync('BeginCapture'); + this.closeCapture = () => reference.invokeMethodAsync('CloseCapture'); const disableExternalActions = () => { for (const button of document.querySelectorAll('[data-screenshot-external]')) { if (!button.disabled) button.disabled = true; diff --git a/tests/capture-screenshots.test.mjs b/tests/capture-screenshots.test.mjs new file mode 100644 index 00000000..e9029e1a --- /dev/null +++ b/tests/capture-screenshots.test.mjs @@ -0,0 +1,148 @@ +import { test } from 'node:test'; +import assert from 'node:assert/strict'; +import { spawn } from 'node:child_process'; +import { once } from 'node:events'; +import { createServer } from 'node:http'; +import { copyFile, mkdtemp, mkdir, writeFile, readFile, rm } from 'node:fs/promises'; +import { tmpdir } from 'node:os'; +import { delimiter, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const root = fileURLToPath(new URL('../', import.meta.url)); + +test('capture runner requires consent, preserves native pixels, and closes confirmed runs', async t => { + for (const scenario of ['confirmed', 'unconfirmed', 'low-dpi', 'android-sdk', 'missing-installed-tab']) { + await t.test(scenario, async () => { + const directory = await mkdtemp(join(process.env.MAUI_SHERPA_TEST_ARTIFACTS || tmpdir(), 'sherpa-capture-')); + const app = spawn(process.execPath, ['-e', 'setInterval(() => {}, 1000)'], { stdio: 'ignore' }); + const exited = once(app, 'exit'); + const server = createServer((request, response) => { + response.setHeader('Content-Type', 'application/json'); + response.end(JSON.stringify({ app: { processId: app.pid } })); + }); + try { + const bin = join(directory, 'bin'); + await mkdir(bin); + const mock = `#!/usr/bin/env node +const { createInterface } = require('node:readline'); +const { appendFileSync, writeFileSync } = require('node:fs'); +const state = { + diagnostics: {fixture:'website-v1',platform:'macos',ready:'true',theme:'dark',violations:'0',interrupted:'false'}, + route:'/',title:'Dashboard',loading:0,errors:[],remoteResources:[],blurred:false,debugMenu:false,sidebarOverflow:false,fingerprint:'settled' +}; +createInterface({input:process.stdin}).on('line', command => { + appendFileSync(process.env.MOCK_LOG, command + '\\n'); + let output = 'true'; + if (command.includes("a.href='/android-sdk'")) { + state.route = '/android-sdk'; + state.title = 'Android SDK Packages'; + state.tabs = ['All (11)', 'Installed (8)', 'Available (3)']; + state.activeTab = 'All (11)'; + state.fingerprint = 'sdk-all'; + } + if (command.includes('const tab=Array.from')) { + const clicked = process.env.MOCK_MISSING_TAB !== '1'; + if (clicked) { + state.activeTab = 'Installed (8)'; + state.fingerprint = 'sdk-installed'; + } + output = JSON.stringify({clicked}); + } else if (command.includes('JSON.stringify')) { + output = JSON.stringify(state); + } + if (command.startsWith('MAUI screenshot')) { + const path = command.match(/--output "([^"]+)"/)[1]; + const image = Buffer.alloc(24); + Buffer.from('89504e470d0a1a0a','hex').copy(image); + image.writeUInt32BE(Number(process.env.MOCK_WIDTH),16); + image.writeUInt32BE(Number(process.env.MOCK_WIDTH)*2/3,20); + writeFileSync(path,image); + } + if (command.includes('closeCapture')) process.kill(Number(process.env.MOCK_PID),'SIGTERM'); + console.log(JSON.stringify({command,exit_code:0,output})); +}); +`; + let bootstrap; + if (process.platform === 'win32') { + await copyFile(process.execPath, join(bin, 'dotnet.exe')); + const script = join(bin, 'dotnet-mock.cjs'); + bootstrap = join(bin, 'bootstrap.cjs'); + await writeFile(script, mock); + await writeFile(bootstrap, `if (process.execPath.toLowerCase().endsWith('dotnet.exe')) { + const Module = require('node:module'), path = require('node:path'), resolve = Module._resolveFilename; + Module._resolveFilename = function(request, ...args) { + return path.basename(request) === 'maui' ? ${JSON.stringify(script)} : resolve.call(this, request, ...args); + }; +}\n`); + } else { + await writeFile(join(bin, 'dotnet'), mock, { mode: 0o755 }); + } + server.listen(0, '127.0.0.1'); + await once(server, 'listening'); + const log = join(directory, 'commands.log'); + const child = spawn(process.execPath, [ + 'build/capture-screenshots.mjs', '--agent-port', String(server.address().port), + '--platform', 'macos', '--shots', + scenario === 'android-sdk' ? 'android-sdk' : scenario === 'missing-installed-tab' ? 'dashboard,android-sdk' : 'dashboard', + '--output', directory, + ...(scenario === 'missing-installed-tab' ? ['--timeout', '1'] : []), + ...(scenario === 'unconfirmed' ? [] : ['--confirmed']) + ], { + cwd: root, + env: { + ...process.env, PATH: `${bin}${delimiter}${process.env.PATH}`, + MOCK_LOG: log, MOCK_PID: String(app.pid), + MOCK_WIDTH: scenario === 'low-dpi' ? '1440' : '2880', + MOCK_MISSING_TAB: scenario === 'missing-installed-tab' ? '1' : '0', + ...(bootstrap ? { NODE_OPTIONS: [process.env.NODE_OPTIONS, `--require="${bootstrap.replaceAll('\\', '\\\\')}"`].filter(Boolean).join(' ') } : {}) + }, + stdio: ['ignore', 'pipe', 'pipe'] + }); + let stdout = '', stderr = ''; + child.stdout.on('data', chunk => { stdout += chunk; }); + child.stderr.on('data', chunk => { stderr += chunk; }); + const started = Date.now(); + const [code] = await once(child, 'exit'); + const commands = await readFile(log, 'utf8').catch(error => { + error.message += `\nRunner stderr: ${stderr}`; + throw error; + }); + if (scenario === 'unconfirmed') { + assert.equal(code, 1); + assert.match(stderr, /Ask the user/); + assert.doesNotMatch(commands, /MAUI screenshot|beginCapture|closeCapture/); + return; + } + assert.ok(Date.now() - started >= 5000, 'The user gets the full five-second countdown'); + assert.match(commands, /MAUI screenshot --scale native/); + assert.match(commands, /beginCapture/); + assert.match(commands, /closeCapture/); + await exited; + assert.match(stdout, /isolated capture app has closed/); + if (scenario === 'low-dpi') { + assert.equal(code, 1); + assert.match(stderr, /do not upscale/); + } else if (scenario === 'missing-installed-tab') { + assert.equal(code, 1); + assert.match(stderr, /The Android SDK Installed tab is unavailable/); + assert.doesNotMatch(commands, /android-sdk\.png/); + } else { + assert.equal(code, 0, stderr); + const report = JSON.parse(await readFile(join(directory, 'macos/dark/capture.json'), 'utf8')); + assert.deepEqual(report.pixelDimensions, { width: 2880, height: 1920 }); + assert.deepEqual(report.requestedDimensions, { width: 1440, height: 960 }); + assert.equal(report.shots[0].width, 2880); + if (scenario === 'android-sdk') { + assert.match(commands, /Installed \(/); + assert.equal(report.shots[0].activeTab, 'Installed (8)'); + } + } + } finally { + app.kill(); + await exited; + server.close(); + await rm(directory, { recursive: true, force: true }); + } + }); + } +}); diff --git a/tests/test_screenshot_export.py b/tests/test_screenshot_export.py new file mode 100644 index 00000000..10b33f7d --- /dev/null +++ b/tests/test_screenshot_export.py @@ -0,0 +1,92 @@ +import importlib.util +import json +from pathlib import Path +import tempfile +import unittest + +from PIL import Image + +spec = importlib.util.spec_from_file_location( + "screenshot_export", Path(__file__).resolve().parents[1] / "build" / "export-screenshots.py") +exporter = importlib.util.module_from_spec(spec) +spec.loader.exec_module(exporter) + +window_spec = importlib.util.spec_from_file_location( + "windows_capture", Path(__file__).resolve().parents[1] / "build" / "capture-windows-window.py") +windows_capture = importlib.util.module_from_spec(window_spec) +window_spec.loader.exec_module(windows_capture) + + +class ScreenshotExportTests(unittest.TestCase): + def test_gallery_assets_match_recorded_dimensions_and_windows_have_no_desktop_edge(self): + website = Path(__file__).resolve().parents[1] / "website" + manifest = json.loads((website / "screenshots.json").read_text()) + for shot in manifest["shots"]: + for platform, source in shot["assets"].items(): + with self.subTest(shot=shot["id"], platform=platform), Image.open(website / source) as image: + capture = manifest["platforms"][platform]["capture"] + self.assertEqual(image.size, (capture["width"], capture["height"])) + if platform == "windows": + self.assertEqual(image.mode, "RGBA") + alpha = image.getchannel("A") + self.assertIsNone(alpha.crop((0, 0, image.width, 1)).getbbox()) + self.assertIsNone(alpha.crop((0, image.height - 1, image.width, image.height)).getbbox()) + self.assertIsNone(alpha.crop((0, 0, 1, image.height)).getbbox()) + self.assertIsNone(alpha.crop((image.width - 1, 0, image.width, image.height)).getbbox()) + + def test_windows_desktop_fringe_is_transparent_without_changing_content(self): + for scale in (1, 2): + image = Image.new("RGBA", (144 * scale, 96 * scale), (44, 44, 44, 255)) + for x in range(image.width): + image.putpixel((x, 0), (132, 167, 192, 255)) + result = exporter.clean_windows_frame(image, scale) + for corner in ((0, 0), (result.width - 1, 0), + (0, result.height - 1), (result.width - 1, result.height - 1)): + self.assertEqual(result.getpixel(corner)[3], 0) + self.assertEqual(result.getpixel((result.width // 2, 0))[3], 0) + self.assertEqual(result.getpixel((20 * scale, 20 * scale)), (44, 44, 44, 255)) + self.assertTrue(any(0 < alpha < 255 for alpha in result.getchannel("A").tobytes())) + pixels = result.load() + self.assertTrue(all(len(set(pixels[x, y][:3])) == 1 + for y in range(result.height) for x in range(result.width) + if pixels[x, y][3])) + + def test_native_dimensions_and_alpha_survive_lossless_export(self): + with tempfile.TemporaryDirectory() as directory: + source = Path(directory) / "native.png" + destination = Path(directory) / "native.webp" + image = Image.new("RGBA", (288, 192), (43, 35, 67, 255)) + image.putpixel((0, 0), (43, 35, 67, 72)) + image.save(source) + exporter.export_image(source, destination, "macos", logical_size=(144, 96)) + with Image.open(destination) as exported: + self.assertEqual(exported.size, image.size) + self.assertEqual(exported.tobytes(), image.tobytes()) + + def test_one_x_source_is_rejected_instead_of_upscaled(self): + with tempfile.TemporaryDirectory() as directory: + source = Path(directory) / "legacy.png" + destination = Path(directory) / "native.webp" + Image.new("RGB", (144, 96)).save(source) + with self.assertRaisesRegex(ValueError, "Recapture at native display scale"): + exporter.export_image(source, destination, "linux", logical_size=(144, 96)) + self.assertFalse(destination.exists()) + + def test_windows_capture_rejects_other_windows_and_partial_frames(self): + frame = (100, 50, 2980, 1970) + work_area = (0, 0, 3840, 2080) + windows_capture.validate_window(42, 42, frame, work_area) + with self.assertRaisesRegex(RuntimeError, "not in the foreground"): + windows_capture.validate_window(42, 43, frame, work_area) + with self.assertRaisesRegex(RuntimeError, "usable area"): + windows_capture.validate_window(42, 42, frame, (0, 0, 3840, 1969)) + + def test_windows_capture_sizes_the_visible_frame_not_invisible_borders(self): + outer = (78, 78, 2958, 1998) + frame = (89, 78, 2947, 1987) + work_area = (0, 0, 3840, 2064) + self.assertEqual( + windows_capture.window_placement(outer, frame, work_area, 2880, 1920), + (469, 72, 2902, 1931)) + with self.assertRaisesRegex(RuntimeError, "does not fit"): + windows_capture.window_placement(outer, frame, work_area, 3841, 1920) diff --git a/website/css/home.css b/website/css/home.css index dec4bdc3..49d7b919 100644 --- a/website/css/home.css +++ b/website/css/home.css @@ -3,10 +3,15 @@ --tour-bg: #150d38; --tour-ink: #f5f1ff; --tour-muted: #c9c0df; + --tour-panel: #201644; + --tour-highlight: #34245b; + --tour-border: #82729f; + --tour-accent: #d3baff; } .home h1, .home h2, .home h3 { text-wrap: balance; } .home [hidden] { display: none !important; } +.home .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; } .home section[id] { scroll-margin-top: 85px; } .home h2 { font-size: clamp(1.9rem, 3.5vw, 2.8rem); line-height: 1.15; letter-spacing: -0.035em; } .home .nav__links { gap: clamp(1rem, 2.4vw, 2rem); } @@ -46,15 +51,29 @@ .platform-switch button { display: flex; align-items: center; justify-content: center; gap: .5rem; border: 0; border-radius: 8px; padding: .65rem 1rem; min-height: 44px; font: inherit; font-size: .9rem; font-weight: 600; color: var(--tour-muted); background: transparent; cursor: pointer; } .platform-switch button:hover { color: #fff; background: #40316b; } .platform-switch button[aria-pressed="true"] { background: var(--tour-ink); color: var(--tour-bg); } -.tour-select { display: flex; align-items: center; gap: .75rem; font-size: .9rem; color: var(--tour-muted); } -.tour-select select { max-width: 260px; border: 1px solid #82729f; border-radius: 8px; background: var(--tour-bg); color: var(--tour-ink); padding: .75rem 2rem .75rem .75rem; font: inherit; color-scheme: dark; cursor: pointer; } +.screenshot-picker { position: relative; width: min(440px, 100%); } +.screenshot-picker__trigger { display: flex; align-items: center; gap: .875rem; width: 100%; padding: .875rem 1rem; text-align: left; font: inherit; color: var(--tour-ink); background: var(--tour-panel); border: 1px solid var(--tour-border); border-radius: 12px; cursor: pointer; } +.screenshot-picker__trigger:hover, .screenshot-picker__trigger[aria-expanded="true"] { border-color: var(--tour-accent); background: var(--tour-highlight); } +.screenshot-picker .screenshot-picker__icon { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; background: var(--tour-highlight); color: var(--tour-accent); font-size: 1.1rem; } +.screenshot-picker__copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: .25rem; } +.screenshot-picker__title { display: block; font-size: .95rem; line-height: 1.35; font-weight: 650; } +.screenshot-picker__description { display: block; color: var(--tour-muted); font-size: .78rem; line-height: 1.5; font-weight: 400; } +.screenshot-picker__trigger .screenshot-picker__description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } +.screenshot-picker__chevron { color: var(--tour-accent); font-size: .75rem; transition: transform 150ms ease-out; } +.screenshot-picker__trigger[aria-expanded="true"] .screenshot-picker__chevron { transform: rotate(180deg); } +.screenshot-picker__options { position: absolute; z-index: 20; top: calc(100% + .5rem); right: 0; width: min(520px, calc(100vw - 3rem)); max-height: min(480px, 55svh); overflow-y: auto; overscroll-behavior: contain; scroll-padding: .5rem; padding: .5rem; border: 1px solid var(--tour-border); border-radius: 14px; background: var(--tour-panel); box-shadow: 0 20px 40px -12px #080415b3; } +.screenshot-picker__option { display: flex; align-items: center; gap: .875rem; padding: .875rem; border-radius: 8px; cursor: pointer; } +.screenshot-picker__option.is-active { background: var(--tour-highlight); outline: 1px solid var(--tour-border); outline-offset: -1px; } +.screenshot-picker__option[aria-selected="true"] .screenshot-picker__title { color: var(--tour-accent); } +.screenshot-picker__check { flex: 0 0 16px; color: var(--tour-accent); font-size: .8rem; visibility: hidden; } +.screenshot-picker__option[aria-selected="true"] .screenshot-picker__check { visibility: visible; } .tour-notice { margin-bottom: 1.25rem; padding: .75rem 1rem; border: 1px solid #82729f; border-radius: 8px; color: var(--tour-muted); font-size: .9rem; } .tour-notice a { color: var(--tour-ink); text-decoration: underline; } .tour-figure { margin: 0; } -.tour-stage { position: relative; min-width: 0; aspect-ratio: 1440 / 939; border-radius: 12px; border: 1px solid #82729f; overflow: hidden; background: #1d1830; box-shadow: 0 24px 48px -24px #100a22; } +.tour-stage { position: relative; min-width: 0; aspect-ratio: 3 / 2; } .tour-stage[aria-busy="true"]::after { content: "Loading screenshot…"; position: absolute; bottom: 1rem; left: 1rem; padding: .5rem .75rem; background: var(--tour-bg); border: 1px solid #82729f; border-radius: 6px; color: var(--tour-ink); } .tour-image-button { display: block; position: relative; width: 100%; height: 100%; border: 0; padding: 0; background: transparent; cursor: zoom-in; } -.tour-image-button img { width: 100%; height: 100%; object-fit: contain; } +.tour-image-button img { display: block; width: 100%; height: auto; filter: drop-shadow(0 16px 20px #100a2280); } .tour-image-button__hint { position: absolute; right: 1rem; bottom: 1rem; display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; background: var(--tour-bg); border: 1px solid #82729f; border-radius: 6px; font: 500 .8rem var(--font-body); color: var(--tour-ink); opacity: 0; transition: opacity 150ms ease-out; } .tour-image-button:hover .tour-image-button__hint, .tour-image-button:focus-visible .tour-image-button__hint { opacity: 1; } .tour-caption { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-top: 1.25rem; } @@ -107,7 +126,7 @@ .footer__tagline { color: var(--ink-secondary); font-size: .9rem; margin-top: .75rem; } .home .footer__col h3 { font-size: .85rem; margin-bottom: 1rem; } .home .footer__bottom { color: var(--ink-secondary); } -.home .lightbox img { max-height: 87vh; max-width: 96vw; object-fit: contain; } +.home .lightbox img { max-height: 87vh; max-width: 96vw; object-fit: contain; border-radius: 0; box-shadow: none; filter: drop-shadow(0 20px 30px #00000080); } @media (prefers-color-scheme: dark) { .home { --alpine-purple-deep: #b9a2ff; } @@ -132,8 +151,8 @@ .tour-controls { align-items: stretch; } .platform-switch { width: 100%; } .platform-switch button { flex: 1; padding-inline: .5rem; } - .tour-select { width: 100%; } - .tour-select select { flex: 1; max-width: none; min-width: 0; } + .screenshot-picker { width: 100%; } + .screenshot-picker__options { width: 100%; } .tour-caption { flex-direction: column; gap: .5rem; } .tour-caption__platform { padding: 0; } .tour-stage:has(.tour-empty:not([hidden])) { aspect-ratio: auto; min-height: 320px; } diff --git a/website/images/screenshots/linux/android-devices.webp b/website/images/screenshots/linux/android-devices.webp index 2731d03f..3a9e0a90 100644 Binary files a/website/images/screenshots/linux/android-devices.webp and b/website/images/screenshots/linux/android-devices.webp differ diff --git a/website/images/screenshots/linux/android-sdk.webp b/website/images/screenshots/linux/android-sdk.webp index 77813eb5..77e4a879 100644 Binary files a/website/images/screenshots/linux/android-sdk.webp and b/website/images/screenshots/linux/android-sdk.webp differ diff --git a/website/images/screenshots/linux/app-inspector.webp b/website/images/screenshots/linux/app-inspector.webp index 2a99f00d..4853bcd9 100644 Binary files a/website/images/screenshots/linux/app-inspector.webp and b/website/images/screenshots/linux/app-inspector.webp differ diff --git a/website/images/screenshots/linux/apple-push.webp b/website/images/screenshots/linux/apple-push.webp index 2af021a9..0523f981 100644 Binary files a/website/images/screenshots/linux/apple-push.webp and b/website/images/screenshots/linux/apple-push.webp differ diff --git a/website/images/screenshots/linux/bundle-ids.webp b/website/images/screenshots/linux/bundle-ids.webp index 99ca5e0d..c954373b 100644 Binary files a/website/images/screenshots/linux/bundle-ids.webp and b/website/images/screenshots/linux/bundle-ids.webp differ diff --git a/website/images/screenshots/linux/certificates.webp b/website/images/screenshots/linux/certificates.webp index 1110601b..455f5bd3 100644 Binary files a/website/images/screenshots/linux/certificates.webp and b/website/images/screenshots/linux/certificates.webp differ diff --git a/website/images/screenshots/linux/dashboard.webp b/website/images/screenshots/linux/dashboard.webp index 7265ad0f..645e0276 100644 Binary files a/website/images/screenshots/linux/dashboard.webp and b/website/images/screenshots/linux/dashboard.webp differ diff --git a/website/images/screenshots/linux/doctor.webp b/website/images/screenshots/linux/doctor.webp index 231bf0e5..df2b0d07 100644 Binary files a/website/images/screenshots/linux/doctor.webp and b/website/images/screenshots/linux/doctor.webp differ diff --git a/website/images/screenshots/linux/dotnet-sdk.webp b/website/images/screenshots/linux/dotnet-sdk.webp index 4493ba05..964f4bf2 100644 Binary files a/website/images/screenshots/linux/dotnet-sdk.webp and b/website/images/screenshots/linux/dotnet-sdk.webp differ diff --git a/website/images/screenshots/linux/firebase-push.webp b/website/images/screenshots/linux/firebase-push.webp index 295589be..8a763759 100644 Binary files a/website/images/screenshots/linux/firebase-push.webp and b/website/images/screenshots/linux/firebase-push.webp differ diff --git a/website/images/screenshots/linux/keystores.webp b/website/images/screenshots/linux/keystores.webp index 9238e96b..d83c9a7b 100644 Binary files a/website/images/screenshots/linux/keystores.webp and b/website/images/screenshots/linux/keystores.webp differ diff --git a/website/images/screenshots/linux/profiles.webp b/website/images/screenshots/linux/profiles.webp index 7d600225..e49565c9 100644 Binary files a/website/images/screenshots/linux/profiles.webp and b/website/images/screenshots/linux/profiles.webp differ diff --git a/website/images/screenshots/linux/profiling.webp b/website/images/screenshots/linux/profiling.webp index 84027e36..535fe6b1 100644 Binary files a/website/images/screenshots/linux/profiling.webp and b/website/images/screenshots/linux/profiling.webp differ diff --git a/website/images/screenshots/linux/publishing.webp b/website/images/screenshots/linux/publishing.webp index 794c8d8f..37913a3e 100644 Binary files a/website/images/screenshots/linux/publishing.webp and b/website/images/screenshots/linux/publishing.webp differ diff --git a/website/images/screenshots/linux/secrets.webp b/website/images/screenshots/linux/secrets.webp index 7faa11ea..79c1a8be 100644 Binary files a/website/images/screenshots/linux/secrets.webp and b/website/images/screenshots/linux/secrets.webp differ diff --git a/website/images/screenshots/macos/android-devices.webp b/website/images/screenshots/macos/android-devices.webp index d5776ec1..cf2abd09 100644 Binary files a/website/images/screenshots/macos/android-devices.webp and b/website/images/screenshots/macos/android-devices.webp differ diff --git a/website/images/screenshots/macos/android-sdk.webp b/website/images/screenshots/macos/android-sdk.webp index 4e78fb6c..2467122d 100644 Binary files a/website/images/screenshots/macos/android-sdk.webp and b/website/images/screenshots/macos/android-sdk.webp differ diff --git a/website/images/screenshots/macos/app-inspector.webp b/website/images/screenshots/macos/app-inspector.webp index 77ba05dd..e4797fbb 100644 Binary files a/website/images/screenshots/macos/app-inspector.webp and b/website/images/screenshots/macos/app-inspector.webp differ diff --git a/website/images/screenshots/macos/apple-push.webp b/website/images/screenshots/macos/apple-push.webp index 9a9dbfaf..923cad22 100644 Binary files a/website/images/screenshots/macos/apple-push.webp and b/website/images/screenshots/macos/apple-push.webp differ diff --git a/website/images/screenshots/macos/apple-simulators.webp b/website/images/screenshots/macos/apple-simulators.webp index aa2e5741..82c23dc7 100644 Binary files a/website/images/screenshots/macos/apple-simulators.webp and b/website/images/screenshots/macos/apple-simulators.webp differ diff --git a/website/images/screenshots/macos/bundle-ids.webp b/website/images/screenshots/macos/bundle-ids.webp index 03aa7de0..695a6e19 100644 Binary files a/website/images/screenshots/macos/bundle-ids.webp and b/website/images/screenshots/macos/bundle-ids.webp differ diff --git a/website/images/screenshots/macos/certificates.webp b/website/images/screenshots/macos/certificates.webp index dd82ffd2..e9b9ba24 100644 Binary files a/website/images/screenshots/macos/certificates.webp and b/website/images/screenshots/macos/certificates.webp differ diff --git a/website/images/screenshots/macos/dashboard.webp b/website/images/screenshots/macos/dashboard.webp index 0471cba2..97ba4885 100644 Binary files a/website/images/screenshots/macos/dashboard.webp and b/website/images/screenshots/macos/dashboard.webp differ diff --git a/website/images/screenshots/macos/doctor.webp b/website/images/screenshots/macos/doctor.webp index 899e39b1..5d7a813d 100644 Binary files a/website/images/screenshots/macos/doctor.webp and b/website/images/screenshots/macos/doctor.webp differ diff --git a/website/images/screenshots/macos/dotnet-sdk.webp b/website/images/screenshots/macos/dotnet-sdk.webp index 64fe5b97..7fb4e45f 100644 Binary files a/website/images/screenshots/macos/dotnet-sdk.webp and b/website/images/screenshots/macos/dotnet-sdk.webp differ diff --git a/website/images/screenshots/macos/firebase-push.webp b/website/images/screenshots/macos/firebase-push.webp index c7f672df..84e820e9 100644 Binary files a/website/images/screenshots/macos/firebase-push.webp and b/website/images/screenshots/macos/firebase-push.webp differ diff --git a/website/images/screenshots/macos/keystores.webp b/website/images/screenshots/macos/keystores.webp index 87f487cd..a094d879 100644 Binary files a/website/images/screenshots/macos/keystores.webp and b/website/images/screenshots/macos/keystores.webp differ diff --git a/website/images/screenshots/macos/profiles.webp b/website/images/screenshots/macos/profiles.webp index 38f13992..d80ea4ae 100644 Binary files a/website/images/screenshots/macos/profiles.webp and b/website/images/screenshots/macos/profiles.webp differ diff --git a/website/images/screenshots/macos/profiling.webp b/website/images/screenshots/macos/profiling.webp index 3511f1bd..1e2d57c7 100644 Binary files a/website/images/screenshots/macos/profiling.webp and b/website/images/screenshots/macos/profiling.webp differ diff --git a/website/images/screenshots/macos/publishing.webp b/website/images/screenshots/macos/publishing.webp index 8ebc3836..65db2e47 100644 Binary files a/website/images/screenshots/macos/publishing.webp and b/website/images/screenshots/macos/publishing.webp differ diff --git a/website/images/screenshots/macos/secrets.webp b/website/images/screenshots/macos/secrets.webp index 66cb4afe..5bb57f78 100644 Binary files a/website/images/screenshots/macos/secrets.webp and b/website/images/screenshots/macos/secrets.webp differ diff --git a/website/images/screenshots/macos/xcode.webp b/website/images/screenshots/macos/xcode.webp index 8d8da064..c4078f45 100644 Binary files a/website/images/screenshots/macos/xcode.webp and b/website/images/screenshots/macos/xcode.webp differ diff --git a/website/images/screenshots/windows/android-devices.webp b/website/images/screenshots/windows/android-devices.webp index 8dbb3c58..7eb39dbf 100644 Binary files a/website/images/screenshots/windows/android-devices.webp and b/website/images/screenshots/windows/android-devices.webp differ diff --git a/website/images/screenshots/windows/android-sdk.webp b/website/images/screenshots/windows/android-sdk.webp index 18f86544..6ad7f310 100644 Binary files a/website/images/screenshots/windows/android-sdk.webp and b/website/images/screenshots/windows/android-sdk.webp differ diff --git a/website/images/screenshots/windows/app-inspector.webp b/website/images/screenshots/windows/app-inspector.webp index c4a8fdd4..7ecacdb3 100644 Binary files a/website/images/screenshots/windows/app-inspector.webp and b/website/images/screenshots/windows/app-inspector.webp differ diff --git a/website/images/screenshots/windows/apple-push.webp b/website/images/screenshots/windows/apple-push.webp index 2234824f..55888082 100644 Binary files a/website/images/screenshots/windows/apple-push.webp and b/website/images/screenshots/windows/apple-push.webp differ diff --git a/website/images/screenshots/windows/bundle-ids.webp b/website/images/screenshots/windows/bundle-ids.webp index 45a8ce2f..609591da 100644 Binary files a/website/images/screenshots/windows/bundle-ids.webp and b/website/images/screenshots/windows/bundle-ids.webp differ diff --git a/website/images/screenshots/windows/certificates.webp b/website/images/screenshots/windows/certificates.webp index a427b634..17dc1c4d 100644 Binary files a/website/images/screenshots/windows/certificates.webp and b/website/images/screenshots/windows/certificates.webp differ diff --git a/website/images/screenshots/windows/dashboard.webp b/website/images/screenshots/windows/dashboard.webp index d0db6f7c..9498f133 100644 Binary files a/website/images/screenshots/windows/dashboard.webp and b/website/images/screenshots/windows/dashboard.webp differ diff --git a/website/images/screenshots/windows/doctor.webp b/website/images/screenshots/windows/doctor.webp index 3440d910..250eb11d 100644 Binary files a/website/images/screenshots/windows/doctor.webp and b/website/images/screenshots/windows/doctor.webp differ diff --git a/website/images/screenshots/windows/dotnet-sdk.webp b/website/images/screenshots/windows/dotnet-sdk.webp index 1448bb97..901aaa99 100644 Binary files a/website/images/screenshots/windows/dotnet-sdk.webp and b/website/images/screenshots/windows/dotnet-sdk.webp differ diff --git a/website/images/screenshots/windows/firebase-push.webp b/website/images/screenshots/windows/firebase-push.webp index 686b041d..7803b4f5 100644 Binary files a/website/images/screenshots/windows/firebase-push.webp and b/website/images/screenshots/windows/firebase-push.webp differ diff --git a/website/images/screenshots/windows/keystores.webp b/website/images/screenshots/windows/keystores.webp index 6b7f2ea8..f4158702 100644 Binary files a/website/images/screenshots/windows/keystores.webp and b/website/images/screenshots/windows/keystores.webp differ diff --git a/website/images/screenshots/windows/profiles.webp b/website/images/screenshots/windows/profiles.webp index 4cb8f582..d6644009 100644 Binary files a/website/images/screenshots/windows/profiles.webp and b/website/images/screenshots/windows/profiles.webp differ diff --git a/website/images/screenshots/windows/profiling.webp b/website/images/screenshots/windows/profiling.webp index a05ca484..3c44e0a7 100644 Binary files a/website/images/screenshots/windows/profiling.webp and b/website/images/screenshots/windows/profiling.webp differ diff --git a/website/images/screenshots/windows/publishing.webp b/website/images/screenshots/windows/publishing.webp index ef9b1b47..a15f065f 100644 Binary files a/website/images/screenshots/windows/publishing.webp and b/website/images/screenshots/windows/publishing.webp differ diff --git a/website/images/screenshots/windows/secrets.webp b/website/images/screenshots/windows/secrets.webp index 2d74b6a2..4efda413 100644 Binary files a/website/images/screenshots/windows/secrets.webp and b/website/images/screenshots/windows/secrets.webp differ diff --git a/website/index.html b/website/index.html index 5c1f1a8e..d41fe766 100644 --- a/website/index.html +++ b/website/index.html @@ -68,15 +68,24 @@

Your tools. Your platform.

- +
+ + +