Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <endpoint>.<method>`) 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`
Expand Down
19 changes: 13 additions & 6 deletions lib/preview/preview_hero_palette.dart
Original file line number Diff line number Diff line change
@@ -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<Color> 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,
];
}
7 changes: 7 additions & 0 deletions lib/process/serverpod_process.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -237,6 +238,12 @@ class ServerpodProcessController extends ChangeNotifier

static const _firstRunAside = ' (first run may take 30-60s)';

/// An open method stream (`STREAM <endpoint>.<method>`, 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;

Expand Down
24 changes: 24 additions & 0 deletions test/process/serverpod_process_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading