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.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
fix(desktop): give the terminal-first UI a type scale (#201)
Deeccf1bd8ce0cc
diff --git a/desktop/CLAUDE.md b/desktop/CLAUDE.mdindex 732e2af32..acea80d2b 100644--- a/desktop/CLAUDE.md+++ b/desktop/CLAUDE.md@@ -245,6 +245,14 @@ its headless debug timings do not establish native display or network latency.- `lib/theme/app_theme.dart` (`AppColors`, `AppTheme.terminalLight/terminalDark`) is a set ofadapters over those tokens. Nothing here is `const` on purpose — freezing a colour is how light modesilently breaks. Do not add a parallel palette.+- **Type** is `AppType` (`lib/shared/theme/app_type.dart`): one size scale (display 28, title 20,+ heading 15, label/mono 13, monoLabel 12, caption/monoMeta 11) across two faces. The terminal's+ face leads — headings, labels, buttons, rows, fields, tabs, shortcuts and anything copied are+ mono — and the system sans is kept for prose alone (`body`, `caption`), which is what stops a+ screen reading as a wall of mono. Sizes are fixed: `terminalTextStyle` (the terminal's own size,+ ⌘+/⌘−) is only for the grid, its composer and find field, and `terminalTextScaleOf` only for their+ geometry — UI boxes use `appTextScaleOf`. Native tabs get the terminal face at+ `AppType.chromeSize`; native menus keep the system menu font.- `ThemeModeStore` and `TerminalFontStore` are `ValueNotifier` singletons (they must resolve above theprovider scope and before sign-in).diff --git a/desktop/lib/core/desktop_window.dart b/desktop/lib/core/desktop_window.dartindex 359ba783e..960aec0f0 100644--- a/desktop/lib/core/desktop_window.dart+++ b/desktop/lib/core/desktop_window.dart@@ -4,7 +4,7 @@ import 'package:window_manager/window_manager.dart';import 'package:flutter/services.dart';import '../shared/theme/color_palette.dart';-import '../terminal/terminal_font_store.dart';+import '../shared/theme/app_type.dart';import 'build_identity.dart';/// Whether this build runs inside a window the app is allowed to manage.@@ -40,9 +40,9 @@ Future<void> configureDesktopWindow({if (Platform.isMacOS) {await const MethodChannel('harness/swarm_tabs').invokeMethod('configure', {'palette': palette.nativeColors,- 'fontFamily': terminalFontStore.value.fontFamily,- 'fontSize': terminalFontStore.size,- 'fontFallbacks': terminalFontStore.value.fontFamilyFallback,+ 'fontFamily': AppType.monoFamily,+ 'fontSize': AppType.chromeSize,+ 'fontFallbacks': AppType.monoFallback,});}// Always open filling the screen (owner, 2026-09-15): the tabs, a viewerdiff --git a/desktop/lib/orchestrator/orchestrator_launcher.dart b/desktop/lib/orchestrator/orchestrator_launcher.dartindex 04fa5e9fc..44afb73ee 100644--- a/desktop/lib/orchestrator/orchestrator_launcher.dart+++ b/desktop/lib/orchestrator/orchestrator_launcher.dart@@ -5,7 +5,6 @@ import '../shared/widgets/labeled_field.dart';import 'package:flutter/material.dart';import 'package:flutter/services.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../shared/theme/app_theme.dart' as grid;import '../shared/widgets/app_dialog.dart';@@ -198,7 +197,7 @@ class _OrchestratorLauncherState extends State<OrchestratorLauncher> {minLines: 5,maxLines: 9,maxLength: 24000,- style: Theme.of(context).textTheme.titleMedium,+ style: grid.AppType.mono(height: 1.45),onChanged: (_) => setState(() {}),decoration: const InputDecoration(border: InputBorder.none,@@ -289,7 +288,7 @@ class _OrchestratorLauncherState extends State<OrchestratorLauncher> {const SizedBox(height: 18),Text('Runs on this computer with installed harnesses. Each specialist gets its own folder; no automatic installs.',- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textSecondary,),),diff --git a/desktop/lib/orchestrator/orchestrator_workspace.dart b/desktop/lib/orchestrator/orchestrator_workspace.dartindex 5c083be8e..34d787ee4 100644--- a/desktop/lib/orchestrator/orchestrator_workspace.dart+++ b/desktop/lib/orchestrator/orchestrator_workspace.dart@@ -3,7 +3,6 @@ import 'dart:async';import 'package:flutter/material.dart';import 'package:flutter/services.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../shared/theme/app_theme.dart' as grid;import '../shared/widgets/app_dialog.dart';@@ -369,7 +368,7 @@ class _OrchestratorWorkspaceState extends State<OrchestratorWorkspace> {'${task.harness} · ${question != null ? 'needs input' : task.state}${task.attempt > 1 ? ' · attempt ${task.attempt}' : ''}',maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.body(color: task.error == null && question == null? grid.AppPalette.textSecondary: grid.AppPalette.warn,@@ -475,7 +474,7 @@ class _OrchestratorWorkspaceState extends State<OrchestratorWorkspace> {: role == 'assistant'? 'Director': 'Project update',- style: terminalTextStyle(+ style: grid.AppType.label(color: grid.AppPalette.textSecondary,),),@@ -496,7 +495,7 @@ class _OrchestratorWorkspaceState extends State<OrchestratorWorkspace> {].contains(message['delivery']))Text('Queued for the agent',- style: terminalTextStyle(+ style: grid.AppType.caption(color: grid.AppPalette.textSecondary,),),@@ -514,7 +513,7 @@ class _OrchestratorWorkspaceState extends State<OrchestratorWorkspace> {alignment: Alignment.centerLeft,child: Text('Director is working…',- style: terminalTextStyle(color: grid.AppPalette.textSecondary),+ style: grid.AppType.body(color: grid.AppPalette.textSecondary),),),),@@ -563,7 +562,7 @@ class _OrchestratorWorkspaceState extends State<OrchestratorWorkspace> {children: [Text('Shift ↵ for a new line',- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: grid.AppPalette.textSecondary,),),diff --git a/desktop/lib/screens/login_screen.dart b/desktop/lib/screens/login_screen.dartindex 6259de6fa..619168b52 100644--- a/desktop/lib/screens/login_screen.dart+++ b/desktop/lib/screens/login_screen.dart@@ -1,6 +1,5 @@import 'package:flutter/material.dart';import 'package:flutter/services.dart';-import 'package:harness/terminal/terminal_text.dart';import '../shared/theme/app_theme.dart' as grid;import '../state/app_state.dart';@@ -51,8 +50,7 @@ class LoginScreen extends StatelessWidget {// Preserve room for the primary action and its explanation at the minimum// window size with enlarged text. The illustration is supplementary.final showFleet =- !compact ||- MediaQuery.textScalerOf(context).scale(terminalFontStore.size) <= 20;+ !compact || MediaQuery.textScalerOf(context).scale(16) <= 20;return CallbackShortcuts(bindings: {@@ -94,7 +92,7 @@ class LoginScreen extends StatelessWidget {Text('Your agents, wherever they run',textAlign: TextAlign.center,- style: Theme.of(context).textTheme.titleLarge,+ style: grid.AppType.title(),),const SizedBox(height: 8),Text(diff --git a/desktop/lib/screens/swarm_screen.dart b/desktop/lib/screens/swarm_screen.dartindex 37a48d0d5..84ae6debc 100644--- a/desktop/lib/screens/swarm_screen.dart+++ b/desktop/lib/screens/swarm_screen.dart@@ -117,6 +117,10 @@ typedef _NewHarnessContext = ({String? projectName,});+/// The command box's title line, a step quieter than the rows under it.+TextStyle get _boxCaption =>+ grid.AppType.monoLabel(color: kBoxFaint, fontWeight: FontWeight.w400);+class _SwarmScreenState extends State<SwarmScreen> {static const _channel = MethodChannel('harness/swarm_tabs');late final bool _native =@@ -443,7 +447,7 @@ class _SwarmScreenState extends State<SwarmScreen> {padding: const EdgeInsets.fromLTRB(20, 8, 8, 0),child: Row(children: [- Text('Quick Start', style: boxMonoStyle()),+ Text('Quick Start', style: grid.AppType.heading()),const Spacer(),TextButton(onPressed: () => Navigator.pop(context, 'tour'),@@ -548,9 +552,11 @@ class _SwarmScreenState extends State<SwarmScreen> {'enabled': _routeIsCurrent && !_dialogOpen && !_spokenPaletteOpen,'activeId': app.activeSwarmId,'palette': grid.AppTheme.palette.value.nativeColors,- 'fontFamily': terminalFontStore.value.fontFamily,- 'fontSize': terminalFontStore.size,- 'fontFallbacks': terminalFontStore.value.fontFamilyFallback,+ // The tabs wear the terminal's face at the chrome size, not its size:+ // ⌘+ and ⌘− zoom the terminal alone.+ 'fontFamily': grid.AppType.monoFamily,+ 'fontSize': grid.AppType.chromeSize,+ 'fontFallbacks': grid.AppType.monoFallback,'canReopen': app.canReopenLastClosed,'canFind': _canFindTerminal,'canClosePane': app.focusedPane != null,@@ -2083,7 +2089,7 @@ class _SwarmScreenState extends State<SwarmScreen> {padding: const EdgeInsets.fromLTRB(14, 9, 14, 2),child: Row(children: [- Text(search.title, style: boxMonoStyle(color: kBoxFaint)),+ Text(search.title, style: _boxCaption),if (search.placement == HarnessPlacement.currentTab ||search.split != null)Expanded(@@ -2094,7 +2100,7 @@ class _SwarmScreenState extends State<SwarmScreen> {key: const ValueKey('swarm-search-target'),maxLines: 1,overflow: TextOverflow.ellipsis,- style: boxMonoStyle(color: kBoxFaint),+ style: _boxCaption,),),)@@ -2197,8 +2203,10 @@ class _SwarmScreenState extends State<SwarmScreen> {maxHeight:(constraints.maxHeight -(_native ? 0 : _tabBarHeight)) *- (.65 * terminalFontStore.size / terminalFontSize)- .clamp(.65, 1.0),+ (.65 * grid.appTextScaleOf(context)).clamp(+ .65,+ 1.0,+ ),),child: contents,),@@ -2684,7 +2692,7 @@ class _SwarmScreenState extends State<SwarmScreen> {if (message.isNotEmpty) {ScaffoldMessenger.of(context).showSnackBar(SnackBar(- content: Text(message, style: terminalTextStyle()),+ content: Text(message),action: goBack == null? null: SnackBarAction(@@ -2802,7 +2810,7 @@ class _SwarmScreenState extends State<SwarmScreen> {Expanded(child: Text('Keyboard config has an error. Using the last working shortcuts.',- style: terminalTextStyle(),+ style: grid.AppType.body(),),),TextButton(@@ -2824,7 +2832,7 @@ class _SwarmScreenState extends State<SwarmScreen> {alignment: Alignment.centerLeft,child: Text('$_pendingKeys … Esc to cancel',- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: grid.AppPalette.textSecondary,),),@@ -2848,7 +2856,7 @@ class _SwarmScreenState extends State<SwarmScreen> {_projects.error ?? app.lastError!,maxLines: 2,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(),+ style: grid.AppType.body(),),),if (_projects.error == null &&@@ -3201,7 +3209,11 @@ class _SwarmScreenState extends State<SwarmScreen> {swarm.name,maxLines: 1,overflow: TextOverflow.ellipsis,- style: boxMonoStyle(),+ // Like the native tabs.+ style: grid.AppType.monoLabel(+ color: Colors.white,+ fontWeight: FontWeight.w400,+ ),),),],@@ -3257,7 +3269,7 @@ class _SwarmScreenState extends State<SwarmScreen> {grid.AppPalette.swarmField,),overlayColor: grid.AppPalette.swarmAccent,- textStyle: boxMonoStyle(),+ textStyle: grid.AppType.monoLabel(),minimumSize: const Size(0, 28),padding: const EdgeInsets.symmetric(horizontal: 12),tapTargetSize: MaterialTapTargetSize.shrinkWrap,@@ -3295,7 +3307,6 @@ class _TabActionsRevealState extends State<_TabActionsReveal> {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return MouseRegion(onEnter: (_) => setState(() => _hovered = true),onExit: (_) => setState(() => _hovered = false),diff --git a/desktop/lib/settings/appearance/palette_section.dart b/desktop/lib/settings/appearance/palette_section.dartindex c651cafb9..14b8faa78 100644--- a/desktop/lib/settings/appearance/palette_section.dart+++ b/desktop/lib/settings/appearance/palette_section.dart@@ -1,7 +1,6 @@import 'dart:async';import 'package:flutter/material.dart';-import 'package:harness/terminal/terminal_text.dart';import '../../shared/theme/app_theme.dart' as grid;import '../../shared/theme/appearance_prefs_store.dart';@@ -69,7 +68,7 @@ class _PaletteChoice extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);+ grid.AppTheme.watch(context);return Semantics(button: true,selected: selected,@@ -107,10 +106,7 @@ class _PaletteChoice extends StatelessWidget {Expanded(child: Text(palette.label,- style: terminalTextStyle(- color: Colors.white,- fontWeight: FontWeight.w500,- ),+ style: grid.AppType.label(color: Colors.white),),),SizedBox(@@ -135,7 +131,7 @@ class _WorkspacePreview extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);+ grid.AppTheme.watch(context);return ClipRRect(borderRadius: BorderRadius.circular(4),child: SizedBox(diff --git a/desktop/lib/settings/sections/about_section.dart b/desktop/lib/settings/sections/about_section.dartindex 3f5bec2b3..77653fb83 100644--- a/desktop/lib/settings/sections/about_section.dart+++ b/desktop/lib/settings/sections/about_section.dart@@ -76,7 +76,7 @@ class _AboutSectionState extends State<AboutSection> {? 'Harness checks for a newer build when it starts, ''and every six hours after that.': 'Updates are disabled in this build.',- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textFaint,height: 1.45,),@@ -162,11 +162,7 @@ class _Identity extends StatelessWidget {children: [Text(desktopAppName,- style: terminalTextStyle(- color: grid.AppPalette.textPrimary,- fontWeight: grid.AppFont.semibold,- letterSpacing: -0.1,- ),+ style: grid.AppType.heading(color: grid.AppPalette.textPrimary),),const SizedBox(height: 4),_VersionLine(state: state),@@ -204,7 +200,11 @@ class _VersionLineState extends State<_VersionLine> {@overrideWidget build(BuildContext context) {grid.AppTheme.watch(context);- final style = terminalTextStyle(color: grid.AppPalette.textSecondary);+ TerminalFontScope.watch(context);+ final style = grid.AppType.monoLabel(+ color: grid.AppPalette.textSecondary,+ fontWeight: FontWeight.w400,+ );return Wrap(spacing: 9,runSpacing: 6,@@ -271,7 +271,7 @@ class _StatusPill extends StatelessWidget {Flexible(child: Text(state.label,- style: terminalTextStyle(+ style: grid.AppType.caption(color: state.color,fontWeight: grid.AppFont.medium,),@@ -396,17 +396,17 @@ class _AboutAction extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);+ grid.AppTheme.watch(context);return LayoutBuilder(builder: (context, constraints) {final text = Text(description,- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textSecondary,height: 1.45,),);- final scale = terminalTextScaleOf(context);+ final scale = grid.appTextScaleOf(context);if (constraints.maxWidth < 420 * scale) {return Column(crossAxisAlignment: CrossAxisAlignment.start,diff --git a/desktop/lib/settings/sections/debug_detail_dialog.dart b/desktop/lib/settings/sections/debug_detail_dialog.dartindex cefd33ce5..32d24b4d8 100644--- a/desktop/lib/settings/sections/debug_detail_dialog.dart+++ b/desktop/lib/settings/sections/debug_detail_dialog.dart@@ -1,6 +1,5 @@import 'package:flutter/material.dart';import 'package:flutter/services.dart';-import 'package:harness/terminal/terminal_text.dart';import '../../logging/log_file.dart';import '../../logging/log_stream.dart';@@ -45,7 +44,10 @@ class _DebugDetailDialog extends StatelessWidget {Expanded(child: Text('${entry.category} · ${debugEntryOutcome(entry)}',- style: terminalTextStyle(color: AppPalette.textSecondary),+ style: AppType.monoLabel(+ fontWeight: AppFont.regular,+ color: AppPalette.textSecondary,+ ),),),],@@ -122,7 +124,7 @@ class _Caption extends StatelessWidget {padding: const EdgeInsets.only(bottom: 5),child: Text(text,- style: terminalTextStyle(+ style: AppType.caption(fontWeight: AppFont.medium,color: AppPalette.textFaint,),@@ -152,7 +154,8 @@ class _Block extends StatelessWidget {),child: SelectableText(text,- style: terminalTextStyle(+ style: AppType.monoLabel(+ fontWeight: AppFont.regular,height: 1.45,color: danger ? debugDangerInk(context) : AppPalette.textPrimary,),diff --git a/desktop/lib/settings/sections/debug_filter_bar.dart b/desktop/lib/settings/sections/debug_filter_bar.dartindex 508d578df..65909d1f1 100644--- a/desktop/lib/settings/sections/debug_filter_bar.dart+++ b/desktop/lib/settings/sections/debug_filter_bar.dart@@ -1,5 +1,4 @@import 'package:flutter/material.dart';-import 'package:harness/terminal/terminal_text.dart';import '../../shared/theme/app_theme.dart';import '../../shared/widgets/toolbar_pill.dart';@@ -81,14 +80,11 @@ class _LensLabel extends StatelessWidget {return Row(mainAxisSize: MainAxisSize.min,children: [- Text(- lens.label,- style: terminalTextStyle(fontWeight: AppFont.medium, color: ink),- ),+ Text(lens.label, style: AppType.label(color: ink)),const SizedBox(width: 6),Text('${lens.count}',- style: terminalTextStyle(+ style: AppType.monoMeta(fontWeight: AppFont.medium,color: lens.selected? inkdiff --git a/desktop/lib/settings/sections/debug_log_tile.dart b/desktop/lib/settings/sections/debug_log_tile.dartindex 11c8fb692..6762e6e9d 100644--- a/desktop/lib/settings/sections/debug_log_tile.dart+++ b/desktop/lib/settings/sections/debug_log_tile.dart@@ -1,6 +1,5 @@import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../../logging/log_file.dart';import '../../logging/log_stream.dart';@@ -63,7 +62,8 @@ class _DebugLogTileState extends State<DebugLogTile> {entry.message,maxLines: 3,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: AppType.monoLabel(+ fontWeight: AppFont.regular,height: 1.35,color: AppPalette.textPrimary,),@@ -93,7 +93,8 @@ class _DebugLogTileState extends State<DebugLogTile> {entry.error!,maxLines: 2,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: AppType.monoLabel(+ fontWeight: AppFont.regular,height: 1.35,color: debugDangerInk(context),),@@ -167,7 +168,7 @@ class _Meta extends StatelessWidget {@overrideWidget build(BuildContext context) {AppTheme.watch(context);- final style = terminalTextStyle(color: AppPalette.textFaint);+ final style = AppType.monoMeta(color: AppPalette.textFaint);return Column(crossAxisAlignment: CrossAxisAlignment.end,children: [diff --git a/desktop/lib/settings/sections/debug_paths_card.dart b/desktop/lib/settings/sections/debug_paths_card.dartindex 8c32643ea..6533ac7a0 100644--- a/desktop/lib/settings/sections/debug_paths_card.dart+++ b/desktop/lib/settings/sections/debug_paths_card.dart@@ -1,6 +1,5 @@import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../../core/harness_cli_runner.dart';import '../../logging/log_file.dart';@@ -82,7 +81,7 @@ class _DebugPathsCardState extends State<DebugPathsCard> {Expanded(child: Text('What this app is running',- style: Theme.of(context).textTheme.titleSmall,+ style: AppType.heading(),),),AppIconButton(@@ -143,13 +142,14 @@ class _PathRow extends StatelessWidget {width: 62,child: Text(label,- style: terminalTextStyle(color: AppPalette.textFaint),+ style: AppType.body(color: AppPalette.textFaint),),),Expanded(child: SelectableText(value,- style: terminalTextStyle(+ style: AppType.monoLabel(+ fontWeight: AppFont.regular,height: 1.4,color: AppPalette.textPrimary,),diff --git a/desktop/lib/settings/sections/debug_section.dart b/desktop/lib/settings/sections/debug_section.dartindex 7f95ffa04..bcb67b3b0 100644--- a/desktop/lib/settings/sections/debug_section.dart+++ b/desktop/lib/settings/sections/debug_section.dart@@ -1,6 +1,5 @@import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../../logging/log_file.dart';import '../../logging/log_stream.dart';@@ -116,7 +115,7 @@ class _DebugSectionState extends State<DebugSection> {const SizedBox(height: 10),TextField(controller: _search,- style: terminalTextStyle(),+ style: kFieldTextStyle,decoration:labeledFieldDecoration('Search messages, categories, errors',diff --git a/desktop/lib/settings/sections/debug_toolbar.dart b/desktop/lib/settings/sections/debug_toolbar.dartindex effaa4c52..f0af8ec7c 100644--- a/desktop/lib/settings/sections/debug_toolbar.dart+++ b/desktop/lib/settings/sections/debug_toolbar.dart@@ -2,7 +2,6 @@ import 'dart:async';import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../../core/reveal_folder.dart';import '../../widgets/export_logs_dialog.dart';@@ -29,7 +28,7 @@ class DebugToolbar extends StatelessWidget {Expanded(child: Text('$total ${total == 1 ? 'entry' : 'entries'}',- style: terminalTextStyle(color: AppPalette.textSecondary),+ style: AppType.body(color: AppPalette.textSecondary),),),const _ExportLogsPill(),@@ -65,7 +64,6 @@ class _ExportLogsPill extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return ToolbarPill(onTap: () => unawaited(showExportLogsDialog(context)),rimmed: true,@@ -100,7 +98,6 @@ class _OpenLogsPill extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return ToolbarPill(onTap: () => unawaited(_open(context)),rimmed: true,@@ -136,10 +133,7 @@ class DebugPillLabel extends StatelessWidget {children: [Icon(icon, size: 13, color: ink),const SizedBox(width: 6),- Text(- label,- style: terminalTextStyle(fontWeight: AppFont.medium, color: ink),- ),+ Text(label, style: AppType.label(color: ink)),],);}diff --git a/desktop/lib/settings/sections/devices_section.dart b/desktop/lib/settings/sections/devices_section.dartindex e84352bb2..0dea38dcb 100644--- a/desktop/lib/settings/sections/devices_section.dart+++ b/desktop/lib/settings/sections/devices_section.dart@@ -2,7 +2,6 @@ import 'dart:async';import 'dart:convert';import 'package:flutter/material.dart';-import 'package:harness/terminal/terminal_text.dart';import '../../autonomous_device/autonomous_device_cli.dart';import '../../core/test_run.dart';@@ -133,7 +132,7 @@ class _DevicesSectionState extends State<DevicesSection> {title: Text(title),content: SizedBox(width: 360,- child: Text(detail, style: terminalTextStyle(height: 1.4)),+ child: Text(detail, style: grid.AppType.body(height: 1.4)),),actions: [TextButton(@@ -297,7 +296,7 @@ class _DevicesSectionState extends State<DevicesSection> {padding: const EdgeInsets.symmetric(vertical: 12),child: Text(_actionError ?? _error!,- style: terminalTextStyle(color: grid.AppPalette.dangerFill),+ style: grid.AppType.body(color: grid.AppPalette.dangerFill),),),if (!_unsupported && !_loading) ...[@@ -387,7 +386,7 @@ class _DevicesSectionState extends State<DevicesSection> {obscureText: true,autocorrect: false,enableSuggestions: false,- style: terminalTextStyle(+ style: grid.AppType.mono(color: grid.AppPalette.textPrimary,),decoration: labeledFieldDecoration(@@ -408,7 +407,7 @@ class _DevicesSectionState extends State<DevicesSection> {const SizedBox(height: 10),Text('Harness CLI keeps the connection running when you close Desktop.',- style: terminalTextStyle(color: grid.AppPalette.textSecondary),+ style: grid.AppType.body(color: grid.AppPalette.textSecondary),),const SizedBox(height: 10),],diff --git a/desktop/lib/settings/sections/terminal_section.dart b/desktop/lib/settings/sections/terminal_section.dartindex fe05a8440..1c6a4d1a7 100644--- a/desktop/lib/settings/sections/terminal_section.dart+++ b/desktop/lib/settings/sections/terminal_section.dart@@ -271,7 +271,7 @@ class _Screen extends StatelessWidget {scrollDirection: Axis.horizontal,child: Text.rich(// ⚠️ This previews the TERMINAL's font at the TERMINAL's size. Left to- // the ambient scaler it would grow with the app's UI size setting and+ // the ambient scaler it would grow with the platform's text scale and// show the user a size the terminal will never render at.textScaler: TextScaler.noScaling,TextSpan(@@ -316,8 +316,7 @@ class _ResetRow extends StatelessWidget {children: [Text('⌘0',- style: Theme.of(context).textTheme.bodySmall- ?.copyWith(color: grid.AppPalette.textFaint),+ style: grid.AppType.monoMeta(color: grid.AppPalette.textFaint),),OutlinedButton(key: const Key('terminal-settings-reset-button'),diff --git a/desktop/lib/settings/sections/tracking_detail_dialog.dart b/desktop/lib/settings/sections/tracking_detail_dialog.dartindex fd13eea8b..3caff0639 100644--- a/desktop/lib/settings/sections/tracking_detail_dialog.dart+++ b/desktop/lib/settings/sections/tracking_detail_dialog.dart@@ -69,7 +69,10 @@ class _Body extends StatelessWidget {Expanded(child: Text('${entry.name} · ${trackedOutcome(entry)}',- style: terminalTextStyle(color: AppPalette.textSecondary),+ style: AppType.monoLabel(+ fontWeight: AppFont.regular,+ color: AppPalette.textSecondary,+ ),),),],@@ -155,7 +158,7 @@ class _Caption extends StatelessWidget {padding: const EdgeInsets.only(bottom: 5),child: Text(text,- style: terminalTextStyle(+ style: AppType.caption(fontWeight: AppFont.medium,color: AppPalette.textFaint,),@@ -184,7 +187,8 @@ class _Block extends StatelessWidget {),child: SelectableText(text,- style: terminalTextStyle(+ style: AppType.monoLabel(+ fontWeight: AppFont.regular,height: 1.45,color: danger ? debugDangerInk(context) : AppPalette.textPrimary,),diff --git a/desktop/lib/settings/sections/tracking_section.dart b/desktop/lib/settings/sections/tracking_section.dartindex 53871ef46..18b521e94 100644--- a/desktop/lib/settings/sections/tracking_section.dart+++ b/desktop/lib/settings/sections/tracking_section.dart@@ -1,6 +1,5 @@import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../../analytics/analytics_log.dart';import '../../analytics/analytics_sink.dart';@@ -169,7 +168,7 @@ class _Toolbar extends StatelessWidget {Expanded(child: Text('$total ${total == 1 ? 'event' : 'events'}',- style: terminalTextStyle(color: AppPalette.textSecondary),+ style: AppType.body(color: AppPalette.textSecondary),),),ToolbarPill(diff --git a/desktop/lib/settings/sections/tracking_stream_card.dart b/desktop/lib/settings/sections/tracking_stream_card.dartindex 1f0044b1c..289568222 100644--- a/desktop/lib/settings/sections/tracking_stream_card.dart+++ b/desktop/lib/settings/sections/tracking_stream_card.dart@@ -1,6 +1,5 @@import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../../analytics/analytics_sink.dart';import '../../shared/theme/app_theme.dart';@@ -58,10 +57,7 @@ class _TrackingStreamCardState extends State<TrackingStreamCard> {),const SizedBox(width: 8),Expanded(- child: Text(- 'Analytics stream',- style: Theme.of(context).textTheme.titleSmall,- ),+ child: Text('Analytics stream', style: AppType.heading()),),_StatePill(enabled: status.enabled),],@@ -70,10 +66,7 @@ class _TrackingStreamCardState extends State<TrackingStreamCard> {const SizedBox(height: 6),Text(reason,- style: terminalTextStyle(- height: 1.4,- color: AppPalette.textSecondary,- ),+ style: AppType.body(height: 1.4, color: AppPalette.textSecondary),),],const SizedBox(height: 6),@@ -113,7 +106,7 @@ class _StatePill extends StatelessWidget {),child: Text(enabled ? 'Reporting' : 'Off',- style: terminalTextStyle(fontWeight: AppFont.medium, color: ink),+ style: AppType.caption(fontWeight: AppFont.medium, color: ink),),);}@@ -140,13 +133,14 @@ class _Row extends StatelessWidget {width: 72,child: Text(label,- style: terminalTextStyle(color: AppPalette.textFaint),+ style: AppType.body(color: AppPalette.textFaint),),),Expanded(child: SelectableText(value,- style: terminalTextStyle(+ style: AppType.monoLabel(+ fontWeight: AppFont.regular,height: 1.4,color: muted? AppPalette.textSecondarydiff --git a/desktop/lib/settings/sections/tracking_tile.dart b/desktop/lib/settings/sections/tracking_tile.dartindex 251eb7f44..84e94f9b1 100644--- a/desktop/lib/settings/sections/tracking_tile.dart+++ b/desktop/lib/settings/sections/tracking_tile.dart@@ -1,6 +1,5 @@import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../../analytics/analytics_log.dart';import '../../logging/log_file.dart';@@ -62,7 +61,8 @@ class _TrackingTileState extends State<TrackingTile> {entry.name,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: AppType.monoLabel(+ fontWeight: AppFont.regular,color: AppPalette.textPrimary,),),@@ -91,7 +91,8 @@ class _TrackingTileState extends State<TrackingTile> {summary,maxLines: 2,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: AppType.monoLabel(+ fontWeight: AppFont.regular,height: 1.35,color: failed? debugDangerInk(context)@@ -151,7 +152,7 @@ class _Meta extends StatelessWidget {@overrideWidget build(BuildContext context) {AppTheme.watch(context);- final style = terminalTextStyle(color: AppPalette.textFaint);+ final style = AppType.monoMeta(color: AppPalette.textFaint);return Column(crossAxisAlignment: CrossAxisAlignment.end,children: [diff --git a/desktop/lib/settings/sections/usage_detail_panels.dart b/desktop/lib/settings/sections/usage_detail_panels.dartindex cb49b7520..6a6abb169 100644--- a/desktop/lib/settings/sections/usage_detail_panels.dart+++ b/desktop/lib/settings/sections/usage_detail_panels.dart@@ -20,7 +20,7 @@ import '../../usage/ledger/usage_report.dart';/// How many days the bar chart shows. Ten, as Orca uses — enough to see a shape,/// few enough that each bar keeps a readable label under it.const _kChartDays = 10;-TextStyle get _kChartLabelStyle => terminalTextStyle(height: 1.3);+TextStyle get _kChartLabelStyle => AppType.caption(height: 1.3);const _kBarHeight = 118.0;/// The colours the four token buckets keep, everywhere they are drawn.@@ -74,7 +74,7 @@ class UsageDailyChart extends StatelessWidget {child: Center(child: Text('Nothing in this range.',- style: terminalTextStyle(color: AppPalette.textFaint),+ style: AppType.body(color: AppPalette.textFaint),),),)@@ -148,7 +148,6 @@ class _Bar extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);final total = day.totals.total;final segments = <({int tokens, Color colour})>[// Top-down, so the stack reads in the same order as the legend.@@ -218,7 +217,6 @@ class _LegendDot extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Row(mainAxisSize: MainAxisSize.min,children: [@@ -231,7 +229,7 @@ class _LegendDot extends StatelessWidget {),),const SizedBox(width: 6),- Text(label, style: terminalTextStyle(color: AppPalette.textSecondary)),+ Text(label, style: AppType.caption(color: AppPalette.textSecondary)),],);}@@ -262,7 +260,7 @@ class UsageBreakdownCard extends StatelessWidget {child: shown.isEmpty? Text('Nothing in this range.',- style: terminalTextStyle(color: AppPalette.textFaint),+ style: AppType.body(color: AppPalette.textFaint),): Column(crossAxisAlignment: CrossAxisAlignment.stretch,@@ -279,7 +277,7 @@ class UsageBreakdownCard extends StatelessWidget {child: Text(row.label,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: AppType.body(color: AppPalette.textPrimary,),),@@ -287,7 +285,7 @@ class UsageBreakdownCard extends StatelessWidget {const SizedBox(width: 10),Text(formatTokens(row.tokens),- style: terminalTextStyle(+ style: AppType.body(color: AppPalette.textSecondary,fontFeatures: const [FontFeature.tabularFigures(),@@ -299,7 +297,7 @@ class UsageBreakdownCard extends StatelessWidget {const SizedBox(height: 2),Text(_rowDetail(row),- style: terminalTextStyle(color: AppPalette.textFaint),+ style: AppType.caption(color: AppPalette.textFaint),),],),@@ -335,7 +333,7 @@ class UsageSessionsTable extends StatelessWidget {child: rows.isEmpty? Text('Nothing in this range.',- style: terminalTextStyle(color: AppPalette.textFaint),+ style: AppType.body(color: AppPalette.textFaint),)// A table is the one thing on this pane that can genuinely outgrow// its column, so it brings its own horizontal scroll rather than@@ -380,7 +378,6 @@ const _kSessionColumns = <({String label, double width, bool numeric})>[class _SessionHeaderRow extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Padding(padding: const EdgeInsets.only(bottom: 6),child: Row(@@ -391,7 +388,10 @@ class _SessionHeaderRow extends StatelessWidget {child: Text(column.label,textAlign: column.numeric ? TextAlign.right : TextAlign.left,- style: terminalTextStyle(color: AppPalette.textFaint),+ style: AppType.caption(+ color: AppPalette.textFaint,+ fontWeight: AppFont.medium,+ ),),),],@@ -429,20 +429,30 @@ class _SessionRowTile extends StatelessWidget {textAlign: _kSessionColumns[i].numeric? TextAlign.right: TextAlign.left,- style: terminalTextStyle(- color: i == 1- ? AppPalette.textPrimary- : AppPalette.textSecondary,- fontFeatures: _kSessionColumns[i].numeric- ? const [FontFeature.tabularFigures()]- : null,- ),+ style: _cellStyle(i),),),],),);}++ /// The model column is an id, so it is set in the terminal's face; the rest+ /// read as prose, with the numeric columns on fixed-width digits.+ static TextStyle _cellStyle(int column) {+ final color = column == 1+ ? AppPalette.textPrimary+ : AppPalette.textSecondary;+ if (column == 2) {+ return AppType.monoLabel(color: color, fontWeight: AppFont.regular);+ }+ return AppType.body(+ color: color,+ fontFeatures: _kSessionColumns[column].numeric+ ? AppFont.tabularFigures+ : null,+ );+ }}/// The frame every panel here wears.@@ -459,7 +469,6 @@ class _Card extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Container(padding: const EdgeInsets.fromLTRB(14, 12, 14, 14),decoration: BoxDecoration(@@ -470,12 +479,9 @@ class _Card extends StatelessWidget {child: Column(crossAxisAlignment: CrossAxisAlignment.start,children: [- Text(title, style: Theme.of(context).textTheme.titleSmall),+ Text(title, style: AppType.heading()),const SizedBox(height: 2),- Text(- subtitle,- style: terminalTextStyle(color: AppPalette.textSecondary),- ),+ Text(subtitle, style: AppType.body(color: AppPalette.textSecondary)),const SizedBox(height: 12),child,],diff --git a/desktop/lib/settings/sections/usage_header.dart b/desktop/lib/settings/sections/usage_header.dartindex 58c59e2e0..72468515f 100644--- a/desktop/lib/settings/sections/usage_header.dart+++ b/desktop/lib/settings/sections/usage_header.dart@@ -2,12 +2,12 @@ import 'dart:math' as math;import 'package:flutter/material.dart';-import '../../terminal/terminal_text.dart';+import '../../shared/theme/app_type.dart';import '../../shared/widgets/app_select_field.dart';import '../../usage/ledger/usage_report.dart';double usageControlWidth(BuildContext context, double width) =>- math.max(width, width * terminalTextScaleOf(context));+ math.max(width, width * appTextScaleOf(context));/// Keep the controls together, below the caption when larger text needs room.class UsageHeader extends StatelessWidget {diff --git a/desktop/lib/settings/sections/usage_panels.dart b/desktop/lib/settings/sections/usage_panels.dartindex 32e996b1a..0e9d1d01c 100644--- a/desktop/lib/settings/sections/usage_panels.dart+++ b/desktop/lib/settings/sections/usage_panels.dart@@ -6,8 +6,6 @@/// handed — none reads a store — so the pane can be driven from a fixture.library;-import 'package:harness/terminal/terminal_text.dart';-import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';@@ -36,17 +34,11 @@ class UsageLoadingState extends StatelessWidget {child: Column(crossAxisAlignment: CrossAxisAlignment.start,children: [- Text(- message,- style: terminalTextStyle(color: AppPalette.textSecondary),- ),+ Text(message, style: AppType.body(color: AppPalette.textSecondary)),const SizedBox(height: 12),- SkeletonText(- style: terminalTextStyle(height: 1.1),- widthFactor: .45,- ),+ SkeletonText(style: AppType.title(height: 1.1), widthFactor: .45),const SizedBox(height: 8),- SkeletonText(style: terminalTextStyle(), widthFactor: .7),+ SkeletonText(style: AppType.body(), widthFactor: .7),],),),@@ -78,7 +70,7 @@ class StatsSummaryCards extends StatelessWidget {child: Center(child: Text('Start your first agent to begin tracking.',- style: terminalTextStyle(color: AppPalette.textSecondary),+ style: AppType.body(color: AppPalette.textSecondary),),),);@@ -120,7 +112,7 @@ class StatsSummaryCards extends StatelessWidget {const SizedBox(height: 8),Text('Tracking since ${_trackingDate(since)}',- style: terminalTextStyle(color: AppPalette.textFaint),+ style: AppType.caption(color: AppPalette.textFaint),),],],@@ -200,7 +192,7 @@ class UsageStatCard extends StatelessWidget {Expanded(child: Text(label,- style: terminalTextStyle(color: AppPalette.textSecondary),+ style: AppType.caption(color: AppPalette.textSecondary),),),],@@ -208,17 +200,17 @@ class UsageStatCard extends StatelessWidget {const SizedBox(height: 8),Text(value,- style: terminalTextStyle(- fontWeight: FontWeight.w600,+ style: AppType.title(color: AppPalette.textPrimary,height: 1.1,+ fontFeatures: AppFont.tabularFigures,),),if (footnote != null) ...[const SizedBox(height: 3),Text(footnote!,- style: terminalTextStyle(color: AppPalette.textFaint),+ style: AppType.caption(color: AppPalette.textFaint),),],],@@ -297,27 +289,21 @@ class DailyIntensityGrid extends StatelessWidget {children: [Text(days.isEmpty ? '' : _shortDate(days.first.day),- style: terminalTextStyle(color: AppPalette.textFaint),+ style: AppType.caption(color: AppPalette.textFaint),),const Spacer(),- Text(- 'Less',- style: terminalTextStyle(color: AppPalette.textFaint),- ),+ Text('Less', style: AppType.caption(color: AppPalette.textFaint)),const SizedBox(width: 6),for (var level = 0; level <= 4; level++) ...[_IntensityCell(level: level, size: 9),const SizedBox(width: 3),],const SizedBox(width: 3),- Text(- 'More',- style: terminalTextStyle(color: AppPalette.textFaint),- ),+ Text('More', style: AppType.caption(color: AppPalette.textFaint)),const Spacer(),Text(days.isEmpty ? '' : _shortDate(days.last.day),- style: terminalTextStyle(color: AppPalette.textFaint),+ style: AppType.caption(color: AppPalette.textFaint),),],),@@ -337,7 +323,6 @@ class _IntensityCell extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);// Step 0 is the recess the empty grid is made of; the rest climb the accent.// Discrete steps rather than a ramp, because a heatmap is read by comparing// squares and a smooth gradient gives the eye nothing to compare.@@ -432,7 +417,7 @@ class TokenMixBar extends StatelessWidget {child: Text('${slice.label}: ${formatTokens(slice.tokens)}',overflow: TextOverflow.ellipsis,- style: terminalTextStyle(color: AppPalette.textSecondary),+ style: AppType.caption(color: AppPalette.textSecondary),),),],@@ -492,11 +477,11 @@ class _PanelCard extends StatelessWidget {child: Column(crossAxisAlignment: CrossAxisAlignment.start,children: [- Text(title, style: Theme.of(context).textTheme.titleSmall),+ Text(title, style: AppType.heading()),const SizedBox(height: 2),Text(subtitle,- style: terminalTextStyle(+ style: AppType.body(height: 1.35,color: AppPalette.textSecondary,),@@ -517,7 +502,7 @@ class _PanelCard extends StatelessWidget {),child: Text(label,- style: terminalTextStyle(+ style: AppType.caption(height: 1.25,color: AppPalette.textSecondary,),@@ -607,22 +592,16 @@ class ProviderUsageRow extends StatelessWidget {padding: const EdgeInsets.symmetric(horizontal: 10),tapTargetSize: MaterialTapTargetSize.shrinkWrap,),- child: Text(- state.enabled ? 'Turn off' : 'Enable',- style: terminalTextStyle(),- ),+ child: Text(state.enabled ? 'Turn off' : 'Enable'),),],),const SizedBox(height: 4),if (_detail() case final detail?)- Text(- detail,- style: terminalTextStyle(color: AppPalette.textSecondary),- ),+ Text(detail, style: AppType.body(color: AppPalette.textSecondary)),if (state.status == LedgerStatus.scanning && !ledger.hasData) ...[const SizedBox(height: 10),- SkeletonText(style: terminalTextStyle(), widthFactor: .55),+ SkeletonText(style: AppType.body(), widthFactor: .55),],if (state.enabled &&(state.status == LedgerStatus.ok ||@@ -635,12 +614,15 @@ class ProviderUsageRow extends StatelessWidget {Expanded(child: Text('${formatTokens(ledger.totals.total)} tokens',- style: terminalTextStyle(color: AppPalette.textPrimary),+ style: AppType.body(+ color: AppPalette.textPrimary,+ fontFeatures: AppFont.tabularFigures,+ ),),),Text(formatCost(ledger.costUsd),- style: terminalTextStyle(+ style: AppType.body(color: AppPalette.textPrimary,fontFeatures: const [FontFeature.tabularFigures()],),@@ -724,7 +706,7 @@ class _StatusPill extends StatelessWidget {color: color.withValues(alpha: 0.12),borderRadius: BorderRadius.circular(6),),- child: Text(label, style: terminalTextStyle(color: color, height: 1.3)),+ child: Text(label, style: AppType.caption(color: color, height: 1.3)),);}}@@ -771,7 +753,7 @@ class UsageEmptyState extends StatelessWidget {'Switch on a provider to read the logs its CLI already keeps on ''this computer, and build the token ledger from them. Nothing is ''read until you do, and nothing leaves this machine.',- style: terminalTextStyle(+ style: AppType.body(height: 1.45,color: AppPalette.textSecondary,),@@ -789,10 +771,7 @@ class UsageEmptyState extends StatelessWidget {minimumSize: const Size(0, 30),padding: const EdgeInsets.symmetric(horizontal: 14),),- child: Text(- 'Enable ${provider.label}',- style: terminalTextStyle(),- ),+ child: Text('Enable ${provider.label}'),),],),diff --git a/desktop/lib/settings/sections/usage_provider_pane.dart b/desktop/lib/settings/sections/usage_provider_pane.dartindex 83a83873e..976efecc3 100644--- a/desktop/lib/settings/sections/usage_provider_pane.dart+++ b/desktop/lib/settings/sections/usage_provider_pane.dart@@ -10,8 +10,6 @@/// would filter on a distinction this app does not have.library;-import 'package:harness/terminal/terminal_text.dart';-import 'dart:async';import 'package:flutter/material.dart';@@ -88,7 +86,7 @@ class _UsageProviderPaneState extends State<UsageProviderPane> {Text('Cache reuse rate is cache read tokens / (fresh input + cache read ''tokens).',- style: terminalTextStyle(color: AppPalette.textFaint),+ style: AppType.caption(color: AppPalette.textFaint),),const SizedBox(height: 12),UsageDailyChart(@@ -124,7 +122,6 @@ class _Figures extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);final totals = report.totals;final cards = <Widget>[UsageStatCard(@@ -214,10 +211,7 @@ class _Header extends StatelessWidget {title: Column(crossAxisAlignment: CrossAxisAlignment.start,children: [- Text(- '${provider.label} usage',- style: Theme.of(context).textTheme.titleSmall,- ),+ Text('${provider.label} usage', style: AppType.heading()),const SizedBox(height: 2),Text(// The range is named here as well as in the picker, because the@@ -226,7 +220,7 @@ class _Header extends StatelessWidget {scanning? '${range.label} · Scanning local logs…': 'All local ${provider.label} usage · ${range.label}',- style: terminalTextStyle(color: AppPalette.textSecondary),+ style: AppType.body(color: AppPalette.textSecondary),),],),@@ -271,10 +265,7 @@ class _DisabledCard extends StatelessWidget {child: Column(crossAxisAlignment: CrossAxisAlignment.start,children: [- Text(- '${provider.label} usage',- style: Theme.of(context).textTheme.titleSmall,- ),+ Text('${provider.label} usage', style: AppType.heading()),const SizedBox(height: 6),ConstrainedBox(constraints: const BoxConstraints(maxWidth: 520),@@ -282,7 +273,7 @@ class _DisabledCard extends StatelessWidget {'Reads the logs the ${provider.label} CLI already keeps on this ''computer to show token, model and session figures. Nothing is ''read until you switch it on.',- style: terminalTextStyle(+ style: AppType.body(height: 1.45,color: AppPalette.textSecondary,),@@ -295,7 +286,7 @@ class _DisabledCard extends StatelessWidget {minimumSize: const Size(0, 30),padding: const EdgeInsets.symmetric(horizontal: 14),),- child: Text('Enable ${provider.label}', style: terminalTextStyle()),+ child: Text('Enable ${provider.label}'),),],),@@ -317,7 +308,7 @@ class _Notice extends StatelessWidget {),child: Text(message,- style: terminalTextStyle(color: AppPalette.textSecondary),+ style: AppType.body(color: AppPalette.textSecondary),),);}diff --git a/desktop/lib/settings/sections/usage_section.dart b/desktop/lib/settings/sections/usage_section.dartindex f3a3a4c0e..3e3f7180e 100644--- a/desktop/lib/settings/sections/usage_section.dart+++ b/desktop/lib/settings/sections/usage_section.dart@@ -20,8 +20,6 @@/// silently excluded most of a team's work would be worse than no total.library;-import 'package:harness/terminal/terminal_text.dart';-import 'dart:async';import 'package:flutter/material.dart';@@ -184,7 +182,7 @@ class _UsageSectionState extends State<UsageSection> {if (states.values.any((state) => state.hasIncompleteFigures)) ...[Text('Some usage could not be read. Totals are incomplete.',- style: terminalTextStyle(color: AppPalette.warn),+ style: AppType.body(color: AppPalette.warn),),const SizedBox(height: 12),],@@ -202,7 +200,7 @@ class _UsageSectionState extends State<UsageSection> {))Text('No figures available.',- style: terminalTextStyle(color: AppPalette.textSecondary),+ style: AppType.body(color: AppPalette.textSecondary),)else ...[_cards(overview),@@ -211,7 +209,7 @@ class _UsageSectionState extends State<UsageSection> {padding: const EdgeInsets.only(top: 8),child: Text('The cost is a lower bound because some model prices are unavailable.',- style: terminalTextStyle(color: AppPalette.textSecondary),+ style: AppType.caption(color: AppPalette.textSecondary),),),if (overview.hasAnyData) ...[@@ -354,7 +352,6 @@ class _PanelPair extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return LayoutBuilder(builder: (context, constraints) {if (constraints.maxWidth < 680) {@@ -387,10 +384,7 @@ class _AnalyticsHeader extends StatelessWidget {Widget build(BuildContext context) {AppTheme.watch(context);return UsageHeader(- title: Text(- 'Usage analytics',- style: Theme.of(context).textTheme.titleSmall,- ),+ title: Text('Usage analytics', style: AppType.heading()),controls: [AppSelectField<_Lens>(value: lens,@@ -433,11 +427,11 @@ class _OverviewHeader extends StatelessWidget {title: Column(crossAxisAlignment: CrossAxisAlignment.start,children: [- Text('Usage overview', style: Theme.of(context).textTheme.titleSmall),+ Text('Usage overview', style: AppType.heading()),const SizedBox(height: 2),Text(_updatedLine(),- style: terminalTextStyle(color: AppPalette.textSecondary),+ style: AppType.body(color: AppPalette.textSecondary),),],),@@ -496,7 +490,7 @@ class _ProvidersHeading extends StatelessWidget {child: Column(crossAxisAlignment: CrossAxisAlignment.start,children: [- Text('Providers', style: Theme.of(context).textTheme.titleSmall),+ Text('Providers', style: AppType.heading()),const SizedBox(height: 2),Text(// Two different counts on purpose: a provider can be on and have@@ -504,7 +498,7 @@ class _ProvidersHeading extends StatelessWidget {// panel impossible to read.'${overview.enabledCount} enabled''${hasFigures ? ' · ${overview.dataProviderCount} with data' : ''}',- style: terminalTextStyle(color: AppPalette.textSecondary),+ style: AppType.body(color: AppPalette.textSecondary),),],),@@ -513,7 +507,7 @@ class _ProvidersHeading extends StatelessWidget {Text('${overview.sessionCount} ''${overview.sessionCount == 1 ? 'session' : 'sessions'}',- style: terminalTextStyle(color: AppPalette.textFaint),+ style: AppType.caption(color: AppPalette.textFaint),),],);diff --git a/desktop/lib/settings/settings_nav.dart b/desktop/lib/settings/settings_nav.dartindex 5c0667100..788800402 100644--- a/desktop/lib/settings/settings_nav.dart+++ b/desktop/lib/settings/settings_nav.dart@@ -1,7 +1,6 @@import 'package:flutter/material.dart';import 'package:flutter/services.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../shared/layouts/widgets/rail_section_header.dart';import '../shared/layouts/widgets/sidebar_item.dart';@@ -227,7 +226,7 @@ class _NoMatches extends StatelessWidget {padding: const EdgeInsets.fromLTRB(10, 16, 10, 0),child: Text('No settings match',- style: terminalTextStyle(color: grid.AppPalette.textFaint),+ style: grid.AppType.body(color: grid.AppPalette.textFaint),),);}diff --git a/desktop/lib/shared/layouts/widgets/rail_section_header.dart b/desktop/lib/shared/layouts/widgets/rail_section_header.dartindex 8ca8b0fd6..882523fbf 100644--- a/desktop/lib/shared/layouts/widgets/rail_section_header.dart+++ b/desktop/lib/shared/layouts/widgets/rail_section_header.dart@@ -1,13 +1,12 @@import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../../theme/app_theme.dart';/// A quiet caption over a run of rail rows, with an optional `+` beside it.///-/// Micro-type — 11pt, faint — because it names a group rather than competing-/// with the rows under it. Both halves of the sidebar use it, which is the+/// Micro-type — [AppType.monoMeta], uppercase, faint — because it names a+/// group rather than competing with the rows under it. Both halves of the sidebar use it, which is the/// point: "Projects" in Home and "Projects" in Code list entirely different/// things, and the one thing they must not differ on is how a rail heading/// looks.@@ -39,11 +38,11 @@ class RailSectionHeader extends StatelessWidget {final text = Padding(padding: const EdgeInsets.symmetric(vertical: 4),child: Text(- label,- style: terminalTextStyle(+ label.toUpperCase(),+ semanticsLabel: label,+ style: AppType.monoMeta(color: AppPalette.textFaint,fontWeight: AppFont.medium,- letterSpacing: 0.2,),),);diff --git a/desktop/lib/shared/layouts/widgets/sidebar_item.dart b/desktop/lib/shared/layouts/widgets/sidebar_item.dartindex be3f9ae66..0c3ac1158 100644--- a/desktop/lib/shared/layouts/widgets/sidebar_item.dart+++ b/desktop/lib/shared/layouts/widgets/sidebar_item.dart@@ -1,6 +1,5 @@import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../../theme/app_theme.dart';import '../../widgets/scroll_reveal_text.dart';@@ -222,7 +221,7 @@ class _SidebarRow extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);+ AppTheme.watch(context);const radius = BorderRadius.all(Radius.circular(8));// Weight tracks the selection itself, not the transition: it changes the// label's metrics, so it wants to happen once, at the start, rather than@@ -395,20 +394,20 @@ class _RowLabel extends StatelessWidget {/// fallback chain, and a travelling label that dropped it would jump a pixel/// as the pointer landed.static StrutStyle get _strut => StrutStyle(- fontSize: terminalFontStore.size,- fontFamily: terminalFontStore.value.fontFamily,- fontFamilyFallback: terminalFontStore.value.fontFamilyFallback,+ fontSize: AppType.bodySize,+ fontFamily: AppType.sansFamily,+ fontFamilyFallback: AppType.sansFallback,height: 1.25,forceStrutHeight: true,);@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);- final style = terminalTextStyle(+ AppTheme.watch(context);+ final style = AppType.label(color: ink,height: 1.25,- fontWeight: strong ? AppFont.medium : FontWeight.w400,+ fontWeight: strong ? AppFont.medium : AppFont.regular,);if (!item.revealLabelOnHover || !hovered) {@@ -458,7 +457,7 @@ class _RowIcon extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);+ AppTheme.watch(context);// A row's icon carries the accent whenever the row stands out — the selected// nav item and the emphasized action (New chat) both — so the accent reads// as "this is the one", matching the selected row's rail. Everything else@@ -501,7 +500,7 @@ class _SelectionRail extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);+ AppTheme.watch(context);return Positioned(left: 0,top: 1,@@ -592,14 +591,11 @@ class _SidebarSectionLabelState extends State<SidebarSectionLabel> {children: [Expanded(child: Text(- widget.label,+ widget.label.toUpperCase(),+ semanticsLabel: widget.label,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(- color: ink,- fontWeight: AppFont.medium,- letterSpacing: 0,- ),+ style: AppType.monoMeta(color: ink, fontWeight: AppFont.medium),),),if (foldable)diff --git a/desktop/lib/shared/layouts/widgets/sidebar_show_more.dart b/desktop/lib/shared/layouts/widgets/sidebar_show_more.dartindex 3e7784f7b..bffdfe8e9 100644--- a/desktop/lib/shared/layouts/widgets/sidebar_show_more.dart+++ b/desktop/lib/shared/layouts/widgets/sidebar_show_more.dart@@ -1,5 +1,4 @@import 'package:flutter/material.dart';-import 'package:harness/terminal/terminal_text.dart';import '../../theme/app_theme.dart';import 'sidebar_item.dart';@@ -147,13 +146,7 @@ class _SidebarShowMoreState extends State<SidebarShowMore> {color: hot ? AppSurface.hoverFill : Colors.transparent,borderRadius: BorderRadius.circular(8),),- child: Text(- 'Show more',- style: terminalTextStyle(- color: ink,- fontWeight: AppFont.medium,- ),- ),+ child: Text('Show more', style: AppType.label(color: ink)),),),),diff --git a/desktop/lib/shared/theme/app_theme.dart b/desktop/lib/shared/theme/app_theme.dartindex 3f666b4f5..e0aada73b 100644--- a/desktop/lib/shared/theme/app_theme.dart+++ b/desktop/lib/shared/theme/app_theme.dart@@ -1,8 +1,8 @@-import '../../terminal/terminal_typography.dart';-import 'package:flutter/material.dart';import 'package:harness/terminal/terminal_text.dart';+import 'app_type.dart';+export 'app_type.dart';import 'color_palette.dart';/// The app's live brightness — the single source of truth the color tokens below@@ -937,7 +937,7 @@ ThemeData buildAppTheme({Brightness brightness = Brightness.light}) {// Also stated at ThemeData level, not only inside the ramp: Material builds// text of its own (a dialog's semantics label, a field's error line) that// never passes through `textTheme`, and without this those fall through to- // Roboto instead of the selected terminal font.+ // Roboto instead of the system face.fontFamily: AppFont.sans,fontFamilyFallback: AppFont.sansFallback,scaffoldBackgroundColor: scheme.surface,@@ -1033,8 +1033,8 @@ ThemeData buildAppTheme({Brightness brightness = Brightness.light}) {),],),- // Tooltips keep the same font and size, with room for multiline text.- textStyle: terminalTextStyle(height: 1.45, color: scheme.onSurface),+ // Room for multiline text.+ textStyle: AppType.caption(height: 1.45, color: scheme.onSurface),padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),// Long quoted lines would otherwise take the tooltip out to the window's// full width — a panel wider than the conversation it is explaining.@@ -1084,7 +1084,7 @@ ThemeData buildAppTheme({Brightness brightness = Brightness.light}) {isDense: true,filled: true,fillColor: scheme.surfaceContainerHighest,- // A field hint uses the selected terminal font and size, like its button.+ // A field hint is set like the field's own text.// (The typed text is set on the field via// [kFieldTextStyle]; `InputDecorationTheme` has no `style` of its own, so// a field's own text can't be themed globally here.)@@ -1168,6 +1168,8 @@ ThemeData buildAppTheme({Brightness brightness = Brightness.light}) {shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(AppCard.radius),),+ titleTextStyle: AppType.heading(color: scheme.onSurface),+ contentTextStyle: AppType.body(color: scheme.onSurface),),// ⚠️ [AppPalette.accentOnSurface], NOT `colorScheme.primary`.//@@ -1188,10 +1190,7 @@ ThemeData buildAppTheme({Brightness brightness = Brightness.light}) {width: 520,// A snackbar floats over everything, so it takes the panel fill.backgroundColor: panelFill,- contentTextStyle: terminalTextStyle(- color: scheme.onSurface,- fontWeight: FontWeight.w600,- ),+ contentTextStyle: AppType.body(color: scheme.onSurface),actionTextColor: AppPalette.accent,closeIconColor: scheme.onSurfaceVariant,elevation: 10,@@ -1254,15 +1253,15 @@ abstract final class AppControl {/// [anchoredMenuPosition] clamps to this by default.static const double menuMaxHeight = 240;- /// Button labels use the same selected point size as every other surface.- static double get fontSize => terminalFontStore.size;+ /// A button's label: [AppType.label].+ static const double fontSize = AppType.bodySize;static const FontWeight fontWeight = AppFont.medium;/// A leading glyph inside a button, sized to sit on the cap height of a 13pt/// label rather than tower over it.static const double iconSize = 16;- /// A compact glyph for an inline chip; its text keeps the shared font size.+ /// A compact glyph for an inline chip.static const double iconSizeChip = 13;/// Horizontal breathing room. Apple pads a push button generously sideways and@@ -1310,8 +1309,6 @@ abstract final class AppControl {static EdgeInsets get paddingSmallScaled =>EdgeInsets.symmetric(horizontal: 10 * AppFont.uiScale);-- // Text already uses the selected point size. Only control geometry scales.}/// How long the app's UI takes to change, and on what curve.@@ -1368,17 +1365,15 @@ abstract final class AppMotion {static const Curve curve = Curves.easeOut;}-/// Compatibility names for the single Terminal font preference.+/// The app's two faces and its weight ladder. Sizes live in [AppType].abstract final class AppFont {- /// Legacy token names all resolve to the one terminal font preference.- static String get sans => terminalFontStore.value.fontFamily;- static String get mono => sans;- static List<String> get sansFallback =>- terminalFontStore.value.fontFamilyFallback;- static List<String> get monoFallback => sansFallback;- static String get sansDefault => terminalFontFamily;- static String get monoDefault => terminalFontFamily;- static List<String> get defaultFallback => terminalFontFallback;+ /// The system UI face. See [AppType] for the rule on which face text gets.+ static String get sans => AppType.sansFamily;+ static List<String> get sansFallback => AppType.sansFallback;++ /// The terminal's face, used for terminal chrome and copyable strings.+ static String get mono => AppType.monoFamily;+ static List<String> get monoFallback => AppType.monoFallback;/// Digits that hold a fixed width, so a stat doesn't reflow as its value/// changes and a column of numbers lines up.@@ -1416,19 +1411,22 @@ abstract final class AppFont {/// ladder was introduced to fix. Reach for [medium] first.static const FontWeight semibold = FontWeight.w600;- /// Monospaced characters keep the terminal's natural cell spacing.- static double trackingFor(double size) => 0;+ /// Tracking for the sans face; see [AppType.trackingFor].+ static double trackingFor(double size) => AppType.trackingFor(size);++ /// The UI no longer scales with the terminal's size setting: ⌘+ and ⌘−+ /// resize the terminal alone, so control geometry stays as drawn.+ static const double uiScale = 1;- /// Geometry scales with the selected terminal font, without scaling text twice.- static const double uiSizeDefault = terminalFontSize;- static double get uiScale => terminalFontStore.size / terminalFontSize;+ /// The terminal's size, for a surface that shows terminal output verbatim.static double get codeSize => terminalFontStore.size;+ /// A block of code or a log: the terminal face at the UI's mono size.static TextStyle codeStyle({Color? color,double? height,FontWeight? fontWeight,- }) => terminalTextStyle(color: color, height: height, fontWeight: fontWeight);+ }) => AppType.mono(color: color, height: height, fontWeight: fontWeight);}/// A text field's rim at one state. Radius matches [AppControl.radius] so a@@ -1439,26 +1437,20 @@ OutlineInputBorder _fieldBorder(Color color, {double width = 1}) =>borderSide: BorderSide(color: color, width: width),);-/// The label style shared by every button, carrying the UI font: a-/// `ButtonStyle.textStyle` does **not** inherit `fontFamily` from the text-/// theme, so a button must receive the shared font explicitly.-///-/// A getter, not a const: it reads [AppFont.sans], which the user can change.-TextStyle get _buttonTextStyle => terminalTextStyle(- fontWeight: AppControl.fontWeight,- letterSpacing: AppFont.trackingFor(AppControl.fontSize),-);+/// The label style shared by every button: a `ButtonStyle.textStyle` does+/// **not** inherit `fontFamily` from the text theme, so a button must receive+/// the UI font explicitly.+TextStyle get _buttonTextStyle =>+ AppType.label(fontWeight: AppControl.fontWeight);-/// A text field's own text uses the selected terminal font and size.+/// A text field's own text: [AppType.mono] — what the user types is set the+/// way a terminal sets it, at the scale of the button beside it./// `InputDecorationTheme` has no `style` slot (it themes the *decoration*, not/// the editable text), so a field must be handed this explicitly:/// `TextField(style: kFieldTextStyle, ...)`.TextStyle get kFieldTextStyle => _fieldTextStyle(AppPalette.textPrimary);-TextStyle _fieldTextStyle(Color color) => terminalTextStyle(- letterSpacing: AppFont.trackingFor(AppControl.fontSize),- color: color,-);+TextStyle _fieldTextStyle(Color color) => AppType.mono(color: color);/// A field's leading glyph — the magnifier on a search box, and its kind.///@@ -1545,29 +1537,29 @@ ButtonStyle _textButtonStyle() => TextButton.styleFrom();TextTheme _appTextTheme(Color primary, Color secondary) {- final base = terminalTextStyle(- color: primary,- height: 1.34,- fontWeight: AppFont.regular,- );-- final heading = base.copyWith(fontWeight: AppFont.semibold);- final label = base.copyWith(fontWeight: AppFont.medium);+ // Material's fifteen roles folded onto [AppType]'s steps: headings and+ // labels in mono, body in sans. A heading keeps semibold; a role that names a+ // control drops to medium.+ final display = AppType.display(color: primary);+ final title = AppType.title(color: primary);+ final heading = AppType.heading(color: primary);+ final body = AppType.body(color: primary);+ final label = AppType.label(color: primary);return TextTheme(- displayLarge: heading,- displayMedium: heading,- displaySmall: heading,- headlineLarge: heading,- headlineMedium: heading,- headlineSmall: heading,- titleLarge: heading,+ displayLarge: display,+ displayMedium: display,+ displaySmall: display,+ headlineLarge: title,+ headlineMedium: title,+ headlineSmall: title,+ titleLarge: title,titleMedium: heading,titleSmall: label,- bodyLarge: base,- bodyMedium: base,- bodySmall: base.copyWith(color: secondary),+ bodyLarge: body,+ bodyMedium: body,+ bodySmall: body.copyWith(color: secondary),labelLarge: label,labelMedium: label,- labelSmall: label,+ labelSmall: AppType.monoMeta(color: primary, fontWeight: AppFont.medium),);}diff --git a/desktop/lib/shared/theme/app_type.dart b/desktop/lib/shared/theme/app_type.dartnew file mode 100644index 000000000..bdde0f562--- /dev/null+++ b/desktop/lib/shared/theme/app_type.dart@@ -0,0 +1,286 @@+import 'package:flutter/widgets.dart';++import '../../core/apple_fonts.dart';+import '../../terminal/terminal_font_store.dart';++/// The app's type scale: which face, size and weight a piece of text gets.+///+/// Harness is a terminal app, drawn for people who have lived in one, so the+/// terminal's face leads. Two faces, split by one rule:+///+/// * **Mono** — the face chosen in Settings ▸ Terminal — for everything that+/// names, labels or is typed: headings, titles, buttons, rows, navigation,+/// fields, tabs, pane headers, shortcuts, counts, and the strings the user+/// copies (a path, a branch, an id, a log line). Read like a CLI's `--help`:+/// the command in mono, its description beside it.+/// * **Sans** — the system UI face — only for prose: a description, an+/// explanation, a dialog's sentence, a caption. A paragraph of mono at 13pt is+/// what made an all-mono build read as a wall, so prose is where the second+/// face earns its place.+///+/// Sizes are fixed. The terminal's own size setting (⌘+ / ⌘−) moves the+/// terminal grid, its composer and its find field — [terminalTextStyle] — and+/// nothing here. An earlier build set every text in the app in the terminal+/// face at the terminal size, which left a heading and its body copy one size+/// apart only by weight.+///+/// ```+/// display mono 28 semibold one per screen: a page title, sign-in+/// title mono 20 semibold a settings pane, a hero card, a figure+/// heading mono 15 semibold a section, a dialog title, a card title+/// label mono 13 medium buttons, rows, sidebar items, links+/// mono mono 13 regular field text, typed commands, paths+/// monoLabel mono 12 medium tabs, pane headers, command-box rows+/// monoMeta mono 11 regular shortcuts, counts, eyebrows, timestamps+/// body sans 13 regular prose: descriptions, explanations+/// caption sans 11 regular tooltips, footnotes+/// ```+///+/// Every style takes the same optional arguments as `terminalTextStyle`, so a+/// call site states its role and only then its colour or weight.+abstract final class AppType {+ static const double displaySize = 28;+ static const double titleSize = 20;+ static const double headingSize = 15;+ static const double bodySize = 13;+ static const double captionSize = 11;+ static const double monoSize = 13;+ static const double monoLabelSize = 12;+ static const double monoMetaSize = 11;++ /// The size the native title bar's tabs are drawn at; see `SwarmTitlebar.swift`.+ static const double chromeSize = monoLabelSize;++ /// The system UI face.+ ///+ /// `Ubuntu Sans` (25.04 and later) and `Ubuntu` lead on Linux because they+ /// are what the desktop itself is set in. Both are two-axis variable fonts+ /// that the engine cannot currently reach on Ubuntu 26.04, so there the face+ /// that actually draws is `Noto Sans`, next in [sansFallback].+ static String get sansFamily =>+ hasAppleFonts ? '.AppleSystemUIFont' : 'Ubuntu Sans';++ static List<String> get sansFallback => hasAppleFonts+ ? const ['SF Pro Text', 'Helvetica Neue', 'Arial']+ : const ['Ubuntu', 'Noto Sans', 'DejaVu Sans', 'sans-serif'];++ /// The terminal's face, so mono chrome changes with the terminal font.+ static String get monoFamily => terminalFontStore.value.fontFamily;+ static List<String> get monoFallback =>+ terminalFontStore.value.fontFamilyFallback;++ /// Tracking for the sans face at [size], after Apple's SF Pro table: SF Pro+ /// is optically sized, and Flutter asks CoreText for one static face, so+ /// small text reads cramped and large text reads as one mass without it.+ /// Mono keeps its cell spacing and takes none.+ static double trackingFor(double size) {+ if (size >= 28) return -0.4;+ if (size >= 20) return -0.25;+ if (size >= 17) return -0.1;+ if (size >= 15) return 0;+ if (size >= 13) return 0.05;+ return 0.12;+ }++ static TextStyle display({+ Color? color,+ FontWeight? fontWeight,+ FontStyle? fontStyle,+ double? height,+ double? letterSpacing,+ List<FontFeature>? fontFeatures,+ }) => _mono(+ displaySize,+ fontWeight ?? FontWeight.w600,+ color,+ fontStyle,+ height,+ letterSpacing,+ fontFeatures,+ );++ static TextStyle title({+ Color? color,+ FontWeight? fontWeight,+ FontStyle? fontStyle,+ double? height,+ double? letterSpacing,+ List<FontFeature>? fontFeatures,+ }) => _mono(+ titleSize,+ fontWeight ?? FontWeight.w600,+ color,+ fontStyle,+ height,+ letterSpacing,+ fontFeatures,+ );++ static TextStyle heading({+ Color? color,+ FontWeight? fontWeight,+ FontStyle? fontStyle,+ double? height,+ double? letterSpacing,+ List<FontFeature>? fontFeatures,+ }) => _mono(+ headingSize,+ fontWeight ?? FontWeight.w600,+ color,+ fontStyle,+ height,+ letterSpacing,+ fontFeatures,+ );++ static TextStyle body({+ Color? color,+ FontWeight? fontWeight,+ FontStyle? fontStyle,+ double? height,+ double? letterSpacing,+ List<FontFeature>? fontFeatures,+ }) => _sans(+ bodySize,+ fontWeight ?? FontWeight.w400,+ color,+ fontStyle,+ height,+ letterSpacing,+ fontFeatures,+ );++ static TextStyle label({+ Color? color,+ FontWeight? fontWeight,+ FontStyle? fontStyle,+ double? height,+ double? letterSpacing,+ List<FontFeature>? fontFeatures,+ }) => _mono(+ bodySize,+ fontWeight ?? FontWeight.w500,+ color,+ fontStyle,+ height,+ letterSpacing,+ fontFeatures,+ );++ static TextStyle caption({+ Color? color,+ FontWeight? fontWeight,+ FontStyle? fontStyle,+ double? height,+ double? letterSpacing,+ List<FontFeature>? fontFeatures,+ }) => _sans(+ captionSize,+ fontWeight ?? FontWeight.w400,+ color,+ fontStyle,+ height,+ letterSpacing,+ fontFeatures,+ );++ static TextStyle mono({+ Color? color,+ FontWeight? fontWeight,+ FontStyle? fontStyle,+ double? height,+ double? letterSpacing,+ List<FontFeature>? fontFeatures,+ }) => _mono(+ monoSize,+ fontWeight ?? FontWeight.w400,+ color,+ fontStyle,+ height,+ letterSpacing,+ fontFeatures,+ );++ static TextStyle monoLabel({+ Color? color,+ FontWeight? fontWeight,+ FontStyle? fontStyle,+ double? height,+ double? letterSpacing,+ List<FontFeature>? fontFeatures,+ }) => _mono(+ monoLabelSize,+ fontWeight ?? FontWeight.w500,+ color,+ fontStyle,+ height,+ letterSpacing,+ fontFeatures,+ );++ static TextStyle monoMeta({+ Color? color,+ FontWeight? fontWeight,+ FontStyle? fontStyle,+ double? height,+ double? letterSpacing,+ List<FontFeature>? fontFeatures,+ }) => _mono(+ monoMetaSize,+ fontWeight ?? FontWeight.w400,+ color,+ fontStyle,+ height,+ letterSpacing,+ fontFeatures,+ );++ static TextStyle _sans(+ double size,+ FontWeight weight,+ Color? color,+ FontStyle? fontStyle,+ double? height,+ double? letterSpacing,+ List<FontFeature>? fontFeatures,+ ) => TextStyle(+ fontFamily: sansFamily,+ fontFamilyFallback: sansFallback,+ fontSize: size,+ fontWeight: weight,+ color: color,+ fontStyle: fontStyle,+ height: height,+ letterSpacing: letterSpacing ?? trackingFor(size),+ fontFeatures: fontFeatures,+ );++ static TextStyle _mono(+ double size,+ FontWeight weight,+ Color? color,+ FontStyle? fontStyle,+ double? height,+ double? letterSpacing,+ List<FontFeature>? fontFeatures,+ ) => TextStyle(+ fontFamily: monoFamily,+ fontFamilyFallback: monoFallback,+ fontSize: size,+ fontWeight: weight,+ color: color,+ fontStyle: fontStyle,+ height: height,+ letterSpacing: letterSpacing,+ fontFeatures: fontFeatures,+ );+}++/// How much larger than drawn the UI's text is, for sizing the box around it.+///+/// The UI's counterpart to `terminalTextScaleOf`, which follows the terminal's+/// size setting and so belongs only to the terminal's own surfaces. This one+/// follows the platform text scale alone, so chrome keeps its layout when the+/// terminal is zoomed.+double appTextScaleOf(BuildContext context) =>+ MediaQuery.textScalerOf(context).scale(AppType.bodySize) / AppType.bodySize;diff --git a/desktop/lib/shared/widgets/app_choice_picker.dart b/desktop/lib/shared/widgets/app_choice_picker.dartindex bdaabc344..2d1b2f76c 100644--- a/desktop/lib/shared/widgets/app_choice_picker.dart+++ b/desktop/lib/shared/widgets/app_choice_picker.dart@@ -1,7 +1,6 @@import 'dart:math' as math;import 'package:flutter/material.dart';-import 'package:harness/terminal/terminal_text.dart';import '../theme/app_theme.dart';import 'app_select_field.dart';@@ -141,8 +140,8 @@ class _AppChoicePickerState<T> extends State<AppChoicePicker<T>> {if (widget.tileSize != null) return _tileChoices();final candidates = _visibleOptions;if (candidates.isEmpty) return const SizedBox.shrink();- final textStyle = terminalTextStyle(fontWeight: FontWeight.w500);- final detailStyle = textStyle.copyWith(fontWeight: FontWeight.w400);+ final textStyle = AppType.label();+ final detailStyle = AppType.body();final height = widget.showDetails? (widget.compact ? 52.0 : 58.0): (widget.compact ? 40.0 : 44.0);@@ -449,7 +448,7 @@ class AppChoiceTile extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);+ AppTheme.watch(context);return SizedBox(width: size.width,height: size.height,@@ -518,8 +517,8 @@ class AppChoiceTileContent extends StatelessWidget {/// The name's type, and the detail's under it. Written down because the tile/// height is arithmetic over exactly these numbers — see [linesFor] and the/// New Harness dialog's `tileSize`.- static double get labelSize => terminalFontStore.size;- static double get detailSize => terminalFontStore.size;+ static const double labelSize = AppType.bodySize;+ static const double detailSize = AppType.bodySize;static const double lineHeight = 1.25;static const double lineGap = 4;@@ -558,7 +557,7 @@ class AppChoiceTileContent extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);+ AppTheme.watch(context);if (terminalStyle) {final style = DefaultTextStyle.of(context).style.copyWith(height: 1.35,@@ -601,9 +600,8 @@ class AppChoiceTileContent extends StatelessWidget {),);}- final labelStyle = terminalTextStyle(+ final labelStyle = AppType.label(height: lineHeight,- fontWeight: AppFont.medium,color: AppPalette.textPrimary,);return Row(@@ -646,7 +644,7 @@ class AppChoiceTileContent extends StatelessWidget {detail!,maxLines: lines.detail,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: AppType.body(height: lineHeight,color: AppPalette.textSecondary,),diff --git a/desktop/lib/shared/widgets/app_menu.dart b/desktop/lib/shared/widgets/app_menu.dartindex f93e7e880..e7797add2 100644--- a/desktop/lib/shared/widgets/app_menu.dart+++ b/desktop/lib/shared/widgets/app_menu.dart@@ -1,26 +1,25 @@import 'dart:math' as math;-import 'package:harness/terminal/terminal_text.dart';-import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';import '../theme/app_theme.dart';-/// Menus share the terminal typography. Compact and roomy variants only-/// change padding and icon spacing.+/// A row names a choice, so it is set in [AppType.mono] like every other+/// label; its detail line is prose, in [AppType.caption]. Compact and roomy variants only change padding and icon+/// spacing.@immutableclass AppMenuRowMetrics {const AppMenuRowMetrics({required this.iconSize, required this.padding});- double get fontSize => terminalFontStore.size;- double get noteSize => terminalFontStore.size;+ double get fontSize => AppType.bodySize;+ double get noteSize => AppType.captionSize;final double iconSize;final EdgeInsets padding;/// Round line metrics up before adding padding, so panels reserve enough- /// room at every supported terminal size. The extra two pixels are the row- /// border; app_select_field_test checks the result against actual layout.+ /// room for the line. The extra two pixels are the row border;+ /// app_select_field_test checks the result against actual layout.double get extent =>math.max(iconSize, (fontSize * 1.2).ceilToDouble()) +padding.vertical +@@ -227,12 +226,12 @@ class _AppMenuItemState extends State<AppMenuItem> {widget.label,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: AppType.mono(color: widget.danger ? error : AppPalette.textPrimary,height: 1.2,fontWeight: widget.selected- ? AppFont.semibold- : AppFont.medium,+ ? AppFont.medium+ : AppFont.regular,),),if (widget.detail case final detail?) ...[@@ -241,7 +240,7 @@ class _AppMenuItemState extends State<AppMenuItem> {detail,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: AppType.caption(color: AppPalette.textSecondary,height: 1.25,),@@ -257,7 +256,7 @@ class _AppMenuItemState extends State<AppMenuItem> {widget.note!,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: AppType.mono(color: AppPalette.textFaint,height: 1.2,),diff --git a/desktop/lib/shared/widgets/app_select_field.dart b/desktop/lib/shared/widgets/app_select_field.dartindex 2bb69b011..a53110c8e 100644--- a/desktop/lib/shared/widgets/app_select_field.dart+++ b/desktop/lib/shared/widgets/app_select_field.dart@@ -2,7 +2,6 @@ import 'dart:math' as math;import 'package:flutter/material.dart';import 'package:flutter/services.dart';-import 'package:harness/terminal/terminal_text.dart';import '../theme/app_theme.dart';import 'app_menu.dart';@@ -661,11 +660,8 @@ class _AppSelectFieldState<T> extends State<AppSelectField<T>> {overflow: TextOverflow.ellipsis,style:widget.textStyle ??- terminalTextStyle(+ AppType.label(fontWeight: AppControl.fontWeight,- letterSpacing: AppFont.trackingFor(- AppControl.fontSize,- ),color: AppPalette.textPrimary,),),@@ -677,7 +673,7 @@ class _AppSelectFieldState<T> extends State<AppSelectField<T>> {current!.note!,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: AppType.mono(color: AppPalette.textFaint,),),diff --git a/desktop/lib/shared/widgets/command_row.dart b/desktop/lib/shared/widgets/command_row.dartindex 62a1ce12d..53f08c5ca 100644--- a/desktop/lib/shared/widgets/command_row.dart+++ b/desktop/lib/shared/widgets/command_row.dart@@ -35,11 +35,11 @@ class CommandRow extends StatelessWidget {),child: Row(children: [- Text('\$ ', style: TextStyle(color: AppColors.mutedStrong)),+ Text('\$ ', style: grid.AppType.mono(color: AppColors.mutedStrong)),Expanded(child: SelectableText(command,- style: terminalTextStyle(color: AppColors.text),+ style: grid.AppType.mono(color: AppColors.text),),),Icon(diff --git a/desktop/lib/shared/widgets/empty_state.dart b/desktop/lib/shared/widgets/empty_state.dartindex 4fda07c24..eba6e2839 100644--- a/desktop/lib/shared/widgets/empty_state.dart+++ b/desktop/lib/shared/widgets/empty_state.dart@@ -1,5 +1,4 @@import 'package:flutter/material.dart';-import 'package:harness/terminal/terminal_text.dart';import '../theme/app_theme.dart';@@ -59,10 +58,7 @@ class EmptyState extends StatelessWidget {Text(title,textAlign: TextAlign.center,- style: terminalTextStyle(- color: AppPalette.textPrimary,- fontWeight: FontWeight.w600,- ),+ style: AppType.heading(color: AppPalette.textPrimary),),if (message != null) ...[const SizedBox(height: 6),@@ -71,7 +67,7 @@ class EmptyState extends StatelessWidget {child: Text(message!,textAlign: TextAlign.center,- style: terminalTextStyle(+ style: AppType.body(color: AppPalette.textSecondary,height: 1.4,),diff --git a/desktop/lib/shared/widgets/section_heading.dart b/desktop/lib/shared/widgets/section_heading.dartindex 529a5a879..3f55caba0 100644--- a/desktop/lib/shared/widgets/section_heading.dart+++ b/desktop/lib/shared/widgets/section_heading.dart@@ -1,16 +1,14 @@import 'package:flutter/material.dart';-import 'package:harness/terminal/terminal_text.dart';import '../theme/app_theme.dart';/// A heading for one group inside a screen — "Theme", "Typography" — sitting/// under the screen's own title and above the rows it names.///-/// 19pt semibold with a touch of negative tracking, which is a step of its own-/// rather than a ramp entry: it only has to out-rank the `medium` row titles-/// BELOW it, not the screen title above. Reaching for `headlineSmall` (25) here-/// makes every group look like a new screen; reaching for `titleSmall` (14.5)-/// leaves the group indistinguishable from its own contents.+/// [AppType.heading]: it only has to out-rank the `medium` row titles BELOW+/// it, not the screen title above. Reaching for [AppType.title] here makes+/// every group look like a new screen; reaching for [AppType.label] leaves the+/// group indistinguishable from its own contents.////// A widget rather than a style so the size cannot drift: before this existed/// each pane invented its own, which is how one app ends up with four different@@ -34,12 +32,7 @@ class SectionHeading extends StatelessWidget {children: [Text(title,- style: terminalTextStyle(- color: AppPalette.textPrimary,- fontWeight: AppFont.semibold,- letterSpacing: -0.2,- height: 1.2,- ),+ style: AppType.heading(color: AppPalette.textPrimary, height: 1.2),),if (subtitle != null) ...[const SizedBox(height: 3),diff --git a/desktop/lib/sharing/share_harness_dialog.dart b/desktop/lib/sharing/share_harness_dialog.dartindex b825462f8..46398fa12 100644--- a/desktop/lib/sharing/share_harness_dialog.dart+++ b/desktop/lib/sharing/share_harness_dialog.dart@@ -3,7 +3,6 @@ import 'dart:async';import '../shared/widgets/labeled_field.dart';import 'package:flutter/material.dart';-import 'package:harness/terminal/terminal_text.dart';import '../shared/theme/app_theme.dart' as grid;import '../shared/widgets/app_dialog.dart';@@ -298,7 +297,7 @@ class _ShareHarnessDialogState extends State<ShareHarnessDialog> {child: Text('They’ll find this harness in Machines → Shared with you using the invited email. ''Keep your machine online while they watch. You can remove access at any time.',- style: terminalTextStyle(height: 1.5),+ style: grid.AppType.body(height: 1.5),),),],@@ -338,15 +337,15 @@ class _ShareHarnessDialogState extends State<ShareHarnessDialog> {backgroundColor: grid.AppSurface.recess,child: Text(email.substring(0, 1).toUpperCase(),- style: terminalTextStyle(),+ style: grid.AppType.label(),),),title: Text(email,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(),+ style: grid.AppType.label(),),- subtitle: Text(subtitle, style: terminalTextStyle()),+ subtitle: Text(subtitle, style: grid.AppType.body()),trailing: TextButton(onPressed: _busy ? null : () => _remove(share['id'] as String),child: const Text('Remove'),diff --git a/desktop/lib/sharing/shared_harness_panel.dart b/desktop/lib/sharing/shared_harness_panel.dartindex fdafc70f5..e7ab590c3 100644--- a/desktop/lib/sharing/shared_harness_panel.dart+++ b/desktop/lib/sharing/shared_harness_panel.dart@@ -206,6 +206,7 @@ class _SharedHarnessPanelState extends State<SharedHarnessPanel> {@overrideWidget build(BuildContext context) {grid.AppTheme.watch(context);+ TerminalFontScope.watch(context);final live = !_ended && _status == ConnectionStatus.connected;return Column(children: [@@ -221,11 +222,16 @@ class _SharedHarnessPanelState extends State<SharedHarnessPanel> {child: Text(widget.grant.name,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(fontWeight: FontWeight.w600),+ style: grid.AppType.monoLabel(+ fontWeight: grid.AppFont.semibold,+ ),),),const SizedBox(width: 8),- Text('View only', style: terminalTextStyle()),+ Text(+ 'View only',+ style: grid.AppType.monoLabel(fontWeight: grid.AppFont.regular),+ ),const SizedBox(width: 12),Tooltip(message:@@ -239,7 +245,8 @@ class _SharedHarnessPanelState extends State<SharedHarnessPanel> {: live? 'Live': 'Reconnecting',- style: terminalTextStyle(+ style: grid.AppType.monoLabel(+ fontWeight: grid.AppFont.regular,color: grid.AppPalette.textSecondary,),),@@ -257,7 +264,7 @@ class _SharedHarnessPanelState extends State<SharedHarnessPanel> {width: double.infinity,padding: const EdgeInsets.all(12),color: grid.AppSurface.recess,- child: Text(_failure!, style: terminalTextStyle()),+ child: Text(_failure!, style: grid.AppType.body()),),Expanded(child: LayoutBuilder(@@ -286,7 +293,7 @@ class _SharedHarnessPanelState extends State<SharedHarnessPanel> {Text(_viewerMessage,textAlign: TextAlign.center,- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textSecondary,),),@@ -350,7 +357,9 @@ class _SharedHarnessPanelState extends State<SharedHarnessPanel> {child: Text(widget.pane.sharedOwnerName ?? 'Shared harness',overflow: TextOverflow.ellipsis,- style: terminalTextStyle(),+ style: grid.AppType.monoLabel(+ fontWeight: grid.AppFont.regular,+ ),),),const SizedBox(width: 12),diff --git a/desktop/lib/shortcuts/key_cap.dart b/desktop/lib/shortcuts/key_cap.dartindex 5bfd1aacd..bcbb4d528 100644--- a/desktop/lib/shortcuts/key_cap.dart+++ b/desktop/lib/shortcuts/key_cap.dart@@ -1,7 +1,6 @@import 'dart:math' as math;import 'package:flutter/material.dart';-import 'package:harness/terminal/terminal_text.dart';import '../shared/theme/app_theme.dart' as grid;import 'app_shortcuts.dart';@@ -63,7 +62,7 @@ class KeyCap extends StatelessWidget {): Text(label,- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: grid.AppPalette.textPrimary,height: 1,// Tabular so ⌘1 – ⌘9 and ⌘W keep the same cap width.@@ -100,7 +99,7 @@ class KeyChordView extends StatelessWidget {padding: const EdgeInsets.symmetric(horizontal: 2),child: Text('or',- style: terminalTextStyle(color: grid.AppPalette.textFaint),+ style: grid.AppType.caption(color: grid.AppPalette.textFaint),),),for (final key in chords[i]) KeyCap(key),diff --git a/desktop/lib/shortcuts/keyboard_practice.dart b/desktop/lib/shortcuts/keyboard_practice.dartindex a69b7ea4f..8dfa16eb2 100644--- a/desktop/lib/shortcuts/keyboard_practice.dart+++ b/desktop/lib/shortcuts/keyboard_practice.dart@@ -8,6 +8,7 @@ import 'package:harness/terminal/terminal_text.dart';import '../core/harness_file_store.dart';import '../core/local_key_value_store.dart';import '../core/test_run.dart';+import '../shared/theme/app_type.dart';import '../widgets/box_chrome.dart';import '../widgets/terminal_prompt.dart';import 'app_keymap.dart';@@ -328,7 +329,7 @@ class _KeyboardPracticeState extends State<KeyboardPractice> {if (rows.isEmpty) return;setState(() => _cursor = (_cursor + delta).clamp(0, rows.length - 1));if (_scroll.hasClients) {- final height = 54.0 * terminalTextScaleOf(context);+ final height = 54.0 * appTextScaleOf(context);final top = _cursor * height, bottom = top + height;final at = _scroll.offset, view = _scroll.position.viewportDimension;if (top < at || bottom > at + view) {@@ -538,7 +539,7 @@ class _KeyboardPracticeState extends State<KeyboardPractice> {: ListView.builder(controller: _scroll,shrinkWrap: true,- itemExtent: 54.0 * terminalTextScaleOf(context),+ itemExtent: 54.0 * appTextScaleOf(context),itemCount: rows.length,itemBuilder: (context, i) {final row = rows[i];diff --git a/desktop/lib/shortcuts/keymap_settings.dart b/desktop/lib/shortcuts/keymap_settings.dartindex c37a48faf..b99de80fd 100644--- a/desktop/lib/shortcuts/keymap_settings.dart+++ b/desktop/lib/shortcuts/keymap_settings.dart@@ -51,7 +51,7 @@ class KeymapSettings extends StatelessWidget {value: contextKind,// Keep the context readable when the user enlarges text. The// surrounding Wrap still limits the field to the pane width.- width: 160 * terminalTextScaleOf(context),+ width: 160 * grid.appTextScaleOf(context),options: const [SelectOption(value: KeymapContext.workspace,@@ -84,19 +84,22 @@ class KeymapSettings extends StatelessWidget {const SizedBox(height: 8),Text('Saves apply automatically. Invalid edits keep your last working shortcuts.',- style: terminalTextStyle(color: grid.AppPalette.textSecondary),+ style: grid.AppType.body(color: grid.AppPalette.textSecondary),),const SizedBox(height: 4),SelectableText(keymap!.path!,- style: terminalTextStyle(color: grid.AppPalette.textFaint),+ style: grid.AppType.monoLabel(+ color: grid.AppPalette.textFaint,+ fontWeight: FontWeight.w400,+ ),),],if (keymap?.error != null) ...[const SizedBox(height: 8),SelectableText(keymap!.error!,- style: terminalTextStyle(color: Colors.orangeAccent),+ style: grid.AppType.body(color: Colors.orangeAccent),),],const SizedBox(height: 16),diff --git a/desktop/lib/shortcuts/shortcuts_list.dart b/desktop/lib/shortcuts/shortcuts_list.dartindex 53fe8667b..f71684232 100644--- a/desktop/lib/shortcuts/shortcuts_list.dart+++ b/desktop/lib/shortcuts/shortcuts_list.dart@@ -90,7 +90,7 @@ class ShortcutsDeck extends StatelessWidget {final width = math.min(constraints.maxWidth, maxWidth);// Preserve room for the label as its keycaps grow. Otherwise large// text keeps three narrow lanes and leaves only a word per line.- final textScale = terminalTextScaleOf(context);+ final textScale = grid.appTextScaleOf(context);final minWidth = minCardWidth * math.max(1.0, textScale);final columns = ((width + _gap) / (minWidth + _gap)).floor().clamp(1,@@ -164,7 +164,7 @@ class _ShortcutCard extends StatelessWidget {Expanded(child: _CardTitle(title)),Text('${rows.length}',- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: grid.AppPalette.textFaint,fontFeatures: const [FontFeature.tabularFigures()],),@@ -214,7 +214,7 @@ class _TerminalCard extends StatelessWidget {Expanded(child: Text(key.label,- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textFaint,),),@@ -244,9 +244,8 @@ class _CardTitle extends StatelessWidget {grid.AppTheme.watch(context);return Text(label.toUpperCase(),- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: grid.AppPalette.textFaint,- letterSpacing: 0.08 * 10.5,fontWeight: grid.AppFont.medium,),);@@ -270,7 +269,7 @@ class ShortcutsNote extends StatelessWidget {'Harness shortcuts control your workspace. Other input goes to the ''focused agent, where prompt editing and cancellation follow that ''coding agent’s behavior.',- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textSecondary,height: 1.5,),@@ -334,7 +333,7 @@ class _ShortcutRowView extends StatelessWidget {Expanded(child: Text(row.label,- style: terminalTextStyle(color: grid.AppPalette.textSecondary),+ style: grid.AppType.body(color: grid.AppPalette.textSecondary),),),const SizedBox(width: _gutter),@@ -345,7 +344,7 @@ class _ShortcutRowView extends StatelessWidget {child: row.chords.isEmpty? Text('Unassigned',- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textFaint,),)diff --git a/desktop/lib/store/store_category.dart b/desktop/lib/store/store_category.dartindex 1332772b9..bc6d798ed 100644--- a/desktop/lib/store/store_category.dart+++ b/desktop/lib/store/store_category.dart@@ -138,8 +138,7 @@ class _StoreCategoryState extends State<StoreCategory> {children: [Text('Your next tool is waiting.',- style: terminalTextStyle(- fontWeight: FontWeight.w600,+ style: grid.AppType.heading(color: grid.AppPalette.textPrimary,),),@@ -147,7 +146,7 @@ class _StoreCategoryState extends State<StoreCategory> {Text('Explore the harnesses in $name and choose one to try.',textAlign: TextAlign.center,- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textSecondary,),),@@ -249,10 +248,8 @@ class _DisciplineHero extends StatelessWidget {children: [Text(name,- style: terminalTextStyle(+ style: grid.AppType.display(height: 1.15,- letterSpacing: -1,- fontWeight: FontWeight.w700,color: grid.AppPalette.textPrimary,),),@@ -269,26 +266,24 @@ class _DisciplineHero extends StatelessWidget {children: [Text('GET STARTED',- style: terminalTextStyle(+ style: grid.AppType.monoMeta(letterSpacing: 1.2,- fontWeight: FontWeight.w700,+ fontWeight: grid.AppFont.medium,color: grid.AppPalette.accentOnSurface,),),const SizedBox(height: 12),Text(headline.replaceAll('\n', ' '),- style: terminalTextStyle(+ style: grid.AppType.title(height: 1.15,- letterSpacing: -.5,- fontWeight: FontWeight.w700,color: grid.AppPalette.textPrimary,),),const SizedBox(height: 12),Text(description,- style: terminalTextStyle(+ style: grid.AppType.body(height: 1.5,color: grid.AppPalette.textSecondary,),@@ -302,8 +297,7 @@ class _DisciplineHero extends StatelessWidget {Expanded(child: Text('Explore ${entry!.name}',- style: terminalTextStyle(- fontWeight: FontWeight.w600,+ style: grid.AppType.label(color: grid.AppPalette.textPrimary,),),diff --git a/desktop/lib/store/store_discover.dart b/desktop/lib/store/store_discover.dartindex 6c9f68f44..9236b1174 100644--- a/desktop/lib/store/store_discover.dart+++ b/desktop/lib/store/store_discover.dart@@ -87,10 +87,8 @@ class StoreDiscover extends StatelessWidget {Text('Follow your curiosity.',key: const ValueKey('store-curiosity-hero'),- style: terminalTextStyle(+ style: grid.AppType.heading(height: 1.15,- letterSpacing: -1.1,- fontWeight: FontWeight.w700,color: grid.AppPalette.textPrimary,),),@@ -98,7 +96,7 @@ class StoreDiscover extends StatelessWidget {const SizedBox(height: 24),LayoutBuilder(builder: (context, constraints) {- final scale = terminalTextScaleOf(context);+ final scale = grid.appTextScaleOf(context);final wide =constraints.maxWidth >= 980 &&scale <= 1.25 &&@@ -199,7 +197,7 @@ class StoreDiscover extends StatelessWidget {const SizedBox(height: 16),LayoutBuilder(builder: (context, constraints) {- final scale = terminalTextScaleOf(context);+ final scale = grid.appTextScaleOf(context);final columns = (constraints.maxWidth / (320 * scale)).floor().clamp(1, 3);@@ -232,15 +230,14 @@ class StoreDiscover extends StatelessWidget {const SizedBox(height: 32),Text('For polymaths in the making.',- style: terminalTextStyle(- fontWeight: FontWeight.w600,+ style: grid.AppType.heading(color: grid.AppPalette.textPrimary,),),const SizedBox(height: 6),Text('Learn the next craft through the things you build.',- style: terminalTextStyle(+ style: grid.AppType.body(height: 1.5,color: grid.AppPalette.textSecondary,),@@ -254,7 +251,7 @@ class StoreDiscover extends StatelessWidget {const SizedBox(height: 32),Text('Start with a coding agent. More disciplines will appear here as harnesses become available.',- style: terminalTextStyle(+ style: grid.AppType.body(height: 1.5,color: grid.AppPalette.textSecondary,),@@ -288,7 +285,7 @@ class _FeaturedStory extends StatelessWidget {'Design' => 'Give your ideas shape.',_ => 'Build something real.',};- final scale = terminalTextScaleOf(context);+ final scale = grid.appTextScaleOf(context);return StoreExploreCard(key: ValueKey('store-feature:${entry.id}'),color: storeDiscipline(category).color,@@ -304,9 +301,9 @@ class _FeaturedStory extends StatelessWidget {children: [Text(category.toUpperCase(),- style: terminalTextStyle(+ style: grid.AppType.monoMeta(letterSpacing: 1.1,- fontWeight: FontWeight.w700,+ fontWeight: grid.AppFont.medium,color: grid.AppPalette.accentOnSurface,),),@@ -315,10 +312,8 @@ class _FeaturedStory extends StatelessWidget {height: 50 * scale,child: Text(headline,- style: terminalTextStyle(+ style: grid.AppType.title(height: 1.15,- letterSpacing: -.4,- fontWeight: FontWeight.w700,color: grid.AppPalette.textPrimary,),),@@ -332,7 +327,7 @@ class _FeaturedStory extends StatelessWidget {'Explore ${entry.name}',maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.label(color: grid.AppPalette.textSecondary,),),@@ -374,7 +369,6 @@ class _DisciplineLink extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);final discipline = storeDiscipline(name);final example = discipline.example(entries)!;return StoreExploreCard(@@ -393,15 +387,14 @@ class _DisciplineLink extends StatelessWidget {children: [Text(name,- style: terminalTextStyle(- fontWeight: FontWeight.w600,+ style: grid.AppType.label(color: grid.AppPalette.textPrimary,),),const SizedBox(height: 5),Text('${entries.length} ${entries.length == 1 ? 'harness' : 'harnesses'}',- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textSecondary,),),diff --git a/desktop/lib/store/store_explore_widgets.dart b/desktop/lib/store/store_explore_widgets.dartindex 535a12f34..7814c8858 100644--- a/desktop/lib/store/store_explore_widgets.dart+++ b/desktop/lib/store/store_explore_widgets.dart@@ -1,7 +1,6 @@import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';import 'package:url_launcher/url_launcher.dart';-import 'package:harness/terminal/terminal_text.dart';import '../core/dsh_catalog.dart';import '../shared/theme/app_theme.dart' as grid;@@ -25,7 +24,6 @@ class StoreExploreHeading extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Row(crossAxisAlignment: CrossAxisAlignment.start,children: [@@ -35,10 +33,8 @@ class StoreExploreHeading extends StatelessWidget {children: [Text(title,- style: terminalTextStyle(+ style: grid.AppType.heading(height: 1.15,- fontWeight: FontWeight.w700,- letterSpacing: -.4,color: grid.AppPalette.textPrimary,),),@@ -46,7 +42,7 @@ class StoreExploreHeading extends StatelessWidget {const SizedBox(height: 8),Text(subtitle!,- style: terminalTextStyle(+ style: grid.AppType.body(height: 1.5,color: grid.AppPalette.textSecondary,),@@ -79,7 +75,6 @@ class StoreProjectArt extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);final color = storeDiscipline(storeCategoryFor(entry)).color;final fallback = DecoratedBox(decoration: BoxDecoration(@@ -185,7 +180,6 @@ class _CoverCredit extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Tooltip(message:'${cover.description}\n${cover.credit} · ${cover.license}\nView source',@@ -252,7 +246,6 @@ class _StoreExploreCardState extends State<StoreExploreCard> {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);final active = _hovered || _focused;final radius = BorderRadius.circular(16);return AnimatedContainer(diff --git a/desktop/lib/store/store_harness_actions.dart b/desktop/lib/store/store_harness_actions.dartindex 7cb923cb0..9efc2cb60 100644--- a/desktop/lib/store/store_harness_actions.dart+++ b/desktop/lib/store/store_harness_actions.dart@@ -4,7 +4,6 @@ import 'dart:math' as math;import 'package:flutter/material.dart';import 'package:flutter/services.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../core/models.dart';import '../core/harness_catalog.dart';@@ -193,7 +192,7 @@ class _StoreHarnessActionsState extends State<StoreHarnessActions> {horizontal: widget.prominent ? 20 : 12,vertical: 8,);- final textStyle = terminalTextStyle(fontWeight: FontWeight.w600);+ final textStyle = grid.AppType.label(fontWeight: grid.AppFont.semibold);final tooltip = multiple? 'Choose a harness to resume': targets.firstOrNull?.tooltip ?? '';@@ -235,8 +234,7 @@ class _StoreHarnessActionsState extends State<StoreHarnessActions> {padding: const EdgeInsets.fromLTRB(18, 12, 18, 8),child: Text('Recent harnesses',- style: terminalTextStyle(- fontWeight: FontWeight.w600,+ style: grid.AppType.label(color: grid.AppPalette.textSecondary,),),diff --git a/desktop/lib/store/store_listing.dart b/desktop/lib/store/store_listing.dartindex ebebeca16..e5c7a8b15 100644--- a/desktop/lib/store/store_listing.dart+++ b/desktop/lib/store/store_listing.dart@@ -16,7 +16,6 @@ class StoreAppIcon extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Container(width: size,height: size,@@ -54,10 +53,9 @@ class StoreListing extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return LayoutBuilder(builder: (context, box) {- final scale = terminalTextScaleOf(context);+ final scale = grid.appTextScaleOf(context);final columns = (box.maxWidth / (340 * scale)).floor().clamp(1, 3);final width = (box.maxWidth - (columns - 1) * 28) / columns;final reserveRating = entries.any((entry) => !ratingFor(entry).isEmpty);@@ -105,7 +103,7 @@ class _ProductRow extends StatelessWidget {@overrideWidget build(BuildContext context) {TerminalFontScope.watch(context);- final scale = terminalTextScaleOf(context);+ final scale = grid.appTextScaleOf(context);final benefit = entry.isEngine? entry.tagline ??engineIdentity(entry.id).tagline ??@@ -129,8 +127,7 @@ class _ProductRow extends StatelessWidget {width: 18,child: Text('$rank',- style: terminalTextStyle(- fontWeight: FontWeight.w600,+ style: grid.AppType.monoLabel(color: grid.AppPalette.textSecondary,),),@@ -149,20 +146,20 @@ class _ProductRow extends StatelessWidget {entry.name,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(- fontWeight: FontWeight.w600,+ style: grid.AppType.label(color: grid.AppPalette.textPrimary,),),),const SizedBox(height: 4),+ // Two lines of the description: 2 × 13 × 1.3.SizedBox(- height: 32 * scale,+ height: 34 * scale,child: Text(benefit,maxLines: 2,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.body(height: 1.3,color: grid.AppPalette.textSecondary,),@@ -172,7 +169,7 @@ class _ProductRow extends StatelessWidget {const SizedBox(height: 4),Text(entry.hasUpdate ? 'Update available' : ' ',- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.accentOnSurface,),),@@ -193,7 +190,7 @@ class _ProductRow extends StatelessWidget {const SizedBox(width: 3),Text('${rating.average.toStringAsFixed(1)} · ${rating.count}',- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: grid.AppPalette.textSecondary,),),diff --git a/desktop/lib/store/store_screen.dart b/desktop/lib/store/store_screen.dartindex 80f31c8f0..2bae72ba0 100644--- a/desktop/lib/store/store_screen.dart+++ b/desktop/lib/store/store_screen.dart@@ -590,7 +590,7 @@ class _StoreNav extends StatelessWidget {Widget build(BuildContext context) {TerminalFontScope.watch(context);final shelf = this.shelf;- final textScale = (terminalTextScaleOf(context)).clamp(1.0, 1.5);+ final textScale = grid.appTextScaleOf(context).clamp(1.0, 1.5);return Container(width:(MediaQuery.sizeOf(context).width < 1000 ? 184 : 216) +@@ -621,9 +621,9 @@ class _StoreNav extends StatelessWidget {padding: const EdgeInsets.fromLTRB(10, 0, 10, 10),child: Text('DISCIPLINES',- style: terminalTextStyle(+ style: grid.AppType.monoMeta(letterSpacing: 1.4,- fontWeight: FontWeight.w600,+ fontWeight: grid.AppFont.medium,color: grid.AppPalette.textFaint,),),@@ -639,10 +639,13 @@ class _StoreNav extends StatelessWidget {trailingWidth: 22,trailing: textScale > 1.2? null- : Text(- '${counts[name]}',- style: terminalTextStyle(- color: grid.AppPalette.textFaint,+ : Align(+ alignment: Alignment.centerRight,+ child: Text(+ '${counts[name]}',+ style: grid.AppType.monoMeta(+ color: grid.AppPalette.textFaint,+ ),),),onTap: () => onSelect(_Category(name)),@@ -725,7 +728,6 @@ class _Shelf$View extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);if (shelf is _Category) {return StoreCategory(name: _title,@@ -750,16 +752,12 @@ class _Shelf$View extends StatelessWidget {children: [Text(_title,- style: terminalTextStyle(- fontWeight: FontWeight.w700,- letterSpacing: -.6,- color: grid.AppPalette.textPrimary,- ),+ style: grid.AppType.display(color: grid.AppPalette.textPrimary),),const SizedBox(height: 8),Text(_subtitle,- style: terminalTextStyle(color: grid.AppPalette.textSecondary),+ style: grid.AppType.body(color: grid.AppPalette.textSecondary),),const SizedBox(height: 24),if (entries.isEmpty)@@ -771,7 +769,7 @@ class _Shelf$View extends StatelessWidget {: loaded? 'Nothing here yet.': 'Asking this computer…',- style: terminalTextStyle(+ style: grid.AppType.body(height: 1.5,color: grid.AppPalette.textSecondary,),@@ -819,7 +817,6 @@ class _Stars extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Row(mainAxisSize: MainAxisSize.min,children: [@@ -1155,10 +1152,8 @@ class _ProductPageState extends State<_ProductPage> {Text(entry.name,textAlign: TextAlign.center,- style: terminalTextStyle(- height: 1.02,- fontWeight: FontWeight.w700,- letterSpacing: wide ? -2.2 : -1.2,+ style: grid.AppType.display(+ height: 1.1,color: grid.AppPalette.textPrimary,),),@@ -1170,7 +1165,7 @@ class _ProductPageState extends State<_ProductPage> {child: Text(description,textAlign: TextAlign.center,- style: terminalTextStyle(+ style: grid.AppType.body(height: 1.45,color: grid.AppPalette.textSecondary,),@@ -1191,7 +1186,7 @@ class _ProductPageState extends State<_ProductPage> {'Runs on $baseLabel',].join(' · '),textAlign: TextAlign.center,- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textFaint,),),@@ -1257,8 +1252,8 @@ class _ProductPageState extends State<_ProductPage> {foregroundColor: grid.AppPalette.windowBg,minimumSize: const Size(148, 50),padding: const EdgeInsets.symmetric(horizontal: 30),- textStyle: terminalTextStyle(- fontWeight: FontWeight.w600,+ textStyle: grid.AppType.label(+ fontWeight: grid.AppFont.semibold,),shape: const StadiumBorder(),),@@ -1278,7 +1273,7 @@ class _ProductPageState extends State<_ProductPage> {Text('Your projects and files are kept.',textAlign: TextAlign.center,- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textSecondary,),),@@ -1302,7 +1297,7 @@ class _ProductPageState extends State<_ProductPage> {child: local == null? Text('Connecting to this computer…',- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textFaint,),)@@ -1362,9 +1357,7 @@ class _ProductPageState extends State<_ProductPage> {Text('Ratings and reviews',textAlign: TextAlign.center,- style: terminalTextStyle(- fontWeight: FontWeight.w700,- letterSpacing: -0.6,+ style: grid.AppType.heading(color: grid.AppPalette.textPrimary,),),@@ -1387,7 +1380,7 @@ class _ProductPageState extends State<_ProductPage> {Text('Reviews are unavailable right now.',textAlign: TextAlign.center,- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textSecondary,),),@@ -1397,7 +1390,7 @@ class _ProductPageState extends State<_ProductPage> {Text('No reviews yet. Be the first.',textAlign: TextAlign.center,- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textFaint,),),@@ -1451,6 +1444,7 @@ class _InstallLine extends StatelessWidget {@overrideWidget build(BuildContext context) {grid.AppTheme.watch(context);+ TerminalFontScope.watch(context);final row = _machineHarness(state, entry.id);final run = state.dsh.runs[_operationId(state, entry.id)];final installing = run != null && run.inProgress;@@ -1512,7 +1506,7 @@ class _InstallLine extends StatelessWidget {} else {status = 'Not installed';}- final faint = terminalTextStyle(color: grid.AppPalette.textFaint);+ final faint = grid.AppType.body(color: grid.AppPalette.textFaint);return Wrap(alignment: WrapAlignment.center,crossAxisAlignment: WrapCrossAlignment.center,@@ -1532,7 +1526,7 @@ class _InstallLine extends StatelessWidget {Text(status,key: const ValueKey('store-install-status'),- style: terminalTextStyle(+ style: grid.AppType.body(color: run?.failed == true? grid.AppPalette.warn: grid.AppPalette.textSecondary,@@ -1544,7 +1538,13 @@ class _InstallLine extends StatelessWidget {message: row?.availableCommit == null? 'Installed version: ${row!.installedCommit}': 'Installed: ${row!.installedCommit}\nAvailable: ${row.availableCommit}',- child: Text(row.installedCommit!.substring(0, 8), style: faint),+ child: Text(+ row.installedCommit!.substring(0, 8),+ style: grid.AppType.monoLabel(+ fontWeight: grid.AppFont.regular,+ color: grid.AppPalette.textFaint,+ ),+ ),),if (installed && !installing && !busy) ...[Text('·', style: faint),@@ -1601,7 +1601,7 @@ class _QuietLinkState extends State<_QuietLink> {? grid.AppPalette.textPrimary: grid.AppPalette.textSecondary;final content = DefaultTextStyle.merge(- style: terminalTextStyle(color: color),+ style: grid.AppType.label(color: color),child: Row(mainAxisSize: MainAxisSize.min,children: [@@ -1644,16 +1644,16 @@ class _RatingSummary extends StatelessWidget {children: [Text(rating.average.toStringAsFixed(1),- style: terminalTextStyle(- fontWeight: FontWeight.w700,+ style: grid.AppType.title(height: 1,color: grid.AppPalette.textPrimary,+ fontFeatures: grid.AppFont.tabularFigures,),),const SizedBox(height: 6),Text('out of 5 · ${rating.count} rating${rating.count == 1 ? '' : 's'}',- style: terminalTextStyle(color: grid.AppPalette.textFaint),+ style: grid.AppType.body(color: grid.AppPalette.textFaint),),],),@@ -1671,7 +1671,7 @@ class _RatingSummary extends StatelessWidget {child: Text('$stars',textAlign: TextAlign.right,- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: grid.AppPalette.textFaint,),),@@ -1719,7 +1719,6 @@ class _ReviewCard extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Container(padding: const EdgeInsets.all(14),decoration: BoxDecoration(@@ -1740,8 +1739,7 @@ class _ReviewCard extends StatelessWidget {review.title!,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(- fontWeight: FontWeight.w600,+ style: grid.AppType.label(color: grid.AppPalette.textPrimary,),),@@ -1763,13 +1761,13 @@ class _ReviewCard extends StatelessWidget {const SizedBox(height: 4),Text('${review.mine ? 'You' : review.authorName} · ${_when(review.updatedAt)}',- style: terminalTextStyle(color: grid.AppPalette.textFaint),+ style: grid.AppType.body(color: grid.AppPalette.textFaint),),if (review.body != null) ...[const SizedBox(height: 8),Text(review.body!,- style: terminalTextStyle(+ style: grid.AppType.body(height: 1.45,color: grid.AppPalette.textPrimary,),@@ -1819,7 +1817,6 @@ class _ReviewDialogState extends State<_ReviewDialog> {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return _DialogCard(width: 460,child: Column(@@ -1830,10 +1827,7 @@ class _ReviewDialogState extends State<_ReviewDialog> {widget.existing == null? 'Rate ${widget.name}': 'Your review of ${widget.name}',- style: terminalTextStyle(- fontWeight: FontWeight.w600,- color: grid.AppPalette.textPrimary,- ),+ style: grid.AppType.heading(color: grid.AppPalette.textPrimary),),const SizedBox(height: 14),_Stars(@@ -1913,7 +1907,6 @@ class _ConfirmCard extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return _DialogCard(width: 420,child: Column(@@ -1922,15 +1915,12 @@ class _ConfirmCard extends StatelessWidget {children: [Text(title,- style: terminalTextStyle(- fontWeight: FontWeight.w600,- color: grid.AppPalette.textPrimary,- ),+ style: grid.AppType.heading(color: grid.AppPalette.textPrimary),),const SizedBox(height: 8),Text(detail,- style: terminalTextStyle(+ style: grid.AppType.body(height: 1.4,color: grid.AppPalette.textSecondary,),@@ -1967,7 +1957,6 @@ class _DialogCard extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Center(child: Material(color: grid.AppPalette.panelBg,diff --git a/desktop/lib/store/store_search.dart b/desktop/lib/store/store_search.dartindex 961bfd7f6..6a01eade8 100644--- a/desktop/lib/store/store_search.dart+++ b/desktop/lib/store/store_search.dart@@ -41,14 +41,13 @@ class StoreSearch extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return LayoutBuilder(builder: (context, box) {final padding = box.maxWidth < 680 ? 20.0 : 36.0;// A control's height, grown with the text so a scaled label still has air.final height = math.max(grid.AppControl.height,- MediaQuery.textScalerOf(context).scale(terminalFontStore.size) + 18,+ MediaQuery.textScalerOf(context).scale(grid.AppType.bodySize) + 18,);return Container(key: const ValueKey('store-search-header'),@@ -253,14 +252,14 @@ class _Field extends StatelessWidget {onChanged: onChanged,textInputAction: TextInputAction.search,textAlignVertical: TextAlignVertical.center,- style: terminalTextStyle(+ style: grid.AppType.mono(color: grid.AppPalette.textPrimary,),// Bare: the outline around it is this field's border,// so none of the theme's own may draw inside it.decoration: InputDecoration(hintText: 'Search harnesses',- hintStyle: terminalTextStyle(+ hintStyle: grid.AppType.mono(color: grid.AppPalette.textSecondary,),isCollapsed: true,@@ -289,7 +288,7 @@ class _Field extends StatelessWidget {padding: const EdgeInsets.only(right: 5),child: Text(shortcut,- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: grid.AppPalette.textFaint,),),@@ -317,7 +316,6 @@ class _CreateHarness extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Tooltip(message: 'Your first harness in ten minutes, on GitHub',child: FilledButton(@@ -333,7 +331,7 @@ class _CreateHarness extends StatelessWidget {padding: EdgeInsets.symmetric(horizontal: labelled ? 14 : 0),backgroundColor: grid.AppPalette.textPrimary,foregroundColor: grid.AppPalette.windowBg,- textStyle: terminalTextStyle(fontWeight: FontWeight.w600),+ textStyle: grid.AppType.label(),shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(grid.AppControl.radius),),diff --git a/desktop/lib/store/store_showcase.dart b/desktop/lib/store/store_showcase.dartindex 2fde33b17..6e4f439e9 100644--- a/desktop/lib/store/store_showcase.dart+++ b/desktop/lib/store/store_showcase.dart@@ -88,6 +88,7 @@ class _ExampleBlockState extends State<_ExampleBlock> {@overrideWidget build(BuildContext context) {grid.AppTheme.watch(context);+ TerminalFontScope.watch(context);final example = widget.example;final i = widget.index;return LayoutBuilder(@@ -98,7 +99,7 @@ class _ExampleBlockState extends State<_ExampleBlock> {children: [Text('${(i + 1).toString().padLeft(2, '0')} / ${widget.count.toString().padLeft(2, '0')}',- style: terminalTextStyle(+ style: grid.AppType.monoMeta(letterSpacing: 2,color: grid.AppPalette.accentOnSurface,),@@ -110,10 +111,8 @@ class _ExampleBlockState extends State<_ExampleBlock> {'“${example.prompt}”',key: ValueKey('store-example-prompt:$i'),textAlign: TextAlign.center,- style: terminalTextStyle(+ style: grid.AppType.title(height: 1.24,- fontWeight: FontWeight.w600,- letterSpacing: wide ? -0.8 : -0.4,color: grid.AppPalette.textPrimary,),),@@ -134,7 +133,9 @@ class _ExampleBlockState extends State<_ExampleBlock> {foregroundColor: Colors.white,minimumSize: const Size(0, 46),padding: const EdgeInsets.symmetric(horizontal: 22),- textStyle: terminalTextStyle(fontWeight: FontWeight.w600),+ textStyle: grid.AppType.label(+ fontWeight: grid.AppFont.semibold,+ ),shape: const StadiumBorder(),),),@@ -220,7 +221,7 @@ class _ExampleBlockState extends State<_ExampleBlock> {Text(example.caption!,textAlign: TextAlign.center,- style: terminalTextStyle(+ style: grid.AppType.body(height: 1.4,color: grid.AppPalette.textSecondary,),@@ -241,7 +242,6 @@ class _Output extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);final placeholder = Center(child: Opacity(opacity: 0.5,@@ -327,7 +327,6 @@ class _RevealState extends State<_Reveal> with SingleTickerProviderStateMixin {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return AnimatedBuilder(animation: _controller,builder: (context, child) {diff --git a/desktop/lib/store/store_viewers.dart b/desktop/lib/store/store_viewers.dartindex 61dae9f7b..2bf6f76d0 100644--- a/desktop/lib/store/store_viewers.dart+++ b/desktop/lib/store/store_viewers.dart@@ -1,6 +1,5 @@import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../core/dsh_catalog.dart';import '../shared/theme/app_theme.dart' as grid;@@ -24,22 +23,18 @@ class StoreViewers extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return ListView(key: const ValueKey('store-viewers'),padding: const EdgeInsets.all(28),children: [Text('Viewers',- style: terminalTextStyle(- fontWeight: FontWeight.w700,- color: grid.AppPalette.textPrimary,- ),+ style: grid.AppType.display(color: grid.AppPalette.textPrimary),),const SizedBox(height: 8),Text('Shared previews and the agents that use them.',- style: terminalTextStyle(color: grid.AppPalette.textSecondary),+ style: grid.AppType.body(color: grid.AppPalette.textSecondary),),const SizedBox(height: 24),if (viewers.isEmpty)@@ -87,8 +82,7 @@ class StoreViewers extends StatelessWidget {Expanded(child: Text(viewer.name,- style: terminalTextStyle(- fontWeight: FontWeight.w600,+ style: grid.AppType.heading(color: grid.AppPalette.textPrimary,),),@@ -104,7 +98,7 @@ class StoreViewers extends StatelessWidget {const SizedBox(height: 8),Text(viewer.description!,- style: terminalTextStyle(+ style: grid.AppType.body(height: 1.4,color: grid.AppPalette.textSecondary,),@@ -115,21 +109,18 @@ class StoreViewers extends StatelessWidget {machines.isEmpty? 'Not installed': 'Installed on ${machines.join(', ')}',- style: terminalTextStyle(color: grid.AppPalette.textSecondary),+ style: grid.AppType.body(color: grid.AppPalette.textSecondary),),const SizedBox(height: 14),Text('Used by',- style: terminalTextStyle(- fontWeight: FontWeight.w600,- color: grid.AppPalette.textSecondary,- ),+ style: grid.AppType.label(color: grid.AppPalette.textSecondary),),const SizedBox(height: 4),if (uses.isEmpty)Text('No agents reported in this catalog.',- style: terminalTextStyle(color: grid.AppPalette.textSecondary),+ style: grid.AppType.body(color: grid.AppPalette.textSecondary),)elseWrap(diff --git a/desktop/lib/theme/app_theme.dart b/desktop/lib/theme/app_theme.dartindex c6f273a3d..2eec6b546 100644--- a/desktop/lib/theme/app_theme.dart+++ b/desktop/lib/theme/app_theme.dart@@ -58,7 +58,8 @@ abstract final class AppColors {grid.AppTheme.pick(const Color(0xFFB3261E), const Color(0xFFF2544B));}-/// Legacy names resolve to the single Terminal font preference.+/// The app's two faces, as [grid.AppFont] names them: system sans for the UI,+/// the terminal's face for terminal chrome and copyable strings.abstract final class AppFonts {static String get sans => grid.AppFont.sans;static List<String> get sansFallback => grid.AppFont.sansFallback;diff --git a/desktop/lib/widgets/agent_picker.dart b/desktop/lib/widgets/agent_picker.dartindex 2e607f4c5..434bebe99 100644--- a/desktop/lib/widgets/agent_picker.dart+++ b/desktop/lib/widgets/agent_picker.dart@@ -319,8 +319,8 @@ class _AgentPickerState extends State<AgentPicker> {double _rowHeight(TextScaler scaler) => widget.terminalStyle? math.max(46,- scaler.scale(terminalFontStore.size) * 1.35 +- scaler.scale(terminalFontStore.size) * 1.35 ++ scaler.scale(grid.AppType.monoSize) * 1.35 ++ scaler.scale(grid.AppType.monoSize) * 1.35 +12,): swarmSearchRowHeight(scaler, commands: false);@@ -366,8 +366,7 @@ class _AgentPickerState extends State<AgentPicker> {overflow: TextOverflow.ellipsis,style: widget.terminalStyle? boxMonoStyle()- : terminalTextStyle(- fontWeight: FontWeight.w500,+ : grid.AppType.monoLabel(color: choice == null ? Colors.white60 : Colors.white,),),@@ -609,7 +608,10 @@ class _AgentPickerState extends State<AgentPicker> {'No agents match “${_query.text.trim()}”.',maxLines: 2,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(color: Colors.white60),+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,+ color: Colors.white60,+ ),),),)@@ -755,7 +757,7 @@ class _AgentPickerState extends State<AgentPicker> {final compactAction =(panelWidth >= 760 ? panelWidth / 2 : panelWidth) <- 380 * scaler.scale(terminalFontStore.size) / terminalFontSize;+ 380 * scaler.scale(grid.AppType.monoSize) / grid.AppType.monoSize;return MouseRegion(onHover: (event) {if (_pointer.moved(event) && _cursor != index) {@@ -798,7 +800,7 @@ class _AgentPickerState extends State<AgentPicker> {matches: matches(choice.label, title: true),style: widget.terminalStyle? boxMonoStyle()- : terminalTextStyle(+ : grid.AppType.monoLabel(fontWeight: FontWeight.w600,color: Colors.white,),@@ -814,7 +816,7 @@ class _AgentPickerState extends State<AgentPicker> {overflow: TextOverflow.ellipsis,style: widget.terminalStyle? boxMonoStyle(color: kBoxFaint)- : terminalTextStyle(color: Colors.white54),+ : grid.AppType.monoMeta(color: Colors.white54),),),],@@ -827,7 +829,7 @@ class _AgentPickerState extends State<AgentPicker> {matches: matches(choice.detail, title: false),style: widget.terminalStyle? boxMonoStyle(color: Colors.white60)- : terminalTextStyle(color: Colors.white60),+ : grid.AppType.monoMeta(color: Colors.white60),),trailing: widget.terminalStyle && highlighted? Text('↵', style: boxMonoStyle(color: kBoxFaint))@@ -836,8 +838,8 @@ class _AgentPickerState extends State<AgentPicker> {constraints: BoxConstraints(maxWidth:170 *- scaler.scale(terminalFontStore.size) /- terminalFontSize,+ scaler.scale(grid.AppType.bodySize) /+ grid.AppType.bodySize,),child: TextButton(key: const ValueKey('new-agent-agent-row-action'),@@ -930,9 +932,12 @@ class _AgentPreview extends StatelessWidget {final bool terminalStyle;static TextStyle get _muted =>- terminalTextStyle(height: 1.5, color: Colors.white54);- static TextStyle get _body =>- terminalTextStyle(height: 1.6, color: Color(0xffe1e1e4));+ grid.AppType.monoMeta(height: 1.5, color: Colors.white54);+ static TextStyle get _body => grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,+ height: 1.6,+ color: Color(0xffe1e1e4),+ );@overrideWidget build(BuildContext context) {@@ -964,7 +969,7 @@ class _AgentPreview extends StatelessWidget {text: choice.label,style: terminalStyle? boxMonoStyle()- : terminalTextStyle(+ : grid.AppType.monoLabel(fontWeight: FontWeight.w600,color: Colors.white,),@@ -974,7 +979,7 @@ class _AgentPreview extends StatelessWidget {text: ' by $creator',style: terminalStyle? boxMonoStyle(color: kBoxFaint)- : terminalTextStyle(color: Colors.white54),+ : grid.AppType.monoMeta(color: Colors.white54),),],),@@ -990,7 +995,11 @@ class _AgentPreview extends StatelessWidget {detail,style: terminalStyle? boxMonoStyle(color: Colors.white70)- : terminalTextStyle(height: 1.4, color: Colors.white70),+ : grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,+ height: 1.4,+ color: Colors.white70,+ ),),],if (chips.isNotEmpty) ...[@@ -1015,7 +1024,7 @@ class _AgentPreview extends StatelessWidget {),child: Text(chip,- style: terminalTextStyle(color: Colors.white70),+ style: grid.AppType.monoMeta(color: Colors.white70),),),),diff --git a/desktop/lib/widgets/agent_switcher.dart b/desktop/lib/widgets/agent_switcher.dartindex c22bea190..fdab702cd 100644--- a/desktop/lib/widgets/agent_switcher.dart+++ b/desktop/lib/widgets/agent_switcher.dart@@ -2,7 +2,6 @@ import 'dart:async';import 'package:flutter/material.dart';import 'package:flutter/services.dart';-import 'package:harness/terminal/terminal_text.dart';import '../core/models.dart';import '../core/fuzzy_match.dart';@@ -246,14 +245,14 @@ class _AgentSwitcherState extends State<_AgentSwitcher> {controller: _query,focusNode: _field,autofocus: true,- style: terminalTextStyle(+ style: grid.AppType.mono(color: grid.AppPalette.textPrimary,),decoration: InputDecoration(border: InputBorder.none,isDense: true,hintText: 'Find a harness',- hintStyle: terminalTextStyle(+ hintStyle: grid.AppType.mono(color: grid.AppPalette.textFaint,),),@@ -270,7 +269,8 @@ class _AgentSwitcherState extends State<_AgentSwitcher> {padding: const EdgeInsets.fromLTRB(16, 18, 16, 20),child: Text('No agent matches that.',- style: terminalTextStyle(+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,color: grid.AppPalette.textFaint,),),@@ -293,7 +293,7 @@ class _AgentSwitcherState extends State<_AgentSwitcher> {padding: const EdgeInsets.fromLTRB(16, 9, 16, 10),child: Text('↑↓ or ⌃n ⌃p to move · ⏎ to go · ⇧⏎ in a new tile · esc',- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: grid.AppPalette.textFaint,),),@@ -336,7 +336,9 @@ class _Row extends StatelessWidget {entry.agent.name,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(color: grid.AppPalette.textPrimary),+ style: grid.AppType.monoLabel(+ color: grid.AppPalette.textPrimary,+ ),),),const SizedBox(width: 12),@@ -344,7 +346,7 @@ class _Row extends StatelessWidget {entry.machineName,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(color: grid.AppPalette.textFaint),+ style: grid.AppType.monoMeta(color: grid.AppPalette.textFaint),),// A dot, not the word "open": the list is read at a glance and a// second column of text would compete with the machine's name.diff --git a/desktop/lib/widgets/bootstrapping_screen.dart b/desktop/lib/widgets/bootstrapping_screen.dartindex 4ad5311d7..6213e86ef 100644--- a/desktop/lib/widgets/bootstrapping_screen.dart+++ b/desktop/lib/widgets/bootstrapping_screen.dart@@ -1,6 +1,5 @@import 'package:flutter/material.dart';-import '../shared/theme/app_theme.dart' as grid;import 'login_relay_diagram.dart';@@ -50,7 +49,7 @@ class BootstrappingScreen extends StatelessWidget {Text('Getting Harness ready',textAlign: TextAlign.center,- style: Theme.of(context).textTheme.titleLarge,+ style: grid.AppType.display(),),const SizedBox(height: 8),Text(diff --git a/desktop/lib/widgets/box_chrome.dart b/desktop/lib/widgets/box_chrome.dartindex 5ce53153f..8ae81b81c 100644--- a/desktop/lib/widgets/box_chrome.dart+++ b/desktop/lib/widgets/box_chrome.dart@@ -68,7 +68,6 @@ class CommandDock extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return LayoutBuilder(builder: (context, constraints) {final available =@@ -76,8 +75,7 @@ class CommandDock extends StatelessWidget {0.0,double.infinity,);- final scale =- MediaQuery.textScalerOf(context).scale(terminalFontStore.size) / 13;+ final scale = grid.appTextScaleOf(context);// A shallow dock at ordinary sizes, with room for readable defaults and// key hints when accessibility text or a narrow window needs more rows.final minimum = constraints.maxWidth < 800 * scale ? 320.0 : 280.0;@@ -112,11 +110,12 @@ class CommandDock extends StatelessWidget {}}-/// Shared typography and frame for prompts that sit over the terminals.-TextStyle boxMonoStyle({Color? color, FontWeight? weight}) => terminalTextStyle(+/// Shared typography and frame for prompts that sit over the terminals: the+/// terminal's face at [grid.AppType.monoSize], which ⌘+ and ⌘− leave alone.+TextStyle boxMonoStyle({Color? color, FontWeight? weight}) => grid.AppType.mono(height: 1.35,color: color ?? Colors.white,- fontWeight: weight ?? FontWeight.w400,+ fontWeight: weight,);class TerminalBox extends StatelessWidget {@@ -150,11 +149,11 @@ class TerminalBox extends StatelessWidget {/// A compact text row that grows with the user's accessibility text size.double boxRowHeight(TextScaler scale) =>- (scale.scale(terminalFontStore.size) * 1.35 + 8).clamp(26, double.infinity);+ (scale.scale(grid.AppType.monoSize) * 1.35 + 8).clamp(26, double.infinity);-/// Secondary text keeps the same typography, with a quieter color.+/// Key hints, shortcut glyphs and counts: the box's meta line.const kBoxFaint = Colors.white54;-TextStyle get kBoxFaintStyle => terminalTextStyle(color: kBoxFaint);+TextStyle get kBoxFaintStyle => grid.AppType.monoMeta(color: kBoxFaint);/// Keep the user's actual binding, printed like a terminal's local key guide.String boxKeyLabel(String hint) => hint@@ -186,7 +185,6 @@ class BoxRowHighlight extends StatelessWidget {// Material, and a plain fill between the two hides it (Flutter asserts so).@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Material(color: highlighted? Colors.white.withValues(alpha: .10)@@ -473,7 +471,6 @@ class _ReadlineKeysState extends State<ReadlineKeys> {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return CallbackShortcuts(bindings: {const SingleActivator(LogicalKeyboardKey.keyW, control: true):diff --git a/desktop/lib/widgets/clone_repository_dialog.dart b/desktop/lib/widgets/clone_repository_dialog.dartindex 4b73d614c..c28657ba0 100644--- a/desktop/lib/widgets/clone_repository_dialog.dart+++ b/desktop/lib/widgets/clone_repository_dialog.dart@@ -165,6 +165,9 @@ class _CloneRepositoryDialogState extends State<CloneRepositoryDialog> {controller: _url,autofocus: true,readOnly: _busy,+ style: grid.AppType.mono(+ color: grid.AppPalette.textPrimary,+ ),decoration: const InputDecoration(hintText: 'https://github.com/owner/repository',),diff --git a/desktop/lib/widgets/codex_profile_field.dart b/desktop/lib/widgets/codex_profile_field.dartindex bb7d8dc27..a0eb63417 100644--- a/desktop/lib/widgets/codex_profile_field.dart+++ b/desktop/lib/widgets/codex_profile_field.dart@@ -192,9 +192,15 @@ class _CodexProfileFieldState extends State<CodexProfileField> {if (widget.value != null) widget.value!.path: widget.value!,};const refreshValue = '__refresh_profiles__';+ // A profile names a folder on disk, so the field is set in mono.+ final textStyle =+ widget.textStyle ??+ grid.AppType.mono(color: grid.AppPalette.textPrimary);final height = math.max(34.0,- MediaQuery.textScalerOf(context).scale(terminalFontStore.size) * 1.35 ++ MediaQuery.textScalerOf(context)+ .scale(textStyle.fontSize ?? grid.AppType.monoSize) *+ 1.35 +14,);return Wrap(@@ -203,7 +209,7 @@ class _CodexProfileFieldState extends State<CodexProfileField> {crossAxisAlignment: WrapCrossAlignment.center,children: [SizedBox(- width: 252 * math.min(1.4, terminalTextScaleOf(context)),+ width: 252 * math.min(1.4, grid.appTextScaleOf(context)),height: height,child: AppSelectField<String>(key: const Key('new-agent-codex-profile-field'),@@ -239,9 +245,7 @@ class _CodexProfileFieldState extends State<CodexProfileField> {'Codex profile: ${widget.value?.label ?? (_loading ? 'Loading…' : 'Default')}',maxLines: 1,overflow: TextOverflow.ellipsis,- style:- widget.textStyle ??- terminalTextStyle(color: grid.AppPalette.textPrimary),+ style: textStyle,),),const SizedBox(width: 8),@@ -260,14 +264,14 @@ class _CodexProfileFieldState extends State<CodexProfileField> {foregroundColor: grid.AppPalette.textSecondary,padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 6),minimumSize: const Size(0, 32),- textStyle: widget.textStyle ?? terminalTextStyle(),+ textStyle: textStyle,),child: Text(_linking ? 'Adding…' : 'Add'),),if (_error != null)Text(_error!,- style: terminalTextStyle(+ style: grid.AppType.body(color: Theme.of(context).colorScheme.error,),),diff --git a/desktop/lib/widgets/dsh_install_panel.dart b/desktop/lib/widgets/dsh_install_panel.dartindex ea808d9b6..d47c703b9 100644--- a/desktop/lib/widgets/dsh_install_panel.dart+++ b/desktop/lib/widgets/dsh_install_panel.dart@@ -107,18 +107,14 @@ class _DshInstallPanelState extends State<DshInstallPanel> {run.done? '${widget.harnessName} installed on ${widget.machineName}': 'Installing ${widget.harnessName} on ${widget.machineName}',- style: terminalTextStyle(- fontWeight: grid.AppFont.semibold,+ style: grid.AppType.heading(color: grid.AppPalette.textPrimary,),),),Text(_clock(elapsed),- style: terminalTextStyle(- color: grid.AppPalette.textFaint,- fontFeatures: const [FontFeature.tabularFigures()],- ),+ style: grid.AppType.monoMeta(color: grid.AppPalette.textFaint),),],),@@ -162,7 +158,7 @@ class _DshInstallPanelState extends State<DshInstallPanel> {: run.done? 'Starting the harness…': 'The first install takes a few minutes. You can keep using Harness.',- style: terminalTextStyle(color: grid.AppPalette.textFaint),+ style: grid.AppType.body(color: grid.AppPalette.textFaint),),),],@@ -461,8 +457,7 @@ class _StepRow extends StatelessWidget {children: [Text(step.name,- style: terminalTextStyle(- fontWeight: grid.AppFont.medium,+ style: grid.AppType.label(color: muted? grid.AppPalette.textFaint: grid.AppPalette.textPrimary,@@ -475,7 +470,7 @@ class _StepRow extends StatelessWidget {sub!,maxLines: 2,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.body(color: state == _StepState.active? grid.AppPalette.textSecondary: grid.AppPalette.textFaint,@@ -489,10 +484,7 @@ class _StepRow extends StatelessWidget {const SizedBox(width: 10),Text(_DshInstallPanelState._short(took!),- style: terminalTextStyle(- color: grid.AppPalette.textFaint,- fontFeatures: const [FontFeature.tabularFigures()],- ),+ style: grid.AppType.monoMeta(color: grid.AppPalette.textFaint),),],],@@ -527,7 +519,8 @@ class _LogTail extends StatelessWidget {tail[i],maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,height: 1.5,color: i == tail.length - 1? grid.AppPalette.textSecondary@@ -562,7 +555,7 @@ class _FailureCard extends StatelessWidget {children: [Text(failure.title,- style: terminalTextStyle(+ style: grid.AppType.label(fontWeight: grid.AppFont.semibold,color: grid.AppPalette.textPrimary,),@@ -573,7 +566,7 @@ class _FailureCard extends StatelessWidget {padding: const EdgeInsets.only(top: 2),child: Text(line,- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textSecondary,),),@@ -583,7 +576,10 @@ class _FailureCard extends StatelessWidget {padding: const EdgeInsets.only(top: 6),child: SelectableText(failure.command!,- style: terminalTextStyle(color: grid.AppPalette.textPrimary),+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,+ color: grid.AppPalette.textPrimary,+ ),),),],diff --git a/desktop/lib/widgets/engine_identity.dart b/desktop/lib/widgets/engine_identity.dartindex 87af9ca1a..18e9f1da8 100644--- a/desktop/lib/widgets/engine_identity.dart+++ b/desktop/lib/widgets/engine_identity.dart@@ -1014,11 +1014,14 @@ class _InitialMark extends StatelessWidget {// glyph would grow while its 17px square did not, and the letter would// clip out of its own mark.textScaler: TextScaler.noScaling,- style: terminalTextStyle(+ style: TextStyle(color: identity.color,// The app's mono stack, not a literal: `Menlo` names nothing on// Linux, so this initial was drawn in the proportional default// while every mark beside it was monospaced.+ fontFamily: AppFonts.mono,+ fontFamilyFallback: AppFonts.monoFallback,+ fontSize: size * 0.68,height: 1,fontWeight: FontWeight.w700,),diff --git a/desktop/lib/widgets/environment_preflight_screen.dart b/desktop/lib/widgets/environment_preflight_screen.dartindex 654b29557..b2aae53f9 100644--- a/desktop/lib/widgets/environment_preflight_screen.dart+++ b/desktop/lib/widgets/environment_preflight_screen.dart@@ -89,7 +89,7 @@ class _CheckingContent extends StatelessWidget {Text('Checking this computer',textAlign: TextAlign.center,- style: Theme.of(context).textTheme.titleLarge,+ style: grid.AppType.display(),),const SizedBox(height: 8),Text(@@ -125,7 +125,7 @@ class _ReadyContent extends StatelessWidget {Text('Environment ready',textAlign: TextAlign.center,- style: Theme.of(context).textTheme.titleLarge,+ style: grid.AppType.display(),),const SizedBox(height: 8),Text(diff --git a/desktop/lib/widgets/environment_setup_screen.dart b/desktop/lib/widgets/environment_setup_screen.dartindex d317c006d..a83d528a6 100644--- a/desktop/lib/widgets/environment_setup_screen.dart+++ b/desktop/lib/widgets/environment_setup_screen.dart@@ -160,16 +160,19 @@ class _EnvironmentSetupScreenState extends State<EnvironmentSetupScreen> {children: [Text(eyebrow.toUpperCase(),- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: AppColors.accent,- fontWeight: FontWeight.w700,- letterSpacing: 1.4,+ fontWeight: FontWeight.w600,+ letterSpacing: 1.2,),),const SizedBox(height: 6),- Text(title, style: terminalTextStyle(fontWeight: FontWeight.w600)),+ Text(title, style: grid.AppType.display()),const SizedBox(height: 8),- Text(lead, style: TextStyle(color: AppColors.textSoft, height: 1.55)),+ Text(+ lead,+ style: grid.AppType.body(color: AppColors.textSoft, height: 1.55),+ ),const SizedBox(height: 16),],);@@ -372,7 +375,7 @@ class _EnvironmentSetupScreenState extends State<EnvironmentSetupScreen> {'Every dependency is ready. Continue to final verification.',);}- final stacked = terminalTextScaleOf(context) > 1.25;+ final stacked = grid.appTextScaleOf(context) > 1.25;return _Panel(child: Column(children: [@@ -383,13 +386,13 @@ class _EnvironmentSetupScreenState extends State<EnvironmentSetupScreen> {radius: 14,backgroundColor: AppColors.hover,foregroundColor: AppColors.text,- child: Text('${index + 1}', style: terminalTextStyle()),+ child: Text('${index + 1}', style: grid.AppType.monoLabel()),),- title: Text(items[index].title, style: terminalTextStyle()),+ title: Text(items[index].title, style: grid.AppType.label()),subtitle: stacked? Text(items[index].detail,- style: terminalTextStyle(color: AppColors.textSoft),+ style: grid.AppType.body(color: AppColors.textSoft),): null,trailing: stacked@@ -401,7 +404,7 @@ class _EnvironmentSetupScreenState extends State<EnvironmentSetupScreen> {maxLines: 2,overflow: TextOverflow.ellipsis,textAlign: TextAlign.end,- style: terminalTextStyle(color: AppColors.muted),+ style: grid.AppType.body(color: AppColors.muted),),),),@@ -428,7 +431,7 @@ class _EnvironmentSetupScreenState extends State<EnvironmentSetupScreen> {children: [Text('${index + 1} · ${items[index].title}',- style: terminalTextStyle(fontWeight: FontWeight.w600),+ style: grid.AppType.heading(),),const SizedBox(height: 9),CommandRow(@@ -463,10 +466,7 @@ class _EnvironmentSetupScreenState extends State<EnvironmentSetupScreen> {title: Row(children: [Expanded(- child: Text(- 'Setup details',- style: terminalTextStyle(fontWeight: FontWeight.w600),- ),+ child: Text('Setup details', style: grid.AppType.heading()),),TextButton.icon(onPressed: () => _copy(diagnostics),@@ -486,7 +486,8 @@ class _EnvironmentSetupScreenState extends State<EnvironmentSetupScreen> {padding: const EdgeInsets.all(14),child: SelectableText(diagnostics,- style: terminalTextStyle(+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,height: 1.55,color: AppColors.textSoft,),@@ -518,12 +519,12 @@ class _EnvironmentSetupScreenState extends State<EnvironmentSetupScreen> {children: [Text(title,- style: terminalTextStyle(fontWeight: FontWeight.w600),+ style: grid.AppType.label(fontWeight: FontWeight.w600),),const SizedBox(height: 4),Text(detail,- style: terminalTextStyle(+ style: grid.AppType.body(color: AppColors.textSoft,height: 1.45,),@@ -614,7 +615,7 @@ class _EnvironmentSetupScreenState extends State<EnvironmentSetupScreen> {liveRegion: _copyError != null,child: Text(_copyError ?? 'Next: sign in and start a harness.',- style: terminalTextStyle(+ style: grid.AppType.body(color: _copyError == null ? AppColors.textSoft : AppColors.danger,),),@@ -628,7 +629,7 @@ class _EnvironmentSetupScreenState extends State<EnvironmentSetupScreen> {child: LayoutBuilder(builder: (context, constraints) {if (constraints.maxWidth < 600 ||- terminalTextScaleOf(context) > 1.25) {+ grid.appTextScaleOf(context) > 1.25) {return Column(mainAxisSize: MainAxisSize.min,crossAxisAlignment: CrossAxisAlignment.stretch,@@ -655,7 +656,6 @@ class _Panel extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Container(width: double.infinity,padding: padding,@@ -686,9 +686,9 @@ class _CheckSectionLabel extends StatelessWidget {),child: Text(label.toUpperCase(),- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: AppColors.textSoft,- fontWeight: FontWeight.w700,+ fontWeight: FontWeight.w600,letterSpacing: 1.1,),),@@ -710,7 +710,7 @@ class _CheckRow extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);+ grid.AppTheme.watch(context);final color = switch (status) {EnvironmentStepStatus.ready => AppColors.success,EnvironmentStepStatus.failed => AppColors.danger,@@ -749,12 +749,9 @@ class _CheckRow extends StatelessWidget {child: Column(crossAxisAlignment: CrossAxisAlignment.start,children: [- Text(- label,- style: terminalTextStyle(fontWeight: FontWeight.w500),- ),+ Text(label, style: grid.AppType.label()),const SizedBox(height: 3),- Text(detail, style: terminalTextStyle(color: AppColors.muted)),+ Text(detail, style: grid.AppType.body(color: AppColors.muted)),],),),@@ -765,7 +762,7 @@ class _CheckRow extends StatelessWidget {EnvironmentStepStatus.running => 'Working',EnvironmentStepStatus.notApplicable => 'Not applicable',_ => checking ? 'Checking' : 'Required',- }, style: terminalTextStyle(color: color)),+ }, style: grid.AppType.label(color: color)),],),);diff --git a/desktop/lib/widgets/export_logs_dialog.dart b/desktop/lib/widgets/export_logs_dialog.dartindex b5bddbcc5..916d9f3c1 100644--- a/desktop/lib/widgets/export_logs_dialog.dart+++ b/desktop/lib/widgets/export_logs_dialog.dart@@ -2,7 +2,6 @@ import 'dart:async';import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../core/harness_cli_runner.dart';import '../core/reveal_folder.dart';@@ -121,15 +120,12 @@ class _ExportLogsDialogState extends State<_ExportLogsDialog> {const SizedBox(height: 12),Text(title,- style: terminalTextStyle(- color: grid.AppPalette.textPrimary,- fontWeight: grid.AppFont.semibold,- ),+ style: grid.AppType.heading(color: grid.AppPalette.textPrimary),),const SizedBox(height: 5),SelectableText(body,- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textSecondary,height: 1.5,),@@ -171,11 +167,9 @@ class _Label extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Text(text,- style: terminalTextStyle(- fontWeight: grid.AppFont.medium,+ style: grid.AppType.label(color: ToolbarPill.tint(tinted: tinted, enabled: true),),);diff --git a/desktop/lib/widgets/flash_firmware_dialog.dart b/desktop/lib/widgets/flash_firmware_dialog.dartindex 8a4a29a55..f44d8bba2 100644--- a/desktop/lib/widgets/flash_firmware_dialog.dart+++ b/desktop/lib/widgets/flash_firmware_dialog.dart@@ -3,7 +3,6 @@ import 'dart:async';import 'package:flutter/material.dart';import 'package:flutter/services.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../flash/flasher.dart';import '../shared/theme/app_theme.dart' as grid;@@ -255,15 +254,12 @@ class _FlashDialogState extends State<_FlashDialog> {children: [Text(title,- style: terminalTextStyle(- color: grid.AppPalette.textPrimary,- fontWeight: grid.AppFont.semibold,- ),+ style: grid.AppType.heading(color: grid.AppPalette.textPrimary),),const SizedBox(height: 3),Text(sub,- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textSecondary,height: 1.5,),@@ -334,13 +330,14 @@ class _FlashDialogState extends State<_FlashDialog> {width: 104,child: Text(label,- style: terminalTextStyle(color: grid.AppPalette.textFaint),+ style: grid.AppType.body(color: grid.AppPalette.textFaint),),),Expanded(child: Text(value,- style: terminalTextStyle(+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,color: tone ?? grid.AppPalette.textSecondary,),),@@ -357,7 +354,7 @@ class _FlashDialogState extends State<_FlashDialog> {children: [Text('More than one board is connected — pick one:',- style: terminalTextStyle(color: grid.AppPalette.textSecondary),+ style: grid.AppType.body(color: grid.AppPalette.textSecondary),),const SizedBox(height: 7),for (final port in _ports)@@ -392,7 +389,7 @@ class _FlashDialogState extends State<_FlashDialog> {Expanded(child: RichText(text: TextSpan(- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textSecondary,height: 1.5,),@@ -460,14 +457,17 @@ class _FlashDialogState extends State<_FlashDialog> {const SizedBox(width: 8),Text('Output',- style: terminalTextStyle(+ style: grid.AppType.caption(color: grid.AppPalette.textSecondary,+ fontWeight: grid.AppFont.medium,),),const Spacer(),Text('flash-circle.sh',- style: terminalTextStyle(color: grid.AppPalette.textFaint),+ style: grid.AppType.monoMeta(+ color: grid.AppPalette.textFaint,+ ),),],),@@ -489,7 +489,10 @@ class _FlashDialogState extends State<_FlashDialog> {),],),- style: terminalTextStyle(height: 1.62),+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,+ height: 1.62,+ ),),),),@@ -676,7 +679,7 @@ class _StepRow extends StatelessWidget {label,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(color: ink),+ style: grid.AppType.body(color: ink),),),],@@ -723,7 +726,7 @@ class _DialogButton extends StatelessWidget {? BorderSide(color: grid.AppGlass.hair): BorderSide.none,),- textStyle: terminalTextStyle(+ textStyle: grid.AppType.label(fontWeight: primary ? grid.AppFont.semibold : grid.AppFont.regular,),),@@ -780,7 +783,10 @@ class _PortChoice extends StatelessWidget {const SizedBox(width: 9),Text(port,- style: terminalTextStyle(color: grid.AppPalette.textPrimary),+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,+ color: grid.AppPalette.textPrimary,+ ),),],),diff --git a/desktop/lib/widgets/grid_model_picker.dart b/desktop/lib/widgets/grid_model_picker.dartindex bbdc21ee1..4aecf6b11 100644--- a/desktop/lib/widgets/grid_model_picker.dart+++ b/desktop/lib/widgets/grid_model_picker.dart@@ -6,6 +6,7 @@ import 'package:harness/terminal/terminal_text.dart';import '../core/models.dart';import '../core/test_run.dart';import '../state/app_state.dart';+import '../shared/theme/app_type.dart';import '../theme/app_theme.dart';import '../usage/models_menu_controller.dart';import 'engine_identity.dart';@@ -469,7 +470,10 @@ class _GridModelPickerState extends State<GridModelPicker> {],Text('Model',- style: terminalTextStyle(color: AppColors.textSoft),+ style: AppType.monoLabel(+ fontWeight: FontWeight.w400,+ color: AppColors.textSoft,+ ),),Icon(Icons.arrow_drop_down,@@ -510,7 +514,6 @@ class _ManagerInvitationState extends State<_ManagerInvitation> {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Padding(// Wider than a row's inset on purpose: this block is not one of them.padding: const EdgeInsets.fromLTRB(@@ -531,7 +534,7 @@ class _ManagerInvitationState extends State<_ManagerInvitation> {child: Text('Manage the models on your machines',textAlign: TextAlign.center,- style: terminalTextStyle(color: AppColors.mutedStrong),+ style: AppType.caption(color: AppColors.mutedStrong),),),const SizedBox(width: 8),@@ -557,8 +560,7 @@ class _ManagerInvitationState extends State<_ManagerInvitation> {),child: Text('Open Grid',- style: terminalTextStyle(- fontWeight: FontWeight.w500,+ style: AppType.label(color: _hovered ? AppColors.text : AppColors.textSoft,),),diff --git a/desktop/lib/widgets/harness_command_bar.dart b/desktop/lib/widgets/harness_command_bar.dartindex 460bf9f62..ce2b923dc 100644--- a/desktop/lib/widgets/harness_command_bar.dart+++ b/desktop/lib/widgets/harness_command_bar.dart@@ -2,7 +2,6 @@ import 'dart:async';import 'package:flutter/material.dart';import 'package:flutter/services.dart';-import 'package:harness/terminal/terminal_text.dart';import '../shared/theme/app_theme.dart' as grid;import '../state/command_bar.dart';@@ -197,7 +196,7 @@ class _HarnessCommandBarState extends State<HarnessCommandBar> {enabled: controller.phase != CommandPhase.executing,autofocus: !widget.compact,maxLength: 2000,- style: terminalTextStyle(+ style: grid.AppType.mono(color: grid.AppPalette.commandInk,),cursorColor: grid.AppPalette.commandInk,@@ -208,7 +207,7 @@ class _HarnessCommandBarState extends State<HarnessCommandBar> {hintText: narrow? 'Ask Harness…': 'Ask, find, or make something happen',- hintStyle: terminalTextStyle(+ hintStyle: grid.AppType.mono(color: grid.AppPalette.commandMuted,),border: InputBorder.none,@@ -274,8 +273,7 @@ class _HarnessCommandBarState extends State<HarnessCommandBar> {const SizedBox(width: 7),Text(_findOnly ? 'Find' : 'Auto',- style: terminalTextStyle(- fontWeight: FontWeight.w500,+ style: grid.AppType.monoLabel(color: grid.AppPalette.commandInk,),),@@ -333,7 +331,7 @@ class _HarnessCommandBarState extends State<HarnessCommandBar> {const SizedBox(width: 6),Text('JEV · OpenRouter',- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: grid.AppPalette.textFaint,),),@@ -359,13 +357,13 @@ class _HarnessCommandBarState extends State<HarnessCommandBar> {),style: TextButton.styleFrom(foregroundColor: grid.AppPalette.textSecondary,- textStyle: terminalTextStyle(),+ textStyle: grid.AppType.label(),),),if (!widget.compact && !watchesVisible)Text('⌘⇧J · toggle Esc · close',- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: grid.AppPalette.textFaint,),),@@ -413,7 +411,8 @@ class _HarnessCommandBarState extends State<HarnessCommandBar> {liveRegion: true,child: Text(controller.message,- style: terminalTextStyle(+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,color: grid.AppPalette.textSecondary,),),@@ -422,7 +421,9 @@ class _HarnessCommandBarState extends State<HarnessCommandBar> {if (controller.elapsedMs != null)Text('${(controller.elapsedMs! / 1000).toStringAsFixed(1)}s',- style: terminalTextStyle(color: grid.AppPalette.textFaint),+ style: grid.AppType.monoMeta(+ color: grid.AppPalette.textFaint,+ ),),IconButton(visualDensity: VisualDensity.compact,@@ -441,7 +442,8 @@ class _HarnessCommandBarState extends State<HarnessCommandBar> {liveRegion: true,child: Text(controller.error!,- style: terminalTextStyle(+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,height: 1.5,color: grid.AppPalette.textPrimary,),@@ -533,8 +535,7 @@ class _HarnessCommandBarState extends State<HarnessCommandBar> {action.title,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(- fontWeight: FontWeight.w500,+ style: grid.AppType.monoLabel(color: grid.AppPalette.textPrimary,),),@@ -543,7 +544,7 @@ class _HarnessCommandBarState extends State<HarnessCommandBar> {action.detail,maxLines: 2,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.monoMeta(height: 1.4,color: grid.AppPalette.textSecondary,),@@ -557,10 +558,7 @@ class _HarnessCommandBarState extends State<HarnessCommandBar> {onPressed: controller.busy? null: () => unawaited(controller.choose(action)),- child: Text(- action.buttonLabel,- style: terminalTextStyle(),- ),+ child: Text(action.buttonLabel),),],),@@ -570,7 +568,7 @@ class _HarnessCommandBarState extends State<HarnessCommandBar> {'“${controller.query}”',maxLines: 3,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.mono(height: 1.5,color: grid.AppPalette.textPrimary,),@@ -580,7 +578,7 @@ class _HarnessCommandBarState extends State<HarnessCommandBar> {padding: const EdgeInsets.only(top: 8),child: Text('Current sessions only · checks changed activity once a minute · alerts appear here',- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: grid.AppPalette.textFaint,),),@@ -595,7 +593,8 @@ class _HarnessCommandBarState extends State<HarnessCommandBar> {action.context,maxLines: 4,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,height: 1.5,color: grid.AppPalette.textSecondary,),@@ -637,7 +636,7 @@ class _HarnessCommandBarState extends State<HarnessCommandBar> {watch.prompt,maxLines: 2,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(),+ style: grid.AppType.monoLabel(),),),IconButton(@@ -652,7 +651,7 @@ class _HarnessCommandBarState extends State<HarnessCommandBar> {(watch.checking? 'Checking recent activity…': '${watch.matches.length} matches · watching ${watch.scope.length} sessions'),- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: grid.AppPalette.textSecondary,),),diff --git a/desktop/lib/widgets/harness_customize_pane.dart b/desktop/lib/widgets/harness_customize_pane.dartindex d50b8bd3d..37caf7fa9 100644--- a/desktop/lib/widgets/harness_customize_pane.dart+++ b/desktop/lib/widgets/harness_customize_pane.dart@@ -1,13 +1,11 @@import 'package:flutter/material.dart';import 'package:flutter/services.dart';-import 'package:harness/terminal/terminal_text.dart';import '../settings/sections/appearance_section.dart';import '../settings/sections/terminal_section.dart';import '../shared/theme/app_theme.dart' as grid;import '../shared/theme/appearance_prefs_store.dart';import '../shared/widgets/app_dialog.dart';-import 'box_chrome.dart';import 'prompt_customize.dart';/// Opens customization over the workspace so appearance changes remain visible@@ -21,7 +19,7 @@ Future<void> showHarnessCustomizePane(BuildContext context) =>builder: (context) => Align(alignment: Alignment.centerRight,child: SizedBox(- width: (440 * terminalTextScaleOf(context)).clamp(+ width: (440 * grid.appTextScaleOf(context)).clamp(0,MediaQuery.sizeOf(context).width,),@@ -59,9 +57,8 @@ class HarnessCustomizePane extends StatelessWidget {Expanded(child: Text('Customize Harness',- style: boxMonoStyle(+ style: grid.AppType.heading(color: grid.AppPalette.textPrimary,- weight: FontWeight.w600,),),),@@ -82,7 +79,7 @@ class HarnessCustomizePane extends StatelessWidget {unselectedLabelColor: grid.AppPalette.textSecondary,indicatorColor: grid.AppPalette.swarmAccent,dividerColor: grid.AppPalette.divider,- labelStyle: boxMonoStyle(),+ labelStyle: grid.AppType.label(),tabs: const [Tab(key: ValueKey('customize-prompt'), text: 'Pane'),Tab(diff --git a/desktop/lib/widgets/harness_join_guide_screen.dart b/desktop/lib/widgets/harness_join_guide_screen.dartindex a42f3b1d0..15bd24afa 100644--- a/desktop/lib/widgets/harness_join_guide_screen.dart+++ b/desktop/lib/widgets/harness_join_guide_screen.dart@@ -1,7 +1,7 @@import 'package:flutter/material.dart';import 'package:flutter/services.dart';-import 'package:harness/terminal/terminal_text.dart';+import '../shared/theme/app_type.dart';import '../shared/widgets/command_row.dart';import '../state/app_state.dart';import '../theme/app_theme.dart';@@ -42,7 +42,6 @@ class _HarnessJoinGuideScreenState extends State<HarnessJoinGuideScreen> {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);final isLocal = widget.machineState.isLocalMachine;final content = Center(child: ConstrainedBox(@@ -63,10 +62,7 @@ class _HarnessJoinGuideScreenState extends State<HarnessJoinGuideScreen> {const SizedBox(height: 14),Text('Harness is offline',- style: terminalTextStyle(- color: AppColors.text,- fontWeight: FontWeight.w700,- ),+ style: AppType.heading(color: AppColors.text),),const SizedBox(height: 8),Text(diff --git a/desktop/lib/widgets/harness_start_page.dart b/desktop/lib/widgets/harness_start_page.dartindex fa369670e..39ab87881 100644--- a/desktop/lib/widgets/harness_start_page.dart+++ b/desktop/lib/widgets/harness_start_page.dart@@ -1,6 +1,5 @@import 'package:flutter/material.dart';import 'package:url_launcher/url_launcher.dart';-import 'package:harness/terminal/terminal_text.dart';import '../shared/theme/app_theme.dart' as grid;import '../shared/theme/appearance_prefs_store.dart';@@ -256,9 +255,8 @@ class _HarnessStartPageState extends State<HarnessStartPage> {padding: const EdgeInsets.only(left: 18, right: 8),child: Text('Browse the\nHarness Store',- style: terminalTextStyle(+ style: grid.AppType.heading(height: 1.3,- fontWeight: FontWeight.w500,color: Colors.white.withValues(alpha: .94),),),@@ -310,9 +308,8 @@ class _HarnessStartPageState extends State<HarnessStartPage> {padding: const EdgeInsets.only(left: 18, right: 8),child: Text('Meet the\nHarness device',- style: terminalTextStyle(+ style: grid.AppType.heading(height: 1.3,- fontWeight: FontWeight.w500,color: Colors.white.withValues(alpha: .94),),),diff --git a/desktop/lib/widgets/layout_palette.dart b/desktop/lib/widgets/layout_palette.dartindex 385b2d695..f84aa2676 100644--- a/desktop/lib/widgets/layout_palette.dart+++ b/desktop/lib/widgets/layout_palette.dart@@ -216,7 +216,7 @@ class _LayoutPaletteState extends State<_LayoutPalette> {final choices = PanePreset.forCount(count);final current = _currentChoice(count);final cursor = _cursorIn(choices, current);- final textScale = terminalTextScaleOf(context);+ final textScale = grid.appTextScaleOf(context);final shapeWidth = (_Strip.shape * textScale).clamp(_Strip.shape, 216.0);final paletteWidth =_Strip.width(choices.length) * textScale.clamp(1.0, 2.0);@@ -306,10 +306,8 @@ class _LayoutPaletteState extends State<_LayoutPalette> {padding: const EdgeInsets.fromLTRB(18, 16, 18, 12),child: Text(choices.isEmpty ? 'Layout' : 'Layout · $count panes',- style: terminalTextStyle(+ style: grid.AppType.monoLabel(color: grid.AppPalette.textSecondary,- letterSpacing: 0.9,- fontWeight: grid.AppFont.medium,),),),@@ -319,7 +317,8 @@ class _LayoutPaletteState extends State<_LayoutPalette> {child: Text('One tile has no layout to choose. Open another and the ''shapes appear here.',- style: terminalTextStyle(+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,color: grid.AppPalette.textFaint,height: 1.45,),@@ -364,7 +363,7 @@ class _LayoutPaletteState extends State<_LayoutPalette> {child: Text('Arrows to move · Enter or 1–${choices.length} to apply.\n''Changing layout resets pane sizes.',- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: grid.AppPalette.textSecondary,height: 1.4,),@@ -482,7 +481,8 @@ class _ShapeButton extends StatelessWidget {preset.label,maxLines: 2,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,color: selected? grid.AppPalette.textPrimary: grid.AppPalette.textSecondary,@@ -491,7 +491,9 @@ class _ShapeButton extends StatelessWidget {const SizedBox(height: 2),Text('$index',- style: terminalTextStyle(color: grid.AppPalette.textSecondary),+ style: grid.AppType.monoMeta(+ color: grid.AppPalette.textSecondary,+ ),),],),diff --git a/desktop/lib/widgets/login_fleet_map.dart b/desktop/lib/widgets/login_fleet_map.dartindex 49185bb7a..674bdfcb2 100644--- a/desktop/lib/widgets/login_fleet_map.dart+++ b/desktop/lib/widgets/login_fleet_map.dart@@ -2,7 +2,6 @@ import 'dart:math' as math;import 'dart:ui' as ui;import 'package:flutter/material.dart';-import 'package:harness/terminal/terminal_text.dart';import '../shared/theme/app_theme.dart' as grid;@@ -235,7 +234,10 @@ class _MapPainter extends CustomPainter {/// The loop's phase, 0 → 1, wrapping.final double t;final _MapPalette palette;- final _textStyle = terminalTextStyle(height: 1.2);+ // Machine names in the UI face; the line under each, a place and its agents,+ // in the terminal's.+ final _sansStyle = grid.AppType.caption(height: 1.2);+ final _monoStyle = grid.AppType.monoMeta(height: 1.2);double _paintScale = 1;static const Size _design = Size(512, 190);@@ -498,7 +500,7 @@ class _MapPainter extends CustomPainter {// Labels are laid out in unscaled space and only faded, so the text// never renders at a fractional scale mid-pop.final nameWidth = _measure(pin.name, weight: FontWeight.w500);- final subWidth = _measure(pin.sub);+ final subWidth = _measure(pin.sub, mono: true);final width = math.max(nameWidth, subWidth);// Centred on the pin, but never off the field.final left = (pin.at.dx - width / 2).clamp(@@ -519,9 +521,9 @@ class _MapPainter extends CustomPainter {pin.sub,Offset(left + (width - subWidth) / 2,- top + terminalFontStore.size * 1.2 / _paintScale,+ top + grid.AppType.captionSize * 1.2 / _paintScale,),-+ mono: true,color: _fade(palette.faint, alpha),);}@@ -580,15 +582,19 @@ class _MapPainter extends CustomPainter {TextPainter _layout(String text, {FontWeight weight = FontWeight.w400,+ bool mono = false,Color color = const Color(0xFFFFFFFF),}) {final painter = TextPainter(text: TextSpan(text: text,- style: _textStyle.copyWith(fontWeight: weight, color: color),+ style: (mono ? _monoStyle : _sansStyle).copyWith(+ fontWeight: weight,+ color: color,+ ),),textDirection: TextDirection.ltr,- // Scale the drawing, but keep its labels at the selected point size.+ // Scale the drawing, but keep its labels at their own point size.textScaler: TextScaler.linear(1 / _paintScale),maxLines: 1,ellipsis: '…',@@ -596,8 +602,11 @@ class _MapPainter extends CustomPainter {return painter;}- double _measure(String text, {FontWeight weight = FontWeight.w400}) =>- _layout(text, weight: weight).width;+ double _measure(+ String text, {+ FontWeight weight = FontWeight.w400,+ bool mono = false,+ }) => _layout(text, weight: weight, mono: mono).width;void _text(Canvas canvas,@@ -605,8 +614,9 @@ class _MapPainter extends CustomPainter {Offset at, {required Color color,FontWeight weight = FontWeight.w400,+ bool mono = false,}) {- _layout(text, weight: weight, color: color).paint(canvas, at);+ _layout(text, weight: weight, mono: mono, color: color).paint(canvas, at);}@override@@ -614,5 +624,6 @@ class _MapPainter extends CustomPainter {old.t != t ||old.entrance != entrance ||old.palette != palette ||- old._textStyle != _textStyle;+ old._sansStyle != _sansStyle ||+ old._monoStyle != _monoStyle;}diff --git a/desktop/lib/widgets/login_relay_diagram.dart b/desktop/lib/widgets/login_relay_diagram.dartindex a51df759b..9723a100f 100644--- a/desktop/lib/widgets/login_relay_diagram.dart+++ b/desktop/lib/widgets/login_relay_diagram.dart@@ -1,7 +1,6 @@import 'dart:math' as math;import 'package:flutter/material.dart';-import 'package:harness/terminal/terminal_text.dart';import '../shared/theme/app_theme.dart' as grid;@@ -233,7 +232,7 @@ class _RelayPainter extends CustomPainter {final double t;final _DiagramPalette palette;final _DiagramLabels labels;- final _textStyle = terminalTextStyle(height: 1.0);+ final _textStyle = grid.AppType.caption(height: 1.0);double _paintScale = 1;static const Size _design = Size(440, 140);@@ -554,7 +553,7 @@ class _RelayPainter extends CustomPainter {style: _textStyle.copyWith(color: color),),textDirection: TextDirection.ltr,- // Counteract only the drawing scale; labels retain the terminal size.+ // Counteract only the drawing scale; labels keep their own point size.textScaler: TextScaler.linear(1 / _paintScale),maxLines: 1,ellipsis: '…',diff --git a/desktop/lib/widgets/new_agent_dialog.dart b/desktop/lib/widgets/new_agent_dialog.dartindex c034bff6a..abc913800 100644--- a/desktop/lib/widgets/new_agent_dialog.dart+++ b/desktop/lib/widgets/new_agent_dialog.dart@@ -5,7 +5,6 @@ import 'package:file_selector/file_selector.dart';import 'package:flutter/material.dart';import 'package:flutter/services.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../analytics/analytics.dart';import '../state/pane_arrangement.dart';@@ -1019,10 +1018,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {),],);- final scale =- MediaQuery.textScalerOf(context)- .scale(terminalFontStore.size) /- 13;+ final scale = grid.appTextScaleOf(context);final stacked =(_advancedOpen || _confirmationPending) &&constraints.maxWidth < 740 * math.min(1.4, scale);@@ -1123,7 +1119,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {/// but never on its width — so the task field, laid out outside the tiles'/// LayoutBuilder, can be the same height as they are.static double _tileHeight(TextScaler scaler, {required bool compactHeight}) {- return math.max(32, scaler.scale(terminalFontStore.size) * 1.35 + 14);+ return math.max(32, scaler.scale(grid.AppType.monoSize) * 1.35 + 14);}Widget _choices() => LayoutBuilder(@@ -1394,7 +1390,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {builder: (context, _) {final radius = BorderRadius.circular(2);final line =- MediaQuery.textScalerOf(context).scale(terminalFontStore.size) * 1.35;+ MediaQuery.textScalerOf(context).scale(grid.AppType.monoSize) * 1.35;final padding = ((minHeight - line) / 2).clamp(6.0, double.infinity);final tooLong = _taskTooLong;final errorBorder = OutlineInputBorder(@@ -1502,16 +1498,10 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {/// How far the agent may go without asking. The field shows the mode; the menu says what each/// one does, since "Accept edits" and "Plan first" mean little on their own.Widget _permissionModeField(List<PermissionMode> modes) => SizedBox(- width:- 156 *- math.min(- 1.8,- MediaQuery.textScalerOf(context).scale(terminalFontStore.size) / 13,- ),+ width: 156 * math.min(1.8, grid.appTextScaleOf(context)),height: math.max(34,- MediaQuery.textScalerOf(context).scale(terminalFontStore.size) * 1.35 +- 14,+ MediaQuery.textScalerOf(context).scale(grid.AppType.monoSize) * 1.35 + 14,),child: AppSelectField<String>(key: const Key('new-agent-permission-mode'),@@ -1519,7 +1509,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {radius: 2,height: math.max(34,- MediaQuery.textScalerOf(context).scale(terminalFontStore.size) * 1.35 ++ MediaQuery.textScalerOf(context).scale(grid.AppType.monoSize) * 1.35 +14,),menuWidth: 340,diff --git a/desktop/lib/widgets/new_harness_box.dart b/desktop/lib/widgets/new_harness_box.dartindex 714792d28..2cf449c7b 100644--- a/desktop/lib/widgets/new_harness_box.dart+++ b/desktop/lib/widgets/new_harness_box.dart@@ -580,8 +580,8 @@ class _NewHarnessBoxState extends State<NewHarnessBox> {box.field == NewHarnessField.projectName ||box.field == NewHarnessField.projectRepository ||_projectMenu)- ? scale.scale(terminalFontStore.size) * 1.35 +- scale.scale(terminalFontStore.size) * 1.35 ++ ? scale.scale(grid.AppType.monoSize) * 1.35 ++ scale.scale(grid.AppType.monoSize) * 1.35 +10: boxRowHeight(scale);final input = Semantics(@@ -1248,7 +1248,7 @@ class _NewHarnessBoxState extends State<NewHarnessBox> {: 'Nothing matches “${box.query.trim()}” in ''${_fieldName(box.field)}. Escape goes back.',textAlign: TextAlign.center,- style: terminalTextStyle(color: kBoxFaint),+ style: boxMonoStyle(color: kBoxFaint),),),);@@ -1611,7 +1611,6 @@ class _AgentSettingsButtonState extends State<_AgentSettingsButton> {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Focus(onFocusChange: (focused) => setState(() => _focused = focused),child: Opacity(diff --git a/desktop/lib/widgets/new_harness_help.dart b/desktop/lib/widgets/new_harness_help.dartindex 62414d60d..eb56dad71 100644--- a/desktop/lib/widgets/new_harness_help.dart+++ b/desktop/lib/widgets/new_harness_help.dart@@ -1,6 +1,5 @@import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../shared/theme/app_theme.dart';import '../shared/widgets/app_dialog.dart';@@ -54,9 +53,7 @@ class _HarnessHelpLinkState extends State<HarnessHelpLink> {foregroundColor: AppPalette.textSecondary,minimumSize: const Size(0, 32),padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6),- textStyle:- widget.textStyle ??- terminalTextStyle(fontWeight: FontWeight.w400, height: 1.4),+ textStyle: widget.textStyle ?? AppType.body(height: 1.4),side: BorderSide.none,shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6),@@ -165,9 +162,8 @@ class _HarnessHelpDialogState extends State<_HarnessHelpDialog> {header: true,child: Text(title,- style: terminalTextStyle(+ style: AppType.title(height: 1.2,- fontWeight: AppFont.semibold,color: AppPalette.textPrimary,),),@@ -175,7 +171,7 @@ class _HarnessHelpDialogState extends State<_HarnessHelpDialog> {const SizedBox(height: 20),Text(intro,- style: terminalTextStyle(+ style: AppType.body(height: 1.5,color: AppPalette.textSecondary,),@@ -310,16 +306,15 @@ class _HelpOption extends StatelessWidget {children: [Text(title,- style: terminalTextStyle(+ style: AppType.heading(height: 1.4,- fontWeight: AppFont.semibold,color: AppPalette.textPrimary,),),const SizedBox(height: 8),Text(description,- style: terminalTextStyle(+ style: AppType.body(height: 1.5,color: AppPalette.textSecondary,),diff --git a/desktop/lib/widgets/pane_grid.dart b/desktop/lib/widgets/pane_grid.dartindex ea61bce4b..90e57008b 100644--- a/desktop/lib/widgets/pane_grid.dart+++ b/desktop/lib/widgets/pane_grid.dart@@ -639,7 +639,7 @@ class _SwarmCanvasState extends State<_SwarmCanvas> {TextSpan(text: action),],),- style: boxMonoStyle(color: kBoxFaint),+ style: kBoxFaintStyle,),],),@@ -1696,10 +1696,7 @@ class _FileDropZoneState extends State<_FileDropZone> {),child: Text('Drop to attach',- style: terminalTextStyle(- color: AppColors.text,- fontWeight: FontWeight.w600,- ),+ style: grid.AppType.label(color: AppColors.text),),),),@@ -1924,9 +1921,8 @@ class _SwapZone extends StatelessWidget {),child: Text('Swap with this pane',- style: terminalTextStyle(+ style: grid.AppType.label(color: AppColors.text,- fontWeight: FontWeight.w600,),),),@@ -2018,7 +2014,7 @@ class _PaneHeader extends StatelessWidget {child: Text(title,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.monoLabel(color: AppColors.text,fontWeight: FontWeight.w600,),@@ -2088,7 +2084,7 @@ class _PaneStatus extends StatelessWidget {child: Text(message,textAlign: TextAlign.center,- style: terminalTextStyle(color: AppColors.mutedStrong),+ style: grid.AppType.body(color: AppColors.mutedStrong),),),),@@ -2159,10 +2155,7 @@ class _DropZone extends StatelessWidget {paneId == null? 'Open ${candidate.first?.name ?? 'agent'} here': 'Show ${candidate.first?.name ?? 'agent'} in this pane',- style: terminalTextStyle(- color: AppColors.text,- fontWeight: FontWeight.w600,- ),+ style: grid.AppType.label(color: AppColors.text),),),),@@ -2194,7 +2187,7 @@ class _AddSlot extends StatelessWidget {const SizedBox(height: 8),Text('Drop here for a new pane',- style: terminalTextStyle(color: AppColors.mutedStrong),+ style: grid.AppType.body(color: AppColors.mutedStrong),),],),@@ -2253,7 +2246,7 @@ class _EmptyGrid extends StatelessWidget {children: [Text('Select an agent, or drag one in from the left.',- style: terminalTextStyle(color: AppColors.mutedStrong),+ style: grid.AppType.body(color: AppColors.mutedStrong),),// Selecting and dragging both need an agent to already exist. On a// first launch none does, so the two sentences around this button@@ -2279,7 +2272,7 @@ class _EmptyGrid extends StatelessWidget {Text('Press ${shortcutHintFor(ShortcutAction.showShortcuts)} for ''keyboard shortcuts',- style: terminalTextStyle(color: grid.AppPalette.textFaint),+ style: grid.AppType.body(color: grid.AppPalette.textFaint),),],),diff --git a/desktop/lib/widgets/pane_header_actions.dart b/desktop/lib/widgets/pane_header_actions.dartindex 79f9ed9b5..ac58f5fcf 100644--- a/desktop/lib/widgets/pane_header_actions.dart+++ b/desktop/lib/widgets/pane_header_actions.dart@@ -1,6 +1,5 @@import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';-import 'package:harness/terminal/terminal_text.dart';import '../shared/theme/app_theme.dart' as grid;import '../theme/app_theme.dart';@@ -245,7 +244,6 @@ class _CompactPaneActionsState extends State<_CompactPaneActions> {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);final enabled = widget.items.where((item) => item.callback != null).toList();@@ -279,7 +277,7 @@ class _CompactPaneActionsState extends State<_CompactPaneActions> {focusNode: i == 0 ? _firstFocus : null,onPressed: enabled[i].callback,style: ButtonStyle(- textStyle: WidgetStatePropertyAll(boxMonoStyle()),+ textStyle: WidgetStatePropertyAll(grid.AppType.body()),foregroundColor: WidgetStatePropertyAll(AppColors.text),minimumSize: const WidgetStatePropertyAll(Size(180, 30)),shape: const WidgetStatePropertyAll(RoundedRectangleBorder()),@@ -326,7 +324,6 @@ class _PaneHeaderHoverState extends State<PaneHeaderHover> {bool _hovered = false, _focused = false;@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return MouseRegion(onEnter: (_) => setState(() => _hovered = true),onExit: (_) => setState(() => _hovered = false),@@ -373,7 +370,6 @@ class _ViewerToggle extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);final glow = color.withValues(alpha: .55);return IconButton(tooltip: on ? 'Hide viewer' : 'Show viewer',diff --git a/desktop/lib/widgets/pane_menu.dart b/desktop/lib/widgets/pane_menu.dartindex 7b0c32a2d..51de2c0ec 100644--- a/desktop/lib/widgets/pane_menu.dart+++ b/desktop/lib/widgets/pane_menu.dart@@ -3,12 +3,12 @@ import 'dart:math' as math;import 'package:flutter/material.dart';import 'package:flutter/services.dart';-import 'package:harness/terminal/terminal_text.dart';import '../shortcuts/app_keymap.dart';import '../shortcuts/keymap.dart';import 'box_chrome.dart';+import '../shared/theme/app_type.dart';import '../theme/app_theme.dart';import 'engine_identity.dart';import 'transient_menus.dart';@@ -183,7 +183,6 @@ class _PaneMenuFocusState extends State<_PaneMenuFocus> {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return KeymapRegion(contextKind: KeymapContext.picker,child: FocusScope(@@ -232,7 +231,7 @@ Widget paneMenuEmpty(String text) => Padding(kPaneMenuInset + kPaneMenuRowPadding,6,),- child: Text(text, style: terminalTextStyle(color: AppColors.textSoft)),+ child: Text(text, style: AppType.body(color: AppColors.textSoft)),);/// A section label. Non-interactive and short, so the groups read as groups rather than as@@ -257,7 +256,7 @@ Widget paneMenuHeader(String label, {String? caption}) => Padding(children: [Text(label,- style: terminalTextStyle(+ style: AppType.caption(fontWeight: FontWeight.w600,letterSpacing: .3,color: AppColors.mutedStrong,@@ -268,7 +267,7 @@ Widget paneMenuHeader(String label, {String? caption}) => Padding(padding: const EdgeInsets.only(top: 2),child: Text(caption,- style: terminalTextStyle(color: AppColors.textSoft),+ style: AppType.caption(color: AppColors.textSoft),),),],@@ -302,7 +301,6 @@ class PaneMenuRow extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);final row = Row(children: [if (engine != null) ...[@@ -313,17 +311,14 @@ class PaneMenuRow extends StatelessWidget {const SizedBox(width: 7),],// The title gets spare width; trailing metadata may ellipsize when- // the selected terminal size makes the combined line too wide.+ // the combined line is too wide.Expanded(child: Text(title,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(- // Stated rather than inherited: a PopupMenuItem's default text style is heavier than- // this menu wants, which read as every row being emphasised.- fontWeight: FontWeight.w400,- color: AppColors.text,- ),+ // Regular, stated by the style rather than inherited: a PopupMenuItem's default text+ // style is heavier than this menu wants, which read as every row being emphasised.+ style: AppType.mono(color: AppColors.text),),),if (detail.isNotEmpty) ...[@@ -333,7 +328,7 @@ class PaneMenuRow extends StatelessWidget {detail,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(color: AppColors.mutedStrong),+ style: AppType.mono(color: AppColors.mutedStrong),),),],@@ -344,7 +339,7 @@ class PaneMenuRow extends StatelessWidget {status!,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(color: AppColors.mutedStrong),+ style: AppType.mono(color: AppColors.mutedStrong),),),],@@ -377,7 +372,7 @@ class PaneMenuRow extends StatelessWidget {child: Text(subtitle!,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(color: AppColors.textSoft),+ style: AppType.body(color: AppColors.textSoft),),),],diff --git a/desktop/lib/widgets/prompt_context.dart b/desktop/lib/widgets/prompt_context.dartindex 86ae2a5f5..e88318376 100644--- a/desktop/lib/widgets/prompt_context.dart+++ b/desktop/lib/widgets/prompt_context.dart@@ -5,7 +5,6 @@ import '../shared/theme/app_theme.dart' as grid;import '../shared/theme/appearance_prefs_store.dart';import '../shared/theme/prompt_style.dart';import '../terminal/terminal_text.dart';-import 'box_chrome.dart';import 'search_result_text.dart';/// The same compact identity line in the picker, pane header and live preview.@@ -23,7 +22,7 @@ class PromptContextView extends StatelessWidget {final PromptContext contextData;final PromptPrefs? prefs;final AppearancePrefsStore? store;- double get size => terminalFontStore.size;+ double get size => grid.AppType.monoLabelSize;final Iterable<SearchFieldMatch> matches;@override@@ -39,6 +38,14 @@ class PromptContextView extends StatelessWidget {);}+ /// Breadcrumbs name places a person copies, so they are mono, one step+ /// under the terminal's own text.+ static TextStyle _style(Color tone) => grid.AppType.monoLabel(+ color: tone,+ fontWeight: FontWeight.w400,+ height: 1.35,+ );+Widget _line(PromptPrefs prefs) {final data = contextData;final segments =@@ -118,7 +125,7 @@ class PromptContextView extends StatelessWidget {if (part.ascii.isNotEmpty) ...[if (prefs.style == PromptStyle.plain ||part.icon == null)- Text(part.ascii, style: boxMonoStyle(color: tone))+ Text(part.ascii, style: _style(tone))elseIcon(part.icon, size: size, color: tone),const SizedBox(width: 4),@@ -127,7 +134,7 @@ class PromptContextView extends StatelessWidget {child: SearchResultText(part.value,matches: matches,- style: boxMonoStyle(color: tone),+ style: _style(tone),),),],diff --git a/desktop/lib/widgets/prompt_customize.dart b/desktop/lib/widgets/prompt_customize.dartindex d5361ab5e..c37bdf031 100644--- a/desktop/lib/widgets/prompt_customize.dart+++ b/desktop/lib/widgets/prompt_customize.dart@@ -44,7 +44,10 @@ class PromptCustomize extends StatelessWidget {child: ExcludeSemantics(child: Text('${value ? '[x]' : '[ ]'} $label',- style: boxMonoStyle(color: grid.AppPalette.textPrimary),+ style: grid.AppType.monoLabel(+ color: grid.AppPalette.textPrimary,+ fontWeight: FontWeight.w400,+ ),),),),@@ -56,7 +59,9 @@ class PromptCustomize extends StatelessWidget {children: [Text('header style',- style: boxMonoStyle(color: grid.AppPalette.textSecondary),+ style: grid.AppType.monoMeta(+ color: grid.AppPalette.textSecondary,+ ),),const SizedBox(height: 8),for (final style in PromptStyle.values)@@ -85,15 +90,16 @@ class PromptCustomize extends StatelessWidget {children: [Text('${prefs.style == style ? '>' : ' '} ${style.label}',- style: boxMonoStyle(+ style: grid.AppType.monoLabel(color: grid.AppPalette.textPrimary,+ fontWeight: FontWeight.w400,),),Padding(padding: const EdgeInsets.only(left: 16, top: 3),child: Text(style.description,- style: boxMonoStyle(+ style: grid.AppType.body(color: grid.AppPalette.textSecondary,),),@@ -105,7 +111,9 @@ class PromptCustomize extends StatelessWidget {const SizedBox(height: 16),Text('preview',- style: boxMonoStyle(color: grid.AppPalette.textSecondary),+ style: grid.AppType.monoMeta(+ color: grid.AppPalette.textSecondary,+ ),),const SizedBox(height: 6),TerminalBox(@@ -126,7 +134,9 @@ class PromptCustomize extends StatelessWidget {const SizedBox(height: 16),Text('context',- style: boxMonoStyle(color: grid.AppPalette.textSecondary),+ style: grid.AppType.monoMeta(+ color: grid.AppPalette.textSecondary,+ ),),toggle('machine',@@ -155,7 +165,7 @@ class PromptCustomize extends StatelessWidget {const SizedBox(height: 8),Text('Applies to agent search and pane headers. Changes are saved as you choose.',- style: boxMonoStyle(color: grid.AppPalette.textSecondary),+ style: grid.AppType.body(color: grid.AppPalette.textSecondary),),const SizedBox(height: 12),TextButton(@@ -163,7 +173,9 @@ class PromptCustomize extends StatelessWidget {onPressed: () => choose(const PromptPrefs()),child: Text('Reset header style',- style: boxMonoStyle(color: grid.AppPalette.textSecondary),+ style: grid.AppType.label(+ color: grid.AppPalette.textSecondary,+ ),),),],diff --git a/desktop/lib/widgets/remote_folder_picker.dart b/desktop/lib/widgets/remote_folder_picker.dartindex c9acefe8b..e041a46f9 100644--- a/desktop/lib/widgets/remote_folder_picker.dart+++ b/desktop/lib/widgets/remote_folder_picker.dart@@ -5,7 +5,6 @@ import '../shared/widgets/labeled_field.dart';import 'package:flutter/material.dart';import 'package:flutter/services.dart';import 'package:path/path.dart' as p;-import 'package:harness/terminal/terminal_text.dart';import '../shared/widgets/app_dialog.dart';import '../state/app_state.dart';@@ -256,7 +255,7 @@ class _RemoteFolderPickerDialogState extends State<_RemoteFolderPickerDialog> {Widget build(BuildContext context) {grid.AppTheme.watch(context);final scale = MediaQuery.textScalerOf(context);- _rowHeight = math.max(36, scale.scale(terminalFontStore.size) * 1.35 + 16);+ _rowHeight = math.max(36, scale.scale(grid.AppType.bodySize) * 1.35 + 16);final listHeight =(MediaQuery.sizeOf(context).height - 320 - scale.scale(50)).clamp(120.0,@@ -347,7 +346,10 @@ class _RemoteFolderPickerDialogState extends State<_RemoteFolderPickerDialog> {controller: _location,focusNode: _locationFocus,autofocus: true,- style: grid.kFieldTextStyle,+ // A path: typed and pasted, so set to be copied exactly.+ style: grid.AppType.mono(+ color: grid.AppPalette.textPrimary,+ ),decoration: InputDecoration(hintText: 'Enter a full folder path…',suffixIcon: IconButton(diff --git a/desktop/lib/widgets/shortcuts_sheet.dart b/desktop/lib/widgets/shortcuts_sheet.dartindex 8d33d1b56..9e2dcdfb8 100644--- a/desktop/lib/widgets/shortcuts_sheet.dart+++ b/desktop/lib/widgets/shortcuts_sheet.dart@@ -1,5 +1,4 @@import 'package:flutter/material.dart';-import 'package:harness/terminal/terminal_text.dart';import '../shared/theme/app_theme.dart' as grid;import '../shared/widgets/app_dialog.dart';@@ -47,10 +46,7 @@ class _ShortcutsSheetState extends State<_ShortcutsSheet> {padding: const EdgeInsets.fromLTRB(18, 17, 18, 4),child: Text('Keyboard shortcuts',- style: terminalTextStyle(- color: grid.AppPalette.textPrimary,- fontWeight: grid.AppFont.semibold,- ),+ style: grid.AppType.heading(color: grid.AppPalette.textPrimary),),),Flexible(diff --git a/desktop/lib/widgets/swarm_attention.dart b/desktop/lib/widgets/swarm_attention.dartindex e2e8c21c9..3b9d85774 100644--- a/desktop/lib/widgets/swarm_attention.dart+++ b/desktop/lib/widgets/swarm_attention.dart@@ -1,6 +1,7 @@import 'swarm_search_field.dart';import 'package:flutter/material.dart';+import 'package:harness/shared/theme/app_type.dart';import 'package:harness/terminal/terminal_text.dart';import '../shared/widgets/app_dialog.dart';@@ -117,9 +118,11 @@ class _SwarmAttentionState extends State<_SwarmAttention> {Widget build(BuildContext context) {TerminalFontScope.watch(context);final scale = MediaQuery.textScalerOf(context);+ // The name, two lines of the question, and the place it came from._rowHeight =- (scale.scale(terminalFontStore.size) * 1.35 * 3 +- scale.scale(terminalFontStore.size) * 1.3 ++ (scale.scale(AppType.monoLabelSize) * 1.35 ++ scale.scale(AppType.bodySize) * 1.35 * 2 ++ scale.scale(AppType.monoMetaSize) * 1.3 +36).clamp(104, double.infinity);final selected = _rows.isEmpty ? null : _rows[_cursor];@@ -135,11 +138,11 @@ class _SwarmAttentionState extends State<_SwarmAttention> {children: [Row(children: [- Text('Needs input', style: terminalTextStyle()),+ Text('Needs input', style: AppType.heading()),const SizedBox(width: 8),Text('${_catalog.length}',- style: terminalTextStyle(color: Colors.white54),+ style: AppType.monoMeta(color: Colors.white54),),const Spacer(),IconButton(@@ -170,7 +173,7 @@ class _SwarmAttentionState extends State<_SwarmAttention> {_catalog.isEmpty? 'No agents need your input': 'No matching questions',- style: terminalTextStyle(color: Colors.white60),+ style: AppType.body(color: Colors.white60),),): ListView.builder(@@ -204,17 +207,14 @@ class _SwarmAttentionState extends State<_SwarmAttention> {destination.title,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(- height: 1.35,- fontWeight: FontWeight.w500,- ),+ style: AppType.monoLabel(height: 1.35),),const SizedBox(height: 2),Text(row.question.prompt,maxLines: 2,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: AppType.body(height: 1.35,color: Colors.white70,),@@ -224,7 +224,7 @@ class _SwarmAttentionState extends State<_SwarmAttention> {destination.detail,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: AppType.monoMeta(height: 1.3,color: Colors.white54,),@@ -237,7 +237,7 @@ class _SwarmAttentionState extends State<_SwarmAttention> {: destination.hasView? 'Jump': 'Open Harness',- style: terminalTextStyle(color: Colors.white54),+ style: AppType.monoMeta(color: Colors.white54),),onTap: row.available? () => Navigator.pop(context, row)@@ -257,7 +257,7 @@ class _SwarmAttentionState extends State<_SwarmAttention> {: '↑↓ or ⌃N ⌃P to choose · Return to jump · Esc to close',maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(color: Colors.white54),+ style: AppType.monoMeta(color: Colors.white54),),),],diff --git a/desktop/lib/widgets/swarm_dialogs.dart b/desktop/lib/widgets/swarm_dialogs.dartindex 4cc7e82d9..5949a009b 100644--- a/desktop/lib/widgets/swarm_dialogs.dart+++ b/desktop/lib/widgets/swarm_dialogs.dart@@ -2,7 +2,7 @@ import 'dart:async';import 'package:file_selector/file_selector.dart';import 'package:flutter/material.dart';-import 'package:harness/terminal/terminal_text.dart';+import 'package:harness/shared/theme/app_type.dart';import '../shared/widgets/app_dialog.dart';import '../shared/widgets/app_select_field.dart';@@ -122,7 +122,6 @@ class _ProjectDialogState extends State<_ProjectDialog> {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return AlertDialog(title: const Text('Add project'),content: SizedBox(@@ -133,7 +132,7 @@ class _ProjectDialogState extends State<_ProjectDialog> {children: [Text('Choose an existing working folder.',- style: terminalTextStyle(color: Colors.white60),+ style: AppType.body(color: Colors.white60),),const SizedBox(height: 20),if (machineId != null)@@ -174,10 +173,7 @@ class _ProjectDialogState extends State<_ProjectDialog> {child: const Text('Clone repository…'),),if (error != null)- Text(- error!,- style: terminalTextStyle(color: Colors.orangeAccent),- ),+ Text(error!, style: AppType.body(color: Colors.orangeAccent)),],),),diff --git a/desktop/lib/widgets/swarm_project_agents.dart b/desktop/lib/widgets/swarm_project_agents.dartindex 7776e6172..ddb9eae98 100644--- a/desktop/lib/widgets/swarm_project_agents.dart+++ b/desktop/lib/widgets/swarm_project_agents.dart@@ -1,7 +1,7 @@import 'swarm_search_field.dart';import 'package:flutter/material.dart';-import 'package:harness/terminal/terminal_text.dart';+import 'package:harness/shared/theme/app_type.dart';import '../shared/widgets/app_dialog.dart';import '../state/app_state.dart';@@ -54,7 +54,6 @@ class _ProjectAgentsState extends State<_ProjectAgents> {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Dialog(child: SizedBox(width: 620,@@ -64,14 +63,11 @@ class _ProjectAgentsState extends State<_ProjectAgents> {child: Column(crossAxisAlignment: CrossAxisAlignment.stretch,children: [- Text(- widget.group.name,- style: terminalTextStyle(fontWeight: FontWeight.w500),- ),+ Text(widget.group.name, style: AppType.heading()),const SizedBox(height: 8),Text('Include agents from any machine. Matching repositories are included automatically.',- style: terminalTextStyle(),+ style: AppType.body(),),const SizedBox(height: 16),SwarmSearchField(@@ -105,11 +101,11 @@ class _ProjectAgentsState extends State<_ProjectAgents> {agent.agent.name,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(),+ style: AppType.label(),),subtitle: Text('${agent.machine.machine.displayName}${automatic ? ' · Repository match' : ''}',- style: terminalTextStyle(),+ style: AppType.body(),),onChanged: automatic? nulldiff --git a/desktop/lib/widgets/swarm_search_field.dart b/desktop/lib/widgets/swarm_search_field.dartindex 9f7ad5ca7..37bb3e511 100644--- a/desktop/lib/widgets/swarm_search_field.dart+++ b/desktop/lib/widgets/swarm_search_field.dart@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';import 'package:flutter/services.dart';import 'package:harness/terminal/terminal_text.dart';+import '../shared/theme/app_type.dart';+class SwarmSearchField extends StatefulWidget {const SwarmSearchField({super.key,@@ -85,9 +87,10 @@ class _SwarmSearchFieldState extends State<SwarmSearchField> {autofocus: widget.autofocus,onChanged: widget.onChanged,onSubmitted: (_) => onSubmitted?.call(),- style: terminalTextStyle(),+ style: AppType.mono(),decoration: InputDecoration(hintText: widget.hintText,+ hintStyle: AppType.mono(color: Colors.white60),prefixIcon: const Icon(Icons.search, size: 18),filled: true,fillColor: const Color(0xa6111521),diff --git a/desktop/lib/widgets/swarm_search_input.dart b/desktop/lib/widgets/swarm_search_input.dartindex 6a6659096..262f26b43 100644--- a/desktop/lib/widgets/swarm_search_input.dart+++ b/desktop/lib/widgets/swarm_search_input.dart@@ -54,7 +54,7 @@ class SwarmSearchInput extends StatelessWidget {final double? height;/// The typed text and the hint; the search glyph grows with it.- double get fontSize => terminalFontStore.size;+ double get fontSize => grid.AppType.monoSize;final String? prompt;/// Plain monospace input in a TerminalBox, without a decorative search glyph.@@ -102,7 +102,7 @@ class SwarmSearchInput extends StatelessWidget {onChanged: onChanged,style: terminalStyle? boxMonoStyle()- : terminalTextStyle(color: Colors.white),+ : grid.AppType.mono(color: Colors.white),cursorColor: grid.AppPalette.swarmAccent,textAlignVertical: TextAlignVertical.center,decoration: InputDecoration(@@ -114,7 +114,7 @@ class SwarmSearchInput extends StatelessWidget {: hintText ?? search?.hint ?? kSwarmSearchHint,hintStyle: terminalStyle? boxMonoStyle(color: kBoxFaint)- : terminalTextStyle(color: Colors.white60),+ : grid.AppType.mono(color: Colors.white60),hintMaxLines: 1,prefixIcon: prompt != null? Padding(@@ -153,7 +153,7 @@ class SwarmSearchInput extends StatelessWidget {foregroundColor: Colors.white60,minimumSize: const Size(36, 28),),- child: Text('esc', style: terminalTextStyle()),+ child: Text('esc', style: grid.AppType.monoMeta()),),],),diff --git a/desktop/lib/widgets/swarm_search_preview.dart b/desktop/lib/widgets/swarm_search_preview.dartindex 4e3b50b9a..a01bbb90c 100644--- a/desktop/lib/widgets/swarm_search_preview.dart+++ b/desktop/lib/widgets/swarm_search_preview.dart@@ -6,6 +6,7 @@ import 'package:lucide_icons_flutter/lucide_icons.dart';import 'package:harness/terminal/terminal_text.dart';import '../core/models.dart';+import '../shared/theme/app_type.dart';import '../shared/theme/prompt_style.dart';import '../state/app_state.dart';import '../state/swarm_navigation.dart';@@ -197,7 +198,7 @@ class _SwarmSearchPreviewState extends State<SwarmSearchPreview> {Text(row.title,// The list leads the eye; this confirms it.- style: terminalTextStyle(+ style: AppType.monoLabel(fontWeight: FontWeight.w600,),),@@ -257,8 +258,12 @@ class _SwarmSearchPreviewState extends State<SwarmSearchPreview> {}}-TextStyle get _muted => terminalTextStyle(height: 1.5, color: Colors.white54);-TextStyle get _body => terminalTextStyle(height: 1.6, color: Color(0xffe1e1e4));+TextStyle get _muted => AppType.monoMeta(height: 1.5, color: Colors.white54);+TextStyle get _body => AppType.monoLabel(+ fontWeight: FontWeight.w400,+ height: 1.6,+ color: Color(0xffe1e1e4),+);class _AgentPreview extends StatelessWidget {const _AgentPreview({@@ -361,7 +366,7 @@ class _AgentPreview extends StatelessWidget {Expanded(child: Text(agent.displayName,- style: terminalTextStyle(+ style: AppType.monoLabel(// The list leads the eye; the preview confirms it.fontWeight: FontWeight.w600,height: 1.25,@@ -370,7 +375,7 @@ class _AgentPreview extends StatelessWidget {),if (dense) ...[const SizedBox(width: 10),- Text(state, style: terminalTextStyle(color: color)),+ Text(state, style: AppType.monoMeta(color: color)),],],),@@ -398,7 +403,7 @@ class _AgentPreview extends StatelessWidget {color: color,),const SizedBox(width: 5),- Text(state, style: terminalTextStyle(color: color)),+ Text(state, style: AppType.monoMeta(color: color)),],),),@@ -452,7 +457,7 @@ class _AgentPreview extends StatelessWidget {children: [Text('Needs your input',- style: terminalTextStyle(+ style: AppType.monoLabel(fontWeight: FontWeight.w600,color: color,),diff --git a/desktop/lib/widgets/swarm_switcher.dart b/desktop/lib/widgets/swarm_switcher.dartindex 8c0cf34ae..0ba1910f3 100644--- a/desktop/lib/widgets/swarm_switcher.dart+++ b/desktop/lib/widgets/swarm_switcher.dart@@ -78,14 +78,11 @@ class _SwarmHistoryState extends State<_SwarmHistory> {children: [Row(children: [- Text(- 'History',- style: terminalTextStyle(fontWeight: FontWeight.w500),- ),+ Text('History', style: grid.AppType.monoLabel()),Spacer(),Text('This session',- style: terminalTextStyle(color: Colors.white54),+ style: grid.AppType.monoMeta(color: Colors.white54),),],),@@ -336,11 +333,11 @@ double swarmSearchRowHeight(bool stacked = false,}) => terminal? stacked- ? scale.scale(terminalFontStore.size) * 1.35 +- scale.scale(terminalFontStore.size) * 1.35 ++ ? scale.scale(grid.AppType.monoSize) * 1.35 ++ scale.scale(grid.AppType.monoSize) * 1.35 +8: boxRowHeight(scale)- : (scale.scale(terminalFontStore.size) * 1.2 + 14).clamp(+ : (scale.scale(grid.AppType.monoLabelSize) * 1.2 + 14).clamp(34,double.infinity,);@@ -556,7 +553,10 @@ class _SwarmSearchResultsState extends State<SwarmSearchResults> {widget.terminal &&!search.isCommandMode &&!search.isHelpMode &&- resultWidth < 700 * scale.scale(terminalFontStore.size) / 13;+ resultWidth <+ 700 *+ scale.scale(grid.AppType.monoSize) /+ grid.AppType.monoSize;_rowHeight = swarmSearchRowHeight(scale,commands: search.isCommandMode,@@ -572,7 +572,7 @@ class _SwarmSearchResultsState extends State<SwarmSearchResults> {: constraints.maxHeight;final compactAction =(sideBySide ? constraints.maxWidth / 2 : constraints.maxWidth) <- 380 * scale.scale(terminalFontStore.size) / terminalFontSize;+ 380 * scale.scale(grid.AppType.monoSize) / grid.AppType.monoSize;final geometry = (Size(constraints.maxWidth, height), _rowHeight);if (_geometry != geometry) {_geometry = geometry;@@ -595,7 +595,7 @@ class _SwarmSearchResultsState extends State<SwarmSearchResults> {highlighted ? (search.canAccept, search.actionLabel(row)) : null,_rowHeight,compactAction,- scale.scale(terminalFontStore.size),+ grid.AppType.monoFamily,grid.AppTheme.palette.value,acceptKey,widget.terminal,@@ -695,15 +695,15 @@ class _SwarmSearchResultsState extends State<SwarmSearchResults> {: alreadyHere && search.placement == null? Text('Already added',- style: terminalTextStyle(color: Colors.white54),+ style: grid.AppType.monoMeta(color: Colors.white54),): highlighted? ConstrainedBox(constraints: BoxConstraints(maxWidth:170 *- scale.scale(terminalFontStore.size) /- terminalFontSize,+ scale.scale(grid.AppType.bodySize) /+ grid.AppType.bodySize,),child: TextButton(key: const ValueKey('swarm-row-action'),@@ -721,7 +721,7 @@ class _SwarmSearchResultsState extends State<SwarmSearchResults> {? null: Text(row.shortcut!,- style: terminalTextStyle(color: Colors.white60),+ style: grid.AppType.monoMeta(color: Colors.white60),),onTap: canSubmit ? () => _submit(row) : null,);@@ -776,7 +776,10 @@ class _SwarmSearchResultsState extends State<SwarmSearchResults> {: search.adding? 'No matching harnesses': 'No matching results',- style: terminalTextStyle(color: Colors.white60),+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,+ color: Colors.white60,+ ),),): Padding(@@ -825,7 +828,10 @@ class _SwarmSearchResultsState extends State<SwarmSearchResults> {: 'No room to open this ${selected.isSwarm || selected.isGroup ? 'group' : 'harness'}',maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(color: Colors.white60),+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,+ color: Colors.white60,+ ),),),],@@ -993,7 +999,7 @@ class _SearchRowContentState extends State<_SearchRowContent> {final title = SearchResultText(row.title,matches: matches.where((match) => match.title),- style: widget.terminal ? boxMonoStyle() : terminalTextStyle(),+ style: widget.terminal ? boxMonoStyle() : grid.AppType.monoLabel(),);final detailText = widget.terminal? row.terminalDetail ?? row.detail@@ -1017,7 +1023,7 @@ class _SearchRowContentState extends State<_SearchRowContent> {matches: matches.where((match) => !match.title),style: widget.terminal? boxMonoStyle(color: kBoxFaint)- : terminalTextStyle(color: Colors.white54),+ : grid.AppType.monoMeta(color: Colors.white54),): null;return widget.stacked@@ -1071,7 +1077,7 @@ class SwarmSearchActionLabel extends StatelessWidget {label,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(),+ style: grid.AppType.label(),),),if (hint != null) ...[@@ -1080,7 +1086,7 @@ class SwarmSearchActionLabel extends StatelessWidget {if (hint.length > 1)Text(hint.substring(0, hint.length - 1),- style: terminalTextStyle(),+ style: grid.AppType.monoMeta(),),const Icon(Icons.keyboard_return, size: 14),] else@@ -1090,7 +1096,7 @@ class SwarmSearchActionLabel extends StatelessWidget {hint.replaceAll('↵', 'Return').replaceAll('⇥', 'Tab'),maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(),+ style: grid.AppType.monoMeta(),),),],@@ -1249,10 +1255,7 @@ class SwarmSearchCount extends StatelessWidget {key: const ValueKey('swarm-search-count'),style: terminal? boxMonoStyle(color: kBoxFaint)- : terminalTextStyle(- color: Colors.white54,- fontFeatures: [FontFeature.tabularFigures()],- ),+ : grid.AppType.monoMeta(color: Colors.white54),),);},diff --git a/desktop/lib/widgets/task_palette.dart b/desktop/lib/widgets/task_palette.dartindex 1f1630288..8ef3a8c03 100644--- a/desktop/lib/widgets/task_palette.dart+++ b/desktop/lib/widgets/task_palette.dart@@ -1,9 +1,8 @@import 'dart:async';-import 'dart:ui' show FontFeature, ImageFilter;+import 'dart:ui' show ImageFilter;import 'package:flutter/material.dart';import 'package:flutter/services.dart';-import 'package:harness/terminal/terminal_text.dart';import '../core/models.dart';import '../shared/theme/app_theme.dart' as grid;@@ -126,7 +125,6 @@ abstract final class _D {static const fieldInk = Color(0xFFF4F4F6);static const hint = Color(0xFF6E6E76);static const caret = Color(0xFFE6E6EA);- static const fieldSize = 22.0;/// The rows.static const sep = Color(0x14FFFFFF); // rgba(255,255,255,.08)@@ -578,14 +576,9 @@ class _TaskPaletteState extends State<_TaskPalette> {// Read-only rather than disabled while the router thinks: a disabled field drops the focus,// and the focus is what Esc is listening on.readOnly: working || _stage == _Stage.sent,- style: terminalTextStyle(- color: _D.fieldInk,- height: 1.35,- letterSpacing: -0.22, // -.01em at 22px- ),+ style: grid.AppType.mono(color: _D.fieldInk, height: 1.35),cursorColor: _D.caret,cursorWidth: 2,- cursorHeight: _D.fieldSize * 1.05,cursorRadius: Radius.zero,decoration: InputDecoration(filled: false,@@ -598,7 +591,7 @@ class _TaskPaletteState extends State<_TaskPalette> {focusedBorder: InputBorder.none,disabledBorder: InputBorder.none,hintText: 'Describe the work…',- hintStyle: terminalTextStyle(color: _D.hint, height: 1.35),+ hintStyle: grid.AppType.mono(color: _D.hint, height: 1.35),),),),@@ -630,10 +623,7 @@ class _TaskPaletteState extends State<_TaskPalette> {child: Center(child: Text('${_elapsed}s',- style: terminalTextStyle(- color: _D.hint,- fontFeatures: [FontFeature.tabularFigures()],- ),+ style: grid.AppType.monoMeta(color: _D.hint),),),),@@ -655,7 +645,11 @@ class _TaskPaletteState extends State<_TaskPalette> {padding: const EdgeInsets.fromLTRB(16, 6, 16, 8),child: Text(_note,- style: terminalTextStyle(color: _D.questionInk, height: 1.45),+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,+ color: _D.questionInk,+ height: 1.45,+ ),),),]);@@ -671,13 +665,7 @@ class _TaskPaletteState extends State<_TaskPalette> {children: [Icon(Icons.check, size: 14, color: _D.green),SizedBox(width: 8),- Text(- 'on it',- style: terminalTextStyle(- color: _D.green,- fontWeight: FontWeight.w500,- ),- ),+ Text('on it', style: grid.AppType.monoLabel(color: _D.green)),],),),@@ -740,11 +728,12 @@ class _TaskPaletteState extends State<_TaskPalette> {final reason = (answer?.reason ?? '').trim();final weighed = answer?.weighed ?? 0;final machines = answer?.machines ?? 0;- final base = terminalTextStyle(color: _D.questionInk, height: 1.45);- final mark = terminalTextStyle(- color: _D.questionMark,- fontWeight: FontWeight.w500,+ final base = grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,+ color: _D.questionInk,+ height: 1.45,);+ final mark = grid.AppType.monoLabel(color: _D.questionMark);return Padding(padding: const EdgeInsets.fromLTRB(16, 6, 16, 4),child: Column(@@ -784,7 +773,7 @@ class _TaskPaletteState extends State<_TaskPalette> {'“$reason”',maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: _D.machineDim,fontStyle: FontStyle.italic,),@@ -850,9 +839,8 @@ class _TaskPaletteState extends State<_TaskPalette> {candidate.name,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.monoLabel(color: taken ? const Color(0xFFDFFBE9) : _D.engineInk,- fontWeight: FontWeight.w500,),),),@@ -863,7 +851,7 @@ class _TaskPaletteState extends State<_TaskPalette> {candidate.machine,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: taken ? const Color(0xFF9FD9B6) : _D.machineInk,),),@@ -874,7 +862,7 @@ class _TaskPaletteState extends State<_TaskPalette> {candidate.recent,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: taken ? const Color(0xFFDFFBE9) : _D.nameInk,),),@@ -887,9 +875,8 @@ class _TaskPaletteState extends State<_TaskPalette> {child: Text(fit > 0 ? fit.toStringAsFixed(2) : '',textAlign: TextAlign.right,- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: leader || taken ? _D.green : _D.lowFit,- fontFeatures: const [FontFeature.tabularFigures()],),),),diff --git a/desktop/lib/widgets/terminal_find_bar.dart b/desktop/lib/widgets/terminal_find_bar.dartindex 5db96d679..aba6b43fd 100644--- a/desktop/lib/widgets/terminal_find_bar.dart+++ b/desktop/lib/widgets/terminal_find_bar.dart@@ -1,6 +1,7 @@import 'package:flutter/material.dart';import 'package:flutter/services.dart';+import '../shared/theme/app_type.dart';import '../terminal/terminal_text.dart';import '../terminal/terminal_search.dart';import 'box_chrome.dart';@@ -162,23 +163,25 @@ class TerminalFindBarState extends State<TerminalFindBar> {onOpen: (_, close) => _closeMenu = close,onClose: () => _closeMenu = null,children: (close) {- Widget option(String label, String hint, VoidCallback action) =>- paneMenuItem(- onTap: () => close(action),- child: Padding(- padding: const EdgeInsets.symmetric(- horizontal: 10,- vertical: 8,+ Widget option(+ String label,+ String hint,+ VoidCallback action,+ ) => paneMenuItem(+ onTap: () => close(action),+ child: Padding(+ padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),+ child: Row(+ children: [+ Expanded(+ child: Text(label, style: AppType.body(color: Colors.white)),),- child: Row(- children: [- Expanded(child: Text(label, style: boxMonoStyle())),- const SizedBox(width: 16),- Text(hint, style: boxMonoStyle(color: kBoxFaint)),- ],- ),- ),- );+ const SizedBox(width: 16),+ Text(hint, style: kBoxFaintStyle),+ ],+ ),+ ),+ );return [option('Match case',@@ -230,7 +233,8 @@ class TerminalFindBarState extends State<TerminalFindBar> {focusNode: _focus,autofocus: widget.search != null,textAlignVertical: TextAlignVertical.center,- style: boxMonoStyle().copyWith(height: 1),+ // The query is terminal text, so it is set like the terminal.+ style: terminalTextStyle(height: 1, color: Colors.white),decoration: const InputDecoration(hintText: 'Find in terminal…',hintStyle: TextStyle(color: Colors.white54),@@ -312,7 +316,7 @@ class TerminalFindBarState extends State<TerminalFindBar> {child: ExcludeSemantics(child: Text('/',- style: boxMonoStyle(color: Colors.white70),+ style: terminalTextStyle(color: Colors.white70),),),),@@ -334,12 +338,13 @@ class TerminalFindBarState extends State<TerminalFindBar> {status,maxLines: 1,overflow: TextOverflow.ellipsis,- style: boxMonoStyle(+ style: AppType.monoMeta(color:count == 0 && query.isNotEmpty && !searching? const Color(0xffffb4a9): Colors.white54,- ).copyWith(height: 1),+ height: 1,+ ),),),),@@ -358,12 +363,13 @@ class TerminalFindBarState extends State<TerminalFindBar> {'Match case',Text('Aa',- style: boxMonoStyle(+ style: AppType.monoLabel(color: sensitive ? Colors.white : Colors.white54,- weight: sensitive+ fontWeight: sensitive? FontWeight.w700- : FontWeight.normal,- ).copyWith(height: 1),+ : FontWeight.w400,+ height: 1,+ ),),_toggleCase,selected: sensitive,diff --git a/desktop/lib/widgets/terminal_name_prompt.dart b/desktop/lib/widgets/terminal_name_prompt.dartindex a74070acb..8431d6b35 100644--- a/desktop/lib/widgets/terminal_name_prompt.dart+++ b/desktop/lib/widgets/terminal_name_prompt.dart@@ -179,7 +179,7 @@ class _TerminalNamePromptState extends State<TerminalNamePrompt> {widget.maxLength! - 10? '${_text.text.characters.length}/${widget.maxLength}': null,- suffixStyle: boxMonoStyle(color: kBoxFaint),+ suffixStyle: kBoxFaintStyle,isDense: true,filled: false,border: InputBorder.none,diff --git a/desktop/lib/widgets/terminal_panel.dart b/desktop/lib/widgets/terminal_panel.dartindex 0d086d49b..ff06979e6 100644--- a/desktop/lib/widgets/terminal_panel.dart+++ b/desktop/lib/widgets/terminal_panel.dart@@ -35,7 +35,6 @@ import '../terminal/terminal_viewport.dart';import '../shared/theme/app_theme.dart' as grid;import '../theme/app_theme.dart';import 'engine_identity.dart';-import 'box_chrome.dart';import 'grid_model_picker.dart';import 'pane_header_actions.dart';@@ -1497,8 +1496,9 @@ class _TerminalPanelState extends State<TerminalPanel>session.agentName,maxLines: 1,overflow: TextOverflow.ellipsis,- style: boxMonoStyle(+ style: grid.AppType.monoLabel(color: Colors.white70,+ fontWeight: FontWeight.w400,),),),@@ -1911,7 +1911,7 @@ class _TerminalHeader extends StatelessWidget {padding: const EdgeInsets.symmetric(horizontal: _stripPadding),child: LayoutBuilder(builder: (context, constraints) {- final scale = terminalTextScaleOf(context);+ final scale = grid.appTextScaleOf(context);final narrow = constraints.maxWidth < 560 * math.max(1, scale);final rightWidth = narrow? math.max(@@ -1951,10 +1951,9 @@ class _TerminalHeader extends StatelessWidget {session.agentName,maxLines: 1,overflow: TextOverflow.ellipsis,- style: boxMonoStyle(+ style: grid.AppType.monoLabel(color: AppColors.text,-- weight: FontWeight.w600,+ fontWeight: FontWeight.w600,),),),@@ -2017,7 +2016,9 @@ class _TerminalHeader extends StatelessWidget {status.label,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(),+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,+ ),),),],@@ -2195,7 +2196,6 @@ class _LinkModeMark extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);final (icon, color, label) = switch (mode) {'p2p' => (LucideIcons.link2,@@ -2314,7 +2314,7 @@ class _ControlBanner extends StatelessWidget {// and the button on one line; there the button takes a line of// its own under the title rather than running off the edge.final narrow =- constraints.maxWidth < 340 * terminalTextScaleOf(context);+ constraints.maxWidth < 340 * grid.appTextScaleOf(context);final lead = !busy? Icon(Icons.lock_outline, size: 16, color: ink): SizedBox(@@ -2333,9 +2333,9 @@ class _ControlBanner extends StatelessWidget {title,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.label(color: AppColors.text,- fontWeight: FontWeight.w700,+ fontWeight: FontWeight.w600,),),if (detail != null) ...[@@ -2344,7 +2344,7 @@ class _ControlBanner extends StatelessWidget {detail,maxLines: narrow ? 1 : 2,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.body(color: nudged ? ink : AppColors.textSoft,height: 1.3,),@@ -2405,7 +2405,6 @@ class _ControlBannerButton extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);final onAccent = Theme.of(context).colorScheme.onPrimary;return FilledButton(onPressed: onPressed,@@ -2418,12 +2417,7 @@ class _ControlBannerButton extends StatelessWidget {child: Row(mainAxisSize: MainAxisSize.min,children: [- Flexible(- child: Text(- 'Take control',- style: terminalTextStyle(fontWeight: FontWeight.w600),- ),- ),+ Flexible(child: Text('Take control', style: grid.AppType.label())),const SizedBox(width: 8),Container(padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 1),@@ -2476,10 +2470,7 @@ class _TransferProgressBadge extends StatelessWidget {child: Text('$label$percentLabel',overflow: TextOverflow.ellipsis,- style: terminalTextStyle(- color: AppColors.textSoft,- fontWeight: FontWeight.w700,- ),+ style: grid.AppType.label(color: AppColors.textSoft),),),const SizedBox(width: 8),@@ -2487,10 +2478,7 @@ class _TransferProgressBadge extends StatelessWidget {onTap: onCancel,child: Text('CANCEL',- style: terminalTextStyle(- color: AppColors.textSoft,- fontWeight: FontWeight.w700,- ),+ style: grid.AppType.label(color: AppColors.textSoft),),),],@@ -2573,7 +2561,7 @@ class _PaneGhost extends StatelessWidget {child: Center(child: Text(session.agentName,- style: terminalTextStyle(+ style: grid.AppType.monoLabel(color: AppColors.mutedStrong,fontWeight: FontWeight.w600,),diff --git a/desktop/lib/widgets/terminal_prompt.dart b/desktop/lib/widgets/terminal_prompt.dartindex fbb8fc480..81413f659 100644--- a/desktop/lib/widgets/terminal_prompt.dart+++ b/desktop/lib/widgets/terminal_prompt.dart@@ -1,7 +1,7 @@import 'package:flutter/material.dart';import 'package:flutter/services.dart';-import 'package:harness/terminal/terminal_text.dart';+import '../shared/theme/app_type.dart';import '../shared/widgets/app_dialog.dart';import '../shortcuts/app_keymap.dart';import '../shortcuts/keymap.dart';@@ -179,7 +179,6 @@ class TerminalPromptKeys extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);final focused = Focus(focusNode: focusNode,autofocus: true,@@ -220,7 +219,6 @@ class TerminalPrompt extends StatelessWidget {final double width;@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Dialog(alignment: Alignment.topCenter,insetPadding: EdgeInsets.fromLTRB(@@ -251,7 +249,7 @@ Widget terminalPromptButton(onPressed: onPressed,style: TextButton.styleFrom(foregroundColor: danger ? Colors.orangeAccent : Colors.white70,- textStyle: boxMonoStyle(),+ textStyle: AppType.label(),padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6),minimumSize: const Size(0, 30),tapTargetSize: MaterialTapTargetSize.shrinkWrap,diff --git a/desktop/lib/widgets/update_notice.dart b/desktop/lib/widgets/update_notice.dartindex c9e902f2b..4150b628d 100644--- a/desktop/lib/widgets/update_notice.dart+++ b/desktop/lib/widgets/update_notice.dart@@ -128,7 +128,7 @@ class UpdateNotice extends StatelessWidget {message,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textPrimary,),),@@ -137,7 +137,7 @@ class UpdateNotice extends StatelessWidget {const SizedBox(width: 8),Text('· ${formatDownloadSize(update.size)}',- style: terminalTextStyle(+ style: grid.AppType.monoMeta(color: grid.AppPalette.textFaint,),),@@ -243,7 +243,7 @@ class _NoticeAction extends StatelessWidget {? BorderSide(color: grid.AppGlass.hair): BorderSide.none,),- textStyle: terminalTextStyle(+ textStyle: grid.AppType.label(fontWeight: primary ? grid.AppFont.semibold : grid.AppFont.regular,),),@@ -452,7 +452,7 @@ class _UpdateDialog extends StatelessWidget {// it belongs to the menu panel, not to a dialog.child: ConstrainedBox(constraints: BoxConstraints(- maxWidth: 372 * terminalTextScaleOf(context),+ maxWidth: 372 * grid.appTextScaleOf(context),),child: SingleChildScrollView(child: Padding(@@ -485,15 +485,14 @@ class _UpdateDialog extends StatelessWidget {const SizedBox(height: 12),Text(title,- style: terminalTextStyle(+ style: grid.AppType.heading(color: grid.AppPalette.textPrimary,- fontWeight: grid.AppFont.semibold,),),const SizedBox(height: 5),Text(body,- style: terminalTextStyle(+ style: grid.AppType.body(color: grid.AppPalette.textSecondary,height: 1.5,),@@ -572,15 +571,19 @@ class _Fact extends StatelessWidget {crossAxisAlignment: CrossAxisAlignment.start,children: [SizedBox(- width: 96 * terminalTextScaleOf(context),+ width: 96 * grid.appTextScaleOf(context),child: Text(label,- style: terminalTextStyle(color: grid.AppPalette.textFaint),+ style: grid.AppType.body(color: grid.AppPalette.textFaint),),),Expanded(+ // Versions and sizes: copied into a report, so set in mono.child: DefaultTextStyle(- style: terminalTextStyle(color: grid.AppPalette.textSecondary),+ style: grid.AppType.monoLabel(+ fontWeight: FontWeight.w400,+ color: grid.AppPalette.textSecondary,+ ),child: value,),),diff --git a/desktop/lib/widgets/verdict_marks.dart b/desktop/lib/widgets/verdict_marks.dartindex cc7c9849a..00eb7afee 100644--- a/desktop/lib/widgets/verdict_marks.dart+++ b/desktop/lib/widgets/verdict_marks.dart@@ -6,6 +6,7 @@ import 'package:lucide_icons_flutter/lucide_icons.dart';import 'package:harness/terminal/terminal_text.dart';import '../core/models.dart';+import '../shared/theme/app_type.dart';import '../theme/app_theme.dart';/// Ready wins; then errors; then the phase under way; then warnings; then the@@ -89,7 +90,7 @@ class VerdictStatus extends StatelessWidget {label,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(color: color, fontWeight: weight),+ style: AppType.monoLabel(color: color, fontWeight: weight),),),],diff --git a/desktop/lib/widgets/web_pane_panel.dart b/desktop/lib/widgets/web_pane_panel.dartindex eb8eff7eb..d0952874c 100644--- a/desktop/lib/widgets/web_pane_panel.dart+++ b/desktop/lib/widgets/web_pane_panel.dart@@ -4,7 +4,6 @@ import 'package:flutter/material.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';import 'package:webview_flutter/webview_flutter.dart';import 'package:webview_flutter_wkwebview/webview_flutter_wkwebview.dart';-import 'package:harness/terminal/terminal_text.dart';import '../core/models.dart' show AgentVerdict;import '../core/test_run.dart';@@ -244,7 +243,7 @@ class _WebPanePanelState extends State<WebPanePanel> {widget.title,maxLines: 1,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(+ style: grid.AppType.monoLabel(color: AppColors.text,fontWeight: FontWeight.w600,),@@ -253,9 +252,8 @@ class _WebPanePanelState extends State<WebPanePanel> {if (widget.verdict case final verdict?) ...[Text(' · ',- style: terminalTextStyle(+ style: grid.AppType.monoLabel(color: AppColors.mutedStrong,- fontWeight: FontWeight.w500,),),Flexible(@@ -352,7 +350,6 @@ class _ViewerActions extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);Widget action(String tooltip, IconData icon, VoidCallback? callback) =>IconButton(tooltip: tooltip,@@ -413,7 +410,6 @@ class _Notice extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Center(child: Padding(padding: const EdgeInsets.all(20),@@ -424,7 +420,7 @@ class _Notice extends StatelessWidget {const SizedBox(height: 10),Text(title,- style: terminalTextStyle(+ style: grid.AppType.label(color: AppColors.text,fontWeight: FontWeight.w600,),@@ -435,7 +431,7 @@ class _Notice extends StatelessWidget {textAlign: TextAlign.center,maxLines: 3,overflow: TextOverflow.ellipsis,- style: terminalTextStyle(color: AppColors.mutedStrong),+ style: grid.AppType.body(color: AppColors.mutedStrong),),if (action != null) ...[const SizedBox(height: 8), action!],],diff --git a/desktop/lib/widgets/window_chrome.dart b/desktop/lib/widgets/window_chrome.dartindex 743be7acf..d4685c109 100644--- a/desktop/lib/widgets/window_chrome.dart+++ b/desktop/lib/widgets/window_chrome.dart@@ -2,7 +2,6 @@ import 'dart:io' show Platform;import 'package:flutter/widgets.dart';import 'package:window_manager/window_manager.dart';-import 'package:harness/terminal/terminal_text.dart';import '../core/desktop_window.dart';import '../shared/theme/app_theme.dart' as grid;@@ -60,7 +59,8 @@ class HarnessTopBar extends StatelessWidget {alignment: Alignment.centerLeft,child: Text('Harness',- style: terminalTextStyle(+ // Title-bar chrome, set like the native tabs beside it.+ style: grid.AppType.monoLabel(fontWeight: FontWeight.w600,color: grid.AppPalette.textSecondary,),@@ -92,7 +92,6 @@ class WindowDragArea extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return GestureDetector(// Translucent, like DragToMoveArea: the drag has to be available from// the gaps between whatever the region draws.@@ -115,7 +114,6 @@ class WindowDragStrip extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return DragToMoveArea(child: SizedBox(height: Platform.isMacOS ? windowDragBandHeight : 0,@@ -138,7 +136,6 @@ class FullWindowScreen extends StatelessWidget {@overrideWidget build(BuildContext context) {- TerminalFontScope.watch(context);return Stack(children: [Positioned.fill(child: child),diff --git a/desktop/lib/widgets/workspace_start_guide.dart b/desktop/lib/widgets/workspace_start_guide.dartindex bd86bd0f6..ab6725f2e 100644--- a/desktop/lib/widgets/workspace_start_guide.dart+++ b/desktop/lib/widgets/workspace_start_guide.dart@@ -37,7 +37,7 @@ class WorkspaceStartGuide extends StatelessWidget {color: grid.AppPalette.swarmWelcome,child: LayoutBuilder(builder: (context, constraints) {- final scale = terminalTextScaleOf(context);+ final scale = grid.appTextScaleOf(context);final compact = constraints.maxWidth < 680 * scale;final short = constraints.maxHeight < 420 * scale;Widget callout(String command, String label, String explanation) =>diff --git a/desktop/macos/Runner/SwarmTitlebar.swift b/desktop/macos/Runner/SwarmTitlebar.swiftindex 67cd383ec..28a7355fa 100644--- a/desktop/macos/Runner/SwarmTitlebar.swift+++ b/desktop/macos/Runner/SwarmTitlebar.swift@@ -2,10 +2,12 @@ import Cocoaimport FlutterMacOSimport ImageIO-/// The native chrome uses the same typography payload as Flutter's terminal.+/// The title bar's tabs and Store action wear the terminal's face at the chrome size Flutter+/// sends (`AppType.chromeSize`), never the terminal's own size: ⌘+ and ⌘− zoom the terminal alone.+/// Menus are not chrome — they use the system menu font, like every other Mac app's.enum HarnessTypography {private static var families = [".AppleSystemUIFontMonospaced"]- private(set) static var size: CGFloat = 13+ private(set) static var size: CGFloat = 12@discardableResultstatic func update(_ state: [String: Any]) -> Bool {@@ -20,14 +22,9 @@ enum HarnessTypography {return families != previousFamilies || size != previousSize}- static func apply(to menu: NSMenu) {- menu.font = font()- for item in menu.items {- if let submenu = item.submenu { apply(to: submenu) }- }- }-- static func font(weight: NSFont.Weight = .regular) -> NSFont {+ /// The tab label's face. [size] defaults to the chrome size; the ⌘1 badge asks one point less.+ static func font(weight: NSFont.Weight = .regular, size: CGFloat? = nil) -> NSFont {+ let size = size ?? self.sizelet base = families.first == ".AppleSystemUIFontMonospaced"? NSFont.monospacedSystemFont(ofSize: size, weight: weight): families.compactMap { NSFont(name: $0, size: size) }.first@@ -80,7 +77,6 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation, NSMenuDelegate {HarnessTypography.update(state)self.configure(palette: state["palette"] as? [String: Any])self.strip.updateTypography()- if let main = NSApp.mainMenu { HarnessTypography.apply(to: main) }result(true)case "update":let state = call.arguments as? [String: Any] ?? [:]@@ -90,13 +86,6 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation, NSMenuDelegate {self.canClosePane = state["canClosePane"] as? Bool == trueself.canGoBack = state["canGoBack"] as? Bool == trueself.canGoForward = state["canGoForward"] as? Bool == true- let fontChanged = HarnessTypography.update(state)- if fontChanged {- self.rebuildHistoryMenu()- self.rebuildModelsMenu()- self.rebuildMachinesMenu()- if let main = NSApp.mainMenu { HarnessTypography.apply(to: main) }- }self.updateHistory(state["history"] as? [[String: Any]] ?? [], closed: state["closedHistory"] as? [[String: Any]] ?? [])self.strip.update(state)self.window?.backgroundColor = self.strip.palette.tabBar@@ -300,7 +289,6 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation, NSMenuDelegate {}if let file = main.item(withTitle: "File") { main.removeItem(file) }let file = NSMenu(title: "File")- file.font = HarnessTypography.font()add(file, "New Tab", "t", "new")add(file, "New Pane…", "p", "addAgent")// ⌘⇧T, as in a terminal app. It used to be Reopen Last Closed (History menu), which keeps its@@ -338,11 +326,9 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation, NSMenuDelegate {rebuildMachinesMenu()install(machinesMenu, at: main.items.firstIndex(where: { $0.title == "Window" }) ?? main.numberOfItems)installTerminalFindMenu(main)- HarnessTypography.apply(to: main)}func menuWillOpen(_ menu: NSMenu) {- menu.font = HarnessTypography.font()syncMenuKeys()if menu === historyMenu {for item in menu.items {@@ -369,7 +355,6 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation, NSMenuDelegate {}private func rebuildMachinesMenu() {- machinesMenu.font = HarnessTypography.font()machinesMenu.removeAllItems()machinesMenu.minimumWidth = 0let labels = machines.map { machine -> (name: String, owner: String, presence: String, status: String, count: String) in@@ -418,7 +403,7 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation, NSMenuDelegate {let paragraph = NSMutableParagraphStyle()paragraph.tabStops = [NSTextTab(textAlignment: .right, location: trailingEdge)]let label = NSMutableAttributedString(string: parts.name,- attributes: [.font: HarnessTypography.font(), .paragraphStyle: paragraph])+ attributes: [.font: NSFont.menuFont(ofSize: 0), .paragraphStyle: paragraph])// After the name: the node presence ("Online"). Trailing (tab-aligned// right): the agent count, or the link/offline status when there is no// count. The two are independent slots, so a machine can read@@ -426,12 +411,11 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation, NSMenuDelegate {let afterName = parts.owner + (parts.presence.isEmpty ? "" : " " + parts.presence)let trailing = parts.count.isEmpty ? parts.status : parts.countlabel.append(NSAttributedString(string: afterName + "\t" + trailing,- attributes: [.font: HarnessTypography.font(), .paragraphStyle: paragraph,+ attributes: [.font: NSFont.menuFont(ofSize: 0), .paragraphStyle: paragraph,.foregroundColor: NSColor.secondaryLabelColor]))item.attributedTitle = labelitem.image = NSImage(systemSymbolName: machine.shared ? "person.2" : machine.local ? "laptopcomputer" : "desktopcomputer", accessibilityDescription: machine.shared ? "Shared machine" : nil)let submenu = NSMenu(title: machine.name)- submenu.font = HarnessTypography.font()for agent in machine.agents {let child = NSMenuItem(title: agent.title + (machine.shared ? " · View only" : ""), action: #selector(machineAgentAction(_:)), keyEquivalent: "")child.target = self@@ -552,7 +536,6 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation, NSMenuDelegate {private var localSections: [MenuGridSection] = []private func rebuildModelsMenu() {- modelsMenu.font = HarnessTypography.font()modelsMenu.removeAllItems()func label(_ title: String, in menu: NSMenu) {let item = NSMenuItem(title: title, action: nil, keyEquivalent: "")@@ -641,7 +624,6 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation, NSMenuDelegate {run.identifier = NSUserInterfaceItemIdentifier(HarnessKeymapMenu.actionPrefix + "runLocalModel")if machines.filter({ !$0.shared }).count > 1 {let pick = NSMenu(title: run.title)- pick.font = HarnessTypography.font()for machine in machines where !machine.shared {let item = NSMenuItem(title: machine.local ? "\(machine.name) (this computer)" : machine.name,action: #selector(runLocalModelAction(_:)), keyEquivalent: "")@@ -671,7 +653,6 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation, NSMenuDelegate {}private func rebuildHistoryMenu() {- historyMenu.font = HarnessTypography.font()historyMenu.removeAllItems()historyMenu.minimumWidth = 0let visited = Array(history.prefix(15))@@ -747,7 +728,6 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation, NSMenuDelegate {guard let edit = main.items.first(where: { $0.title == "Edit" })?.submenu,let find = edit.items.first(where: { $0.title == "Find" }) else { return }let menu = NSMenu(title: "Find")- menu.font = HarnessTypography.font()for (title, key, action, modifiers) in [("Find in Terminal…", "f", "findTerminal", NSEvent.ModifierFlags.command),("Find Next", "g", "findNext", NSEvent.ModifierFlags.command),@@ -909,12 +889,12 @@ private struct SwarmSubscriptionEntry: Equatable {/// follows starts something instead. Without it the action read as one more model, which is the/// mistake the in-app menu made before it grew this block.private final class SwarmMenuCaptionView: NSView {- private static var font: NSFont { HarnessTypography.font() }+ private static let font = NSFont.menuFont(ofSize: NSFont.smallSystemFontSize - 1)private let caption: NSTextFieldinit(text: String, width: CGFloat) {caption = NSTextField(labelWithString: text)- super.init(frame: NSRect(x: 0, y: 0, width: width, height: max(24, ceil(HarnessTypography.size * 1.35) + 6)))+ super.init(frame: NSRect(x: 0, y: 0, width: width, height: 24))autoresizingMask = [.width]caption.font = Self.fontcaption.textColor = .secondaryLabelColor@@ -958,12 +938,12 @@ private final class SwarmMenuCaptionView: NSView {/// both are done here: the fill follows `isHighlighted`, and the mouse dispatches the item's own/// target/action the way the menu would have.private final class SwarmMenuButtonView: NSView {- private static var font: NSFont { HarnessTypography.font() }+ private static let font = NSFont.menuFont(ofSize: 0)private let label: NSTextFieldinit(title: String, width: CGFloat) {label = NSTextField(labelWithString: title)- super.init(frame: NSRect(x: 0, y: 0, width: width, height: max(34, ceil(HarnessTypography.size * 1.35) + 12)))+ super.init(frame: NSRect(x: 0, y: 0, width: width, height: 34))autoresizingMask = [.width]label.font = Self.fontlabel.textColor = .labelColor@@ -1024,7 +1004,7 @@ private final class SwarmMenuButtonView: NSView {/// Read-only account information, with aligned trailing balances. There is no/// action or submenu to suggest another step just to read the remaining usage.private final class SwarmSubscriptionView: NSView {- private static var rowFont: NSFont { HarnessTypography.font() }+ private static let rowFont = NSFont.menuFont(ofSize: 0)let identity = NSTextField(labelWithString: "")let balance = NSTextField(labelWithString: "")private let icon = NSImageView()@@ -1056,7 +1036,7 @@ private final class SwarmSubscriptionView: NSView {/// which AppKit greys wholesale, so a served model looked unavailable beside the accounts above.init(title primary: String, account: String, status: String, icon: NSImage?, width: CGFloat,accessibility: String, tint: NSColor? = nil) {- super.init(frame: NSRect(x: 0, y: 0, width: width, height: max(26, ceil(HarnessTypography.size * 1.35) + 8)))+ super.init(frame: NSRect(x: 0, y: 0, width: width, height: 26))autoresizingMask = [.width]self.icon.image = iconself.icon.imageScaling = .scaleProportionallyDown@@ -1110,7 +1090,7 @@ private final class SwarmHistoryMenuRow: NSView {var highlighted = false { didSet { needsDisplay = true } }var machineFrame: NSRect {let width = ceil(SwarmMenuText.width(entry.menuMachine))- let font = HarnessTypography.font()+ let font = NSFont.menuFont(ofSize: 0)let height = ceil(font.ascender - font.descender + font.leading)return NSRect(x: bounds.width - 18 - width, y: (bounds.height - height) / 2, width: width, height: height)}@@ -1118,7 +1098,7 @@ private final class SwarmHistoryMenuRow: NSView {init(item: NSMenuItem, entry: SwarmHistoryEntry, width: CGFloat) {self.item = itemself.entry = entry- super.init(frame: NSRect(x: 0, y: 0, width: width, height: max(24, ceil(HarnessTypography.size * 1.35) + 6)))+ super.init(frame: NSRect(x: 0, y: 0, width: width, height: 24))autoresizingMask = [.width]setAccessibilityElement(true)setAccessibilityRole(.menuItem)@@ -1140,7 +1120,7 @@ private final class SwarmHistoryMenuRow: NSView {}let color = !item.isEnabled ? NSColor.disabledControlTextColor: selected ? .selectedMenuItemTextColor : .labelColor- let attributes: [NSAttributedString.Key: Any] = [.font: HarnessTypography.font(), .foregroundColor: color]+ let attributes: [NSAttributedString.Key: Any] = [.font: NSFont.menuFont(ofSize: 0), .foregroundColor: color]if item.state == .on {let mark = NSImage(systemSymbolName: "checkmark", accessibilityDescription: nil)!let tinted = mark.copy() as! NSImage@@ -1184,7 +1164,7 @@ private final class SwarmHistoryMenuRow: NSView {/// Keep native menu columns aligned without reserving a fixed, empty span.private enum SwarmMenuText {static func width(_ text: String) -> CGFloat {- (text as NSString).size(withAttributes: [.font: HarnessTypography.font()]).width+ (text as NSString).size(withAttributes: [.font: NSFont.menuFont(ofSize: 0)]).width}static func fitted(_ text: String, width limit: CGFloat) -> String {@@ -1216,11 +1196,11 @@ private struct SwarmHistoryEntry: Equatable {let engine: String?let iconAsset: String?let canReopen: Bool- var menuName: String { SwarmMenuText.fitted(title, width: (machineName.isEmpty ? 330 : 250) * HarnessTypography.size / 13) }- var menuMachine: String { SwarmMenuText.fitted(machineName, width: 140 * HarnessTypography.size / 13) }+ var menuName: String { SwarmMenuText.fitted(title, width: machineName.isEmpty ? 330 : 250) }+ var menuMachine: String { SwarmMenuText.fitted(machineName, width: 140) }func menuTitle(trailingEdge: CGFloat? = nil) -> NSAttributedString {- let font = HarnessTypography.font()+ let font = NSFont.menuFont(ofSize: 0)let name = menuNamelet machine = menuMachinelet paragraph = NSMutableParagraphStyle()@@ -1579,7 +1559,6 @@ private final class SwarmTabStrip: NSView {storeButton.font = HarnessTypography.font(weight: .medium)for tab in tabs {tab.labelFont = HarnessTypography.font()- if let menu = tab.menu { HarnessTypography.apply(to: menu) }}needsLayout = true}@@ -1604,7 +1583,6 @@ private final class SwarmTabStrip: NSView {let tab = previous[id] ?? SwarmTabButton(id: id)tab.palette = palettetab.labelFont = HarnessTypography.font()- tab.menu?.font = HarnessTypography.font()tab.name = row["name"] as? String ?? "New Tab"let count = row["agentCount"] as? Int ?? 0// The Harness Store tab holds no agents; without its own mark it would wear New Tab's plus.@@ -1775,6 +1753,10 @@ private final class SwarmTabButton: NSView, NSDraggingSource, NSMenuItemValidativar labelFont = HarnessTypography.font() {didSet { if oldValue != labelFont { invalidateLabel() } }}+ /// The ⌘1 badge: the tab's face one point under its label, so the name leads.+ private var badgeFont: NSFont {+ HarnessTypography.font(size: max(9, labelFont.pointSize - 1))+ }private var cachedLabel: NSAttributedString?var actionsEnabled = true {didSet {@@ -1812,7 +1794,6 @@ private final class SwarmTabButton: NSView, NSDraggingSource, NSMenuItemValidaticloseButton.action = #selector(closeSwarm)addSubview(closeButton)let menu = NSMenu()- menu.font = HarnessTypography.font()for (title, action) in [("Rename Tab…", #selector(renameSwarm)), ("Close Tab", #selector(closeSwarm))] {let item = NSMenuItem(title: title, action: action, keyEquivalent: "")item.target = self@@ -1917,7 +1898,7 @@ private final class SwarmTabButton: NSView, NSDraggingSource, NSMenuItemValidatilet label = self.labellet labelHeight = label.size().heightlet trailing = shortcut.map { value in- max(42, ceil(("⌘\(value)" as NSString).size(withAttributes: [.font: labelFont]).width) + 22)+ max(42, ceil(("⌘\(value)" as NSString).size(withAttributes: [.font: badgeFont]).width) + 22)} ?? 42label.draw(in: NSRect(x: 46, y: contentCenterY - labelHeight / 2,width: max(0, bounds.width - 46 - trailing), height: labelHeight))@@ -1933,7 +1914,7 @@ private final class SwarmTabButton: NSView, NSDraggingSource, NSMenuItemValidatilet paragraph = NSMutableParagraphStyle()paragraph.alignment = .rightlet badge = NSAttributedString(string: "⌘\(shortcut)",- attributes: [.font: labelFont,+ attributes: [.font: badgeFont,.foregroundColor: NSColor(white: 1, alpha: selected ? 0.7 : 0.5), .paragraphStyle: paragraph])let badgeHeight = badge.size().heightlet badgeWidth = max(32, ceil(badge.size().width))diff --git a/desktop/test/app_select_field_test.dart b/desktop/test/app_select_field_test.dartindex e272b3b2c..0745fbee4 100644--- a/desktop/test/app_select_field_test.dart+++ b/desktop/test/app_select_field_test.dart@@ -200,8 +200,8 @@ void main() {// 1. the tick, 2. the heavier label. (3. the accent wash is painted by an// `Ink` and is checked by eye, not here.)expect(find.byIcon(LucideIcons.check300), findsOneWidget);- expect(labelIn('Menlo').style?.fontWeight, grid.AppFont.semibold);- expect(labelIn('Helvetica Neue').style?.fontWeight, grid.AppFont.medium);+ expect(labelIn('Menlo').style?.fontWeight, grid.AppFont.medium);+ expect(labelIn('Helvetica Neue').style?.fontWeight, grid.AppFont.regular);});testWidgets('a note reads as an aside, not as part of the name', (diff --git a/desktop/test/desktop_window_test.dart b/desktop/test/desktop_window_test.dartindex f7207ad37..158310860 100644--- a/desktop/test/desktop_window_test.dart+++ b/desktop/test/desktop_window_test.dart@@ -6,6 +6,7 @@ import 'dart:io';import 'package:flutter/services.dart';import 'package:flutter_test/flutter_test.dart';import 'package:harness/core/desktop_window.dart';+import 'package:harness/shared/theme/app_type.dart';import 'package:harness/shared/theme/color_palette.dart';const _windowChannel = MethodChannel('window_manager');@@ -129,7 +130,7 @@ void main() {expect(nativeCalls.single.arguments, {'palette': HarnessPalette.graphite.nativeColors,'fontFamily': terminalFontStore.value.fontFamily,- 'fontSize': terminalFontStore.size,+ 'fontSize': AppType.chromeSize,'fontFallbacks': terminalFontStore.value.fontFamilyFallback,});expect(calls.indexOf('native:configure'), lessThan(calls.indexOf('show')));@@ -147,7 +148,7 @@ void main() {expect(nativeCalls.single.arguments, {'palette': palette.nativeColors,'fontFamily': terminalFontStore.value.fontFamily,- 'fontSize': terminalFontStore.size,+ 'fontSize': AppType.chromeSize,'fontFallbacks': terminalFontStore.value.fontFamilyFallback,});expect(diff --git a/desktop/test/settings_screen_test.dart b/desktop/test/settings_screen_test.dartindex 8ddd7a74c..400498a75 100644--- a/desktop/test/settings_screen_test.dart+++ b/desktop/test/settings_screen_test.dart@@ -74,8 +74,8 @@ void main() {testWidgets('Settings lists customization under Preferences', (tester) async {await openSettings(tester);- expect(find.text('Preferences'), findsOneWidget);- expect(find.text('Help'), findsOneWidget);+ expect(find.text('PREFERENCES'), findsOneWidget);+ expect(find.text('HELP'), findsOneWidget);expect(find.text('Usage'), findsNWidgets(2));expect(find.text('Customize'), findsOneWidget);expect(find.text('Keyboard shortcuts'), findsOneWidget);@@ -144,7 +144,7 @@ void main() {// Filtering the rail preserves the open pane.expect(find.text('Usage'), findsOneWidget);expect(find.text('Terminal'), findsNothing);- expect(find.text('Preferences'), findsNothing);+ expect(find.text('PREFERENCES'), findsNothing);await tester.enterText(find.byKey(const Key('settings-search-field')),diff --git a/desktop/test/shortcuts_deck_test.dart b/desktop/test/shortcuts_deck_test.dartindex afeff6115..a83b394eb 100644--- a/desktop/test/shortcuts_deck_test.dart+++ b/desktop/test/shortcuts_deck_test.dart@@ -227,7 +227,7 @@ void main() {child: Text(label,key: probe,- style: const TextStyle(fontSize: 11.5, height: 1),+ style: AppType.monoMeta(height: 1),),),const KeyCap('⇥'),diff --git a/desktop/test/terminal_ui_typography_test.dart b/desktop/test/terminal_ui_typography_test.dartindex 4fd14efbe..53a442456 100644--- a/desktop/test/terminal_ui_typography_test.dart+++ b/desktop/test/terminal_ui_typography_test.dart@@ -52,24 +52,38 @@ void main() {);}- void checkText(WidgetTester tester) {- var count = 0;+ final ramp = <double>{+ grid.AppType.displaySize,+ grid.AppType.titleSize,+ grid.AppType.headingSize,+ grid.AppType.bodySize,+ grid.AppType.monoLabelSize,+ grid.AppType.captionSize,+ };++ /// Every visible text is on the fixed scale, in the system face or the+ /// terminal's — and never at the terminal's own size unless it is one of the+ /// scale's steps. Returns each text's size so a caller can compare them+ /// across a terminal zoom.+ Map<String, double> checkText(WidgetTester tester) {+ final sizes = <String, double>{};void check(InlineSpan span, TextStyle inherited) {final style = inherited.merge(span.style);if (span is TextSpan) {- if (span.text?.trim().isNotEmpty == true &&+ final text = span.text?.trim();+ if (text?.isNotEmpty == true &&!['MaterialIcons','lucide','LucideIcons',].any((icon) => style.fontFamily?.contains(icon) == true)) {- expect(style.fontSize, terminalFontStore.size, reason: span.text);+ expect(ramp, contains(style.fontSize), reason: text);expect(- style.fontFamily,- terminalFontStore.value.fontFamily,- reason: span.text,+ [grid.AppType.sansFamily, grid.AppType.monoFamily],+ contains(style.fontFamily),+ reason: text,);- count++;+ sizes[text!] = style.fontSize!;}for (final child in span.children ?? <InlineSpan>[]) {check(child, style);@@ -83,11 +97,24 @@ void main() {for (final widget in tester.widgetList<EditableText>(find.byType(EditableText),)) {- expect(widget.style.fontSize, terminalFontStore.size);- expect(widget.style.fontFamily, terminalFontStore.value.fontFamily);+ // A field is on the scale, or it types into the terminal and follows it.+ expect({+ ...ramp,+ terminalFontStore.size,+ }, contains(widget.style.fontSize));}- expect(count, greaterThan(3));+ expect(sizes.length, greaterThan(3));expect(tester.takeException(), isNull);+ return sizes;+ }++ /// Zooming the terminal leaves every UI text where it was.+ void expectSameSizes(Map<String, double> before, Map<String, double> after) {+ for (final entry in after.entries) {+ if (before.containsKey(entry.key)) {+ expect(entry.value, before[entry.key], reason: entry.key);+ }+ }}Future<void> mount(@@ -124,45 +151,57 @@ void main() {await tester.pumpAndSettle();}- test('all theme roles and control styles use the selected terminal font', () {+ test('the theme keeps its scale whatever the terminal size', () {for (final size in [9.0, 13.0, 18.0, 22.0]) {selectFont(size);final theme = grid.buildAppTheme(brightness: Brightness.dark);final t = theme.textTheme;- for (final style in [- t.displayLarge,- t.displayMedium,- t.displaySmall,- t.headlineLarge,- t.headlineMedium,- t.headlineSmall,- t.titleLarge,- t.titleMedium,- t.titleSmall,- t.bodyLarge,- t.bodyMedium,- t.bodySmall,- t.labelLarge,- t.labelMedium,- t.labelSmall,- grid.kFieldTextStyle,- grid.AppFont.codeStyle(),- ]) {- expect(style!.fontSize, size);- expect(style.fontFamily, 'Menlo');+ final mono = grid.AppType.monoFamily;+ final sans = grid.AppType.sansFamily;+ // Headings, labels and what the user types are mono; prose is sans.+ final expected = {+ t.displayLarge: (grid.AppType.displaySize, mono),+ t.headlineSmall: (grid.AppType.titleSize, mono),+ t.titleLarge: (grid.AppType.titleSize, mono),+ t.titleMedium: (grid.AppType.headingSize, mono),+ t.titleSmall: (grid.AppType.bodySize, mono),+ t.labelLarge: (grid.AppType.bodySize, mono),+ t.labelSmall: (grid.AppType.monoMetaSize, mono),+ t.bodyLarge: (grid.AppType.bodySize, sans),+ t.bodyMedium: (grid.AppType.bodySize, sans),+ t.bodySmall: (grid.AppType.bodySize, sans),+ grid.kFieldTextStyle: (grid.AppType.monoSize, mono),+ theme.dialogTheme.titleTextStyle: (grid.AppType.headingSize, mono),+ theme.dialogTheme.contentTextStyle: (grid.AppType.bodySize, sans),+ theme.tooltipTheme.textStyle: (grid.AppType.captionSize, sans),+ };+ for (final entry in expected.entries) {+ expect(entry.key!.fontSize, entry.value.$1);+ expect(entry.key!.fontFamily, entry.value.$2);}- expect(- theme.inputDecorationTheme.contentPadding!- .resolve(TextDirection.ltr)- .vertical,- isNonNegative,- );- expect(grid.AppControl.heightFieldScaled, closeTo(36 * size / 13, .001));+ expect(grid.AppControl.heightFieldScaled, 36);+ expect(grid.AppControl.heightScaled, 32);}});+ test('mono takes the terminal face but not its size', () {+ selectFont(22);+ for (final (style, size) in [+ (grid.AppType.heading(), grid.AppType.headingSize),+ (grid.AppType.label(), grid.AppType.bodySize),+ (grid.AppType.mono(), grid.AppType.monoSize),+ (grid.AppType.monoLabel(), grid.AppType.monoLabelSize),+ (grid.AppType.monoMeta(), grid.AppType.monoMetaSize),+ (grid.AppFont.codeStyle(), grid.AppType.monoSize),+ ]) {+ expect(style.fontFamily, 'Menlo');+ expect(style.fontSize, size);+ }+ expect(terminalTextStyle().fontSize, 22);+ });+testWidgets(- 'tabs, panes, welcome, Cmd-N, Cmd-O and Cmd-P update while open',+ 'tabs, panes, welcome, Cmd-N, Cmd-O and Cmd-P keep the scale while the terminal zooms',(tester) async {final app = createApp();final map = MemoryKeymap();@@ -171,20 +210,20 @@ void main() {app.adoptSessionForTest(terminal('a0', []));selectFont(13);await mount(tester, app, map);- checkText(tester);+ final before = checkText(tester);selectFont(18, TerminalFontChoice.monaco);await tester.pumpAndSettle();- checkText(tester);+ expectSameSizes(before, checkText(tester));await key(tester, LogicalKeyboardKey.keyT, cmd: true);expect(find.byType(WorkspaceWelcome), findsOneWidget);checkText(tester);await key(tester, LogicalKeyboardKey.keyN, cmd: true);expect(find.byType(NewHarnessBox), findsOneWidget);- checkText(tester);+ final box = checkText(tester);selectFont(22);await tester.pumpAndSettle();- checkText(tester);+ expectSameSizes(box, checkText(tester));await key(tester, LogicalKeyboardKey.escape);for (final shortcut in [LogicalKeyboardKey.keyO,@@ -196,7 +235,7 @@ void main() {await key(tester, LogicalKeyboardKey.arrowUp);await tester.pumpAndSettle();expect(find.byType(SwarmSearchPreview), findsOneWidget);- checkText(tester);+ final search = checkText(tester);selectFont(shortcut == LogicalKeyboardKey.keyO ? 9 : 18,TerminalFontChoice.monaco,@@ -204,60 +243,61 @@ void main() {await tester.pumpAndSettle();expect(tester.widget<TextField>(input).controller!.text, 'Agent');expect(tester.widget<TextField>(input).focusNode!.hasFocus, isTrue);- checkText(tester);+ expectSameSizes(search, checkText(tester));await key(tester, LogicalKeyboardKey.escape);}await tester.pumpWidget(const SizedBox());},);- testWidgets(- 'rename and stop forms follow family and size without reopening',- (tester) async {- final app = createApp();- final map = MemoryKeymap();- addTearDown(app.dispose);- addTearDown(map.dispose);- app.adoptSessionForTest(terminal('a0', []));- selectFont(13);- await mount(tester, app, map);- final context = tester.element(find.byType(SwarmScreen));- unawaited(showSwarmRenameDialog(context, 'My project', keymap: map));- await tester.pumpAndSettle();- checkText(tester);- selectFont(22, TerminalFontChoice.monaco);- await tester.pumpAndSettle();- checkText(tester);- expect(- tester- .widget<TextField>(find.byKey(const Key('tab-rename-input')))- .controller!- .text,+ testWidgets('rename and stop forms keep the scale while the terminal zooms', (+ tester,+ ) async {+ final app = createApp();+ final map = MemoryKeymap();+ addTearDown(app.dispose);+ addTearDown(map.dispose);+ app.adoptSessionForTest(terminal('a0', []));+ selectFont(13);+ await mount(tester, app, map);+ final context = tester.element(find.byType(SwarmScreen));+ unawaited(showSwarmRenameDialog(context, 'My project', keymap: map));+ await tester.pumpAndSettle();+ final rename = checkText(tester);+ selectFont(22, TerminalFontChoice.monaco);+ await tester.pumpAndSettle();+ expectSameSizes(rename, checkText(tester));+ expect(+ tester+ .widget<TextField>(find.byKey(const Key('tab-rename-input')))+ .controller!+ .text,+ 'My project',+ );+ await key(tester, LogicalKeyboardKey.escape);+ unawaited(+ confirmDeleteAgent(+ context,+ app,+ 'm',+ 'a0','My project',- );- await key(tester, LogicalKeyboardKey.escape);- unawaited(- confirmDeleteAgent(- context,- app,- 'm',- 'a0',- 'My project',- engine: 'codex',- keymap: map,- ),- );- await tester.pumpAndSettle();- checkText(tester);- selectFont(9);- await tester.pumpAndSettle();- checkText(tester);- await key(tester, LogicalKeyboardKey.escape);- await tester.pumpWidget(const SizedBox());- },- );+ engine: 'codex',+ keymap: map,+ ),+ );+ await tester.pumpAndSettle();+ final stop = checkText(tester);+ selectFont(9);+ await tester.pumpAndSettle();+ expectSameSizes(stop, checkText(tester));+ await key(tester, LogicalKeyboardKey.escape);+ await tester.pumpWidget(const SizedBox());+ });- testWidgets('native tab payload follows the same font live', (tester) async {+ testWidgets('native tabs take the terminal face at the chrome size', (+ tester,+ ) async {final updates = <Map<dynamic, dynamic>>[];const channel = MethodChannel('harness/swarm_tabs');tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(channel, (@@ -281,7 +321,7 @@ void main() {selectFont(22, TerminalFontChoice.monaco);await tester.pumpAndSettle();expect(updates.last['fontFamily'], 'Monaco');- expect(updates.last['fontSize'], 22);+ expect(updates.last['fontSize'], grid.AppType.chromeSize);await tester.pumpWidget(const SizedBox());});}diff --git a/desktop/tool/swarm_titlebar_checks.swift b/desktop/tool/swarm_titlebar_checks.swiftindex c1dfc3185..7289c9796 100644--- a/desktop/tool/swarm_titlebar_checks.swift+++ b/desktop/tool/swarm_titlebar_checks.swift@@ -120,25 +120,25 @@ private extension SwarmTabStrip {}func checkSharedTypography() throws {- defer { HarnessTypography.update(["fontFamily": ".AppleSystemUIFontMonospaced", "fontSize": 13]) }- for size in [CGFloat(9), 13, 22] {+ defer { HarnessTypography.update(["fontFamily": ".AppleSystemUIFontMonospaced", "fontSize": 12]) }+ let menuFont = NSFont.menuFont(ofSize: 0)+ for size in [CGFloat(12), 14] {update(["tabs": [["id": "font-tab", "name": "Typography"]], "activeId": "font-tab","enabled": true, "fontFamily": "Menlo", "fontSize": size])let tab = tabs[0]try checkTitlebar(tab.labelFont.pointSize == size && tab.labelFont.familyName == "Menlo",- "Native tab uses the terminal face and size")+ "Native tab uses the terminal face at the chrome size Flutter sends")try checkTitlebar(storeButton.font?.pointSize == size && storeButton.font?.familyName == "Menlo",- "Native store action uses the terminal face and size")- try checkTitlebar(tab.menu?.font.pointSize == size,- "Native tab menu follows the terminal font")+ "Native store action uses the terminal face at the chrome size")+ try checkTitlebar(tab.menu?.font.familyName == menuFont.familyName && tab.menu?.font.pointSize == menuFont.pointSize,+ "Native tab menu keeps the system menu font")let history = SwarmHistoryEntry(["id": "font", "title": "Project", "machineName": "Machine"])!let font = history.menuTitle().attribute(.font, at: 0, effectiveRange: nil) as! NSFont- try checkTitlebar(font.pointSize == size && font.familyName == "Menlo",- "Native history uses the terminal face and size")+ try checkTitlebar(font == menuFont, "Native history keeps the system menu font")let item = NSMenuItem()let row = SwarmHistoryMenuRow(item: item, entry: history, width: 400)try checkTitlebar(row.machineFrame.minY >= 0 && row.machineFrame.maxY <= row.bounds.height,- "Native history text fits at every supported point size")+ "Native history text fits its row")}}@@ -740,9 +740,9 @@ private extension SwarmTitlebar {try checkTitlebar(messenger.calls.last?.method == "machineList","Machines Manager opens through the Flutter command bridge")let destinations = machineMenu.items.filter { $0.action == #selector(machineAction(_:)) }- try checkTitlebar(machineMenu.minimumWidth == 0 && machineMenu.size.width < SwarmMenuText.width(String(repeating: "M", count: 80)) &&+ try checkTitlebar(machineMenu.minimumWidth == 0 && machineMenu.size.width < 432 &&destinations.first?.attributedTitle?.string.hasSuffix("\t2 harnesses") == true,- "Machines sizes with the selected font and aligns harness counts")+ "Machines gives labels twenty percent more room with aligned counts")try checkTitlebar(destinations.map { $0.representedObject as? String } == ["office", "home"],"Machines lists each linked computer as a destination")try checkTitlebar(destinations[0].attributedTitle?.string.contains("Online") == true &&