69ae0519bd
Keep capture and probe tooling on the app's single Material surface by removing obsolete platform switches, hosts, and documentation. Preserve the existing Material routes and fixture behavior while retaining compatibility APIs outside this lane.
39 lines
1.2 KiB
Dart
39 lines
1.2 KiB
Dart
import 'dart:js_interop';
|
|
import 'dart:js_interop_unsafe';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:pipelines_app/core/servers/server_catalog.dart';
|
|
import 'package:pipelines_app/core/servers/server_catalog_store.dart';
|
|
import 'package:pipelines_app/features/settings/saved_servers_section.dart';
|
|
import 'package:pipelines_app/features/settings/server_connections.dart';
|
|
|
|
// Isolated, in-memory browser fixture: first write fails, retry succeeds.
|
|
// No sockets, real storage, or production requests.
|
|
void main() {
|
|
final connections = ServerConnections(
|
|
store: _Store(),
|
|
onSelected: (_) async {},
|
|
);
|
|
final body = SafeArea(
|
|
child: SingleChildScrollView(
|
|
child: SavedServersSection(connections: connections),
|
|
),
|
|
);
|
|
runApp(MaterialApp(home: Scaffold(body: body)));
|
|
}
|
|
|
|
class _Store extends MemoryServerCatalogStore {
|
|
var _attempts = 0;
|
|
|
|
@override
|
|
Future<bool> save(ServerCatalog catalog) async {
|
|
globalContext.setProperty(
|
|
'serverEditorSaveAttempts'.toJS,
|
|
(++_attempts).toJS,
|
|
);
|
|
await Future<void>.delayed(const Duration(seconds: 3));
|
|
if (_attempts == 1) return false;
|
|
return super.save(catalog);
|
|
}
|
|
}
|