Files
pipelines/app/tool/fixture_host/fixture_host_web.dart
T
alan bc00d321d9 Designs: cache themes, value-equal tokens, and a per-design perf budget
A rebuilt Terminal theme never equalled the last one (AppDesignTokens,
AnsiAccents and the tab indicator compared by identity), so any host
rebuild (a detached window's title, a font notification) rebuilt every
Theme.of dependent and ran MaterialApp's 200 ms theme animation. Themes
are now cached per (design, brightness, font) and compare by value;
chat colour seeded schemes are cached too.

test/perf/design_bench_test.dart and tool/perf/design_bench.mjs check
every registered AppDesign against Default (tool/perf/README.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 19:43:10 +00:00

35 lines
1.2 KiB
Dart

import 'package:flutter/widgets.dart';
import 'package:pipelines_app/application/server_endpoint.dart';
import 'package:web/web.dart' as web;
import '../perf/backdrop_census.dart';
import '../perf/chat_scroll_probe.dart';
import '../perf/design_probe.dart';
import '../perf/frame_log.dart';
/// The fixture options: the page URL's query.
Map<String, String> fixtureParams() => Uri.base.queryParameters;
/// Installs the DevTools-facing probes the capture kit evaluates.
void installHostProbes(Map<String, String> params) {
installBackdropCensus();
installFrameLog(params);
installChatScrollProbe();
installDesignProbe(params);
}
/// Moves the browser to [route] before the app reads its location.
void openFixtureRoute(String route) {
web.window.history.replaceState(null, '', route);
}
/// The browser build's endpoint is its own page origin.
ServerEndpoint fixtureServer(Map<String, String> params) =>
ServerEndpoint.resolve(base: Uri.base, web: true);
/// The browser's location is the route; no provider is needed.
RouteInformationProvider? fixtureRouteProvider(String? route) => null;
/// Runs [app] unchanged.
void runFixtureApp(Widget app, Map<String, String> params) => runApp(app);