greenroom 0.3.1
greenroom: ^0.3.1 copied to clipboard
Turns Flutter's own @Preview annotations into widget tests proving every preview mounts — with screenshots and a machine-readable verdicts file.
0.3.1 #
- NEW:
skills/flutter-widget-previews/SKILL.mdships with the package — an agent-facing guide to writing@Previewannotations, verifying them, wiring CI, supplying ambient dependencies, and reading failures. - FIXED: previews returning
WidgetBuilder(legal per Flutter's annotation) generated uncompilable code; they now mount through aBuilder. - FIXED (fail-open bug): when the target project did not resolve — no
pub get, broken package_config, SDK mismatch — discovery silently found zero previews and the generated suite PASSED while proving nothing. greenroom now refuses to generate unlesspackage:flutter/widgets.dartresolves, and reports a missingflutter_testdev_dependency. - The missing-entry message no longer claims "has required parameters" for widgets whose only barrier is having no unnamed constructor.
0.3.0 #
- ALL
@Previewfields are now applied —theme:andlocalizations:included. Every annotation (direct or subclass) is re-instantiated by the generated test with resolved imports and applied at runtime, deleting the static field-extraction path.PreviewThemeData's API drift across the supported range (newerapply()vs older theme fields) is bridged dynamically so one generated file works everywhere. - Verified end-to-end on Flutter 3.38.5 and 3.47.0, including cross-library
wrapper + theme arguments, a German
localizations:preview, and MultiPreview runtime expansion.
Unreleased #
- REMOVED: the classified fix-hint table. A failure is Flutter's native error report, nothing else.
0.2.0 #
-
Discovery is now fully RESOLVED (analyzer resolution; target must be
pub get-able): element-identity provenance, constant-evaluated annotation fields,wrapper:from any library,Preview/MultiPreviewsubclass expansion at runtime (the official previewer's architecture), transitive widget-base detection, InheritedWidgets excluded as subjects. -
Version support widened and verified end-to-end: Dart
^3.9.0(Flutter 3.35+, where@Previewshipped); analyzer>=12.1.0 <15.0.0tested at 12.1 / 13.3 / 14.0 / 14.1; runs proven on Flutter 3.38.5 and 3.47.0. -
REMOVED:
greenroom watch(the resident daemon) and the analyzer plugin — agents runflutter test; ambient verdicts served a keystroke cadence that agent-driven authorship doesn't have. Git history keeps them. -
Failures now carry Flutter's FULL native error report (zero summarization) plus at most one
greenroom:hint, kept only where it encodes convention knowledge Flutter cannot have (missing fakes, shell, test-vs-previewer policy). Layout advice is Flutter's own.
0.1.0 #
Initial release.
dart run greenroom: generates a self-containedtest/greenroom.g_test.dartfrom Flutter's own@Previewannotations — onetestWidgetsper annotation (stacked annotations included), honoringname/size/textScaleFactor/brightness/wrapperwith the official previewer's exact semantics.- Bare mounts for default-constructible widgets; failing obligation tests for widgets that can be neither entered nor bare-mounted.
- PNG screenshot per passing test (real Roboto/MaterialIcons glyphs) and a
hash-stamped
.dart_tool/greenroom/verdicts.json, written by the test run itself —flutter testis the runner and the gate. - Failure output built for agents: exception,
file:line:colattribution (project stack frame, or widget creation location for layout errors), and a classified fix hint. --check: CI drift guard (exit 1 when the committed generated file is stale).greenroom watch: optional resident dev mode (~200ms edit→verdict).- Import-gated annotation provenance;
lib/preview/shell.darthook for mounting under the app's real wrappers with fake services.