diff --git a/AGENTS.md b/AGENTS.md index 050af22..5bf725d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -387,6 +387,10 @@ toggle that used to lead the bar is Logs → Show/Hide Logs. call included — and those last milliseconds; shown at once, a busy server would flicker a spinner on every request. A younger one is waited out: `ServerStatus.settlesIn` tells the indicator when to look again. +- **Open method streams (`STREAM .`) are never shown.** A + stream is in flight for as long as a client stays connected, so it held the + spinner up for the whole run of an app that streams. The status skips it; + the log still records it. - Runner labels lose the trailing dots the CLI writes for a terminal. ### The Logs menu, and `LogViewController` diff --git a/lib/preview/preview_hero_palette.dart b/lib/preview/preview_hero_palette.dart index 0e272f0..f8310b0 100644 --- a/lib/preview/preview_hero_palette.dart +++ b/lib/preview/preview_hero_palette.dart @@ -1,15 +1,22 @@ import 'dart:ui'; -/// Colors sampled from [assets/hero-main.webp], with very dark tones lifted -/// so the preview backdrop never reads as pure black. +/// Colors of the Serverpod design system's blue hero picture, +/// `hero-cloud.webp` (indigo to cyan), taken from the `[data-theme="cloud"]` +/// `--hero-*` tokens the design system samples from it. The darkest tones +/// are lifted so the preview backdrop never reads as pure black. abstract final class PreviewHeroPalette { - static const Color base = Color(0xFF1E1E5A); + /// `--hero-indigo` (#141B56), lifted. + static const Color base = Color(0xFF1A2262); /// Four corner colors for [AnimatedMeshGradient] (exactly four required). static const List meshColors = [ - Color(0xFFF8A8C8), - Color(0xFF5858A8), - Color(0xFF382878), + // Between `--hero-glow` (#42C4FC) and `--hero-haze` (#B2F5FE): the + // cyan floor of the picture. + Color(0xFF7ADCFD), + // The bright blue band across its middle. + Color(0xFF3A8AE6), + // `--hero-mid`. + Color(0xFF2E46A3), base, ]; } diff --git a/lib/process/serverpod_process.dart b/lib/process/serverpod_process.dart index 8645012..324062d 100644 --- a/lib/process/serverpod_process.dart +++ b/lib/process/serverpod_process.dart @@ -190,6 +190,7 @@ class ServerpodProcessController extends ChangeNotifier final at = now ?? DateTime.now(); Duration? settlesIn; for (final operation in log.activeOperations.reversed) { + if (_isStream(operation.label)) continue; final age = at.difference(operation.startedAt); if (age >= kStatusOperationDelay) { return ServerStatus.busy(_sentence(operation.label)); @@ -237,6 +238,12 @@ class ServerpodProcessController extends ChangeNotifier static const _firstRunAside = ' (first run may take 30-60s)'; + /// An open method stream (`STREAM .`, from the pod's + /// session log). It stays in flight for as long as a client is connected — + /// the whole time the app runs — so it says nothing about what the server + /// is doing and would hold the spinner up forever. The log still shows it. + static bool _isStream(String label) => label.startsWith('STREAM '); + /// Whether the attached runner is one App Studio started, and so stops. bool get ownsRunner => _owned; diff --git a/test/process/serverpod_process_test.dart b/test/process/serverpod_process_test.dart index df5c65a..76a6b75 100644 --- a/test/process/serverpod_process_test.dart +++ b/test/process/serverpod_process_test.dart @@ -699,6 +699,30 @@ void main() { expect(later.message, 'greeting.hello'); }); + test('an open method stream never shows, however long it runs', () async { + final runner = await projectWithRunner( + snapshot: { + 'flutterApps': [demoApp], + 'runningFlutterApps': ['demo'], + 'flutterAppUrls': {'demo': 'http://localhost:51234'}, + }, + ); + await open(runner); + process.markPreviewLive(); + final started = DateTime.now().subtract(const Duration(minutes: 5)); + runner.emit({ + 'event': 'operationStarted', + 'id': 'stream', + 'label': 'STREAM greeting.watch', + 'startedAt': started.toIso8601String(), + }); + await until(() => process.log.activeOperations.isNotEmpty); + + final status = process.serverStatus(); + expect(status, const ServerStatus.running()); + expect(status.settlesIn, isNull); + }); + test('a failed build is stopped, with the reason in the detail', () async { final runner = await projectWithRunner(stage: 'degraded'); await open(runner);