diff --git a/docs/parity-testing-harness.md b/docs/parity-testing-harness.md index 33cd89a..fbd52db 100644 --- a/docs/parity-testing-harness.md +++ b/docs/parity-testing-harness.md @@ -32,6 +32,13 @@ Hard screenshot smoke: powershell -ExecutionPolicy Bypass -File .\scripts\run-parity-smoke.ps1 ``` +The smoke expands every resizable renderer across the manifest's responsive +viewport matrix: + +- `phone`: 390 x 844 +- `tablet`: 768 x 1024 +- `desktop`: 1280 x 720 + The semantic runner writes: - `artifacts/parity/latest.md` @@ -57,6 +64,7 @@ The first pass is semantic and fixture-driven: - check required style tokens; - check required bindings; - check retained slider skins and control parts. +- record the responsive viewport matrix used by screenshot smoke. This already catches the most embarrassing class of parity lie: a runtime or fixture claiming to render CultUI while the retained tree no longer contains @@ -67,12 +75,17 @@ lower. The harness tracks every target runtime: -- Web reference: active semantic and screenshot target through Chrome headless. +- Web reference: active semantic and screenshot target through Chrome headless + using the provider query parameter. +- Web responsive layout: Chrome headless emits phone, tablet, and desktop PNGs. - iOS / UIKit: screenshot target through SSH and EveCanvas' - `/var/mobile/Library/EveCanvas/capture-request` service. + `/var/mobile/Library/EveCanvas/capture-request` service. Current iOS capture + is fixed-device until a simulator or device-resize adapter exists. - Android / Kotlin: screenshot target through `adb install`, activity launch, - and `adb exec-out screencap`. -- Windows / Flutter: screenshot target through the Flutter parity golden smoke. + `adb shell wm size`, and `adb exec-out screencap`; the script restores the + device size after each viewport. +- Windows / Flutter: screenshot target through the Flutter parity golden smoke, + with phone, tablet, and desktop goldens. - Linux / Flutter: requires a Linux runner. A Windows host must fail this target instead of pretending to be Linux. - Fensalir Direct2D: specialized native target, adapter/capture still missing. diff --git a/docs/renderer-parity.md b/docs/renderer-parity.md index a0d4d6b..389c8f6 100644 --- a/docs/renderer-parity.md +++ b/docs/renderer-parity.md @@ -22,11 +22,11 @@ current evidence surface for semantic parity and runtime capture gaps. | Renderer | Status | Proof | Gap | | --- | --- | --- | --- | -| Web reference | Active reference/debug renderer | `web/` renders live VoidBot and fixture surfaces through the provider picker; compiles indentation CultUI; lowers partitions, field rows, and slider anatomy; Chrome headless capture emits PNGs | Needs command round-trip tests | -| Windows / Flutter | Active shared graphical smoke target | `flutter/eve_parity` renders the CultUI Inspector surface and emits a golden PNG through `capture-flutter-parity.ps1` | Needs lowerer fed by compiled `gamecult.eve.surface.v1` instead of hardcoded inspector widget | +| Web reference | Active reference/debug renderer | `web/` renders live VoidBot and fixture surfaces through the provider picker; compiles indentation CultUI; lowers partitions, field rows, and slider anatomy; Chrome headless capture emits phone/tablet/desktop PNGs | Needs command round-trip tests | +| Windows / Flutter | Active shared graphical smoke target | `flutter/eve_parity` renders the CultUI Inspector surface and emits phone/tablet/desktop golden PNGs through `capture-flutter-parity.ps1` | Needs lowerer fed by compiled `gamecult.eve.surface.v1` instead of hardcoded inspector widget | | Linux / Flutter | Runner-blocked shared graphical target | Flutter Linux platform scaffold exists | Needs a Linux host/runner to emit a real Linux PNG | | iOS / UIKit | Native proof | Renders Odin's fullscreen interface wall from `surface.root`, generic provider trees, and a custom VoidBot cockpit with avatar images; SSH capture emits PNGs | Needs provider picker, Repixelizer style token lowering, and a decision on what UIKit still owns if Flutter covers the shared graphical path | -| Android / Kotlin | Device-edge proof | APK builds, Periwinkle attaches through adb, and smoke capture emits PNGs | Needs provider picker, full surface tree rendering, style token lowering, asset image lowering, command controls, and a decision on what Kotlin still owns if Flutter covers the shared graphical path | +| Android / Kotlin | Device-edge proof | APK builds, Periwinkle attaches through adb, and smoke capture emits phone/tablet/desktop PNGs via `adb shell wm size` | Needs provider picker, full surface tree rendering, style token lowering, asset image lowering, command controls, and a decision on what Kotlin still owns if Flutter covers the shared graphical path | | Fensalir Direct2D | Specialized native/game-runtime landing zone | Existing `AquariumUiDocument` and `DirectWriteOverlay` path | Needs adapter from Eve surface document to `AquariumUiDocument`, DirectWrite/Direct2D token lowering, and a clear reason to stay separate from Flutter for desktop UI | ## Spawned Surfaces diff --git a/docs/runtime-app-parity-roadmap.md b/docs/runtime-app-parity-roadmap.md index b8d89d4..c12bd14 100644 --- a/docs/runtime-app-parity-roadmap.md +++ b/docs/runtime-app-parity-roadmap.md @@ -236,6 +236,8 @@ pan/zoom, eyedropper, pencil, and upload parity. Minimum parity verification should cover: - static fixture render for each runtime; +- responsive fixture render for phone, tablet, and desktop viewports where the + runtime can be resized; - provider picker selection and re-selection; - style token snapshot against the Repixelizer token set; - command emission shape for primary controls; diff --git a/flutter/eve_parity/lib/main.dart b/flutter/eve_parity/lib/main.dart index af205f7..f366ae3 100644 --- a/flutter/eve_parity/lib/main.dart +++ b/flutter/eve_parity/lib/main.dart @@ -85,7 +85,7 @@ class InspectorSliderRow extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - height: 34, + constraints: const BoxConstraints(minHeight: 34), padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), decoration: BoxDecoration( gradient: const LinearGradient( @@ -99,24 +99,35 @@ class InspectorSliderRow extends StatelessWidget { BoxShadow(color: Color(0x66000000), blurRadius: 8, offset: Offset(0, 2)), ], ), - child: Row( - children: [ - SizedBox( - width: 190, - child: Text( - label, - style: const TextStyle( - color: Color(0xFFFFB84F), - fontFamily: 'monospace', - fontSize: 13, - fontWeight: FontWeight.w700, - ), + child: LayoutBuilder( + builder: (context, constraints) { + final labelText = Text( + label, + style: const TextStyle( + color: Color(0xFFFFB84F), + fontFamily: 'monospace', + fontSize: 13, + fontWeight: FontWeight.w700, ), - ), - Expanded( - child: CultUiSlider(value: value), - ), - ], + ); + if (constraints.maxWidth < 520) { + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + labelText, + const SizedBox(height: 4), + CultUiSlider(value: value), + ], + ); + } + + return Row( + children: [ + SizedBox(width: 190, child: labelText), + Expanded(child: CultUiSlider(value: value)), + ], + ); + }, ), ); } diff --git a/flutter/eve_parity/test/goldens/cultui-inspector.png b/flutter/eve_parity/test/goldens/cultui-inspector-desktop.png similarity index 100% rename from flutter/eve_parity/test/goldens/cultui-inspector.png rename to flutter/eve_parity/test/goldens/cultui-inspector-desktop.png diff --git a/flutter/eve_parity/test/goldens/cultui-inspector-phone.png b/flutter/eve_parity/test/goldens/cultui-inspector-phone.png new file mode 100644 index 0000000..0670fa5 Binary files /dev/null and b/flutter/eve_parity/test/goldens/cultui-inspector-phone.png differ diff --git a/flutter/eve_parity/test/goldens/cultui-inspector-tablet.png b/flutter/eve_parity/test/goldens/cultui-inspector-tablet.png new file mode 100644 index 0000000..5802052 Binary files /dev/null and b/flutter/eve_parity/test/goldens/cultui-inspector-tablet.png differ diff --git a/flutter/eve_parity/test/parity_smoke_test.dart b/flutter/eve_parity/test/parity_smoke_test.dart index 8643098..c51f2f8 100644 --- a/flutter/eve_parity/test/parity_smoke_test.dart +++ b/flutter/eve_parity/test/parity_smoke_test.dart @@ -3,14 +3,30 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { - testWidgets('renders CultUI inspector parity fixture', (tester) async { - await tester.binding.setSurfaceSize(const Size(1280, 720)); - await tester.pumpWidget(const EveParityApp()); - await tester.pumpAndSettle(); + for (final viewport in _viewports) { + testWidgets('renders CultUI inspector parity fixture at ${viewport.id}', (tester) async { + await tester.binding.setSurfaceSize(Size(viewport.width, viewport.height)); + await tester.pumpWidget(const EveParityApp()); + await tester.pumpAndSettle(); - await expectLater( - find.byType(EveParityApp), - matchesGoldenFile('goldens/cultui-inspector.png'), - ); - }); + await expectLater( + find.byType(EveParityApp), + matchesGoldenFile('goldens/cultui-inspector-${viewport.id}.png'), + ); + }); + } +} + +const _viewports = [ + _Viewport('phone', 390, 844), + _Viewport('tablet', 768, 1024), + _Viewport('desktop', 1280, 720), +]; + +class _Viewport { + const _Viewport(this.id, this.width, this.height); + + final String id; + final double width; + final double height; } diff --git a/scripts/capture-android-screenshot.ps1 b/scripts/capture-android-screenshot.ps1 index 275a519..3a072f1 100644 --- a/scripts/capture-android-screenshot.ps1 +++ b/scripts/capture-android-screenshot.ps1 @@ -3,7 +3,10 @@ param( [string] $ApkPath = "artifacts\android\eve-debug.apk", [string] $PackageName = "org.gamecult.eve", [string] $ActivityName = ".MainActivity", - [int] $LaunchDelaySeconds = 3 + [int] $LaunchDelaySeconds = 3, + [int] $Width = 0, + [int] $Height = 0, + [switch] $ForceInstall ) $ErrorActionPreference = "Stop" @@ -22,22 +25,39 @@ if (-not (Test-Path $absoluteApk)) { throw "Android APK not found: $absoluteApk" } -adb install -r $absoluteApk | Out-Host -if ($LASTEXITCODE -ne 0) { - throw "adb install failed with exit code $LASTEXITCODE" -} +$overrideSize = $Width -gt 0 -and $Height -gt 0 +try { + if ($overrideSize) { + adb shell am force-stop $PackageName | Out-Host + adb shell wm size "${Width}x${Height}" | Out-Host + if ($LASTEXITCODE -ne 0) { + throw "adb wm size failed with exit code $LASTEXITCODE" + } + } -adb shell am start -n "$PackageName/$ActivityName" | Out-Host -if ($LASTEXITCODE -ne 0) { - throw "adb launch failed with exit code $LASTEXITCODE" -} + $installed = adb shell pm path $PackageName + if ($ForceInstall -or -not $installed) { + adb install -r $absoluteApk | Out-Host + if ($LASTEXITCODE -ne 0) { + throw "adb install failed with exit code $LASTEXITCODE" + } + } -Start-Sleep -Seconds $LaunchDelaySeconds + adb shell am start -n "$PackageName/$ActivityName" | Out-Host + if ($LASTEXITCODE -ne 0) { + throw "adb launch failed with exit code $LASTEXITCODE" + } -$cmdOutput = $absoluteOutput.Replace('\', '\\') -cmd /c "adb exec-out screencap -p > `"$absoluteOutput`"" -if ($LASTEXITCODE -ne 0) { - throw "adb screencap failed with exit code $LASTEXITCODE" + Start-Sleep -Seconds $LaunchDelaySeconds + + cmd /c "adb exec-out screencap -p > `"$absoluteOutput`"" + if ($LASTEXITCODE -ne 0) { + throw "adb screencap failed with exit code $LASTEXITCODE" + } +} finally { + if ($overrideSize) { + adb shell wm size reset | Out-Host + } } if (-not (Test-Path $absoluteOutput) -or (Get-Item $absoluteOutput).Length -le 0) { diff --git a/scripts/capture-flutter-parity.ps1 b/scripts/capture-flutter-parity.ps1 index a2ebb04..91b106e 100644 --- a/scripts/capture-flutter-parity.ps1 +++ b/scripts/capture-flutter-parity.ps1 @@ -1,6 +1,8 @@ param( [ValidateSet("windows", "linux")] [string] $Target = "windows", + [ValidateSet("phone", "tablet", "desktop")] + [string] $ViewportId = "desktop", [string] $OutputPath = "artifacts\parity\flutter-windows-cultui-inspector.png" ) @@ -30,7 +32,7 @@ try { Pop-Location } -$golden = Join-Path $flutterRoot "test\goldens\cultui-inspector.png" +$golden = Join-Path $flutterRoot "test\goldens\cultui-inspector-$ViewportId.png" if (-not (Test-Path $golden) -or (Get-Item $golden).Length -le 0) { throw "Flutter golden did not produce a PNG: $golden" } diff --git a/scripts/run-parity-smoke.ps1 b/scripts/run-parity-smoke.ps1 index 634f74e..1ee00ad 100644 --- a/scripts/run-parity-smoke.ps1 +++ b/scripts/run-parity-smoke.ps1 @@ -10,6 +10,8 @@ $projectRoot = Split-Path -Parent $PSScriptRoot $stamp = Get-Date -Format "yyyyMMdd-HHmmss" $runRoot = Join-Path $projectRoot (Join-Path $OutputDirectory $stamp) New-Item -ItemType Directory -Force $runRoot | Out-Null +$manifest = Get-Content (Join-Path $projectRoot "tools\parity\parity-manifest.json") | ConvertFrom-Json +$responsiveCases = @($manifest.responsiveCases) $results = [ordered]@{ schema = "gamecult.eve.parity_smoke.v1" @@ -59,10 +61,14 @@ try { throw "Semantic parity harness failed with exit code $LASTEXITCODE" } - Invoke-Capture "web" { - powershell -ExecutionPolicy Bypass -File .\scripts\capture-web-reference.ps1 ` - -ProviderId $ProviderId ` - -OutputPath (Join-Path $runRoot "web-$ProviderId.png") + foreach ($case in $responsiveCases) { + Invoke-Capture "web-$($case.id)" { + powershell -ExecutionPolicy Bypass -File .\scripts\capture-web-reference.ps1 ` + -ProviderId $ProviderId ` + -OutputPath (Join-Path $runRoot "web-$ProviderId-$($case.id).png") ` + -Width $case.width ` + -Height $case.height + } } Invoke-Capture "ios" { @@ -71,21 +77,31 @@ try { -OutputDirectory $runRoot } - Invoke-Capture "android" { - powershell -ExecutionPolicy Bypass -File .\scripts\capture-android-screenshot.ps1 ` - -OutputPath (Join-Path $runRoot "android-periwinkle.png") + foreach ($case in $responsiveCases) { + Invoke-Capture "android-$($case.id)" { + powershell -ExecutionPolicy Bypass -File .\scripts\capture-android-screenshot.ps1 ` + -OutputPath (Join-Path $runRoot "android-periwinkle-$($case.id).png") ` + -Width $case.width ` + -Height $case.height + } } - Invoke-Capture "windows" { - powershell -ExecutionPolicy Bypass -File .\scripts\capture-flutter-parity.ps1 ` - -Target windows ` - -OutputPath (Join-Path $runRoot "windows-flutter-cultui-inspector.png") + foreach ($case in $responsiveCases) { + Invoke-Capture "windows-$($case.id)" { + powershell -ExecutionPolicy Bypass -File .\scripts\capture-flutter-parity.ps1 ` + -Target windows ` + -ViewportId $case.id ` + -OutputPath (Join-Path $runRoot "windows-flutter-cultui-inspector-$($case.id).png") + } } - Invoke-Capture "linux" { - powershell -ExecutionPolicy Bypass -File .\scripts\capture-flutter-parity.ps1 ` - -Target linux ` - -OutputPath (Join-Path $runRoot "linux-flutter-cultui-inspector.png") + foreach ($case in $responsiveCases) { + Invoke-Capture "linux-$($case.id)" { + powershell -ExecutionPolicy Bypass -File .\scripts\capture-flutter-parity.ps1 ` + -Target linux ` + -ViewportId $case.id ` + -OutputPath (Join-Path $runRoot "linux-flutter-cultui-inspector-$($case.id).png") + } } $jsonPath = Join-Path $runRoot "parity-smoke.json" diff --git a/tools/parity/parity-manifest.json b/tools/parity/parity-manifest.json index d1a40be..d55f890 100644 --- a/tools/parity/parity-manifest.json +++ b/tools/parity/parity-manifest.json @@ -1,5 +1,25 @@ { "schema": "gamecult.eve.parity_manifest.v1", + "responsiveCases": [ + { + "id": "phone", + "width": 390, + "height": 844, + "deviceScale": 1 + }, + { + "id": "tablet", + "width": 768, + "height": 1024, + "deviceScale": 1 + }, + { + "id": "desktop", + "width": 1280, + "height": 720, + "deviceScale": 1 + } + ], "fixtures": [ { "id": "cultui-inspector", @@ -75,8 +95,8 @@ "kind": "active", "semanticHarness": true, "capture": { - "status": "manual-or-plugin", - "note": "Browser screenshots are currently verified through the in-app browser; a standalone Playwright/CDP runner should plug in here once the repo owns that dependency." + "status": "chrome-headless", + "note": "Chrome headless captures phone, tablet, and desktop PNGs through the provider query parameter." } }, { diff --git a/tools/parity/run-parity.mjs b/tools/parity/run-parity.mjs index 592ede9..5447cea 100644 --- a/tools/parity/run-parity.mjs +++ b/tools/parity/run-parity.mjs @@ -26,6 +26,7 @@ const report = { schema: "gamecult.eve.parity_report.v1", generatedAt: new Date().toISOString(), manifest: path.relative(repoRoot, manifestPath).replaceAll("\\", "/"), + responsiveCases: manifest.responsiveCases || [], summary: summarize(fixtureResults, runtimeResults), fixtures: fixtureResults, runtimes: runtimeResults, @@ -200,12 +201,24 @@ function renderMarkdown(report) { "", `- Fixtures: ${report.summary.passedFixtures}/${report.summary.totalFixtures} passed`, `- Runtimes: ${report.summary.activeRuntimes}/${report.summary.totalRuntimes} active`, + "", + "## Responsive Cases", + "", + "| Case | Size |", + "| --- | --- |", + ]; + + for (const viewport of report.responsiveCases || []) { + lines.push(`| ${viewport.id} | ${viewport.width} x ${viewport.height} |`); + } + + lines.push( "", "## Fixtures", "", "| Fixture | Status | Provider | Components | Failed Checks |", "| --- | --- | --- | ---: | --- |", - ]; + ); for (const fixture of report.fixtures) { const failed = fixture.checks.filter(check => !check.pass).map(check => check.id).join(", ") || ""; diff --git a/web/styles.css b/web/styles.css index 13c3385..9e5d1f7 100644 --- a/web/styles.css +++ b/web/styles.css @@ -392,6 +392,17 @@ p { transform: translate(-50%, -50%); } +@media (max-width: 520px) { + .cultui-partition[data-role="inspector.row"] { + flex-direction: column; + align-items: stretch; + } + + .cultui-partition[data-role="inspector.label"] { + flex: 0 0 auto !important; + } +} + body[data-provider="repixelizer"] .surface { position: relative; }