Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

Store pages are the prompts and what they made, top to bottom

deeb2f19d015dc1
diff --git a/desktop/lib/store/store_discover.dart b/desktop/lib/store/store_discover.dart
index a72d07bb4..48e3075e7 100644
--- a/desktop/lib/store/store_discover.dart
+++ b/desktop/lib/store/store_discover.dart
@@ -1,10 +1,8 @@
import 'package:flutter/material.dart';
-import 'package:flutter/services.dart';
import 'package:lucide_icons_flutter/lucide_icons.dart';
import '../core/dsh_catalog.dart';
import '../shared/theme/app_theme.dart' as grid;
-import '../shared/widgets/app_icon_button.dart';
import '../shared/widgets/skeleton.dart';
import '../widgets/engine_identity.dart';
import 'store_editorial.dart';
@@ -612,77 +610,3 @@ class _ProductRow extends StatelessWidget {
),
);
}
-
-class StoreProductStory extends StatelessWidget {
- const StoreProductStory({super.key, required this.story});
- final StoreStory story;
-
- @override
- Widget build(BuildContext context) => Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- if (story.asset != null) ...[
- ClipRRect(
- borderRadius: BorderRadius.circular(14),
- child: Image.asset(
- story.asset!,
- fit: BoxFit.cover,
- semanticLabel: story.caption,
- ),
- ),
- const SizedBox(height: 8),
- Text(
- story.caption!,
- style: TextStyle(fontSize: 11, color: grid.AppPalette.textFaint),
- ),
- const SizedBox(height: 24),
- ],
- Text(
- 'Start with an idea',
- style: TextStyle(
- fontSize: 18,
- fontWeight: FontWeight.w600,
- color: grid.AppPalette.textPrimary,
- ),
- ),
- const SizedBox(height: 10),
- for (final (i, prompt) in story.prompts.indexed)
- Container(
- margin: const EdgeInsets.only(bottom: 8),
- padding: const EdgeInsets.fromLTRB(14, 12, 10, 12),
- decoration: BoxDecoration(
- color: grid.AppPalette.cardBg,
- borderRadius: BorderRadius.circular(10),
- ),
- child: Row(
- children: [
- Expanded(
- child: Text(
- prompt,
- style: TextStyle(
- fontSize: 13,
- height: 1.4,
- color: grid.AppPalette.textPrimary,
- ),
- ),
- ),
- const SizedBox(width: 10),
- AppIconButton(
- key: ValueKey('store-copy-prompt:$i'),
- icon: LucideIcons.copy300,
- tooltip: 'Copy prompt',
- onPressed: () async {
- await Clipboard.setData(ClipboardData(text: prompt));
- if (context.mounted) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(content: Text('Prompt copied')),
- );
- }
- },
- ),
- ],
- ),
- ),
- ],
- );
-}
diff --git a/desktop/lib/store/store_screen.dart b/desktop/lib/store/store_screen.dart
index c3e820593..57242304f 100644
--- a/desktop/lib/store/store_screen.dart
+++ b/desktop/lib/store/store_screen.dart
@@ -825,8 +825,12 @@ class _ProductPageState extends State<_ProductPage> {
if (failure != null) _say(failure);
}
+ /// Where the reviews start, so the rating under the name can take a person there.
+ final _reviewsKey = GlobalKey();
+
@override
Widget build(BuildContext context) {
+ grid.AppTheme.watch(context);
final entry = widget.entry;
final identity = engineIdentity(entry.id, displayName: entry.name);
final author = entry.author ?? identity.creator;
@@ -835,165 +839,256 @@ class _ProductPageState extends State<_ProductPage> {
final page = widget.store.reviews[_key];
final local = widget.notifier.localMachineState;
final localInstalled = _installedOnMachine(local, entry.id);
- final machines = [?local];
final base = entry.engine.isNotEmpty
? entry.engine
: (knownHarnessBase[entry.id] ?? '');
final baseLabel = base.isEmpty ? null : engineIdentity(base).label;
+ final description = entry.description ?? identity.blurb;
+ final installing = local?.dsh.runs[entry.id]?.inProgress == true;
+ final failed = local?.dsh.runs[entry.id]?.failed == true;
+ final busy = local != null && _busy.contains(local.machine.machineId);
// New Harness installs a harness the machine lacks before it creates, so
// an example can be tried from here whether or not Get was pressed.
final canTry =
!entry.isViewerPackage &&
local != null &&
- !_busy.contains(local.machine.machineId) &&
- local.dsh.runs[entry.id]?.inProgress != true &&
+ !busy &&
+ !installing &&
(localInstalled || _canGetOnMachine(local, entry));
-
- return SingleChildScrollView(
- padding: const EdgeInsets.fromLTRB(32, 12, 32, 48),
- child: Align(
- alignment: Alignment.topLeft,
- child: ConstrainedBox(
- constraints: BoxConstraints(
- maxWidth: entry.examples.isEmpty ? 820 : 1080,
- ),
+ // A package that has not published its own examples yet still leads with
+ // prompts — the editorial ones — so every page reads the same way.
+ final examples = entry.examples.isNotEmpty
+ ? entry.examples
+ : [
+ for (final prompt
+ in storeStories[entry.id]?.prompts ?? const <String>[])
+ StoreExample(prompt: prompt),
+ ];
+ final screenshots = entry.examples.isEmpty
+ ? entry.screenshots
+ : const <String>[];
+ // A viewer package is never opened on its own: once it is here there is
+ // nothing more to press, and Remove sits in the line beneath.
+ final showAction =
+ local != null && !(entry.isViewerPackage && localInstalled);
+
+ return LayoutBuilder(
+ builder: (context, constraints) {
+ final wide = constraints.maxWidth >= 820;
+ final side = wide ? 56.0 : 24.0;
+ return SingleChildScrollView(
+ padding: EdgeInsets.fromLTRB(side, 12, side, 140),
child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
- TextButton.icon(
- key: const ValueKey('store-back'),
- onPressed: widget.onBack,
- icon: const Icon(LucideIcons.arrowLeft300, size: 15),
- label: const Text('Back'),
- style: TextButton.styleFrom(
- foregroundColor: grid.AppPalette.textSecondary,
+ Align(
+ alignment: Alignment.centerLeft,
+ child: TextButton.icon(
+ key: const ValueKey('store-back'),
+ onPressed: widget.onBack,
+ icon: const Icon(LucideIcons.arrowLeft300, size: 15),
+ label: const Text('Back'),
+ style: TextButton.styleFrom(
+ foregroundColor: grid.AppPalette.textSecondary,
+ ),
),
),
- const SizedBox(height: 12),
- Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- EngineMark(
- engine: entry.id,
- displayName: entry.name,
- size: 96,
+ // The name in its own light: a soft glow of the harness's colour behind the hero.
+ DecoratedBox(
+ decoration: BoxDecoration(
+ gradient: RadialGradient(
+ center: const Alignment(0, -0.12),
+ radius: wide ? 0.44 : 0.5,
+ colors: [
+ identity.color.withValues(alpha: 0.16),
+ identity.color.withValues(alpha: 0),
+ ],
),
- const SizedBox(width: 20),
- Expanded(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- entry.name,
- style: TextStyle(
- fontSize: 28,
- fontWeight: FontWeight.w700,
- letterSpacing: -0.5,
- color: grid.AppPalette.textPrimary,
- ),
- ),
- const SizedBox(height: 4),
- Text(
- [
- ?author,
- ?category,
- if (entry.isViewerPackage)
- 'Viewer package'
- else if (entry.isEngine)
- 'Coding agent'
- else if (baseLabel != null)
- 'Runs on $baseLabel',
- ].join(' · '),
- style: TextStyle(
- fontSize: 13,
- color: grid.AppPalette.textSecondary,
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ SizedBox(height: wide ? 44 : 20),
+ Center(
+ child: EngineMark(
+ engine: entry.id,
+ displayName: entry.name,
+ size: wide ? 96 : 72,
+ ),
+ ),
+ const SizedBox(height: 26),
+ Text(
+ entry.name,
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontSize: wide ? 64 : 42,
+ height: 1.02,
+ fontWeight: FontWeight.w700,
+ letterSpacing: wide ? -2.2 : -1.2,
+ color: grid.AppPalette.textPrimary,
+ ),
+ ),
+ if (description != null) ...[
+ const SizedBox(height: 18),
+ Center(
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 640),
+ child: Text(
+ description,
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontSize: wide ? 19 : 16,
+ height: 1.45,
+ color: grid.AppPalette.textSecondary,
+ ),
),
),
- if (!rating.isEmpty) ...[
- const SizedBox(height: 10),
- Row(
- children: [
- _Stars(value: rating.average, size: 16),
- const SizedBox(width: 8),
- Expanded(
- child: Text(
- '${rating.average.toStringAsFixed(1)} · ${rating.count} rating${rating.count == 1 ? '' : 's'}',
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: TextStyle(
- fontSize: 12.5,
- color: grid.AppPalette.textSecondary,
+ ),
+ ],
+ const SizedBox(height: 22),
+ Text(
+ [
+ ?author,
+ ?category,
+ if (entry.isViewerPackage)
+ 'Viewer package'
+ else if (entry.isEngine)
+ 'Coding agent'
+ else if (baseLabel != null)
+ 'Runs on $baseLabel',
+ ].join(' · '),
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontSize: 13,
+ color: grid.AppPalette.textFaint,
+ ),
+ ),
+ const SizedBox(height: 12),
+ Wrap(
+ alignment: WrapAlignment.center,
+ crossAxisAlignment: WrapCrossAlignment.center,
+ spacing: 20,
+ runSpacing: 8,
+ children: [
+ if (!rating.isEmpty)
+ _QuietLink(
+ key: const ValueKey('store-rating-link'),
+ onTap: () {
+ final target = _reviewsKey.currentContext;
+ if (target != null) {
+ unawaited(
+ Scrollable.ensureVisible(
+ target,
+ duration: const Duration(milliseconds: 600),
+ curve: Curves.easeInOutCubic,
),
+ );
+ }
+ },
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ _Stars(value: rating.average, size: 14),
+ const SizedBox(width: 6),
+ Text(
+ '${rating.average.toStringAsFixed(1)} · ${rating.count} rating${rating.count == 1 ? '' : 's'}',
),
- ),
- ],
+ ],
+ ),
),
- ],
+ if (entry.homepage != null)
+ _QuietLink(label: 'Website', url: entry.homepage!),
+ if (entry.upstream != null)
+ _QuietLink(label: 'Source', url: entry.upstream!),
+ if (entry.repo != null)
+ _QuietLink(label: 'Package', url: entry.repo!),
+ if (entry.license != null)
+ _QuietLink(label: '${entry.license} licence'),
],
),
- ),
- const SizedBox(width: 16),
- if (!entry.isViewerPackage && local != null)
- FilledButton(
- key: const ValueKey('store-primary-action'),
- onPressed:
- _busy.contains(local.machine.machineId) ||
- local.dsh.runs[entry.id]?.inProgress == true ||
- (!localInstalled &&
- !_canGetOnMachine(local, entry))
- ? null
- : () => localInstalled
- ? _open(local.machine.machineId)
- : _get(local.machine.machineId),
- style: FilledButton.styleFrom(
- backgroundColor: grid.AppPalette.accent,
- foregroundColor: Colors.white,
- minimumSize: const Size(96, 38),
- shape: const StadiumBorder(),
+ const SizedBox(height: 34),
+ if (showAction)
+ Center(
+ child: FilledButton(
+ key: const ValueKey('store-primary-action'),
+ onPressed:
+ busy ||
+ installing ||
+ (!localInstalled &&
+ !_canGetOnMachine(local, entry))
+ ? null
+ : () => localInstalled
+ ? _open(local.machine.machineId)
+ : _get(local.machine.machineId),
+ style: FilledButton.styleFrom(
+ backgroundColor: grid.AppPalette.textPrimary,
+ foregroundColor: grid.AppPalette.windowBg,
+ minimumSize: const Size(148, 50),
+ padding: const EdgeInsets.symmetric(horizontal: 30),
+ textStyle: const TextStyle(
+ fontSize: 16,
+ fontWeight: FontWeight.w600,
+ ),
+ shape: const StadiumBorder(),
+ ),
+ child: Text(
+ installing || busy
+ ? 'Working…'
+ : localInstalled
+ ? 'Open'
+ : failed
+ ? 'Try again'
+ : 'Get',
+ ),
+ ),
),
- child: Text(localInstalled ? 'Open' : 'Get'),
+ const SizedBox(height: 14),
+ Center(
+ child: local == null
+ ? Text(
+ 'Connecting to this computer…',
+ style: TextStyle(
+ fontSize: 12.5,
+ color: grid.AppPalette.textFaint,
+ ),
+ )
+ : _InstallLine(
+ key: ValueKey(
+ 'store-machine:${local.machine.machineId}',
+ ),
+ state: local,
+ entry: entry,
+ busy: busy,
+ onRemove: () => _remove(
+ local.machine.machineId,
+ local.machine.displayName,
+ ),
+ ),
),
- ],
+ const SizedBox(height: 24),
+ ],
+ ),
),
- if (entry.examples.isNotEmpty) ...[
- const SizedBox(height: 28),
- StoreShowcase(
+ if (examples.isNotEmpty) ...[
+ SizedBox(height: wide ? 136 : 88),
+ StoreExampleFlow(
entry: entry,
- examples: entry.examples,
+ examples: examples,
onTry: canTry
? (prompt) =>
_open(local.machine.machineId, prompt: prompt)
: null,
),
],
- const SizedBox(height: 24),
- if (entry.description != null)
- Text(
- entry.description!,
- style: TextStyle(
- fontSize: 14,
- height: 1.5,
- color: grid.AppPalette.textPrimary,
- ),
- ),
- if (entry.examples.isEmpty)
- if (storeStories[entry.id] case final story?) ...[
- const SizedBox(height: 24),
- StoreProductStory(story: story),
- ],
- if (entry.screenshots.isNotEmpty) ...[
- const SizedBox(height: 20),
- SizedBox(
- height: 220,
- child: ListView.separated(
- scrollDirection: Axis.horizontal,
- itemCount: entry.screenshots.length,
- separatorBuilder: (_, _) => const SizedBox(width: 12),
- itemBuilder: (context, i) => ClipRRect(
- borderRadius: BorderRadius.circular(10),
+ for (final (i, url) in screenshots.indexed) ...[
+ SizedBox(height: i == 0 ? (wide ? 120 : 72) : 48),
+ Center(
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 1120),
+ child: ClipRRect(
+ borderRadius: BorderRadius.circular(wide ? 28 : 18),
child: Image.network(
- entry.screenshots[i],
- height: 220,
+ url,
fit: BoxFit.cover,
errorBuilder: (_, _, _) => const SizedBox.shrink(),
),
@@ -1001,187 +1096,118 @@ class _ProductPageState extends State<_ProductPage> {
),
),
],
- const SizedBox(height: 28),
- _SectionTitle('On this computer'),
- const SizedBox(height: 8),
- Container(
- decoration: BoxDecoration(
- color: grid.AppPalette.cardBg,
- borderRadius: BorderRadius.circular(12),
- border: Border.all(color: grid.AppPalette.divider),
- ),
- child: Column(
- children: [
- for (final (i, state) in machines.indexed) ...[
- if (i > 0)
- Divider(height: 1, color: grid.AppPalette.divider),
- _MachineRow(
- key: ValueKey(
- 'store-machine:${state.machine.machineId}',
- ),
- state: state,
- entry: entry,
- isLocal: identical(state, local),
- busy: _busy.contains(state.machine.machineId),
- onGet: () => _get(state.machine.machineId),
- onRemove: () => _remove(
- state.machine.machineId,
- state.machine.displayName,
- ),
- onOpen: entry.isViewerPackage
- ? null
- : () => _open(state.machine.machineId),
- ),
- ],
- if (machines.isEmpty)
- Padding(
- padding: const EdgeInsets.all(16),
- child: Text(
- 'Connecting to this computer…',
+ if (page != null || !rating.isEmpty) ...[
+ SizedBox(height: wide ? 160 : 96),
+ Center(
+ child: ConstrainedBox(
+ key: _reviewsKey,
+ constraints: const BoxConstraints(maxWidth: 720),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ Text(
+ 'Ratings and reviews',
+ textAlign: TextAlign.center,
style: TextStyle(
- fontSize: 13,
- color: grid.AppPalette.textFaint,
+ fontSize: 28,
+ fontWeight: FontWeight.w700,
+ letterSpacing: -0.6,
+ color: grid.AppPalette.textPrimary,
),
),
- ),
- ],
- ),
- ),
- if (entry.repo != null ||
- entry.homepage != null ||
- entry.upstream != null ||
- entry.license != null) ...[
- const SizedBox(height: 28),
- _SectionTitle('Links'),
- const SizedBox(height: 8),
- Wrap(
- spacing: 8,
- runSpacing: 8,
- children: [
- if (entry.homepage != null)
- _LinkChip(label: 'Website', url: entry.homepage!),
- if (entry.upstream != null)
- _LinkChip(
- label: 'Upstream project',
- url: entry.upstream!,
- ),
- if (entry.repo != null)
- _LinkChip(label: 'Package source', url: entry.repo!),
- if (entry.license != null)
- _LinkChip(label: 'Licence · ${entry.license}'),
- ],
- ),
- ],
- if (page != null || !rating.isEmpty) ...[
- const SizedBox(height: 28),
- Row(
- children: [
- const Expanded(child: _SectionTitle('Ratings and reviews')),
- TextButton(
- key: const ValueKey('store-write-review'),
- onPressed: _review,
- child: Text(
- page?.mine == null
- ? 'Write a review'
- : 'Edit your review',
- ),
- ),
- ],
- ),
- const SizedBox(height: 8),
- if (!rating.isEmpty) _RatingSummary(rating: rating),
- if (widget.store.reviewsError[_key] != null) ...[
- const SizedBox(height: 8),
- Text(
- 'Reviews are unavailable right now.',
- style: TextStyle(
- fontSize: 12,
- color: grid.AppPalette.textSecondary,
- ),
- ),
- ],
- const SizedBox(height: 12),
- if (page != null && page.reviews.isEmpty)
- Text(
- 'No reviews yet. Be the first.',
- style: TextStyle(
- fontSize: 13,
- color: grid.AppPalette.textFaint,
- ),
- ),
- for (final review in page?.reviews ?? const <StoreReview>[])
- Padding(
- padding: const EdgeInsets.only(bottom: 10),
- child: _ReviewCard(
- key: ValueKey('store-review:${review.id}'),
- review: review,
- onEdit: review.mine ? _review : null,
+ const SizedBox(height: 6),
+ Center(
+ child: TextButton(
+ key: const ValueKey('store-write-review'),
+ onPressed: _review,
+ child: Text(
+ page?.mine == null
+ ? 'Write a review'
+ : 'Edit your review',
+ ),
+ ),
+ ),
+ const SizedBox(height: 20),
+ if (!rating.isEmpty) _RatingSummary(rating: rating),
+ if (widget.store.reviewsError[_key] != null) ...[
+ const SizedBox(height: 8),
+ Text(
+ 'Reviews are unavailable right now.',
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontSize: 12,
+ color: grid.AppPalette.textSecondary,
+ ),
+ ),
+ ],
+ const SizedBox(height: 16),
+ if (page != null && page.reviews.isEmpty)
+ Text(
+ 'No reviews yet. Be the first.',
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontSize: 13,
+ color: grid.AppPalette.textFaint,
+ ),
+ ),
+ for (final review
+ in page?.reviews ?? const <StoreReview>[])
+ Padding(
+ padding: const EdgeInsets.only(bottom: 10),
+ child: _ReviewCard(
+ key: ValueKey('store-review:${review.id}'),
+ review: review,
+ onEdit: review.mine ? _review : null,
+ ),
+ ),
+ ],
),
),
+ ),
],
],
),
- ),
- ),
+ );
+ },
);
}
}
-class _SectionTitle extends StatelessWidget {
- const _SectionTitle(this.text);
- final String text;
-
- @override
- Widget build(BuildContext context) => Text(
- text,
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.w600,
- color: grid.AppPalette.textPrimary,
- ),
- );
-}
-
-class _MachineRow extends StatelessWidget {
- const _MachineRow({
+/// The one line under the page's action: where this is, and what it is doing there — asking,
+/// installing, installed, failed — with Remove once there is something to remove.
+class _InstallLine extends StatelessWidget {
+ const _InstallLine({
super.key,
required this.state,
required this.entry,
- required this.isLocal,
required this.busy,
- required this.onGet,
required this.onRemove,
- required this.onOpen,
});
final MachineState state;
final DshEntry entry;
- final bool isLocal;
final bool busy;
- final VoidCallback onGet;
final VoidCallback onRemove;
- final VoidCallback? onOpen;
+
+ String _engineStatus() {
+ final installed = state.engines[entry.id]?.installed == true;
+ if (!installed && state.needsLink) return 'Link required';
+ if (!installed && state.nodeOnline == false) return 'Offline';
+ if (!state.engines.loaded) return 'Asking…';
+ return installed ? 'Installed' : 'Not installed';
+ }
@override
Widget build(BuildContext context) {
- if (entry.isEngine) return _engineRow(context);
+ grid.AppTheme.watch(context);
final row = state.dsh[entry.id];
final run = state.dsh.runs[entry.id];
final installing = run != null && run.inProgress;
- final installed = row?.installed == true;
- // Why a machine cannot take this package right now, when it cannot. An
- // offline or unlinked machine answers nothing, so without these the row
- // said "Asking…" forever; a machine whose CLI predates the package lists
- // no row for it, and a Get there would only fail.
- final unavailable = state.needsLink
- ? 'Link required'
- : state.nodeOnline == false
- ? 'Offline'
- : state.dsh.loaded && state.dsh.error == null && row == null
- ? 'Update Harness CLI on this machine to get it'
- : null;
+ final installed = !entry.isEngine && row?.installed == true;
final String status;
- if (installing) {
+ if (entry.isEngine) {
+ status = _engineStatus();
+ } else if (installing) {
status = switch (run.phase) {
'clone' => 'Fetching…',
'setup' => 'Setting up the toolchain…',
@@ -1196,11 +1222,19 @@ class _MachineRow extends StatelessWidget {
status = row?.linked == true
? 'Installed · linked to a checkout'
: 'Installed';
- } else if (unavailable != null) {
- status = unavailable;
+ } else if (state.needsLink) {
+ // Why a machine cannot take this package right now, when it cannot. An
+ // offline or unlinked machine answers nothing, so without these the line
+ // said "Asking…" forever; a machine whose CLI predates the package lists
+ // no row for it, and a Get there would only fail.
+ status = 'Link required';
+ } else if (state.nodeOnline == false) {
+ status = 'Offline';
+ } else if (state.dsh.loaded && state.dsh.error == null && row == null) {
+ status = 'Update Harness CLI on this machine to get it';
} else if (!state.dsh.loaded) {
// `dsh_list` refused by a CLI that predates it arrives as the bare wire
- // code; the row says what to do about it instead.
+ // code; the line says what to do about it instead.
status = switch (state.dsh.error) {
null => 'Asking…',
'UNSUPPORTED' || 'UNSUPPORTED_ON_REMOTE' =>
@@ -1210,204 +1244,97 @@ class _MachineRow extends StatelessWidget {
} else {
status = 'Not installed';
}
- return Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
- child: Row(
- children: [
- Icon(
- isLocal ? LucideIcons.laptop300 : LucideIcons.server300,
- size: 16,
- color: grid.AppPalette.textSecondary,
- ),
- const SizedBox(width: 10),
- Expanded(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- isLocal
- ? '${state.machine.displayName} · this computer'
- : state.machine.displayName,
- style: TextStyle(
- fontSize: 13,
- fontWeight: FontWeight.w500,
- color: grid.AppPalette.textPrimary,
- ),
- ),
- const SizedBox(height: 2),
- Text(
- status,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: TextStyle(
- fontSize: 12,
- color: run?.failed == true
- ? grid.AppPalette.warn
- : grid.AppPalette.textSecondary,
- ),
- ),
- ],
- ),
+ final faint = TextStyle(fontSize: 12.5, color: grid.AppPalette.textFaint);
+ return Wrap(
+ alignment: WrapAlignment.center,
+ crossAxisAlignment: WrapCrossAlignment.center,
+ spacing: 8,
+ runSpacing: 4,
+ children: [
+ if (installing || busy)
+ const SizedBox(
+ width: 12,
+ height: 12,
+ child: CircularProgressIndicator(strokeWidth: 1.6),
),
- if (installing || busy)
- const SizedBox(
- width: 16,
- height: 16,
- child: CircularProgressIndicator(strokeWidth: 2),
- )
- else if (installed) ...[
- if (onOpen != null)
- TextButton(
- key: ValueKey('store-open:${state.machine.machineId}'),
- onPressed: onOpen,
- child: const Text('Open'),
- ),
- TextButton(
- key: ValueKey('store-remove:${state.machine.machineId}'),
- onPressed: onRemove,
- style: TextButton.styleFrom(
- foregroundColor: grid.AppPalette.textSecondary,
- ),
- child: const Text('Remove'),
- ),
- ] else
- FilledButton.tonal(
- key: ValueKey('store-get:${state.machine.machineId}'),
- onPressed: _canGetOnMachine(state, entry) ? onGet : null,
- style: FilledButton.styleFrom(
- minimumSize: const Size(72, 32),
- shape: const StadiumBorder(),
- ),
- child: Text(run?.failed == true ? 'Try again' : 'Get'),
- ),
- ],
- ),
- );
- }
-}
-
-extension on _MachineRow {
- /// An engine's row: what the machine's probe said. Installed → Open; not
- /// installed but installable → Get, which opens New Harness and lets the
- /// daemon install it on the way; anything else is said and not offered.
- Widget _engineRow(BuildContext context) {
- final probe = state.engines[entry.id];
- final loaded = state.engines.loaded;
- final installed = probe?.installed == true;
- final String status;
- if (!installed && state.needsLink) {
- status = 'Link required';
- } else if (!installed && state.nodeOnline == false) {
- status = 'Offline';
- } else if (!loaded) {
- status = 'Asking…';
- } else if (installed) {
- status = 'Installed';
- } else {
- status = 'Not installed';
- }
- return Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
- child: Row(
- children: [
- Icon(
- isLocal ? LucideIcons.laptop300 : LucideIcons.server300,
- size: 16,
- color: grid.AppPalette.textSecondary,
+ Text('${state.machine.displayName} · this computer', style: faint),
+ Text('·', style: faint),
+ Text(
+ status,
+ style: TextStyle(
+ fontSize: 12.5,
+ color: run?.failed == true
+ ? grid.AppPalette.warn
+ : grid.AppPalette.textSecondary,
),
- const SizedBox(width: 10),
- Expanded(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- isLocal
- ? '${state.machine.displayName} · this computer'
- : state.machine.displayName,
- style: TextStyle(
- fontSize: 13,
- fontWeight: FontWeight.w500,
- color: grid.AppPalette.textPrimary,
- ),
- ),
- const SizedBox(height: 2),
- Text(
- status,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: TextStyle(
- fontSize: 12,
- color: grid.AppPalette.textSecondary,
- ),
- ),
- ],
- ),
+ ),
+ if (installed && !installing && !busy) ...[
+ Text('·', style: faint),
+ _QuietLink(
+ key: ValueKey('store-remove:${state.machine.machineId}'),
+ label: 'Remove',
+ onTap: onRemove,
),
- if (installed)
- TextButton(
- key: ValueKey('store-open:${state.machine.machineId}'),
- onPressed: onOpen,
- child: const Text('Open'),
- )
- else if (_canGetOnMachine(state, entry))
- FilledButton.tonal(
- key: ValueKey('store-get:${state.machine.machineId}'),
- onPressed: onGet,
- style: FilledButton.styleFrom(
- minimumSize: const Size(72, 32),
- shape: const StadiumBorder(),
- ),
- child: const Text('Get'),
- ),
],
- ),
+ ],
);
}
}
-class _LinkChip extends StatelessWidget {
- const _LinkChip({required this.label, this.url});
- final String label;
+/// A link that stays out of the way: secondary text, brighter under the pointer, an arrow when it
+/// leaves the app. Without a destination it is plain text (the licence).
+class _QuietLink extends StatefulWidget {
+ const _QuietLink({super.key, this.label, this.url, this.onTap, this.child})
+ : assert(label != null || child != null);
+
+ final String? label;
final String? url;
+ final VoidCallback? onTap;
+ final Widget? child;
+
+ @override
+ State<_QuietLink> createState() => _QuietLinkState();
+}
+
+class _QuietLinkState extends State<_QuietLink> {
+ var _hovering = false;
@override
Widget build(BuildContext context) {
- final child = Container(
- padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 7),
- decoration: BoxDecoration(
- color: grid.AppPalette.cardBg,
- borderRadius: BorderRadius.circular(999),
- border: Border.all(color: grid.AppPalette.divider),
- ),
+ grid.AppTheme.watch(context);
+ final url = widget.url;
+ final VoidCallback? tap = url != null
+ ? () => unawaited(
+ launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication),
+ )
+ : widget.onTap;
+ final color = tap == null
+ ? grid.AppPalette.textFaint
+ : _hovering
+ ? grid.AppPalette.textPrimary
+ : grid.AppPalette.textSecondary;
+ final content = DefaultTextStyle.merge(
+ style: TextStyle(fontSize: 13, color: color),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
- Text(
- label,
- style: TextStyle(
- fontSize: 12.5,
- color: grid.AppPalette.textPrimary,
- ),
- ),
+ widget.child ?? Text(widget.label!),
if (url != null) ...[
- const SizedBox(width: 6),
- Icon(
- LucideIcons.arrowUpRight300,
- size: 13,
- color: grid.AppPalette.textFaint,
- ),
+ const SizedBox(width: 3),
+ Icon(LucideIcons.arrowUpRight300, size: 13, color: color),
],
],
),
);
- if (url == null) return child;
+ if (tap == null) return content;
return MouseRegion(
cursor: SystemMouseCursors.click,
+ onEnter: (_) => setState(() => _hovering = true),
+ onExit: (_) => setState(() => _hovering = false),
child: GestureDetector(
- onTap: () => unawaited(
- launchUrl(Uri.parse(url!), mode: LaunchMode.externalApplication),
- ),
- child: child,
+ behavior: HitTestBehavior.opaque,
+ onTap: tap,
+ child: content,
),
);
}
diff --git a/desktop/lib/store/store_showcase.dart b/desktop/lib/store/store_showcase.dart
index bcc139ad9..0dd7d3953 100644
--- a/desktop/lib/store/store_showcase.dart
+++ b/desktop/lib/store/store_showcase.dart
@@ -8,244 +8,51 @@ import '../shared/theme/app_theme.dart' as grid;
import '../shared/widgets/app_icon_button.dart';
import '../widgets/engine_identity.dart';
-/// The product page's centrepiece: what you ask, and what the harness makes of it.
+/// The body of a store page: what you ask, and what comes out — one after another, down the page.
///
-/// A store page that lists features tells a person what a harness is; this shows them what it does.
-/// One example at a time fills a stage — the prompt types itself out on the left, a line sweeps
-/// across while the harness "works", and the picture of the real output settles in on the right —
-/// then the next example follows. A strip under the stage picks one directly, and "Try this prompt"
-/// opens New Harness with that prompt as its first message, so the thing that made someone lean in is
-/// one click from happening on their own machine.
+/// Nothing competes with the examples. Each is a prompt set large and centred, the button that
+/// tries it, a thread of light, and the real output at full width with one quiet line naming it.
+/// The next follows after a breath of space; a person scrolls through what the harness does rather
+/// than reading about it. An example without a picture (an editorial prompt, before the package
+/// ships its own) is the prompt and its button alone.
///
-/// Reduce Motion (and `flutter test`) shows each example whole and does not advance on its own.
-class StoreShowcase extends StatefulWidget {
- const StoreShowcase({
+/// Each block rises into place the first time it scrolls into view — unless Reduce Motion is on, or
+/// under `flutter test`, where everything is simply there.
+class StoreExampleFlow extends StatelessWidget {
+ const StoreExampleFlow({
super.key,
required this.entry,
required this.examples,
this.onTry,
- this.autoAdvance,
+ this.animate,
});
final DshEntry entry;
final List<StoreExample> examples;
- /// Opens New Harness with the prompt; null when there is no machine to open it on.
+ /// Opens New Harness with the prompt as its first message; null when there is nowhere to open it.
final ValueChanged<String>? onTry;
- /// Types, reveals and moves on to the next example; off under `flutter test` unless asked for.
- final bool? autoAdvance;
-
- @override
- State<StoreShowcase> createState() => _StoreShowcaseState();
-}
-
-class _StoreShowcaseState extends State<StoreShowcase>
- with TickerProviderStateMixin {
- static const _dwell = Duration(seconds: 7);
-
- late final AnimationController _type = AnimationController(vsync: this);
- late final AnimationController _reveal = AnimationController(
- vsync: this,
- duration: const Duration(milliseconds: 650),
- );
- late final AnimationController _dwellClock = AnimationController(
- vsync: this,
- duration: _dwell,
- );
- var _index = 0;
- var _hovering = false;
-
- bool get _animate =>
- (widget.autoAdvance ?? !kUnderTest) &&
- !(MediaQuery.maybeDisableAnimationsOf(context) ?? false);
-
- StoreExample get _example => widget.examples[_index];
-
- @override
- void initState() {
- super.initState();
- _type.addStatusListener((status) {
- if (status == AnimationStatus.completed) _reveal.forward(from: 0);
- });
- _reveal.addStatusListener((status) {
- if (status == AnimationStatus.completed && _animate && !_hovering) {
- _dwellClock.forward(from: 0);
- }
- });
- _dwellClock.addStatusListener((status) {
- if (status == AnimationStatus.completed && mounted) {
- _select((_index + 1) % widget.examples.length);
- }
- });
- WidgetsBinding.instance.addPostFrameCallback((_) {
- if (mounted) _play();
- });
- }
-
- @override
- void didUpdateWidget(StoreShowcase old) {
- super.didUpdateWidget(old);
- if (_index >= widget.examples.length) _select(0);
- }
-
- @override
- void dispose() {
- _type.dispose();
- _reveal.dispose();
- _dwellClock.dispose();
- super.dispose();
- }
-
- void _select(int index) {
- setState(() => _index = index);
- _play();
- }
-
- /// Type the prompt, then reveal the output; shown whole at once when nothing may move.
- void _play() {
- _dwellClock.stop();
- _dwellClock.value = 0;
- if (!_animate) {
- _type.value = 1;
- _reveal.value = 1;
- return;
- }
- final chars = _example.prompt.length;
- _type.duration = Duration(milliseconds: (chars * 22).clamp(600, 2600));
- _reveal.value = 0;
- _type.forward(from: 0);
- }
-
- void _hover(bool hovering) {
- _hovering = hovering;
- if (!_animate) return;
- if (hovering) {
- _dwellClock.stop();
- } else if (_reveal.isCompleted) {
- _dwellClock.forward();
- }
- }
+ /// Rise into view on first sight; defaults to on outside tests.
+ final bool? animate;
@override
Widget build(BuildContext context) {
grid.AppTheme.watch(context);
- if (widget.examples.isEmpty) return const SizedBox.shrink();
- return LayoutBuilder(
- builder: (context, constraints) {
- final wide = constraints.maxWidth >= 760;
- final prompt = _PromptPane(
- entry: widget.entry,
- example: _example,
- typing: _type,
- large: wide,
- onTry: widget.onTry,
- );
- final output = _OutputPane(
- entry: widget.entry,
- example: _example,
- typing: _type,
- reveal: _reveal,
- );
- return Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- MouseRegion(
- onEnter: (_) => _hover(true),
- onExit: (_) => _hover(false),
- child: Container(
- key: const ValueKey('store-showcase-stage'),
- padding: EdgeInsets.all(wide ? 28 : 20),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(22),
- gradient: LinearGradient(
- begin: Alignment.topLeft,
- end: Alignment.bottomRight,
- colors: [
- grid.AppPalette.cardBg,
- Color.alphaBlend(
- grid.AppPalette.accent.withValues(alpha: 0.10),
- grid.AppPalette.cardBg,
- ),
- ],
- ),
- border: Border.all(color: grid.AppPalette.divider),
- ),
- child: wide
- ? Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- SizedBox(
- width: constraints.maxWidth * 0.34,
- child: prompt,
- ),
- const SizedBox(width: 28),
- Expanded(child: output),
- ],
- )
- : Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [prompt, const SizedBox(height: 20), output],
- ),
- ),
- ),
- if (widget.examples.length > 1) ...[
- const SizedBox(height: 14),
- SizedBox(
- height: 72,
- child: ListView.separated(
- scrollDirection: Axis.horizontal,
- itemCount: widget.examples.length,
- separatorBuilder: (_, _) => const SizedBox(width: 10),
- itemBuilder: (context, i) => _ExampleChip(
- key: ValueKey('store-example:$i'),
- entry: widget.entry,
- example: widget.examples[i],
- selected: i == _index,
- progress: _dwellClock,
- onTap: i == _index ? null : () => _select(i),
- ),
- ),
- ),
- ],
- ],
- );
- },
- );
- }
-}
-
-class _Eyebrow extends StatelessWidget {
- const _Eyebrow(this.text, {this.trailing});
- final String text;
- final String? trailing;
-
- @override
- Widget build(BuildContext context) {
- // Const where it is used, so it must ask for the theme itself to follow a flip.
- grid.AppTheme.watch(context);
- return Row(
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
- Text(
- text,
- style: TextStyle(
- fontSize: 11,
- fontWeight: FontWeight.w700,
- letterSpacing: 1.4,
- color: grid.AppPalette.accentOnSurface,
- ),
- ),
- if (trailing != null) ...[
- const SizedBox(width: 10),
- Expanded(
- child: Text(
- trailing!,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: TextStyle(
- fontSize: 12.5,
- color: grid.AppPalette.textSecondary,
- ),
+ for (final (i, example) in examples.indexed) ...[
+ if (i > 0) const SizedBox(height: 132),
+ _Reveal(
+ animate: animate ?? !kUnderTest,
+ child: _ExampleBlock(
+ key: ValueKey('store-example:$i'),
+ index: i,
+ count: examples.length,
+ entry: entry,
+ example: example,
+ onTry: onTry,
),
),
],
@@ -254,223 +61,211 @@ class _Eyebrow extends StatelessWidget {
}
}
-class _PromptPane extends StatelessWidget {
- const _PromptPane({
+class _ExampleBlock extends StatefulWidget {
+ const _ExampleBlock({
+ super.key,
+ required this.index,
+ required this.count,
required this.entry,
required this.example,
- required this.typing,
- required this.large,
required this.onTry,
});
+ final int index;
+ final int count;
final DshEntry entry;
final StoreExample example;
- final Animation<double> typing;
- final bool large;
final ValueChanged<String>? onTry;
@override
- Widget build(BuildContext context) => Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisSize: MainAxisSize.min,
- children: [
- const _Eyebrow('YOU ASK'),
- const SizedBox(height: 14),
- AnimatedBuilder(
- animation: typing,
- builder: (context, _) {
- final prompt = example.prompt;
- final shown = (prompt.length * typing.value).round().clamp(
- 0,
- prompt.length,
- );
- final typingNow = shown < prompt.length;
- return Semantics(
- label: prompt,
- excludeSemantics: true,
- child: Text.rich(
- key: const ValueKey('store-showcase-prompt'),
- TextSpan(
- children: [
- TextSpan(text: '“${prompt.substring(0, shown)}'),
- // The rest is laid out but unseen, so the pane does not grow as it types.
- TextSpan(
- text: '${prompt.substring(shown)}”',
- style: TextStyle(
- color: typingNow
- ? Colors.transparent
- : grid.AppPalette.textPrimary,
- ),
- ),
- ],
- ),
+ State<_ExampleBlock> createState() => _ExampleBlockState();
+}
+
+class _ExampleBlockState extends State<_ExampleBlock> {
+ var _hovering = false;
+
+ @override
+ Widget build(BuildContext context) {
+ grid.AppTheme.watch(context);
+ final example = widget.example;
+ final i = widget.index;
+ return LayoutBuilder(
+ builder: (context, constraints) {
+ final wide = constraints.maxWidth >= 820;
+ final radius = BorderRadius.circular(wide ? 28 : 18);
+ return Column(
+ children: [
+ Text(
+ '${(i + 1).toString().padLeft(2, '0')} / ${widget.count.toString().padLeft(2, '0')}',
style: TextStyle(
- fontSize: large ? 24 : 20,
- height: 1.32,
- fontWeight: FontWeight.w600,
- letterSpacing: -0.3,
- color: grid.AppPalette.textPrimary,
+ fontFamily: grid.AppFont.mono,
+ fontSize: 12,
+ letterSpacing: 2,
+ color: grid.AppPalette.accentOnSurface,
),
),
- );
- },
- ),
- const SizedBox(height: 18),
- Row(
- children: [
- EngineMark(engine: entry.id, displayName: entry.name, size: 18),
- const SizedBox(width: 8),
- Flexible(
- child: Text(
- '${entry.name} harness',
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: TextStyle(
- fontSize: 13,
- fontWeight: FontWeight.w500,
- color: grid.AppPalette.textSecondary,
+ const SizedBox(height: 20),
+ ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 880),
+ child: Text(
+ '“${example.prompt}”',
+ key: ValueKey('store-example-prompt:$i'),
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontSize: wide ? 34 : 24,
+ height: 1.24,
+ fontWeight: FontWeight.w600,
+ letterSpacing: wide ? -0.8 : -0.4,
+ color: grid.AppPalette.textPrimary,
+ ),
),
),
- ),
- const SizedBox(width: 6),
- Icon(
- LucideIcons.arrowRight300,
- size: 14,
- color: grid.AppPalette.textFaint,
- ),
- ],
- ),
- const SizedBox(height: 22),
- Wrap(
- spacing: 8,
- runSpacing: 8,
- crossAxisAlignment: WrapCrossAlignment.center,
- children: [
- FilledButton.icon(
- key: const ValueKey('store-try-prompt'),
- onPressed: onTry == null ? null : () => onTry!(example.prompt),
- icon: const Icon(LucideIcons.sparkles300, size: 16),
- label: const Text('Try this prompt'),
- style: FilledButton.styleFrom(
- backgroundColor: grid.AppPalette.accent,
- foregroundColor: Colors.white,
- minimumSize: const Size(0, 40),
- padding: const EdgeInsets.symmetric(horizontal: 18),
- shape: const StadiumBorder(),
- ),
- ),
- AppIconButton(
- key: const ValueKey('store-copy-prompt'),
- icon: LucideIcons.copy300,
- tooltip: 'Copy prompt',
- onPressed: () async {
- await Clipboard.setData(ClipboardData(text: example.prompt));
- if (context.mounted) {
- ScaffoldMessenger.of(
- context,
- ).showSnackBar(const SnackBar(content: Text('Prompt copied')));
- }
- },
- ),
- ],
- ),
- ],
- );
-}
-
-class _OutputPane extends StatelessWidget {
- const _OutputPane({
- required this.entry,
- required this.example,
- required this.typing,
- required this.reveal,
- });
-
- final DshEntry entry;
- final StoreExample example;
- final Animation<double> typing;
- final Animation<double> reveal;
-
- @override
- Widget build(BuildContext context) => Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- mainAxisSize: MainAxisSize.min,
- children: [
- _Eyebrow('IT MAKES', trailing: example.caption),
- const SizedBox(height: 14),
- AspectRatio(
- aspectRatio: 16 / 10,
- child: ClipRRect(
- borderRadius: BorderRadius.circular(14),
- child: DecoratedBox(
- decoration: const BoxDecoration(color: Color(0xFF111316)),
- child: Stack(
- fit: StackFit.expand,
+ const SizedBox(height: 28),
+ Row(
+ mainAxisSize: MainAxisSize.min,
children: [
- AnimatedBuilder(
- animation: reveal,
- builder: (context, child) => Opacity(
- opacity: Curves.easeOut.transform(reveal.value),
- child: Transform.scale(
- scale:
- 1.04 -
- 0.04 * Curves.easeOutCubic.transform(reveal.value),
- child: child,
+ FilledButton.icon(
+ key: ValueKey('store-try-prompt:$i'),
+ onPressed: widget.onTry == null
+ ? null
+ : () => widget.onTry!(example.prompt),
+ icon: const Icon(LucideIcons.sparkles300, size: 17),
+ label: const Text('Try this prompt'),
+ style: FilledButton.styleFrom(
+ backgroundColor: grid.AppPalette.accent,
+ foregroundColor: Colors.white,
+ minimumSize: const Size(0, 46),
+ padding: const EdgeInsets.symmetric(horizontal: 22),
+ textStyle: const TextStyle(
+ fontSize: 15,
+ fontWeight: FontWeight.w600,
),
+ shape: const StadiumBorder(),
+ ),
+ ),
+ const SizedBox(width: 8),
+ AppIconButton(
+ key: ValueKey('store-copy-prompt:$i'),
+ icon: LucideIcons.copy300,
+ tooltip: 'Copy prompt',
+ onPressed: () async {
+ await Clipboard.setData(
+ ClipboardData(text: example.prompt),
+ );
+ if (context.mounted) {
+ ScaffoldMessenger.of(context).showSnackBar(
+ const SnackBar(content: Text('Prompt copied')),
+ );
+ }
+ },
+ ),
+ ],
+ ),
+ if (example.image != null) ...[
+ // The prompt becoming the thing: a thread of the accent running down into the picture.
+ Container(
+ width: 1.5,
+ height: 64,
+ margin: const EdgeInsets.symmetric(vertical: 18),
+ decoration: BoxDecoration(
+ gradient: LinearGradient(
+ begin: Alignment.topCenter,
+ end: Alignment.bottomCenter,
+ colors: [
+ grid.AppPalette.accent.withValues(alpha: 0),
+ grid.AppPalette.accent.withValues(alpha: 0.8),
+ ],
),
- child: _OutputPicture(entry: entry, example: example),
),
- // The harness at work: a light sweeping across while the prompt is still arriving.
- AnimatedBuilder(
- animation: Listenable.merge([typing, reveal]),
- builder: (context, _) {
- final working = typing.value > 0 && reveal.value == 0;
- if (!working) return const SizedBox.shrink();
- return Align(
- alignment: Alignment(-1.2 + 2.4 * typing.value, 0),
- child: FractionallySizedBox(
- widthFactor: 0.35,
- heightFactor: 1,
- child: DecoratedBox(
- decoration: BoxDecoration(
- gradient: LinearGradient(
- colors: [
- Colors.transparent,
- grid.AppPalette.accent.withValues(alpha: 0.18),
- Colors.transparent,
- ],
+ ),
+ ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 1120),
+ child: MouseRegion(
+ onEnter: (_) => setState(() => _hovering = true),
+ onExit: (_) => setState(() => _hovering = false),
+ child: AnimatedScale(
+ scale: _hovering ? 1.012 : 1,
+ duration: const Duration(milliseconds: 420),
+ curve: Curves.easeOutCubic,
+ child: AnimatedContainer(
+ duration: const Duration(milliseconds: 420),
+ curve: Curves.easeOutCubic,
+ decoration: BoxDecoration(
+ borderRadius: radius,
+ boxShadow: [
+ BoxShadow(
+ color: Colors.black.withValues(
+ alpha: _hovering ? 0.34 : 0.2,
+ ),
+ blurRadius: _hovering ? 60 : 40,
+ offset: const Offset(0, 24),
+ ),
+ ],
+ ),
+ child: ClipRRect(
+ borderRadius: radius,
+ child: AspectRatio(
+ aspectRatio: 16 / 10,
+ child: ColoredBox(
+ color: const Color(0xFF111316),
+ child: _Output(
+ key: ValueKey('store-example-image:$i'),
+ entry: widget.entry,
+ example: example,
),
),
),
),
- );
- },
+ ),
+ ),
+ ),
+ ),
+ if (example.caption != null) ...[
+ const SizedBox(height: 22),
+ Text(
+ example.caption!,
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontSize: 13,
+ height: 1.4,
+ color: grid.AppPalette.textSecondary,
+ ),
),
],
- ),
- ),
- ),
- ),
- ],
- );
+ ],
+ ],
+ );
+ },
+ );
+ }
}
-class _OutputPicture extends StatelessWidget {
- const _OutputPicture({required this.entry, required this.example});
+class _Output extends StatelessWidget {
+ const _Output({super.key, required this.entry, required this.example});
final DshEntry entry;
final StoreExample example;
@override
Widget build(BuildContext context) {
- final image = example.image;
- final placeholder = _OutputPlaceholder(entry: entry);
- if (image == null) return placeholder;
+ final placeholder = Center(
+ child: Opacity(
+ opacity: 0.5,
+ child: EngineMark(engine: entry.id, displayName: entry.name, size: 72),
+ ),
+ );
return Image.network(
- image,
- key: ValueKey('store-showcase-image:$image'),
- fit: BoxFit.contain,
+ example.image!,
+ fit: BoxFit.cover,
filterQuality: FilterQuality.medium,
semanticLabel: example.caption ?? 'What ${entry.name} made',
+ frameBuilder: (context, child, frame, synchronous) => synchronous
+ ? child
+ : AnimatedOpacity(
+ opacity: frame == null ? 0 : 1,
+ duration: const Duration(milliseconds: 500),
+ curve: Curves.easeOut,
+ child: child,
+ ),
loadingBuilder: (context, child, progress) =>
progress == null ? child : placeholder,
errorBuilder: (_, _, _) => placeholder,
@@ -478,125 +273,76 @@ class _OutputPicture extends StatelessWidget {
}
}
-class _OutputPlaceholder extends StatelessWidget {
- const _OutputPlaceholder({required this.entry});
- final DshEntry entry;
+/// Rises into place the first time any of it is on screen, and stays.
+class _Reveal extends StatefulWidget {
+ const _Reveal({required this.animate, required this.child});
+ final bool animate;
+ final Widget child;
@override
- Widget build(BuildContext context) => Center(
- child: Opacity(
- opacity: 0.55,
- child: EngineMark(engine: entry.id, displayName: entry.name, size: 64),
- ),
- );
+ State<_Reveal> createState() => _RevealState();
}
-class _ExampleChip extends StatelessWidget {
- const _ExampleChip({
- super.key,
- required this.entry,
- required this.example,
- required this.selected,
- required this.progress,
- required this.onTap,
- });
+class _RevealState extends State<_Reveal> with SingleTickerProviderStateMixin {
+ late final AnimationController _controller = AnimationController(
+ vsync: this,
+ duration: const Duration(milliseconds: 700),
+ );
+ ScrollPosition? _position;
- final DshEntry entry;
- final StoreExample example;
- final bool selected;
- final Animation<double> progress;
- final VoidCallback? onTap;
+ @override
+ void didChangeDependencies() {
+ super.didChangeDependencies();
+ final still = MediaQuery.maybeDisableAnimationsOf(context) ?? false;
+ if (!widget.animate || still) {
+ _controller.value = 1;
+ return;
+ }
+ final position = Scrollable.maybeOf(context)?.position;
+ if (position != _position) {
+ _position?.removeListener(_check);
+ _position = position?..addListener(_check);
+ }
+ WidgetsBinding.instance.addPostFrameCallback((_) => _check());
+ }
+
+ /// Starts the rise once the block's top edge is inside the viewport.
+ void _check() {
+ if (!mounted || _controller.value > 0 || _controller.isAnimating) return;
+ final box = context.findRenderObject() as RenderBox?;
+ final scrollable = Scrollable.maybeOf(context);
+ final viewport = scrollable?.context.findRenderObject() as RenderBox?;
+ if (box == null || !box.hasSize || viewport == null || !viewport.hasSize) {
+ _controller.forward();
+ return;
+ }
+ final top = box.localToGlobal(Offset.zero, ancestor: viewport).dy;
+ if (top < viewport.size.height * 0.9) {
+ _position?.removeListener(_check);
+ _controller.forward();
+ }
+ }
@override
- Widget build(BuildContext context) => Semantics(
- button: true,
- selected: selected,
- label: example.prompt,
- excludeSemantics: true,
- child: InkWell(
- onTap: onTap,
- borderRadius: BorderRadius.circular(12),
- child: Container(
- width: 240,
- padding: const EdgeInsets.all(8),
- decoration: BoxDecoration(
- color: selected
- ? grid.AppSurface.selectedFill
- : grid.AppPalette.cardBg,
- borderRadius: BorderRadius.circular(12),
- border: Border.all(
- color: selected
- ? grid.AppPalette.accent.withValues(alpha: 0.6)
- : grid.AppPalette.divider,
- ),
- ),
- child: Stack(
- children: [
- Row(
- children: [
- ClipRRect(
- borderRadius: BorderRadius.circular(8),
- child: SizedBox(
- width: 72,
- height: 54,
- child: ColoredBox(
- color: const Color(0xFF111316),
- child: example.image == null
- ? Center(
- child: EngineMark(
- engine: entry.id,
- displayName: entry.name,
- size: 22,
- ),
- )
- : Image.network(
- example.image!,
- fit: BoxFit.cover,
- errorBuilder: (_, _, _) => Center(
- child: EngineMark(
- engine: entry.id,
- displayName: entry.name,
- size: 22,
- ),
- ),
- ),
- ),
- ),
- ),
- const SizedBox(width: 10),
- Expanded(
- child: Text(
- example.prompt,
- maxLines: 2,
- overflow: TextOverflow.ellipsis,
- style: TextStyle(
- fontSize: 12.5,
- height: 1.35,
- color: selected
- ? grid.AppPalette.textPrimary
- : grid.AppPalette.textSecondary,
- ),
- ),
- ),
- ],
- ),
- if (selected)
- Positioned(
- left: 0,
- right: 0,
- bottom: -8,
- child: AnimatedBuilder(
- animation: progress,
- builder: (context, _) => FractionallySizedBox(
- alignment: Alignment.centerLeft,
- widthFactor: progress.value,
- child: Container(height: 2, color: grid.AppPalette.accent),
- ),
- ),
- ),
- ],
+ void dispose() {
+ _position?.removeListener(_check);
+ _controller.dispose();
+ super.dispose();
+ }
+
+ @override
+ Widget build(BuildContext context) => AnimatedBuilder(
+ animation: _controller,
+ builder: (context, child) {
+ final t = Curves.easeOutCubic.transform(_controller.value);
+ return Opacity(
+ opacity: t,
+ child: Transform.translate(
+ offset: Offset(0, 36 * (1 - t)),
+ child: child,
),
- ),
- ),
+ );
+ },
+ child: widget.child,
);
}
diff --git a/desktop/test/store_discover_test.dart b/desktop/test/store_discover_test.dart
index ab47bfdde..5266c483c 100644
--- a/desktop/test/store_discover_test.dart
+++ b/desktop/test/store_discover_test.dart
@@ -357,7 +357,8 @@ void main() {
find.byKey(const ValueKey('store-page:autonomous/blender')),
findsOneWidget,
);
- expect(find.text('Start with an idea'), findsOneWidget);
+ // Before Blender ships its own examples, its editorial prompts lead the page.
+ expect(find.byKey(const ValueKey('store-example:0')), findsOneWidget);
await _capture(tester, key, 'blender-detail');
final copy = find.byKey(const ValueKey('store-copy-prompt:0'));
await tester.ensureVisible(copy);
diff --git a/desktop/test/store_page_test.dart b/desktop/test/store_page_test.dart
index 1b334b504..196ba89c3 100644
--- a/desktop/test/store_page_test.dart
+++ b/desktop/test/store_page_test.dart
@@ -10,6 +10,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
+import 'package:lucide_icons_flutter/lucide_icons.dart';
import 'package:harness/api/api_client.dart';
import 'package:harness/auth/auth_session.dart';
import 'package:harness/core/config.dart';
@@ -261,13 +262,11 @@ void main() {
);
final local = app.machineStates['machine-1']!;
void expectEnabled(bool enabled) {
- for (final key in ['store-primary-action', 'store-get:machine-1']) {
- expect(
- tester.widget<FilledButton>(_key(key)).onPressed != null,
- enabled,
- reason: key,
- );
- }
+ expect(
+ tester.widget<FilledButton>(_key('store-primary-action')).onPressed !=
+ null,
+ enabled,
+ );
}
expectEnabled(false);
@@ -312,7 +311,7 @@ void main() {
app.installGate = Completer<String?>();
expect(_in('store-primary-action', find.text('Get')), findsOneWidget);
await tester.tap(_key('store-primary-action'));
- await tester.tap(_key('store-get:machine-1'));
+ await tester.tap(_key('store-primary-action'), warnIfMissed: false);
expect(app.installs, [('machine-1', 'autonomous/typst')]);
await tester.pump();
expect(
@@ -327,12 +326,12 @@ void main() {
),
findsOneWidget,
);
- expect(_key('store-get:machine-1'), findsNothing);
+ expect(_in('store-primary-action', find.text('Get')), findsNothing);
app.installGate!.complete('kicad-cli is not on studio-mac');
await tester.pumpAndSettle();
expect(find.text('kicad-cli is not on studio-mac'), findsOneWidget);
- expect(_key('store-get:machine-1'), findsOneWidget);
+ expect(_in('store-primary-action', find.text('Get')), findsOneWidget);
expect(
tester.widget<FilledButton>(_key('store-primary-action')).onPressed,
isNotNull,
@@ -345,7 +344,7 @@ void main() {
) async {
final (app, _) = await _open(tester, initialHarness: 'autonomous/typst');
app.installGate = Completer<String?>();
- await tester.tap(_key('store-get:machine-1'));
+ await tester.tap(_key('store-primary-action'));
await tester.pump();
await tester.tap(_key('store-back'));
await tester.pumpAndSettle();
@@ -445,7 +444,7 @@ void main() {
);
testWidgets(
- 'Open, from the page or a machine row, opens New Harness on that machine in a tab of its own',
+ 'Open opens New Harness on this machine in a tab of its own, and a dismissed dialog leaves none',
(tester) async {
final (app, _) = await _open(tester, initialHarness: 'autonomous/marp');
final tabs = app.swarms.length;
@@ -464,16 +463,6 @@ void main() {
tabs,
reason: 'a dismissed dialog leaves no tab',
);
-
- await tester.tap(_key('store-open:machine-1'));
- await tester.pumpAndSettle();
- expect(
- find.byKey(const ValueKey('create-agent-submit')),
- findsOneWidget,
- );
- await tester.sendKeyEvent(LogicalKeyboardKey.escape);
- await tester.pumpAndSettle();
- expect(app.swarms.length, tabs);
},
);
});
@@ -499,7 +488,6 @@ void main() {
_in('store-machine:machine-1', find.text(status)),
findsOneWidget,
);
- expect(find.text('On this computer'), findsOneWidget);
expect(_key('store-machine:remote'), findsNothing);
says('studio-mac · this computer');
says('Not installed');
@@ -549,7 +537,7 @@ void main() {
isNot(quietColor),
);
expect(
- _in('store-get:machine-1', find.text('Try again')),
+ _in('store-primary-action', find.text('Try again')),
findsOneWidget,
);
@@ -565,7 +553,7 @@ void main() {
app.changed();
await tester.pumpAndSettle();
says('miss typst-cli (cargo install typst-cli)');
- await tester.tap(_key('store-get:machine-1'));
+ await tester.tap(_key('store-primary-action'));
await tester.pumpAndSettle();
expect(app.installs, [('machine-1', _typst.id)]);
@@ -586,10 +574,6 @@ void main() {
app.changed();
await tester.pumpAndSettle();
says(label);
- expect(
- tester.widget<FilledButton>(_key('store-get:machine-1')).onPressed,
- isNull,
- );
expect(
tester.widget<FilledButton>(_key('store-primary-action')).onPressed,
isNull,
@@ -607,7 +591,7 @@ void main() {
app.changed();
await tester.pumpAndSettle();
says('Installed · linked to a checkout');
- expect(_key('store-open:machine-1'), findsOneWidget);
+ expect(_in('store-primary-action', find.text('Open')), findsOneWidget);
expect(_key('store-remove:machine-1'), findsOneWidget);
},
);
@@ -717,7 +701,6 @@ void main() {
app.changed();
await tester.pumpAndSettle();
expect(_in('store-primary-action', find.text('Open')), findsOneWidget);
- expect(_key('store-open:machine-1'), findsOneWidget);
},
);
@@ -792,8 +775,8 @@ void main() {
),
);
expect(find.text('Website'), findsNothing);
- expect(find.text('Package source'), findsNothing);
- await tester.tap(find.text('Upstream project'));
+ expect(find.text('Package'), findsNothing);
+ await tester.tap(find.text('Source'));
await tester.pump();
expect(launched, ['https://github.com/marp-team/marp-cli']);
@@ -816,17 +799,24 @@ void main() {
);
testWidgets(
- 'every link the registry names is a chip, the licence without an arrow',
+ 'every link the registry names is under the name, the licence without an arrow',
(tester) async {
await _open(tester, initialHarness: 'autonomous/marp');
- for (final label in [
- 'Website',
- 'Upstream project',
- 'Package source',
- 'Licence · MIT',
- ]) {
+ for (final label in ['Website', 'Source', 'Package', 'MIT licence']) {
expect(find.text(label), findsOneWidget, reason: label);
}
+ expect(
+ find.descendant(
+ of: find
+ .ancestor(
+ of: find.text('MIT licence'),
+ matching: find.byType(Row),
+ )
+ .first,
+ matching: find.byIcon(LucideIcons.arrowUpRight300),
+ ),
+ findsNothing,
+ );
},
);
diff --git a/desktop/test/store_screen_test.dart b/desktop/test/store_screen_test.dart
index f687aeafb..01dbfd670 100644
--- a/desktop/test/store_screen_test.dart
+++ b/desktop/test/store_screen_test.dart
@@ -473,7 +473,7 @@ void main() {
expect(find.text('studio-mac · this computer'), findsOneWidget);
expect(find.text('Not installed'), findsOneWidget);
- await tester.tap(find.byKey(const ValueKey('store-get:machine-1')));
+ await tester.tap(find.byKey(const ValueKey('store-primary-action')));
await tester.pumpAndSettle();
expect(notifier.installs, [('machine-1', 'autonomous/typst')]);
},
@@ -501,7 +501,7 @@ void main() {
findsOneWidget,
);
expect(find.text('Website'), findsOneWidget);
- expect(find.text('Licence · MIT'), findsOneWidget);
+ expect(find.text('MIT licence'), findsOneWidget);
await tester.ensureVisible(
find.byKey(const ValueKey('store-remove:machine-1')),
@@ -600,7 +600,13 @@ void main() {
expect(find.text('OpenAI · Code · Coding agent'), findsOneWidget);
expect(find.textContaining('npm install'), findsNothing);
expect(find.text('Not installed'), findsOneWidget);
- expect(find.byKey(const ValueKey('store-get:machine-1')), findsOneWidget);
+ expect(
+ find.descendant(
+ of: find.byKey(const ValueKey('store-primary-action')),
+ matching: find.text('Get'),
+ ),
+ findsOneWidget,
+ );
expect(
find.byKey(const ValueKey('store-remove:machine-1')),
findsNothing,
diff --git a/desktop/test/store_showcase_test.dart b/desktop/test/store_showcase_test.dart
index ea05fe443..f1c5f96d6 100644
--- a/desktop/test/store_showcase_test.dart
+++ b/desktop/test/store_showcase_test.dart
@@ -1,5 +1,6 @@
-// A store product page shows what a harness does: an example's prompt beside a picture of what it
-// made, and "Try this prompt" opens New Harness with that prompt as the first message.
+// A store product page shows what a harness does: its examples one after another down the page, each
+// a prompt, the picture of what came of it and "Try this prompt", which opens New Harness with that
+// prompt as the first message.
import 'package:file_selector_platform_interface/file_selector_platform_interface.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@@ -26,6 +27,7 @@ const _lamp = StoreExample(
);
const _gear = StoreExample(
prompt: 'A planetary gearbox, 5:1, printable without supports.',
+ image: 'https://example.com/gear.jpg',
caption: 'Gearbox · STEP',
);
@@ -91,42 +93,26 @@ class _Notifier extends AppNotifier {
}
}
-String _promptText(WidgetTester tester) => tester
- .widget<Text>(find.byKey(const ValueKey('store-showcase-prompt')))
- .textSpan!
- .toPlainText();
-
-/// What has been typed so far: the rest of the prompt is laid out but transparent.
-String _typedText(WidgetTester tester) =>
- (tester
- .widget<Text>(
- find.byKey(const ValueKey('store-showcase-prompt')),
- )
- .textSpan!
- as TextSpan)
- .children!
- .first
- .toPlainText();
-
-Future<void> _pumpShowcase(
+Future<void> _pumpFlow(
WidgetTester tester, {
ValueChanged<String>? onTry,
- bool? autoAdvance,
+ bool animate = false,
List<StoreExample> examples = const [_lamp, _gear],
+ Size size = const Size(1200, 900),
}) async {
tester.view.devicePixelRatio = 1;
- tester.view.physicalSize = const Size(1200, 900);
+ tester.view.physicalSize = size;
addTearDown(tester.view.reset);
await tester.pumpWidget(
MaterialApp(
theme: grid.buildAppTheme(brightness: Brightness.dark),
home: Scaffold(
body: SingleChildScrollView(
- child: StoreShowcase(
+ child: StoreExampleFlow(
entry: _blender,
examples: examples,
onTry: onTry,
- autoAdvance: autoAdvance,
+ animate: animate,
),
),
),
@@ -191,45 +177,55 @@ void main() {
});
});
- testWidgets('shows the first example whole, and a strip picks another', (
+ testWidgets('every example is on the page, in order, prompt over picture', (
tester,
) async {
- await _pumpShowcase(tester);
- expect(_promptText(tester), '“${_lamp.prompt}”');
+ await _pumpFlow(tester);
+ expect(find.text('“${_lamp.prompt}”'), findsOneWidget);
+ expect(find.text('“${_gear.prompt}”'), findsOneWidget);
+ expect(find.text('01 / 02'), findsOneWidget);
+ expect(find.text('02 / 02'), findsOneWidget);
expect(find.text('Desk lamp · 9 parts'), findsOneWidget);
- expect(find.text('YOU ASK'), findsOneWidget);
- expect(find.text('IT MAKES'), findsOneWidget);
- expect(find.text('Blender harness'), findsOneWidget);
-
- await tester.tap(find.byKey(const ValueKey('store-example:1')));
- await tester.pumpAndSettle();
- expect(_promptText(tester), '“${_gear.prompt}”');
expect(find.text('Gearbox · STEP'), findsOneWidget);
+ final first = tester.getRect(
+ find.byKey(const ValueKey('store-example-prompt:0')),
+ );
+ final picture = tester.getRect(
+ find.byKey(const ValueKey('store-example-image:0')),
+ );
+ final second = tester.getRect(
+ find.byKey(const ValueKey('store-example-prompt:1')),
+ );
+ expect(picture.top, greaterThan(first.bottom));
+ expect(second.top, greaterThan(picture.bottom));
expect(tester.takeException(), isNull);
});
- testWidgets('one example needs no strip', (tester) async {
- await _pumpShowcase(tester, examples: const [_lamp]);
- expect(find.byKey(const ValueKey('store-example:0')), findsNothing);
- });
-
- testWidgets('Try this prompt hands over the prompt on screen', (
+ testWidgets('an example with no picture is its prompt and its button', (
tester,
) async {
+ await _pumpFlow(
+ tester,
+ examples: const [StoreExample(prompt: 'Start a slide deck.')],
+ );
+ expect(find.text('“Start a slide deck.”'), findsOneWidget);
+ expect(find.byKey(const ValueKey('store-try-prompt:0')), findsOneWidget);
+ expect(find.byKey(const ValueKey('store-example-image:0')), findsNothing);
+ });
+
+ testWidgets('each Try hands over its own prompt', (tester) async {
final tried = <String>[];
- await _pumpShowcase(tester, onTry: tried.add);
- await tester.tap(find.byKey(const ValueKey('store-try-prompt')));
- await tester.tap(find.byKey(const ValueKey('store-example:1')));
- await tester.pumpAndSettle();
- await tester.tap(find.byKey(const ValueKey('store-try-prompt')));
- expect(tried, [_lamp.prompt, _gear.prompt]);
+ await _pumpFlow(tester, onTry: tried.add, size: const Size(1200, 4000));
+ await tester.tap(find.byKey(const ValueKey('store-try-prompt:1')));
+ await tester.tap(find.byKey(const ValueKey('store-try-prompt:0')));
+ expect(tried, [_gear.prompt, _lamp.prompt]);
});
testWidgets('Try this prompt is off with nowhere to open it', (tester) async {
- await _pumpShowcase(tester);
+ await _pumpFlow(tester);
final button = tester.widget<ButtonStyleButton>(
find.ancestor(
- of: find.text('Try this prompt'),
+ of: find.text('Try this prompt').first,
matching: find.bySubtype<ButtonStyleButton>(),
),
);
@@ -253,51 +249,52 @@ void main() {
null,
),
);
- await _pumpShowcase(tester);
- await tester.tap(find.byKey(const ValueKey('store-copy-prompt')));
+ await _pumpFlow(tester);
+ await tester.tap(find.byKey(const ValueKey('store-copy-prompt:0')));
await tester.pump();
expect(copied, _lamp.prompt);
});
- testWidgets(
- 'playing, it types the prompt, then moves on to the next example',
- (tester) async {
- await _pumpShowcase(tester, autoAdvance: true);
- await tester.pump(const Duration(milliseconds: 300));
- final typing = _typedText(tester);
- expect(
- typing.length,
- lessThan('“${_lamp.prompt}”'.length),
- reason: 'still typing',
- );
- expect(typing, startsWith('“A desk'));
-
- await tester.pump(const Duration(seconds: 3)); // typed and revealed
- await tester.pump(const Duration(seconds: 1));
- expect(_promptText(tester), '“${_lamp.prompt}”');
- await tester.pump(const Duration(seconds: 7)); // seen for a while
- await tester.pump(const Duration(seconds: 3));
- await tester.pump(const Duration(seconds: 1));
- expect(_promptText(tester), '“${_gear.prompt}”');
-
- await tester.pumpWidget(const SizedBox());
- },
- );
+ testWidgets('an example rises into view when it is scrolled to, once', (
+ tester,
+ ) async {
+ await _pumpFlow(tester, animate: true, size: const Size(1200, 700));
+ await tester.pump(const Duration(seconds: 1));
+ double opacityOf(int i) => tester
+ .widget<Opacity>(
+ find
+ .ancestor(
+ of: find.byKey(ValueKey('store-example:$i')),
+ matching: find.byType(Opacity),
+ )
+ .first,
+ )
+ .opacity;
+ expect(opacityOf(0), 1, reason: 'the first is on screen');
+ expect(opacityOf(1), 0, reason: 'the second is still below the fold');
+ await tester.drag(
+ find.byType(SingleChildScrollView),
+ const Offset(0, -1600),
+ );
+ await tester.pump();
+ await tester.pump(const Duration(seconds: 1));
+ expect(opacityOf(1), 1);
+ });
- testWidgets('Reduce Motion shows it whole and stays put', (tester) async {
+ testWidgets('Reduce Motion shows every example at once', (tester) async {
tester.view.devicePixelRatio = 1;
- tester.view.physicalSize = const Size(1200, 900);
+ tester.view.physicalSize = const Size(1200, 700);
addTearDown(tester.view.reset);
await tester.pumpWidget(
- MaterialApp(
+ const MaterialApp(
home: MediaQuery(
- data: const MediaQueryData(disableAnimations: true),
+ data: MediaQueryData(disableAnimations: true),
child: Scaffold(
body: SingleChildScrollView(
- child: StoreShowcase(
+ child: StoreExampleFlow(
entry: _blender,
- examples: const [_lamp, _gear],
- autoAdvance: true,
+ examples: [_lamp, _gear],
+ animate: true,
),
),
),
@@ -305,31 +302,14 @@ void main() {
),
);
await tester.pump();
- expect(_promptText(tester), '“${_lamp.prompt}”');
- await tester.pump(const Duration(seconds: 30));
- expect(_promptText(tester), '“${_lamp.prompt}”');
- });
-
- testWidgets('narrow, the prompt sits above the picture', (tester) async {
- tester.view.devicePixelRatio = 1;
- tester.view.physicalSize = const Size(520, 1200);
- addTearDown(tester.view.reset);
- await tester.pumpWidget(
- const MaterialApp(
- home: Scaffold(
- body: SingleChildScrollView(
- child: StoreShowcase(entry: _blender, examples: [_lamp, _gear]),
- ),
- ),
+ for (final opacity in tester.widgetList<Opacity>(
+ find.ancestor(
+ of: find.byKey(const ValueKey('store-example:1')),
+ matching: find.byType(Opacity),
),
- );
- await tester.pump();
- final prompt = tester.getRect(
- find.byKey(const ValueKey('store-showcase-prompt')),
- );
- final picture = tester.getRect(find.text('IT MAKES'));
- expect(picture.top, greaterThan(prompt.bottom));
- expect(tester.takeException(), isNull);
+ )) {
+ expect(opacity.opacity, 1);
+ }
});
group('New Harness with a first message', () {
@@ -420,7 +400,7 @@ void main() {
});
testWidgets(
- 'the product page leads with the examples and tries one in New Harness',
+ 'the product page scrolls through the examples and tries one in New Harness',
(tester) async {
tester.view.devicePixelRatio = 1;
tester.view.physicalSize = const Size(1400, 1000);
@@ -453,18 +433,12 @@ void main() {
);
await tester.pumpAndSettle();
- expect(
- find.byKey(const ValueKey('store-showcase-stage')),
- findsOneWidget,
- );
- expect(
- find.text('Start with an idea'),
- findsNothing,
- reason: 'the examples replace the bare prompt list',
- );
- await tester.tap(find.byKey(const ValueKey('store-example:1')));
+ expect(find.byKey(const ValueKey('store-example:0')), findsOneWidget);
+ expect(find.byKey(const ValueKey('store-example:1')), findsOneWidget);
+ final tryGear = find.byKey(const ValueKey('store-try-prompt:1'));
+ await tester.ensureVisible(tryGear);
await tester.pumpAndSettle();
- await tester.tap(find.byKey(const ValueKey('store-try-prompt')));
+ await tester.tap(tryGear);
await tester.pumpAndSettle();
expect(
find.byKey(const ValueKey('create-agent-submit')),
diff --git a/desktop/test/store_tab_state_test.dart b/desktop/test/store_tab_state_test.dart
index bfe19f651..7042c3c70 100644
--- a/desktop/test/store_tab_state_test.dart
+++ b/desktop/test/store_tab_state_test.dart
@@ -399,11 +399,10 @@ void main() {
expect(older.requests, isEmpty);
expect(relay.requests, isEmpty);
- await tester.tap(find.byKey(const ValueKey('store-get:local')));
+ await tester.tap(find.byKey(const ValueKey('store-primary-action')));
await tester.pumpAndSettle();
expect(installed, {'autonomous/typst'});
expect(says('local', 'Installed'), findsOneWidget);
- expect(find.byKey(const ValueKey('store-open:local')), findsOneWidget);
expect(
find.descendant(
of: find.byKey(const ValueKey('store-primary-action')),