Merge commit 'a823a6e8a398ab1327ff22f9c393d970e52a6f4b' into pipelines/run-20261111-1947-use-desktop-dialogs-for-remaining-sheets-4d07
This commit is contained in:
@@ -1,9 +1,7 @@
|
|||||||
import '../ui/adaptive/platform.dart';
|
|
||||||
import '../ui/adaptive/window_margins.dart';
|
import '../ui/adaptive/window_margins.dart';
|
||||||
import '../ui/theme/app_font_controller.dart';
|
import '../ui/theme/app_font_controller.dart';
|
||||||
import '../ui/theme/app_theme.dart';
|
import '../ui/theme/app_theme.dart';
|
||||||
import '../ui/scale/ui_scale.dart';
|
import '../ui/scale/ui_scale.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../shell/adaptive_shell.dart';
|
import '../shell/adaptive_shell.dart';
|
||||||
@@ -35,6 +33,9 @@ class MyApp extends StatelessWidget {
|
|||||||
onDestinationSelected = null;
|
onDestinationSelected = null;
|
||||||
|
|
||||||
final Map<AppDestination, WidgetBuilder> destinationBodies;
|
final Map<AppDestination, WidgetBuilder> destinationBodies;
|
||||||
|
|
||||||
|
/// Retained for source compatibility with older callers; Material is the
|
||||||
|
/// only application host.
|
||||||
final bool? cupertino;
|
final bool? cupertino;
|
||||||
final AppDestination? destination;
|
final AppDestination? destination;
|
||||||
final ValueChanged<AppDestination>? onDestinationSelected;
|
final ValueChanged<AppDestination>? onDestinationSelected;
|
||||||
@@ -55,28 +56,6 @@ class MyApp extends StatelessWidget {
|
|||||||
|
|
||||||
Widget _host(String? fontFamily) {
|
Widget _host(String? fontFamily) {
|
||||||
final router = routerConfig;
|
final router = routerConfig;
|
||||||
if (cupertino ?? _platformIsCupertino) {
|
|
||||||
final theme = appCupertinoThemeWith(fontFamily: fontFamily);
|
|
||||||
if (router != null) {
|
|
||||||
return CupertinoApp.router(
|
|
||||||
title: 'Pipelines',
|
|
||||||
builder: _scaled,
|
|
||||||
theme: theme,
|
|
||||||
routerConfig: router,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return CupertinoApp(
|
|
||||||
title: 'Pipelines',
|
|
||||||
builder: _scaled,
|
|
||||||
theme: theme,
|
|
||||||
home: AdaptiveShell(
|
|
||||||
destinationBodies: destinationBodies,
|
|
||||||
cupertino: true,
|
|
||||||
destination: destination,
|
|
||||||
onDestinationSelected: onDestinationSelected,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (router != null) {
|
if (router != null) {
|
||||||
return MaterialApp.router(
|
return MaterialApp.router(
|
||||||
title: 'Pipelines',
|
title: 'Pipelines',
|
||||||
@@ -101,8 +80,6 @@ class MyApp extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get _platformIsCupertino => prefersCupertino();
|
|
||||||
|
|
||||||
static Widget _scaled(BuildContext context, Widget? child) => UiScaleHost(
|
static Widget _scaled(BuildContext context, Widget? child) => UiScaleHost(
|
||||||
child: WindowMargins(child: child ?? const SizedBox.shrink()),
|
child: WindowMargins(child: child ?? const SizedBox.shrink()),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'app_route.dart';
|
import 'app_route.dart';
|
||||||
@@ -47,7 +46,7 @@ String routeLocation(Uri uri) {
|
|||||||
class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
||||||
AppRouterDelegate({
|
AppRouterDelegate({
|
||||||
required this.builder,
|
required this.builder,
|
||||||
required this.cupertino,
|
this.cupertino,
|
||||||
this.searchBuilder,
|
this.searchBuilder,
|
||||||
this.templatesBuilder,
|
this.templatesBuilder,
|
||||||
this.schedulesBuilder,
|
this.schedulesBuilder,
|
||||||
@@ -75,7 +74,9 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
|||||||
/// state and selection, and the standard navigation bar supplies Back.
|
/// state and selection, and the standard navigation bar supplies Back.
|
||||||
final Widget Function(BuildContext context)? searchBuilder;
|
final Widget Function(BuildContext context)? searchBuilder;
|
||||||
|
|
||||||
final bool cupertino;
|
/// Retained for compatibility with older composition callers. Routes use
|
||||||
|
/// Material pages on every platform.
|
||||||
|
final bool? cupertino;
|
||||||
|
|
||||||
final _navigatorKey = GlobalKey<NavigatorState>();
|
final _navigatorKey = GlobalKey<NavigatorState>();
|
||||||
static const _pageKey = ValueKey<String>('pipelines-shell');
|
static const _pageKey = ValueKey<String>('pipelines-shell');
|
||||||
@@ -119,9 +120,7 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
|||||||
AppRoute get currentConfiguration => _route;
|
AppRoute get currentConfiguration => _route;
|
||||||
|
|
||||||
Page<void> _page(LocalKey key, Widget child, {bool dialog = false}) =>
|
Page<void> _page(LocalKey key, Widget child, {bool dialog = false}) =>
|
||||||
cupertino
|
MaterialPage<void>(key: key, child: child, fullscreenDialog: dialog);
|
||||||
? CupertinoPage<void>(key: key, child: child, fullscreenDialog: dialog)
|
|
||||||
: MaterialPage<void>(key: key, child: child, fullscreenDialog: dialog);
|
|
||||||
|
|
||||||
/// A page-based Navigator supplies the Overlay, overlay portals and route
|
/// A page-based Navigator supplies the Overlay, overlay portals and route
|
||||||
/// context that native controls (action sheets, tooltips) require. The shell
|
/// context that native controls (action sheets, tooltips) require. The shell
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
|
|||||||
import '../features/chat/chat_runtime.dart';
|
import '../features/chat/chat_runtime.dart';
|
||||||
import '../features/chat/screen.dart';
|
import '../features/chat/screen.dart';
|
||||||
import '../features/chat/windows/chat_windows.dart';
|
import '../features/chat/windows/chat_windows.dart';
|
||||||
import '../ui/adaptive/host.dart';
|
|
||||||
import '../ui/adaptive/top_bar_notices.dart';
|
import '../ui/adaptive/top_bar_notices.dart';
|
||||||
import 'app_session.dart';
|
import 'app_session.dart';
|
||||||
import 'connection_status.dart';
|
import 'connection_status.dart';
|
||||||
@@ -48,7 +47,6 @@ class ChatDestination extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) => AnimatedBuilder(
|
Widget build(BuildContext context) => AnimatedBuilder(
|
||||||
animation: Listenable.merge([session, ?pool]),
|
animation: Listenable.merge([session, ?pool]),
|
||||||
builder: (context, _) {
|
builder: (context, _) {
|
||||||
final cupertino = usesCupertinoHost(context);
|
|
||||||
// Saved machines connect independently; their state and sign-in live
|
// Saved machines connect independently; their state and sign-in live
|
||||||
// in Settings, so the chat itself carries no connection chrome.
|
// in Settings, so the chat itself carries no connection chrome.
|
||||||
if (pool != null && pool!.servers.catalog.servers.isNotEmpty) {
|
if (pool != null && pool!.servers.catalog.servers.isNotEmpty) {
|
||||||
@@ -56,28 +54,17 @@ class ChatDestination extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
if ((server.requiresConfiguration || server.error != null) &&
|
if ((server.requiresConfiguration || server.error != null) &&
|
||||||
session.endpoint == null) {
|
session.endpoint == null) {
|
||||||
return ConnectionGate(
|
return ConnectionGate(session: session, server: server);
|
||||||
session: session,
|
|
||||||
server: server,
|
|
||||||
cupertino: cupertino,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (!session.everConnected) {
|
if (!session.everConnected) {
|
||||||
if (session.connected) return _chatScreen();
|
if (session.connected) return _chatScreen();
|
||||||
return ConnectionGate(
|
return ConnectionGate(session: session, server: server);
|
||||||
session: session,
|
|
||||||
server: server,
|
|
||||||
cupertino: cupertino,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
// The banner stays below the top bar; without it the chat screen
|
// The banner stays below the top bar; without it the chat screen
|
||||||
// reaches the top edge (an open chat beside the list draws its own bar
|
// reaches the top edge (an open chat beside the list draws its own bar
|
||||||
// there).
|
// there).
|
||||||
return TopBarNotices(
|
return TopBarNotices(
|
||||||
notices: [
|
notices: [if (!session.connected) ConnectionBanner(session: session)],
|
||||||
if (!session.connected)
|
|
||||||
ConnectionBanner(session: session, cupertino: cupertino),
|
|
||||||
],
|
|
||||||
child: _chatScreen(),
|
child: _chatScreen(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../core/transport/connection_state.dart';
|
import '../core/transport/connection_state.dart';
|
||||||
@@ -15,12 +14,12 @@ class ConnectionGate extends StatelessWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.session,
|
required this.session,
|
||||||
required this.server,
|
required this.server,
|
||||||
required this.cupertino,
|
this.cupertino,
|
||||||
});
|
});
|
||||||
|
|
||||||
final AppSession session;
|
final AppSession session;
|
||||||
final ServerEndpoint server;
|
final ServerEndpoint server;
|
||||||
final bool cupertino;
|
final bool? cupertino;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -75,18 +74,14 @@ class ConnectionGate extends StatelessWidget {
|
|||||||
if (progress)
|
if (progress)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 12),
|
padding: const EdgeInsets.only(bottom: 12),
|
||||||
child: cupertino
|
child: const CircularProgressIndicator(),
|
||||||
? const CupertinoActivityIndicator()
|
|
||||||
: const CircularProgressIndicator(),
|
|
||||||
),
|
),
|
||||||
Semantics(
|
Semantics(
|
||||||
liveRegion: true,
|
liveRegion: true,
|
||||||
child: Text(
|
child: Text(
|
||||||
title,
|
title,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: cupertino
|
style: theme.textTheme.titleMedium,
|
||||||
? CupertinoTheme.of(context).textTheme.navTitleTextStyle
|
|
||||||
: theme.textTheme.titleMedium,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (detail.isNotEmpty) ...[
|
if (detail.isNotEmpty) ...[
|
||||||
@@ -94,15 +89,12 @@ class ConnectionGate extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
detail,
|
detail,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: cupertino ? null : theme.textTheme.bodyMedium,
|
style: theme.textTheme.bodyMedium,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
if (onRetry != null) ...[
|
if (onRetry != null) ...[
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
if (cupertino)
|
FilledButton(onPressed: onRetry, child: const Text('Retry')),
|
||||||
CupertinoButton(onPressed: onRetry, child: const Text('Retry'))
|
|
||||||
else
|
|
||||||
FilledButton(onPressed: onRetry, child: const Text('Retry')),
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -113,14 +105,10 @@ class ConnectionGate extends StatelessWidget {
|
|||||||
|
|
||||||
/// A compact status bar above retained content after the first connection.
|
/// A compact status bar above retained content after the first connection.
|
||||||
class ConnectionBanner extends StatelessWidget {
|
class ConnectionBanner extends StatelessWidget {
|
||||||
const ConnectionBanner({
|
const ConnectionBanner({super.key, required this.session, this.cupertino});
|
||||||
super.key,
|
|
||||||
required this.session,
|
|
||||||
required this.cupertino,
|
|
||||||
});
|
|
||||||
|
|
||||||
final AppSession session;
|
final AppSession session;
|
||||||
final bool cupertino;
|
final bool? cupertino;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -145,25 +133,19 @@ class ConnectionBanner extends StatelessWidget {
|
|||||||
detail = 'Check that the Pipelines server is running.';
|
detail = 'Check that the Pipelines server is running.';
|
||||||
onRetry = session.retry;
|
onRetry = session.retry;
|
||||||
}
|
}
|
||||||
final textStyle = cupertino
|
final textStyle = Theme.of(context).textTheme.bodyMedium;
|
||||||
? CupertinoTheme.of(context).textTheme.textStyle
|
|
||||||
: Theme.of(context).textTheme.bodyMedium;
|
|
||||||
return ColoredBox(
|
return ColoredBox(
|
||||||
color: cupertino
|
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||||
? CupertinoDynamicColor.resolve(CupertinoColors.systemGrey5, context)
|
|
||||||
: Theme.of(context).colorScheme.surfaceContainerHighest,
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (reconnecting) ...[
|
if (reconnecting) ...[
|
||||||
cupertino
|
const SizedBox(
|
||||||
? const CupertinoActivityIndicator(radius: 7)
|
width: 14,
|
||||||
: const SizedBox(
|
height: 14,
|
||||||
width: 14,
|
child: CircularProgressIndicator(strokeWidth: 2),
|
||||||
height: 14,
|
),
|
||||||
child: CircularProgressIndicator(strokeWidth: 2),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
],
|
],
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -179,14 +161,7 @@ class ConnectionBanner extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
if (cupertino)
|
TextButton(onPressed: onRetry, child: const Text('Retry')),
|
||||||
CupertinoButton(
|
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
onPressed: onRetry,
|
|
||||||
child: const Text('Retry'),
|
|
||||||
)
|
|
||||||
else
|
|
||||||
TextButton(onPressed: onRetry, child: const Text('Retry')),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import '../core/servers/chat/chat_server_pool.dart';
|
|||||||
import '../core/servers/server_context.dart';
|
import '../core/servers/server_context.dart';
|
||||||
import '../core/servers/elevation/elevation_dialog.dart';
|
import '../core/servers/elevation/elevation_dialog.dart';
|
||||||
import '../core/servers/elevation/machine_elevation.dart';
|
import '../core/servers/elevation/machine_elevation.dart';
|
||||||
import '../ui/adaptive/platform.dart';
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
@@ -338,7 +337,8 @@ class _PipelinesAppState extends State<PipelinesApp>
|
|||||||
type: RouteInformationReportingType.neglect,
|
type: RouteInformationReportingType.neglect,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
_cupertino = widget.cupertino ?? _platformIsCupertino;
|
// Kept as a compatibility field on the widget; composition is Material-only.
|
||||||
|
_cupertino = false;
|
||||||
_notifications.onOpenRun = (id) {
|
_notifications.onOpenRun = (id) {
|
||||||
if (mounted) _delegate.goTo(AppRoute.run(id));
|
if (mounted) _delegate.goTo(AppRoute.run(id));
|
||||||
};
|
};
|
||||||
@@ -954,6 +954,4 @@ class _PipelinesAppState extends State<PipelinesApp>
|
|||||||
AppDestination.search => AppRoute.search,
|
AppDestination.search => AppRoute.search,
|
||||||
AppDestination.settings => AppRoute.settings,
|
AppDestination.settings => AppRoute.settings,
|
||||||
};
|
};
|
||||||
|
|
||||||
bool get _platformIsCupertino => prefersCupertino();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
|||||||
import '../core/servers/server_scope.dart';
|
import '../core/servers/server_scope.dart';
|
||||||
|
|
||||||
import '../features/pipelines/screen.dart';
|
import '../features/pipelines/screen.dart';
|
||||||
import '../ui/adaptive/host.dart';
|
|
||||||
import '../ui/adaptive/top_bar_notices.dart';
|
import '../ui/adaptive/top_bar_notices.dart';
|
||||||
import 'app_session.dart';
|
import 'app_session.dart';
|
||||||
import 'connection_status.dart';
|
import 'connection_status.dart';
|
||||||
@@ -64,30 +63,18 @@ class PipelinesDestination extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) => AnimatedBuilder(
|
Widget build(BuildContext context) => AnimatedBuilder(
|
||||||
animation: session,
|
animation: session,
|
||||||
builder: (context, _) {
|
builder: (context, _) {
|
||||||
final cupertino = usesCupertinoHost(context);
|
|
||||||
if ((server.requiresConfiguration || server.error != null) &&
|
if ((server.requiresConfiguration || server.error != null) &&
|
||||||
session.endpoint == null) {
|
session.endpoint == null) {
|
||||||
return ConnectionGate(
|
return ConnectionGate(session: session, server: server);
|
||||||
session: session,
|
|
||||||
server: server,
|
|
||||||
cupertino: cupertino,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (!session.everConnected) {
|
if (!session.everConnected) {
|
||||||
if (session.connected) return _pipelinesScreen();
|
if (session.connected) return _pipelinesScreen();
|
||||||
return ConnectionGate(
|
return ConnectionGate(session: session, server: server);
|
||||||
session: session,
|
|
||||||
server: server,
|
|
||||||
cupertino: cupertino,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
// The banner stays below the top bar; without it the pipelines reach
|
// The banner stays below the top bar; without it the pipelines reach
|
||||||
// the top edge and scroll behind the bar.
|
// the top edge and scroll behind the bar.
|
||||||
return TopBarNotices(
|
return TopBarNotices(
|
||||||
notices: [
|
notices: [if (!session.connected) ConnectionBanner(session: session)],
|
||||||
if (!session.connected)
|
|
||||||
ConnectionBanner(session: session, cupertino: cupertino),
|
|
||||||
],
|
|
||||||
child: _pipelinesScreen(),
|
child: _pipelinesScreen(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import '../core/servers/chat/chat_server_pool.dart';
|
import '../core/servers/chat/chat_server_pool.dart';
|
||||||
import '../ui/adaptive/platform.dart';
|
|
||||||
import '../ui/adaptive/window_margins.dart';
|
import '../ui/adaptive/window_margins.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
@@ -307,8 +305,6 @@ class _PipelinesRootState extends State<PipelinesRoot> {
|
|||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get _cupertino => prefersCupertino();
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (_booting) {
|
if (_booting) {
|
||||||
@@ -318,15 +314,10 @@ class _PipelinesRootState extends State<PipelinesRoot> {
|
|||||||
view: View.of(context),
|
view: View.of(context),
|
||||||
child: Directionality(
|
child: Directionality(
|
||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
child: _cupertino
|
child: Theme(
|
||||||
? const CupertinoTheme(
|
data: appLightTheme(),
|
||||||
data: appCupertinoTheme,
|
child: const Center(child: CircularProgressIndicator()),
|
||||||
child: Center(child: CupertinoActivityIndicator()),
|
),
|
||||||
)
|
|
||||||
: Theme(
|
|
||||||
data: appLightTheme(),
|
|
||||||
child: const Center(child: CircularProgressIndicator()),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -368,26 +359,16 @@ class _PipelinesRootState extends State<PipelinesRoot> {
|
|||||||
final fonts = AppFontController.instance;
|
final fonts = AppFontController.instance;
|
||||||
return ListenableBuilder(
|
return ListenableBuilder(
|
||||||
listenable: fonts,
|
listenable: fonts,
|
||||||
builder: (context, _) => _cupertino
|
builder: (context, _) => MaterialApp(
|
||||||
? CupertinoApp(
|
title: 'Pipelines',
|
||||||
title: 'Pipelines',
|
builder: (context, child) => UiScaleHost(
|
||||||
builder: (context, child) => UiScaleHost(
|
child: WindowMargins(child: child ?? const SizedBox.shrink()),
|
||||||
child: WindowMargins(child: child ?? const SizedBox.shrink()),
|
),
|
||||||
),
|
theme: appLightTheme(fontFamily: fonts.family),
|
||||||
theme: appCupertinoThemeWith(fontFamily: fonts.family),
|
darkTheme: appDarkTheme(fontFamily: fonts.family),
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
home: flow,
|
home: flow,
|
||||||
)
|
),
|
||||||
: MaterialApp(
|
|
||||||
title: 'Pipelines',
|
|
||||||
builder: (context, child) => UiScaleHost(
|
|
||||||
child: WindowMargins(child: child ?? const SizedBox.shrink()),
|
|
||||||
),
|
|
||||||
theme: appLightTheme(fontFamily: fonts.family),
|
|
||||||
darkTheme: appDarkTheme(fontFamily: fonts.family),
|
|
||||||
debugShowCheckedModeBanner: false,
|
|
||||||
home: flow,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import '../features/attention/notify/notification_controller.dart';
|
|||||||
import '../features/attention/runtime/attention_controller.dart';
|
import '../features/attention/runtime/attention_controller.dart';
|
||||||
import '../features/runs/screen.dart';
|
import '../features/runs/screen.dart';
|
||||||
import '../features/runs/ui/run_pipeline_link.dart';
|
import '../features/runs/ui/run_pipeline_link.dart';
|
||||||
import '../ui/adaptive/host.dart';
|
|
||||||
import '../ui/adaptive/top_bar_notices.dart';
|
import '../ui/adaptive/top_bar_notices.dart';
|
||||||
import 'app_session.dart';
|
import 'app_session.dart';
|
||||||
import 'connection_status.dart';
|
import 'connection_status.dart';
|
||||||
@@ -69,22 +68,13 @@ class RunsDestination extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) => AnimatedBuilder(
|
Widget build(BuildContext context) => AnimatedBuilder(
|
||||||
animation: session,
|
animation: session,
|
||||||
builder: (context, _) {
|
builder: (context, _) {
|
||||||
final cupertino = usesCupertinoHost(context);
|
|
||||||
if ((server.requiresConfiguration || server.error != null) &&
|
if ((server.requiresConfiguration || server.error != null) &&
|
||||||
session.endpoint == null) {
|
session.endpoint == null) {
|
||||||
return ConnectionGate(
|
return ConnectionGate(session: session, server: server);
|
||||||
session: session,
|
|
||||||
server: server,
|
|
||||||
cupertino: cupertino,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (!session.everConnected) {
|
if (!session.everConnected) {
|
||||||
if (session.connected) return _runsScreen();
|
if (session.connected) return _runsScreen();
|
||||||
return ConnectionGate(
|
return ConnectionGate(session: session, server: server);
|
||||||
session: session,
|
|
||||||
server: server,
|
|
||||||
cupertino: cupertino,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
// The banner stays below the top bar; without it the runs reach the top
|
// The banner stays below the top bar; without it the runs reach the top
|
||||||
// edge and scroll behind the bar.
|
// edge and scroll behind the bar.
|
||||||
@@ -92,7 +82,7 @@ class RunsDestination extends StatelessWidget {
|
|||||||
notices: [
|
notices: [
|
||||||
if (!session.connected ||
|
if (!session.connected ||
|
||||||
session.subscription == RunSubscriptionState.refused)
|
session.subscription == RunSubscriptionState.refused)
|
||||||
ConnectionBanner(session: session, cupertino: cupertino),
|
ConnectionBanner(session: session),
|
||||||
],
|
],
|
||||||
child: _runsScreen(),
|
child: _runsScreen(),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import '../ui/adaptive/segmented_bar.dart';
|
import '../ui/adaptive/segmented_bar.dart';
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../features/schedules/data/schedules_repository.dart';
|
import '../features/schedules/data/schedules_repository.dart';
|
||||||
@@ -9,7 +8,6 @@ import '../features/schedules/ui/list/schedule_list_controller.dart';
|
|||||||
import '../features/schedules/ui/list/schedule_list_toolbar.dart'
|
import '../features/schedules/ui/list/schedule_list_toolbar.dart'
|
||||||
show ScheduleRefreshAction;
|
show ScheduleRefreshAction;
|
||||||
import '../features/schedules/ui/list/schedule_list_view.dart';
|
import '../features/schedules/ui/list/schedule_list_view.dart';
|
||||||
import '../ui/adaptive/host.dart';
|
|
||||||
import 'app_session.dart';
|
import 'app_session.dart';
|
||||||
import 'server_endpoint.dart';
|
import 'server_endpoint.dart';
|
||||||
|
|
||||||
@@ -94,24 +92,23 @@ class _SchedulesDestinationState extends State<SchedulesDestination> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final cupertino = usesCupertinoHost(context);
|
|
||||||
// The page is built inside the builder from the session's connection and
|
// The page is built inside the builder from the session's connection and
|
||||||
// the list controller's state; the list view itself does not listen, so a
|
// the list controller's state; the list view itself does not listen, so a
|
||||||
// finished read would otherwise stay on `Loading schedules…`.
|
// finished read would otherwise stay on `Loading schedules…`.
|
||||||
return AnimatedBuilder(
|
return AnimatedBuilder(
|
||||||
animation: Listenable.merge([widget.session, _controller]),
|
animation: Listenable.merge([widget.session, _controller]),
|
||||||
builder: (context, _) => _page(cupertino),
|
builder: (context, _) => _page(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _page(bool cupertino) {
|
Widget _page() {
|
||||||
final body = _body(cupertino);
|
final body = _body();
|
||||||
// The round Back closes the page; Refresh sits in the actions pill.
|
// The round Back closes the page; Refresh sits in the actions pill.
|
||||||
final bar = SegmentedBar(
|
final bar = SegmentedBar(
|
||||||
cupertino: cupertino,
|
cupertino: false,
|
||||||
leading: SegmentedBackButton(
|
leading: SegmentedBackButton(
|
||||||
key: schedulesPageBackKey,
|
key: schedulesPageBackKey,
|
||||||
cupertino: cupertino,
|
cupertino: false,
|
||||||
onPressed: widget.onBack,
|
onPressed: widget.onBack,
|
||||||
),
|
),
|
||||||
title: 'Schedules',
|
title: 'Schedules',
|
||||||
@@ -119,23 +116,17 @@ class _SchedulesDestinationState extends State<SchedulesDestination> {
|
|||||||
if (widget.session.everConnected)
|
if (widget.session.everConnected)
|
||||||
ScheduleRefreshAction(
|
ScheduleRefreshAction(
|
||||||
controller: _controller,
|
controller: _controller,
|
||||||
cupertino: cupertino,
|
cupertino: false,
|
||||||
onRefresh: () => unawaited(_controller.refresh()),
|
onRefresh: () => unawaited(_controller.refresh()),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
// The page reaches its top edge: the search strip floats under the bar
|
// The page reaches its top edge: the search strip floats under the bar
|
||||||
// and the list scrolls behind both.
|
// and the list scrolls behind both.
|
||||||
if (cupertino) {
|
|
||||||
return CupertinoPageScaffold(
|
|
||||||
navigationBar: bar,
|
|
||||||
child: SafeArea(top: false, bottom: false, child: body),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return Scaffold(extendBodyBehindAppBar: true, appBar: bar, body: body);
|
return Scaffold(extendBodyBehindAppBar: true, appBar: bar, body: body);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _body(bool cupertino) {
|
Widget _body() {
|
||||||
if (!widget.session.everConnected) {
|
if (!widget.session.everConnected) {
|
||||||
return const Center(
|
return const Center(
|
||||||
child: Text('Connect to the server to see schedules.'),
|
child: Text('Connect to the server to see schedules.'),
|
||||||
@@ -145,7 +136,7 @@ class _SchedulesDestinationState extends State<SchedulesDestination> {
|
|||||||
controller: _controller,
|
controller: _controller,
|
||||||
searchController: _search,
|
searchController: _search,
|
||||||
scrollController: _scroll,
|
scrollController: _scroll,
|
||||||
cupertino: cupertino,
|
cupertino: false,
|
||||||
onOpen: (schedule) {
|
onOpen: (schedule) {
|
||||||
final id = schedule.pipelineId;
|
final id = schedule.pipelineId;
|
||||||
if (id != null) widget.onOpenPipeline(id);
|
if (id != null) widget.onOpenPipeline(id);
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../ui/adaptive/segmented_bar.dart';
|
import '../ui/adaptive/segmented_bar.dart';
|
||||||
import '../core/api_gateway.dart';
|
import '../core/api_gateway.dart';
|
||||||
import '../features/search/search_screen.dart';
|
import '../features/search/search_screen.dart';
|
||||||
import '../ui/adaptive/host.dart';
|
|
||||||
import 'app_session.dart';
|
import 'app_session.dart';
|
||||||
import 'connection_status.dart';
|
import 'connection_status.dart';
|
||||||
import 'server_endpoint.dart';
|
import 'server_endpoint.dart';
|
||||||
@@ -13,10 +11,8 @@ import 'server_endpoint.dart';
|
|||||||
///
|
///
|
||||||
/// Before the first successful connection there is nothing to search, so the
|
/// Before the first successful connection there is nothing to search, so the
|
||||||
/// native connection gate is shown inside the same title bar and Close still
|
/// native connection gate is shown inside the same title bar and Close still
|
||||||
/// returns to the previous destination. In a Cupertino host the screen is
|
/// returns to the previous destination. The screen mounts immediately so the
|
||||||
/// mounted once the route's entrance has completed: during that transition a
|
/// search field retains normal focus and keyboard behavior during navigation.
|
||||||
/// focus request is dropped, so mounting earlier would open Search with no
|
|
||||||
/// keyboard or caret. Material mounts it immediately as usual.
|
|
||||||
class SearchDestination extends StatefulWidget {
|
class SearchDestination extends StatefulWidget {
|
||||||
const SearchDestination({
|
const SearchDestination({
|
||||||
super.key,
|
super.key,
|
||||||
@@ -38,72 +34,21 @@ class SearchDestination extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _SearchDestinationState extends State<SearchDestination> {
|
class _SearchDestinationState extends State<SearchDestination> {
|
||||||
Animation<double>? _animation;
|
|
||||||
bool _entered = false;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didChangeDependencies() {
|
|
||||||
super.didChangeDependencies();
|
|
||||||
// Material's page transition keeps the autofocus request; only the
|
|
||||||
// Cupertino push needs to wait for the route to become current.
|
|
||||||
if (!usesCupertinoHost(context)) {
|
|
||||||
_entered = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final animation = ModalRoute.of(context)?.animation;
|
|
||||||
if (identical(animation, _animation)) return;
|
|
||||||
_animation?.removeStatusListener(_onStatus);
|
|
||||||
_animation = animation;
|
|
||||||
if (animation == null || animation.status == AnimationStatus.completed) {
|
|
||||||
_entered = true;
|
|
||||||
} else {
|
|
||||||
animation.addStatusListener(_onStatus);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onStatus(AnimationStatus status) {
|
|
||||||
if (status != AnimationStatus.completed) return;
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
||||||
if (mounted) setState(() => _entered = true);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_animation?.removeStatusListener(_onStatus);
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => AnimatedBuilder(
|
Widget build(BuildContext context) => AnimatedBuilder(
|
||||||
animation: widget.session,
|
animation: widget.session,
|
||||||
builder: (context, _) {
|
builder: (context, _) {
|
||||||
final cupertino = usesCupertinoHost(context);
|
if (!widget.session.everConnected) {
|
||||||
if (!widget.session.everConnected || !_entered) {
|
|
||||||
if (widget.embedded) {
|
if (widget.embedded) {
|
||||||
return _entered
|
return ConnectionGate(session: widget.session, server: widget.server);
|
||||||
? ConnectionGate(
|
|
||||||
session: widget.session,
|
|
||||||
server: widget.server,
|
|
||||||
cupertino: cupertino,
|
|
||||||
)
|
|
||||||
: const SizedBox.shrink();
|
|
||||||
}
|
}
|
||||||
return _SearchPage(
|
return _SearchPage(
|
||||||
cupertino: cupertino,
|
child: ConnectionGate(session: widget.session, server: widget.server),
|
||||||
child: _entered
|
|
||||||
? ConnectionGate(
|
|
||||||
session: widget.session,
|
|
||||||
server: widget.server,
|
|
||||||
cupertino: cupertino,
|
|
||||||
)
|
|
||||||
: const SizedBox.shrink(),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return SearchScreen(
|
return SearchScreen(
|
||||||
gateway: widget.session.gateway,
|
gateway: widget.session.gateway,
|
||||||
onOpen: widget.onOpen,
|
onOpen: widget.onOpen,
|
||||||
cupertino: cupertino,
|
|
||||||
embedded: widget.embedded,
|
embedded: widget.embedded,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -112,22 +57,16 @@ class _SearchDestinationState extends State<SearchDestination> {
|
|||||||
|
|
||||||
/// The native title bar that owns Back while Search has no screen yet.
|
/// The native title bar that owns Back while Search has no screen yet.
|
||||||
class _SearchPage extends StatelessWidget {
|
class _SearchPage extends StatelessWidget {
|
||||||
const _SearchPage({required this.cupertino, required this.child});
|
const _SearchPage({required this.child});
|
||||||
|
|
||||||
final bool cupertino;
|
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => cupertino
|
Widget build(BuildContext context) => Scaffold(
|
||||||
? CupertinoPageScaffold(
|
extendBodyBehindAppBar: true,
|
||||||
navigationBar: const SegmentedBar(cupertino: true, title: 'Search'),
|
appBar: const SegmentedBar(cupertino: false, title: 'Search'),
|
||||||
child: SafeArea(child: child),
|
body: SafeArea(child: child),
|
||||||
)
|
);
|
||||||
: Scaffold(
|
|
||||||
extendBodyBehindAppBar: true,
|
|
||||||
appBar: const SegmentedBar(cupertino: false, title: 'Search'),
|
|
||||||
body: SafeArea(child: child),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The run a result names, taken only from the server's own payload document.
|
/// The run a result names, taken only from the server's own payload document.
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../core/api_gateway.dart';
|
import '../core/api_gateway.dart';
|
||||||
@@ -7,11 +6,9 @@ import '../features/templates/ui/template_detail.dart'
|
|||||||
show templateDetailBackKey;
|
show templateDetailBackKey;
|
||||||
import '../shell/destination.dart';
|
import '../shell/destination.dart';
|
||||||
import '../shell/shell_bar.dart';
|
import '../shell/shell_bar.dart';
|
||||||
import '../ui/adaptive/host.dart';
|
|
||||||
import '../ui/adaptive/floating_bar_layout.dart';
|
import '../ui/adaptive/floating_bar_layout.dart';
|
||||||
import '../ui/adaptive/segmented_bar.dart';
|
import '../ui/adaptive/segmented_bar.dart';
|
||||||
import '../ui/adaptive/top_bar_notices.dart';
|
import '../ui/adaptive/top_bar_notices.dart';
|
||||||
import '../ui/theme/app_theme.dart';
|
|
||||||
import 'app_session.dart';
|
import 'app_session.dart';
|
||||||
import 'connection_status.dart';
|
import 'connection_status.dart';
|
||||||
import 'server_endpoint.dart';
|
import 'server_endpoint.dart';
|
||||||
@@ -66,52 +63,42 @@ class _TemplatesDestinationState extends State<TemplatesDestination> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final cupertino = usesCupertinoHost(context);
|
|
||||||
final body = ShellBarScope(
|
final body = ShellBarScope(
|
||||||
registry: _bar,
|
registry: _bar,
|
||||||
destination: AppDestination.settings,
|
destination: AppDestination.settings,
|
||||||
child: AnimatedBuilder(
|
child: AnimatedBuilder(
|
||||||
animation: widget.session,
|
animation: widget.session,
|
||||||
builder: (context, _) => _body(cupertino),
|
builder: (context, _) => _body(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
final bar = ListenableBuilder(
|
final bar = ListenableBuilder(
|
||||||
listenable: _bar,
|
listenable: _bar,
|
||||||
builder: (context, _) => _segmentedBar(cupertino),
|
builder: (context, _) => _segmentedBar(),
|
||||||
);
|
);
|
||||||
// The page reaches its top edge: the gallery and an open template scroll
|
// The page reaches its top edge: the gallery and an open template scroll
|
||||||
// behind the bar and pad their own content by its height.
|
// behind the bar and pad their own content by its height.
|
||||||
final page = SafeArea(top: false, bottom: false, child: body);
|
final page = SafeArea(top: false, bottom: false, child: body);
|
||||||
if (cupertino) {
|
|
||||||
// Plain list rows on the page background, like the other lists; the
|
|
||||||
// bar's scrim takes the same colour.
|
|
||||||
return CupertinoPageScaffold(
|
|
||||||
backgroundColor: AppColors.background,
|
|
||||||
navigationBar: _BarSlot(cupertino: true, child: bar),
|
|
||||||
child: page,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
extendBodyBehindAppBar: true,
|
extendBodyBehindAppBar: true,
|
||||||
appBar: _BarSlot(cupertino: false, child: bar),
|
appBar: _BarSlot(child: bar),
|
||||||
body: page,
|
body: page,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SegmentedBar _segmentedBar(bool cupertino) {
|
SegmentedBar _segmentedBar() {
|
||||||
final spec = _bar.specFor(AppDestination.settings);
|
final spec = _bar.specFor(AppDestination.settings);
|
||||||
final onDetailBack = spec?.onBack;
|
final onDetailBack = spec?.onBack;
|
||||||
return SegmentedBar(
|
return SegmentedBar(
|
||||||
cupertino: cupertino,
|
cupertino: false,
|
||||||
leading: onDetailBack != null
|
leading: onDetailBack != null
|
||||||
? SegmentedBackButton(
|
? SegmentedBackButton(
|
||||||
key: templateDetailBackKey,
|
key: templateDetailBackKey,
|
||||||
cupertino: cupertino,
|
cupertino: false,
|
||||||
onPressed: onDetailBack,
|
onPressed: onDetailBack,
|
||||||
)
|
)
|
||||||
: SegmentedBackButton(
|
: SegmentedBackButton(
|
||||||
key: templatesPageBackKey,
|
key: templatesPageBackKey,
|
||||||
cupertino: cupertino,
|
cupertino: false,
|
||||||
onPressed: widget.onBack,
|
onPressed: widget.onBack,
|
||||||
),
|
),
|
||||||
title: spec?.title ?? 'Templates',
|
title: spec?.title ?? 'Templates',
|
||||||
@@ -120,14 +107,14 @@ class _TemplatesDestinationState extends State<TemplatesDestination> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _body(bool cupertino) {
|
Widget _body() {
|
||||||
final session = widget.session;
|
final session = widget.session;
|
||||||
if (!session.everConnected) {
|
if (!session.everConnected) {
|
||||||
return BelowTopBar(
|
return BelowTopBar(
|
||||||
child: ConnectionGate(
|
child: ConnectionGate(
|
||||||
session: session,
|
session: session,
|
||||||
server: widget.server,
|
server: widget.server,
|
||||||
cupertino: cupertino,
|
cupertino: false,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -135,7 +122,7 @@ class _TemplatesDestinationState extends State<TemplatesDestination> {
|
|||||||
return TopBarNotices(
|
return TopBarNotices(
|
||||||
notices: [
|
notices: [
|
||||||
if (!session.connected)
|
if (!session.connected)
|
||||||
ConnectionBanner(session: session, cupertino: cupertino),
|
ConnectionBanner(session: session, cupertino: false),
|
||||||
],
|
],
|
||||||
child: TemplatesScreen(
|
child: TemplatesScreen(
|
||||||
gateway: session.gateway,
|
gateway: session.gateway,
|
||||||
@@ -149,19 +136,14 @@ class _TemplatesDestinationState extends State<TemplatesDestination> {
|
|||||||
|
|
||||||
/// Gives the scaffold a [SegmentedBar]'s size and obstruction while the bar
|
/// Gives the scaffold a [SegmentedBar]'s size and obstruction while the bar
|
||||||
/// itself is rebuilt from the published controls.
|
/// itself is rebuilt from the published controls.
|
||||||
class _BarSlot extends StatelessWidget
|
class _BarSlot extends StatelessWidget implements PreferredSizeWidget {
|
||||||
implements ObstructingPreferredSizeWidget {
|
const _BarSlot({required this.child});
|
||||||
const _BarSlot({required this.cupertino, required this.child});
|
|
||||||
|
|
||||||
final bool cupertino;
|
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Size get preferredSize =>
|
Size get preferredSize =>
|
||||||
SegmentedBar(cupertino: cupertino, title: '').preferredSize;
|
const SegmentedBar(cupertino: false, title: '').preferredSize;
|
||||||
|
|
||||||
@override
|
|
||||||
bool shouldFullyObstruct(BuildContext context) => false;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => child;
|
Widget build(BuildContext context) => child;
|
||||||
|
|||||||
@@ -23,19 +23,3 @@ ButtonStyle chatBarTextButtonStyle(
|
|||||||
|
|
||||||
/// Horizontal padding inside the bar's text buttons (model, mode).
|
/// Horizontal padding inside the bar's text buttons (model, mode).
|
||||||
const EdgeInsets chatBarButtonPadding = EdgeInsets.symmetric(horizontal: 12);
|
const EdgeInsets chatBarButtonPadding = EdgeInsets.symmetric(horizontal: 12);
|
||||||
|
|
||||||
/// Puts [content] (a button's child) in the bar's foreground colour: the
|
|
||||||
/// chat's tint if it has one, else `onSurfaceVariant`. Kept for existing
|
|
||||||
/// callers; the Material path colours buttons with [chatBarTextButtonStyle].
|
|
||||||
Widget chatBarCupertinoContent(BuildContext context, Widget content) {
|
|
||||||
final color =
|
|
||||||
ChatBarTintScope.foregroundOf(context) ??
|
|
||||||
Theme.of(context).colorScheme.onSurfaceVariant;
|
|
||||||
return IconTheme.merge(
|
|
||||||
data: IconThemeData(color: color),
|
|
||||||
child: DefaultTextStyle.merge(
|
|
||||||
style: TextStyle(color: color),
|
|
||||||
child: content,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -831,8 +831,7 @@ class _ChatComposerBarState extends State<ChatComposerBar> {
|
|||||||
// inside the glass with the field, as one floating composer; only the
|
// inside the glass with the field, as one floating composer; only the
|
||||||
// command palette, a separate menu, floats above it.
|
// command palette, a separate menu, floats above it.
|
||||||
final extras = <Widget>[
|
final extras = <Widget>[
|
||||||
if (chatDraftIsShell(composer.draft))
|
if (chatDraftIsShell(composer.draft)) ChatShellModeIndicator(),
|
||||||
ChatShellModeIndicator(cupertino: false),
|
|
||||||
if (!_attachments.isEmpty) _attachmentStrip(context),
|
if (!_attachments.isEmpty) _attachmentStrip(context),
|
||||||
if (_uploading)
|
if (_uploading)
|
||||||
_notice(
|
_notice(
|
||||||
|
|||||||
@@ -3,10 +3,6 @@ import 'package:flutter/material.dart';
|
|||||||
import '../domain/chat_task_metadata.dart';
|
import '../domain/chat_task_metadata.dart';
|
||||||
import '../../../ui/text/monospace.dart';
|
import '../../../ui/text/monospace.dart';
|
||||||
|
|
||||||
/// Always false: the app is Material-only. Kept so existing callers compile;
|
|
||||||
/// a later run removes it with its callers.
|
|
||||||
bool taskCupertino(BuildContext context) => false;
|
|
||||||
|
|
||||||
Color taskSecondary(BuildContext context) =>
|
Color taskSecondary(BuildContext context) =>
|
||||||
Theme.of(context).colorScheme.onSurfaceVariant;
|
Theme.of(context).colorScheme.onSurfaceVariant;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import '../../../shell/windows/window_scope.dart';
|
|||||||
import '../../terminal/terminal_open_action.dart';
|
import '../../terminal/terminal_open_action.dart';
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
|
|
||||||
@@ -1408,9 +1407,6 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
|||||||
identifier: 'chat-files-toggle',
|
identifier: 'chat-files-toggle',
|
||||||
onPressed: _toggleFiles,
|
onPressed: _toggleFiles,
|
||||||
materialIcon: _filesVisible ? Icons.folder : Icons.folder_outlined,
|
materialIcon: _filesVisible ? Icons.folder : Icons.folder_outlined,
|
||||||
cupertinoIcon: _filesVisible
|
|
||||||
? CupertinoIcons.folder_fill
|
|
||||||
: CupertinoIcons.folder,
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
moreActions: [
|
moreActions: [
|
||||||
@@ -1422,7 +1418,6 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
|||||||
label: 'Chat details',
|
label: 'Chat details',
|
||||||
onPressed: _openInfo,
|
onPressed: _openInfo,
|
||||||
materialIcon: Icons.info_outline,
|
materialIcon: Icons.info_outline,
|
||||||
cupertinoIcon: CupertinoIcons.info,
|
|
||||||
),
|
),
|
||||||
...widget.paneControls,
|
...widget.paneControls,
|
||||||
chatShellRunMenuAction(onPressed: _runShellFromMenu),
|
chatShellRunMenuAction(onPressed: _runShellFromMenu),
|
||||||
@@ -1475,12 +1470,7 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
void _runShellFromMenu() => unawaited(
|
void _runShellFromMenu() => unawaited(
|
||||||
runChatShellFromMenu(
|
runChatShellFromMenu(context, _shellRuns, showNotice: _showCommandNotice),
|
||||||
context,
|
|
||||||
_shellRuns,
|
|
||||||
cupertino: false,
|
|
||||||
showNotice: _showCommandNotice,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
void _dismissFinishedShellRuns() => unawaited(
|
void _dismissFinishedShellRuns() => unawaited(
|
||||||
@@ -1488,7 +1478,6 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
|||||||
context,
|
context,
|
||||||
_shellRuns,
|
_shellRuns,
|
||||||
_shellRuns.finishedIds,
|
_shellRuns.finishedIds,
|
||||||
cupertino: false,
|
|
||||||
onRefused: (refusal) => _showCommandNotice(
|
onRefused: (refusal) => _showCommandNotice(
|
||||||
"Couldn't dismiss the commands: $refusal",
|
"Couldn't dismiss the commands: $refusal",
|
||||||
failed: true,
|
failed: true,
|
||||||
|
|||||||
@@ -22,13 +22,11 @@ class ChatShellCardActions extends StatefulWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.run,
|
required this.run,
|
||||||
required this.controller,
|
required this.controller,
|
||||||
required this.cupertino,
|
|
||||||
required this.onFullScreen,
|
required this.onFullScreen,
|
||||||
});
|
});
|
||||||
|
|
||||||
final ChatShellRun run;
|
final ChatShellRun run;
|
||||||
final ChatShellRunsController controller;
|
final ChatShellRunsController controller;
|
||||||
final bool cupertino;
|
|
||||||
final VoidCallback onFullScreen;
|
final VoidCallback onFullScreen;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -10,13 +10,8 @@ const String chatShellDismissAllLabel = 'Dismiss all finished commands';
|
|||||||
|
|
||||||
/// The card's Dismiss button, offered once the command has finished.
|
/// The card's Dismiss button, offered once the command has finished.
|
||||||
class ChatShellDismissButton extends StatelessWidget {
|
class ChatShellDismissButton extends StatelessWidget {
|
||||||
const ChatShellDismissButton({
|
const ChatShellDismissButton({super.key, required this.onPressed});
|
||||||
super.key,
|
|
||||||
required this.cupertino,
|
|
||||||
required this.onPressed,
|
|
||||||
});
|
|
||||||
|
|
||||||
final bool cupertino;
|
|
||||||
final VoidCallback onPressed;
|
final VoidCallback onPressed;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -48,7 +43,6 @@ Future<void> dismissChatShellRuns(
|
|||||||
BuildContext context,
|
BuildContext context,
|
||||||
ChatShellRunsController controller,
|
ChatShellRunsController controller,
|
||||||
List<String> ids, {
|
List<String> ids, {
|
||||||
required bool cupertino,
|
|
||||||
void Function(String refusal)? onRefused,
|
void Function(String refusal)? onRefused,
|
||||||
}) async {
|
}) async {
|
||||||
if (ids.isEmpty) return;
|
if (ids.isEmpty) return;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class ChatShellHistoryChip extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _open(BuildContext context, bool cupertino) {
|
Future<void> _open(BuildContext context, bool _) {
|
||||||
// A dialog in the tiled app on a wide layout. A phone keeps the
|
// A dialog in the tiled app on a wide layout. A phone keeps the
|
||||||
// full-screen page, and a floating window opens it as a page of that
|
// full-screen page, and a floating window opens it as a page of that
|
||||||
// window, so what it opens next (a diff, a command's output) stays in
|
// window, so what it opens next (a diff, a command's output) stays in
|
||||||
|
|||||||
@@ -17,13 +17,9 @@ Future<void> openChatShellHistoryOutput(
|
|||||||
BuildContext context, {
|
BuildContext context, {
|
||||||
required ChatShellRunsController controller,
|
required ChatShellRunsController controller,
|
||||||
required String runId,
|
required String runId,
|
||||||
required bool cupertino,
|
|
||||||
}) {
|
}) {
|
||||||
Widget page(BuildContext _) => ChatShellHistoryOutputPage(
|
Widget page(BuildContext _) =>
|
||||||
controller: controller,
|
ChatShellHistoryOutputPage(controller: controller, runId: runId);
|
||||||
runId: runId,
|
|
||||||
cupertino: cupertino,
|
|
||||||
);
|
|
||||||
return Navigator.push<void>(context, MaterialPageRoute<void>(builder: page));
|
return Navigator.push<void>(context, MaterialPageRoute<void>(builder: page));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,12 +31,10 @@ class ChatShellHistoryOutputPage extends StatefulWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.controller,
|
required this.controller,
|
||||||
required this.runId,
|
required this.runId,
|
||||||
required this.cupertino,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
final ChatShellRunsController controller;
|
final ChatShellRunsController controller;
|
||||||
final String runId;
|
final String runId;
|
||||||
final bool cupertino;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<ChatShellHistoryOutputPage> createState() =>
|
State<ChatShellHistoryOutputPage> createState() =>
|
||||||
@@ -138,7 +132,7 @@ class _ChatShellHistoryOutputPageState
|
|||||||
runSpacing: 4,
|
runSpacing: 4,
|
||||||
crossAxisAlignment: WrapCrossAlignment.center,
|
crossAxisAlignment: WrapCrossAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
ChatShellStatus(run: full, cupertino: false),
|
ChatShellStatus(run: full),
|
||||||
if (full.directory.isNotEmpty)
|
if (full.directory.isNotEmpty)
|
||||||
Text(
|
Text(
|
||||||
full.directory,
|
full.directory,
|
||||||
@@ -154,11 +148,7 @@ class _ChatShellHistoryOutputPageState
|
|||||||
key: const Key('chat-shell-output-empty'),
|
key: const Key('chat-shell-output-empty'),
|
||||||
style: chatCardSecondaryStyle(context, false),
|
style: chatCardSecondaryStyle(context, false),
|
||||||
)
|
)
|
||||||
: ChatShellTerminalView(
|
: ChatShellTerminalView(session: session, fill: true),
|
||||||
session: session,
|
|
||||||
cupertino: false,
|
|
||||||
fill: true,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
ListenableBuilder(
|
ListenableBuilder(
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ class _ChatShellHistoryViewState extends State<ChatShellHistoryView> {
|
|||||||
runSpacing: 4,
|
runSpacing: 4,
|
||||||
crossAxisAlignment: WrapCrossAlignment.center,
|
crossAxisAlignment: WrapCrossAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
ChatShellStatus(run: run, cupertino: false),
|
ChatShellStatus(run: run),
|
||||||
Text(chatShellRunTime(context, run.startedAt), style: secondary),
|
Text(chatShellRunTime(context, run.startedAt), style: secondary),
|
||||||
if (run.purged) Text(chatShellOutputNotKept, style: secondary),
|
if (run.purged) Text(chatShellOutputNotKept, style: secondary),
|
||||||
if (refusal != null)
|
if (refusal != null)
|
||||||
@@ -151,7 +151,6 @@ class _ChatShellHistoryViewState extends State<ChatShellHistoryView> {
|
|||||||
context,
|
context,
|
||||||
controller: widget.controller,
|
controller: widget.controller,
|
||||||
runId: run.id,
|
runId: run.id,
|
||||||
cupertino: false,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ import 'chat_shell_command.dart';
|
|||||||
/// Shown inside the composer while its draft starts with `!`: the draft is a
|
/// Shown inside the composer while its draft starts with `!`: the draft is a
|
||||||
/// shell command for this chat's folder, not a message to the agent.
|
/// shell command for this chat's folder, not a message to the agent.
|
||||||
class ChatShellModeIndicator extends StatelessWidget {
|
class ChatShellModeIndicator extends StatelessWidget {
|
||||||
const ChatShellModeIndicator({super.key, required this.cupertino});
|
const ChatShellModeIndicator({super.key});
|
||||||
|
|
||||||
final bool cupertino;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|||||||
@@ -14,14 +14,12 @@ class ChatShellOutputView extends StatelessWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.run,
|
required this.run,
|
||||||
required this.controller,
|
required this.controller,
|
||||||
required this.cupertino,
|
|
||||||
required this.viewKey,
|
required this.viewKey,
|
||||||
required this.fullScreen,
|
required this.fullScreen,
|
||||||
});
|
});
|
||||||
|
|
||||||
final ChatShellRun run;
|
final ChatShellRun run;
|
||||||
final ChatShellRunsController controller;
|
final ChatShellRunsController controller;
|
||||||
final bool cupertino;
|
|
||||||
|
|
||||||
/// Replaced when the full-screen view closes, so the card's view sizes the
|
/// Replaced when the full-screen view closes, so the card's view sizes the
|
||||||
/// terminal to itself again.
|
/// terminal to itself again.
|
||||||
@@ -47,7 +45,6 @@ class ChatShellOutputView extends StatelessWidget {
|
|||||||
ChatShellTerminalView(
|
ChatShellTerminalView(
|
||||||
key: viewKey,
|
key: viewKey,
|
||||||
session: session,
|
session: session,
|
||||||
cupertino: false,
|
|
||||||
autoResize: !fullScreen,
|
autoResize: !fullScreen,
|
||||||
),
|
),
|
||||||
if (session.live && !fullScreen)
|
if (session.live && !fullScreen)
|
||||||
@@ -55,7 +52,6 @@ class ChatShellOutputView extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.only(top: 8),
|
padding: const EdgeInsets.only(top: 8),
|
||||||
child: ChatShellTerminalKeys(
|
child: ChatShellTerminalKeys(
|
||||||
session: session,
|
session: session,
|
||||||
cupertino: false,
|
|
||||||
field: chatShellTouchFirst(),
|
field: chatShellTouchFirst(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ class _ChatShellRunCardState extends State<ChatShellRunCard> {
|
|||||||
context,
|
context,
|
||||||
controller: widget.controller,
|
controller: widget.controller,
|
||||||
runId: widget.runId,
|
runId: widget.runId,
|
||||||
cupertino: false,
|
|
||||||
);
|
);
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -113,15 +112,12 @@ class _ChatShellRunCardState extends State<ChatShellRunCard> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
ChatShellStatus(run: run, cupertino: false),
|
ChatShellStatus(run: run),
|
||||||
if (!run.running)
|
if (!run.running)
|
||||||
ChatShellDismissButton(
|
ChatShellDismissButton(
|
||||||
cupertino: false,
|
|
||||||
onPressed: () => unawaited(
|
onPressed: () => unawaited(
|
||||||
// A refusal brings the card back with the server's reason.
|
// A refusal brings the card back with the server's reason.
|
||||||
dismissChatShellRuns(context, controller, [
|
dismissChatShellRuns(context, controller, [run.id]),
|
||||||
run.id,
|
|
||||||
], cupertino: false),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -130,7 +126,6 @@ class _ChatShellRunCardState extends State<ChatShellRunCard> {
|
|||||||
ChatShellOutputView(
|
ChatShellOutputView(
|
||||||
run: run,
|
run: run,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
cupertino: false,
|
|
||||||
viewKey: ValueKey<int>(_viewGeneration),
|
viewKey: ValueKey<int>(_viewGeneration),
|
||||||
fullScreen: _fullScreen,
|
fullScreen: _fullScreen,
|
||||||
),
|
),
|
||||||
@@ -146,7 +141,6 @@ class _ChatShellRunCardState extends State<ChatShellRunCard> {
|
|||||||
ChatShellCardActions(
|
ChatShellCardActions(
|
||||||
run: run,
|
run: run,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
cupertino: false,
|
|
||||||
onFullScreen: () => _openFullScreen(),
|
onFullScreen: () => _openFullScreen(),
|
||||||
),
|
),
|
||||||
if (error != null)
|
if (error != null)
|
||||||
|
|||||||
@@ -5,18 +5,14 @@ import 'chat_shell_command.dart';
|
|||||||
|
|
||||||
/// The chat actions menu's "Run command…": a small host dialog with one
|
/// The chat actions menu's "Run command…": a small host dialog with one
|
||||||
/// command field. Returns the trimmed command, or null when cancelled.
|
/// command field. Returns the trimmed command, or null when cancelled.
|
||||||
Future<String?> showChatShellRunDialog(
|
Future<String?> showChatShellRunDialog(BuildContext context) =>
|
||||||
BuildContext context, {
|
showDialog<String>(
|
||||||
required bool cupertino,
|
context: context,
|
||||||
}) => showDialog<String>(
|
builder: (_) => const ChatShellRunDialog(),
|
||||||
context: context,
|
);
|
||||||
builder: (_) => const ChatShellRunDialog(cupertino: false),
|
|
||||||
);
|
|
||||||
|
|
||||||
class ChatShellRunDialog extends StatefulWidget {
|
class ChatShellRunDialog extends StatefulWidget {
|
||||||
const ChatShellRunDialog({super.key, required this.cupertino});
|
const ChatShellRunDialog({super.key});
|
||||||
|
|
||||||
final bool cupertino;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<ChatShellRunDialog> createState() => _ChatShellRunDialogState();
|
State<ChatShellRunDialog> createState() => _ChatShellRunDialogState();
|
||||||
|
|||||||
@@ -8,14 +8,9 @@ import 'chat_shell_run.dart';
|
|||||||
/// while it runs, then a status chip (exit code, stopped, interrupted) with
|
/// while it runs, then a status chip (exit code, stopped, interrupted) with
|
||||||
/// how long it ran. The words carry the state; colour only repeats it.
|
/// how long it ran. The words carry the state; colour only repeats it.
|
||||||
class ChatShellStatus extends StatelessWidget {
|
class ChatShellStatus extends StatelessWidget {
|
||||||
const ChatShellStatus({
|
const ChatShellStatus({super.key, required this.run});
|
||||||
super.key,
|
|
||||||
required this.run,
|
|
||||||
required this.cupertino,
|
|
||||||
});
|
|
||||||
|
|
||||||
final ChatShellRun run;
|
final ChatShellRun run;
|
||||||
final bool cupertino;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|||||||
@@ -71,12 +71,10 @@ class ChatShellTerminalKeys extends StatefulWidget {
|
|||||||
const ChatShellTerminalKeys({
|
const ChatShellTerminalKeys({
|
||||||
super.key,
|
super.key,
|
||||||
required this.session,
|
required this.session,
|
||||||
required this.cupertino,
|
|
||||||
required this.field,
|
required this.field,
|
||||||
});
|
});
|
||||||
|
|
||||||
final ChatShellTerminalSession session;
|
final ChatShellTerminalSession session;
|
||||||
final bool cupertino;
|
|
||||||
final bool field;
|
final bool field;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -12,13 +12,9 @@ Future<void> openChatShellTerminalPage(
|
|||||||
BuildContext context, {
|
BuildContext context, {
|
||||||
required ChatShellRunsController controller,
|
required ChatShellRunsController controller,
|
||||||
required String runId,
|
required String runId,
|
||||||
required bool cupertino,
|
|
||||||
}) {
|
}) {
|
||||||
Widget page(BuildContext _) => ChatShellTerminalPage(
|
Widget page(BuildContext _) =>
|
||||||
controller: controller,
|
ChatShellTerminalPage(controller: controller, runId: runId);
|
||||||
runId: runId,
|
|
||||||
cupertino: cupertino,
|
|
||||||
);
|
|
||||||
return Navigator.push<void>(context, MaterialPageRoute<void>(builder: page));
|
return Navigator.push<void>(context, MaterialPageRoute<void>(builder: page));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,12 +23,10 @@ class ChatShellTerminalPage extends StatelessWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.controller,
|
required this.controller,
|
||||||
required this.runId,
|
required this.runId,
|
||||||
required this.cupertino,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
final ChatShellRunsController controller;
|
final ChatShellRunsController controller;
|
||||||
final String runId;
|
final String runId;
|
||||||
final bool cupertino;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -58,7 +52,6 @@ class ChatShellTerminalPage extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: ChatShellTerminalView(
|
child: ChatShellTerminalView(
|
||||||
session: session,
|
session: session,
|
||||||
cupertino: false,
|
|
||||||
fill: true,
|
fill: true,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
),
|
),
|
||||||
@@ -68,7 +61,6 @@ class ChatShellTerminalPage extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.only(top: 8),
|
padding: const EdgeInsets.only(top: 8),
|
||||||
child: ChatShellTerminalKeys(
|
child: ChatShellTerminalKeys(
|
||||||
session: session,
|
session: session,
|
||||||
cupertino: false,
|
|
||||||
field: chatShellTouchFirst(),
|
field: chatShellTouchFirst(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import '../conversation/chat_card_styles.dart';
|
|||||||
/// background, the body text colour as foreground, the accent as cursor and
|
/// background, the body text colour as foreground, the accent as cursor and
|
||||||
/// selection. The sixteen ANSI colours are the emulator's standard palette,
|
/// selection. The sixteen ANSI colours are the emulator's standard palette,
|
||||||
/// darkened on a light surface so coloured output stays readable.
|
/// darkened on a light surface so coloured output stays readable.
|
||||||
TerminalTheme chatShellTerminalTheme(BuildContext context, bool cupertino) {
|
TerminalTheme chatShellTerminalTheme(BuildContext context) {
|
||||||
final dark = Theme.of(context).brightness == Brightness.dark;
|
final dark = Theme.of(context).brightness == Brightness.dark;
|
||||||
final background = chatCardFillColor(context, false);
|
final background = chatCardFillColor(context, false);
|
||||||
final foreground = Theme.of(context).colorScheme.onSurface;
|
final foreground = Theme.of(context).colorScheme.onSurface;
|
||||||
@@ -54,7 +54,7 @@ TerminalTheme chatShellTerminalTheme(BuildContext context, bool cupertino) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The terminal's text: the host's monospace family at the card body size.
|
/// The terminal's text: the host's monospace family at the card body size.
|
||||||
TerminalStyle chatShellTerminalStyle(BuildContext context, bool cupertino) {
|
TerminalStyle chatShellTerminalStyle(BuildContext context) {
|
||||||
final body = chatCardBodyStyle(context, false) ?? const TextStyle();
|
final body = chatCardBodyStyle(context, false) ?? const TextStyle();
|
||||||
return TerminalStyle(
|
return TerminalStyle(
|
||||||
fontFamily: appMonospaceFamily,
|
fontFamily: appMonospaceFamily,
|
||||||
|
|||||||
@@ -74,14 +74,12 @@ class ChatShellTerminalView extends StatefulWidget {
|
|||||||
const ChatShellTerminalView({
|
const ChatShellTerminalView({
|
||||||
super.key,
|
super.key,
|
||||||
required this.session,
|
required this.session,
|
||||||
required this.cupertino,
|
|
||||||
this.fill = false,
|
this.fill = false,
|
||||||
this.autofocus = false,
|
this.autofocus = false,
|
||||||
this.autoResize = true,
|
this.autoResize = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
final ChatShellTerminalSession session;
|
final ChatShellTerminalSession session;
|
||||||
final bool cupertino;
|
|
||||||
final bool fill;
|
final bool fill;
|
||||||
final bool autofocus;
|
final bool autofocus;
|
||||||
|
|
||||||
@@ -155,7 +153,7 @@ class _ChatShellTerminalViewState extends State<ChatShellTerminalView> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final session = widget.session;
|
final session = widget.session;
|
||||||
final live = session.live;
|
final live = session.live;
|
||||||
final style = chatShellTerminalStyle(context, false);
|
final style = chatShellTerminalStyle(context);
|
||||||
const padding = EdgeInsets.all(8);
|
const padding = EdgeInsets.all(8);
|
||||||
Widget view = Semantics(
|
Widget view = Semantics(
|
||||||
identifier: 'chat-shell-terminal',
|
identifier: 'chat-shell-terminal',
|
||||||
@@ -168,7 +166,7 @@ class _ChatShellTerminalViewState extends State<ChatShellTerminalView> {
|
|||||||
focusNode: _focus,
|
focusNode: _focus,
|
||||||
autofocus: widget.autofocus && live,
|
autofocus: widget.autofocus && live,
|
||||||
autoResize: widget.autoResize,
|
autoResize: widget.autoResize,
|
||||||
theme: chatShellTerminalTheme(context, false),
|
theme: chatShellTerminalTheme(context),
|
||||||
textStyle: style,
|
textStyle: style,
|
||||||
padding: padding,
|
padding: padding,
|
||||||
readOnly: !live,
|
readOnly: !live,
|
||||||
|
|||||||
@@ -22,10 +22,9 @@ Widget chatShellRunMenuAction({required VoidCallback onPressed}) =>
|
|||||||
Future<void> runChatShellFromMenu(
|
Future<void> runChatShellFromMenu(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
ChatShellRunsController controller, {
|
ChatShellRunsController controller, {
|
||||||
required bool cupertino,
|
|
||||||
required void Function(String text, {bool failed}) showNotice,
|
required void Function(String text, {bool failed}) showNotice,
|
||||||
}) async {
|
}) async {
|
||||||
final command = await showChatShellRunDialog(context, cupertino: cupertino);
|
final command = await showChatShellRunDialog(context);
|
||||||
if (command == null) return;
|
if (command == null) return;
|
||||||
final refusal = await controller.start(command);
|
final refusal = await controller.start(command);
|
||||||
if (refusal != null) {
|
if (refusal != null) {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ChatBarAction extends StatelessWidget implements SegmentedOverflowable {
|
|||||||
required this.label,
|
required this.label,
|
||||||
required this.onPressed,
|
required this.onPressed,
|
||||||
required this.materialIcon,
|
required this.materialIcon,
|
||||||
required this.cupertinoIcon,
|
this.cupertinoIcon,
|
||||||
this.identifier,
|
this.identifier,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ class ChatBarAction extends StatelessWidget implements SegmentedOverflowable {
|
|||||||
final IconData materialIcon;
|
final IconData materialIcon;
|
||||||
|
|
||||||
/// Kept for callers; the Material toolbar always draws [materialIcon].
|
/// Kept for callers; the Material toolbar always draws [materialIcon].
|
||||||
final IconData cupertinoIcon;
|
final IconData? cupertinoIcon;
|
||||||
final String? identifier;
|
final String? identifier;
|
||||||
|
|
||||||
/// A narrow bar moves it into its More menu, under the bar's host's icon.
|
/// A narrow bar moves it into its More menu, under the bar's host's icon.
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class ChatCodeHover {
|
|||||||
Object token,
|
Object token,
|
||||||
String text,
|
String text,
|
||||||
Offset pointer, {
|
Offset pointer, {
|
||||||
required bool cupertino,
|
bool? cupertino,
|
||||||
}) {
|
}) {
|
||||||
if (_disposed) return;
|
if (_disposed) return;
|
||||||
hide();
|
hide();
|
||||||
@@ -64,11 +64,7 @@ class ChatCodeHover {
|
|||||||
child: Material(
|
child: Material(
|
||||||
elevation: 3,
|
elevation: 3,
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
child: ChatCopyButton(
|
child: ChatCopyButton(text: text, showLabel: true),
|
||||||
text: text,
|
|
||||||
cupertino: false,
|
|
||||||
showLabel: true,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -132,12 +128,12 @@ class ChatCodeCopyRegion extends StatefulWidget {
|
|||||||
const ChatCodeCopyRegion({
|
const ChatCodeCopyRegion({
|
||||||
super.key,
|
super.key,
|
||||||
required this.code,
|
required this.code,
|
||||||
required this.cupertino,
|
this.cupertino,
|
||||||
required this.label,
|
required this.label,
|
||||||
required this.child,
|
required this.child,
|
||||||
});
|
});
|
||||||
final String code;
|
final String code;
|
||||||
final bool cupertino;
|
final bool? cupertino;
|
||||||
final Widget label, child;
|
final Widget label, child;
|
||||||
@override
|
@override
|
||||||
State<ChatCodeCopyRegion> createState() => _ChatCodeCopyRegionState();
|
State<ChatCodeCopyRegion> createState() => _ChatCodeCopyRegionState();
|
||||||
@@ -170,7 +166,6 @@ class _ChatCodeCopyRegionState extends State<ChatCodeCopyRegion> {
|
|||||||
child: SelectionContainer.disabled(
|
child: SelectionContainer.disabled(
|
||||||
child: ChatCopyButton(
|
child: ChatCopyButton(
|
||||||
text: widget.code,
|
text: widget.code,
|
||||||
cupertino: widget.cupertino,
|
|
||||||
showLabel: true,
|
showLabel: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -12,15 +12,9 @@ const String chatCopiedLabel = 'Copied';
|
|||||||
/// the clipboard. It shows a check for a moment after copying, so the operator
|
/// the clipboard. It shows a check for a moment after copying, so the operator
|
||||||
/// sees the copy landed without a separate toast.
|
/// sees the copy landed without a separate toast.
|
||||||
class ChatCopyButton extends StatefulWidget {
|
class ChatCopyButton extends StatefulWidget {
|
||||||
const ChatCopyButton({
|
const ChatCopyButton({super.key, required this.text, this.showLabel = false});
|
||||||
super.key,
|
|
||||||
required this.text,
|
|
||||||
required this.cupertino,
|
|
||||||
this.showLabel = false,
|
|
||||||
});
|
|
||||||
|
|
||||||
final String text;
|
final String text;
|
||||||
final bool cupertino;
|
|
||||||
final bool showLabel;
|
final bool showLabel;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -202,7 +202,6 @@ class _ChatMarkdownViewState extends State<ChatMarkdownView> {
|
|||||||
);
|
);
|
||||||
return ChatCodeCopyRegion(
|
return ChatCodeCopyRegion(
|
||||||
code: code,
|
code: code,
|
||||||
cupertino: false,
|
|
||||||
label: Text(markdownCodeLabel(language), style: labelStyle),
|
label: Text(markdownCodeLabel(language), style: labelStyle),
|
||||||
child: DecoratedBox(
|
child: DecoratedBox(
|
||||||
decoration: BoxDecoration(color: _codeFill(context)),
|
decoration: BoxDecoration(color: _codeFill(context)),
|
||||||
@@ -274,13 +273,7 @@ class _ChatMarkdownViewState extends State<ChatMarkdownView> {
|
|||||||
),
|
),
|
||||||
onEnter: (event) {
|
onEnter: (event) {
|
||||||
if (_route?.isCurrent != false) {
|
if (_route?.isCurrent != false) {
|
||||||
_codeHover.show(
|
_codeHover.show(context, token, text, event.position);
|
||||||
context,
|
|
||||||
token,
|
|
||||||
text,
|
|
||||||
event.position,
|
|
||||||
cupertino: false,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onExit: (_) => _codeHover.scheduleHide(token),
|
onExit: (_) => _codeHover.scheduleHide(token),
|
||||||
|
|||||||
@@ -31,13 +31,8 @@ Color chatBubbleFill(BuildContext context, Color base) {
|
|||||||
/// in the host's own surface roles. The agent's turn has no bubble at all; its
|
/// in the host's own surface roles. The agent's turn has no bubble at all; its
|
||||||
/// text sits on the page, so only the operator's words are enclosed.
|
/// text sits on the page, so only the operator's words are enclosed.
|
||||||
class ChatUserBubble extends StatelessWidget {
|
class ChatUserBubble extends StatelessWidget {
|
||||||
const ChatUserBubble({
|
const ChatUserBubble({super.key, required this.child});
|
||||||
super.key,
|
|
||||||
required this.cupertino,
|
|
||||||
required this.child,
|
|
||||||
});
|
|
||||||
|
|
||||||
final bool cupertino;
|
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
|
||||||
static const BorderRadius _radius = BorderRadius.all(Radius.circular(20));
|
static const BorderRadius _radius = BorderRadius.all(Radius.circular(20));
|
||||||
@@ -65,13 +60,8 @@ class ChatUserBubble extends StatelessWidget {
|
|||||||
/// The agent's answer drawn straight on the page. Material keeps a transparent
|
/// The agent's answer drawn straight on the page. Material keeps a transparent
|
||||||
/// surface so disclosure ListTiles still paint their ink.
|
/// surface so disclosure ListTiles still paint their ink.
|
||||||
class ChatAgentSurface extends StatelessWidget {
|
class ChatAgentSurface extends StatelessWidget {
|
||||||
const ChatAgentSurface({
|
const ChatAgentSurface({super.key, required this.child});
|
||||||
super.key,
|
|
||||||
required this.cupertino,
|
|
||||||
required this.child,
|
|
||||||
});
|
|
||||||
|
|
||||||
final bool cupertino;
|
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -81,7 +71,7 @@ class ChatAgentSurface extends StatelessWidget {
|
|||||||
|
|
||||||
/// The transcript's reading text: the host's large body role, so answers read
|
/// The transcript's reading text: the host's large body role, so answers read
|
||||||
/// at a comfortable size and still follow the operator's text scaling.
|
/// at a comfortable size and still follow the operator's text scaling.
|
||||||
TextStyle? chatMessageTextStyle(BuildContext context, bool cupertino) =>
|
TextStyle? chatMessageTextStyle(BuildContext context, [bool? cupertino]) =>
|
||||||
Theme.of(context).textTheme.bodyLarge;
|
Theme.of(context).textTheme.bodyLarge;
|
||||||
|
|
||||||
/// The empty-line gap between two paragraphs of a reply: about one line of
|
/// The empty-line gap between two paragraphs of a reply: about one line of
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class ChatMessageView extends StatelessWidget {
|
|||||||
: _agentRow(
|
: _agentRow(
|
||||||
context,
|
context,
|
||||||
content,
|
content,
|
||||||
ChatAgentSurface(cupertino: false, child: body),
|
ChatAgentSurface(child: body),
|
||||||
gutter,
|
gutter,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -117,7 +117,7 @@ class ChatMessageView extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
final hasTimestamp = chatMessageCreatedAt(_userMessage) != null;
|
final hasTimestamp = chatMessageCreatedAt(_userMessage) != null;
|
||||||
if (thumbnails.isEmpty && footer.isEmpty && !hasTimestamp) {
|
if (thumbnails.isEmpty && footer.isEmpty && !hasTimestamp) {
|
||||||
return ChatUserBubble(cupertino: false, child: body);
|
return ChatUserBubble(child: body);
|
||||||
}
|
}
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@@ -132,7 +132,7 @@ class ChatMessageView extends StatelessWidget {
|
|||||||
if (thumbnails.isNotEmpty && content.isNotEmpty)
|
if (thumbnails.isNotEmpty && content.isNotEmpty)
|
||||||
const SizedBox(height: 6),
|
const SizedBox(height: 6),
|
||||||
if (content.isNotEmpty || thumbnails.isEmpty)
|
if (content.isNotEmpty || thumbnails.isEmpty)
|
||||||
ChatUserBubble(cupertino: false, child: body),
|
ChatUserBubble(child: body),
|
||||||
if (footer.isNotEmpty) ...[
|
if (footer.isNotEmpty) ...[
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
Wrap(
|
Wrap(
|
||||||
@@ -181,9 +181,7 @@ class ChatMessageView extends StatelessWidget {
|
|||||||
double gutter,
|
double gutter,
|
||||||
) {
|
) {
|
||||||
final copyText = row['streaming'] == true ? '' : _answerText(_partsOf(row));
|
final copyText = row['streaming'] == true ? '' : _answerText(_partsOf(row));
|
||||||
final copy = copyText.isEmpty
|
final copy = copyText.isEmpty ? null : ChatCopyButton(text: copyText);
|
||||||
? null
|
|
||||||
: ChatCopyButton(text: copyText, cupertino: false);
|
|
||||||
if (gutter <= 0) return _agentTurn(context, content, answer, copy);
|
if (gutter <= 0) return _agentTurn(context, content, answer, copy);
|
||||||
return ChatCopyGutterRow(
|
return ChatCopyGutterRow(
|
||||||
width: gutter,
|
width: gutter,
|
||||||
|
|||||||
@@ -0,0 +1,114 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../ui/adaptive/app_popups.dart';
|
||||||
|
import 'keyboard_shortcuts_registry.dart';
|
||||||
|
|
||||||
|
const keyboardShortcutsLabel = 'Keyboard shortcuts';
|
||||||
|
|
||||||
|
Future<void> showKeyboardShortcutsHelp(BuildContext context) =>
|
||||||
|
showAppDetails<void>(
|
||||||
|
context,
|
||||||
|
maxWidth: 640,
|
||||||
|
builder: (_) => const KeyboardShortcutsHelp(),
|
||||||
|
);
|
||||||
|
|
||||||
|
class KeyboardShortcutsHelp extends StatelessWidget {
|
||||||
|
const KeyboardShortcutsHelp({super.key, this.registry});
|
||||||
|
|
||||||
|
final KeyboardShortcutRegistry? registry;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final entries = (registry ?? KeyboardShortcutRegistry.current()).entries;
|
||||||
|
final content = Semantics(
|
||||||
|
scopesRoute: true,
|
||||||
|
namesRoute: true,
|
||||||
|
explicitChildNodes: true,
|
||||||
|
label: 'Keyboard shortcuts help',
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.fromLTRB(24, 8, 24, 24),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
keyboardShortcutsLabel,
|
||||||
|
style: Theme.of(context).textTheme.headlineSmall,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
tooltip: 'Close keyboard shortcuts',
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
icon: const Icon(Icons.close),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Text(
|
||||||
|
'Shortcuts available in the current app and browser environment.',
|
||||||
|
style: Theme.of(context).textTheme.bodyMedium,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
for (final (index, entry) in entries.indexed) ...[
|
||||||
|
if (index > 0) const Divider(height: 1),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||||
|
child: _ShortcutRow(entry: entry),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
'On macOS, Option is shown for Alt. Browsers can reserve system or tab shortcuts.',
|
||||||
|
style: Theme.of(context).textTheme.bodySmall,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
// The desktop details dialog supplies its own bounded scroll view. The
|
||||||
|
// narrow details sheet does not, so keep the help readable at large text
|
||||||
|
// scales and on short phone screens there as well.
|
||||||
|
return usesDesktopPopups(context)
|
||||||
|
? content
|
||||||
|
: SingleChildScrollView(child: content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ShortcutRow extends StatelessWidget {
|
||||||
|
const _ShortcutRow({required this.entry});
|
||||||
|
|
||||||
|
final KeyboardShortcutEntry entry;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) => Semantics(
|
||||||
|
container: true,
|
||||||
|
label:
|
||||||
|
'${entry.action}: ${entry.keys}${entry.caveat == null ? '' : '. ${entry.caveat}'}',
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Expanded(child: Text(entry.action)),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
entry.keys,
|
||||||
|
textAlign: TextAlign.end,
|
||||||
|
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
if (entry.caveat case final caveat?) ...[
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(caveat, style: Theme.of(context).textTheme.bodySmall),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
|
import '../chat/workspace/chat_center_stage_controller.dart';
|
||||||
|
import '../chat/workspace/chat_float_shortcut.dart';
|
||||||
|
import '../terminal/terminal_shortcuts.dart';
|
||||||
|
import '../../shell/windows/window_shortcuts.dart';
|
||||||
|
import '../../shell/shell_search_shortcut_labels.dart';
|
||||||
|
|
||||||
|
/// A shortcut entry shown in the in-app help. Keeping these entries together
|
||||||
|
/// prevents the help page from inventing chords that the handlers do not use.
|
||||||
|
class KeyboardShortcutEntry {
|
||||||
|
const KeyboardShortcutEntry({
|
||||||
|
required this.action,
|
||||||
|
required this.keys,
|
||||||
|
this.caveat,
|
||||||
|
});
|
||||||
|
|
||||||
|
final String action;
|
||||||
|
final String keys;
|
||||||
|
final String? caveat;
|
||||||
|
}
|
||||||
|
|
||||||
|
class KeyboardShortcutRegistry {
|
||||||
|
const KeyboardShortcutRegistry({required this.platform, required this.web});
|
||||||
|
|
||||||
|
factory KeyboardShortcutRegistry.current() =>
|
||||||
|
KeyboardShortcutRegistry(platform: defaultTargetPlatform, web: kIsWeb);
|
||||||
|
|
||||||
|
final TargetPlatform platform;
|
||||||
|
final bool web;
|
||||||
|
|
||||||
|
bool get _apple =>
|
||||||
|
platform == TargetPlatform.macOS || platform == TargetPlatform.iOS;
|
||||||
|
|
||||||
|
bool get _macOS => platform == TargetPlatform.macOS;
|
||||||
|
|
||||||
|
List<KeyboardShortcutEntry> get entries => [
|
||||||
|
KeyboardShortcutEntry(
|
||||||
|
action: 'Show or hide terminal',
|
||||||
|
keys: TerminalShortcutLabels(
|
||||||
|
web: web,
|
||||||
|
platform: platform,
|
||||||
|
).toggle.join(', '),
|
||||||
|
caveat: web
|
||||||
|
? 'Browser tab shortcuts such as Cmd+T are not available to the app.'
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
KeyboardShortcutEntry(
|
||||||
|
action: 'Show or hide floating chats',
|
||||||
|
keys: _apple
|
||||||
|
? '${chatFloatShortcutLabel(platform)}, Ctrl+Y, Cmd+Y'
|
||||||
|
: '${chatFloatShortcutLabel(platform)}, Ctrl+Y',
|
||||||
|
caveat:
|
||||||
|
'Brings a chat forward from Terminal and focuses its message input.',
|
||||||
|
),
|
||||||
|
KeyboardShortcutEntry(
|
||||||
|
action: 'Toggle Center Stage',
|
||||||
|
keys:
|
||||||
|
'${chatCenterStageShortcutLabel(platform)}${_apple ? ', Cmd+E' : ', Ctrl+E'}',
|
||||||
|
),
|
||||||
|
KeyboardShortcutEntry(
|
||||||
|
action: 'Open Search',
|
||||||
|
keys: shellSearchShortcutLabels(platform).join(', '),
|
||||||
|
caveat: web ? 'The browser may reserve some keyboard shortcuts.' : null,
|
||||||
|
),
|
||||||
|
KeyboardShortcutEntry(
|
||||||
|
action: 'Cycle floating windows',
|
||||||
|
keys:
|
||||||
|
'${windowCycleShortcutLabel(platform)}, ${windowCycleShortcutLabel(platform)} with Shift',
|
||||||
|
),
|
||||||
|
KeyboardShortcutEntry(
|
||||||
|
action: 'Open a chat list item',
|
||||||
|
keys: _macOS ? 'Cmd+1…9' : 'Ctrl+1…9',
|
||||||
|
caveat:
|
||||||
|
'Available when the Chat list is mounted; numbers select its visible item.',
|
||||||
|
),
|
||||||
|
KeyboardShortcutEntry(
|
||||||
|
action: 'Focus the active chat composer',
|
||||||
|
keys: '/',
|
||||||
|
caveat: 'Only outside text fields and other popup surfaces.',
|
||||||
|
),
|
||||||
|
KeyboardShortcutEntry(
|
||||||
|
action: 'Send a chat message',
|
||||||
|
keys: _apple ? 'Cmd+Enter' : 'Ctrl+Enter',
|
||||||
|
),
|
||||||
|
if (!web)
|
||||||
|
const KeyboardShortcutEntry(
|
||||||
|
action: 'Move between terminal tabs',
|
||||||
|
keys: 'Ctrl+Tab, Ctrl+Shift+Tab',
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'keyboard_shortcuts_help.dart';
|
||||||
|
import 'settings_keys.dart';
|
||||||
|
import 'settings_row.dart';
|
||||||
|
|
||||||
|
class SettingsKeyboardShortcutsSection extends StatelessWidget {
|
||||||
|
const SettingsKeyboardShortcutsSection({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) => SettingsRow(
|
||||||
|
key: SettingsKeys.keyboardShortcuts,
|
||||||
|
leading: const Icon(Icons.keyboard_outlined),
|
||||||
|
title: const Text(keyboardShortcutsLabel),
|
||||||
|
subtitle: const Text('See the shortcuts available on this platform.'),
|
||||||
|
chevron: true,
|
||||||
|
onTap: () => showKeyboardShortcutsHelp(context),
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -11,4 +11,7 @@ abstract final class SettingsKeys {
|
|||||||
static const saveWorkspace = ValueKey<String>('settings.saveWorkspace');
|
static const saveWorkspace = ValueKey<String>('settings.saveWorkspace');
|
||||||
static const templates = ValueKey<String>('settings.templates');
|
static const templates = ValueKey<String>('settings.templates');
|
||||||
static const schedules = ValueKey<String>('settings.schedules');
|
static const schedules = ValueKey<String>('settings.schedules');
|
||||||
|
static const keyboardShortcuts = ValueKey<String>(
|
||||||
|
'settings.keyboardShortcuts',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import 'settings_templates_section.dart';
|
|||||||
import 'server_connections.dart';
|
import 'server_connections.dart';
|
||||||
import 'saved_servers_section.dart';
|
import 'saved_servers_section.dart';
|
||||||
import 'managed_connection_section.dart';
|
import 'managed_connection_section.dart';
|
||||||
|
import 'settings_keyboard_shortcuts_section.dart';
|
||||||
|
|
||||||
part 'settings_topic_pages.dart';
|
part 'settings_topic_pages.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,11 @@ extension _SettingsTopicPages on _SettingsScreenState {
|
|||||||
SettingsStorageSection(gateway: widget.client),
|
SettingsStorageSection(gateway: widget.client),
|
||||||
),
|
),
|
||||||
_single('Server', SettingsHealthSection(gateway: widget.client)),
|
_single('Server', SettingsHealthSection(gateway: widget.client)),
|
||||||
|
SettingsGroup(
|
||||||
|
title: 'Help',
|
||||||
|
leadingRows: true,
|
||||||
|
children: const [SettingsKeyboardShortcutsSection()],
|
||||||
|
),
|
||||||
if (widget.onOpenSchedules != null || widget.onOpenTemplates != null)
|
if (widget.onOpenSchedules != null || widget.onOpenTemplates != null)
|
||||||
SettingsGroup(
|
SettingsGroup(
|
||||||
title: 'Library',
|
title: 'Library',
|
||||||
|
|||||||
@@ -15,13 +15,11 @@ class TerminalBody extends StatelessWidget {
|
|||||||
const TerminalBody({
|
const TerminalBody({
|
||||||
super.key,
|
super.key,
|
||||||
required this.hub,
|
required this.hub,
|
||||||
required this.cupertino,
|
|
||||||
this.keys = false,
|
this.keys = false,
|
||||||
this.focus,
|
this.focus,
|
||||||
});
|
});
|
||||||
|
|
||||||
final TerminalHub hub;
|
final TerminalHub hub;
|
||||||
final bool cupertino;
|
|
||||||
final bool keys;
|
final bool keys;
|
||||||
final FocusScopeNode? focus;
|
final FocusScopeNode? focus;
|
||||||
|
|
||||||
@@ -52,7 +50,6 @@ class TerminalBody extends StatelessWidget {
|
|||||||
child: ChatShellTerminalView(
|
child: ChatShellTerminalView(
|
||||||
key: ValueKey('terminal-view-${tab.key}'),
|
key: ValueKey('terminal-view-${tab.key}'),
|
||||||
session: tab.session,
|
session: tab.session,
|
||||||
cupertino: cupertino,
|
|
||||||
fill: true,
|
fill: true,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
),
|
),
|
||||||
@@ -68,7 +65,6 @@ class TerminalBody extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.fromLTRB(8, 0, 8, 8),
|
padding: const EdgeInsets.fromLTRB(8, 0, 8, 8),
|
||||||
child: ChatShellTerminalKeys(
|
child: ChatShellTerminalKeys(
|
||||||
session: tab.session,
|
session: tab.session,
|
||||||
cupertino: cupertino,
|
|
||||||
field: chatShellTouchFirst(),
|
field: chatShellTouchFirst(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -77,10 +73,10 @@ class TerminalBody extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextStyle? _noteStyle(BuildContext context) =>
|
TextStyle? _noteStyle(BuildContext context) => Theme.of(context)
|
||||||
Theme.of(context).textTheme.bodySmall?.copyWith(
|
.textTheme
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
.bodySmall
|
||||||
);
|
?.copyWith(color: Theme.of(context).colorScheme.onSurfaceVariant);
|
||||||
|
|
||||||
Widget _closeEnded(TerminalTab tab) {
|
Widget _closeEnded(TerminalTab tab) {
|
||||||
void close() => unawaited(hub.close(tab));
|
void close() => unawaited(hub.close(tab));
|
||||||
|
|||||||
@@ -15,19 +15,15 @@ class TerminalChoice<T> {
|
|||||||
class TerminalMenuButton<T> extends StatelessWidget {
|
class TerminalMenuButton<T> extends StatelessWidget {
|
||||||
const TerminalMenuButton({
|
const TerminalMenuButton({
|
||||||
super.key,
|
super.key,
|
||||||
required this.cupertino,
|
|
||||||
required this.label,
|
required this.label,
|
||||||
required this.icon,
|
required this.icon,
|
||||||
required this.cupertinoIcon,
|
|
||||||
required this.choices,
|
required this.choices,
|
||||||
required this.onSelected,
|
required this.onSelected,
|
||||||
this.info,
|
this.info,
|
||||||
});
|
});
|
||||||
|
|
||||||
final bool cupertino;
|
|
||||||
final String label;
|
final String label;
|
||||||
final IconData icon;
|
final IconData icon;
|
||||||
final IconData cupertinoIcon;
|
|
||||||
final List<TerminalChoice<T>> choices;
|
final List<TerminalChoice<T>> choices;
|
||||||
final ValueChanged<T> onSelected;
|
final ValueChanged<T> onSelected;
|
||||||
|
|
||||||
|
|||||||
@@ -12,10 +12,8 @@ import 'terminal_tab_strip.dart';
|
|||||||
PageRoute<void> terminalPageRoute({
|
PageRoute<void> terminalPageRoute({
|
||||||
required TerminalHub hub,
|
required TerminalHub hub,
|
||||||
required TerminalLayout layout,
|
required TerminalLayout layout,
|
||||||
required bool cupertino,
|
|
||||||
}) {
|
}) {
|
||||||
Widget page(BuildContext _) =>
|
Widget page(BuildContext _) => TerminalPage(hub: hub, layout: layout);
|
||||||
TerminalPage(hub: hub, layout: layout, cupertino: cupertino);
|
|
||||||
return MaterialPageRoute<void>(builder: page);
|
return MaterialPageRoute<void>(builder: page);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,14 +30,9 @@ class TerminalPageToggle {
|
|||||||
BuildContext context, {
|
BuildContext context, {
|
||||||
required TerminalHub hub,
|
required TerminalHub hub,
|
||||||
required TerminalLayout layout,
|
required TerminalLayout layout,
|
||||||
required bool cupertino,
|
|
||||||
}) async {
|
}) async {
|
||||||
if (_route != null) return;
|
if (_route != null) return;
|
||||||
final route = _route = terminalPageRoute(
|
final route = _route = terminalPageRoute(hub: hub, layout: layout);
|
||||||
hub: hub,
|
|
||||||
layout: layout,
|
|
||||||
cupertino: cupertino,
|
|
||||||
);
|
|
||||||
try {
|
try {
|
||||||
await Navigator.of(context).push(route);
|
await Navigator.of(context).push(route);
|
||||||
} finally {
|
} finally {
|
||||||
@@ -59,16 +52,10 @@ class TerminalPageToggle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class TerminalPage extends StatelessWidget {
|
class TerminalPage extends StatelessWidget {
|
||||||
const TerminalPage({
|
const TerminalPage({super.key, required this.hub, required this.layout});
|
||||||
super.key,
|
|
||||||
required this.hub,
|
|
||||||
required this.layout,
|
|
||||||
required this.cupertino,
|
|
||||||
});
|
|
||||||
|
|
||||||
final TerminalHub hub;
|
final TerminalHub hub;
|
||||||
final TerminalLayout layout;
|
final TerminalLayout layout;
|
||||||
final bool cupertino;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -78,15 +65,8 @@ class TerminalPage extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
TerminalTabStrip(
|
TerminalTabStrip(hub: hub, layout: layout, showModes: false),
|
||||||
hub: hub,
|
Expanded(child: TerminalBody(hub: hub, keys: true)),
|
||||||
layout: layout,
|
|
||||||
cupertino: cupertino,
|
|
||||||
showModes: false,
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: TerminalBody(hub: hub, cupertino: cupertino, keys: true),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -34,14 +34,12 @@ class TerminalPanel extends StatefulWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.hub,
|
required this.hub,
|
||||||
required this.layout,
|
required this.layout,
|
||||||
required this.cupertino,
|
|
||||||
required this.available,
|
required this.available,
|
||||||
this.focus,
|
this.focus,
|
||||||
});
|
});
|
||||||
|
|
||||||
final TerminalHub hub;
|
final TerminalHub hub;
|
||||||
final TerminalLayout layout;
|
final TerminalLayout layout;
|
||||||
final bool cupertino;
|
|
||||||
|
|
||||||
/// The height of the window the panel shares with the app.
|
/// The height of the window the panel shares with the app.
|
||||||
final double available;
|
final double available;
|
||||||
@@ -138,17 +136,9 @@ class _TerminalPanelState extends State<TerminalPanel> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
handle,
|
handle,
|
||||||
TerminalTabStrip(
|
TerminalTabStrip(hub: widget.hub, layout: widget.layout),
|
||||||
hub: widget.hub,
|
|
||||||
layout: widget.layout,
|
|
||||||
cupertino: widget.cupertino,
|
|
||||||
),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TerminalBody(
|
child: TerminalBody(hub: widget.hub, focus: widget.focus),
|
||||||
hub: widget.hub,
|
|
||||||
cupertino: widget.cupertino,
|
|
||||||
focus: widget.focus,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../../ui/adaptive/segmented_bar_pieces.dart';
|
|
||||||
|
|
||||||
/// On a phone, a small floating button below the top bar's right end that
|
/// On a phone, a small floating button below the top bar's right end that
|
||||||
/// opens the full-screen terminal. It shows how many shells are running when
|
/// opens the full-screen terminal. It shows how many shells are running when
|
||||||
/// there is more than one.
|
/// there is more than one.
|
||||||
@@ -9,21 +7,16 @@ class TerminalShortcutBubble extends StatelessWidget {
|
|||||||
const TerminalShortcutBubble({
|
const TerminalShortcutBubble({
|
||||||
super.key,
|
super.key,
|
||||||
required this.running,
|
required this.running,
|
||||||
required this.cupertino,
|
|
||||||
required this.onOpen,
|
required this.onOpen,
|
||||||
});
|
});
|
||||||
|
|
||||||
final int running;
|
final int running;
|
||||||
final bool cupertino;
|
|
||||||
final VoidCallback onOpen;
|
final VoidCallback onOpen;
|
||||||
|
|
||||||
/// The top edge: below the safe area and the top bar (its 8 px top inset
|
/// The top edge: below the safe area and the top bar (its 8 px top inset
|
||||||
/// and its pieces), with an 8 px gap.
|
/// and its pieces), with an 8 px gap.
|
||||||
static double topOf(BuildContext context, {required bool cupertino}) =>
|
static double topOf(BuildContext context) =>
|
||||||
MediaQuery.paddingOf(context).top +
|
MediaQuery.paddingOf(context).top + 8 + kMinInteractiveDimension + 8;
|
||||||
8 +
|
|
||||||
segmentedPieceHeight(cupertino) +
|
|
||||||
8;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ class TerminalStage extends StatelessWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.hub,
|
required this.hub,
|
||||||
required this.layout,
|
required this.layout,
|
||||||
required this.cupertino,
|
|
||||||
required this.present,
|
required this.present,
|
||||||
required this.reveal,
|
required this.reveal,
|
||||||
required this.focus,
|
required this.focus,
|
||||||
@@ -24,7 +23,6 @@ class TerminalStage extends StatelessWidget {
|
|||||||
|
|
||||||
final TerminalHub hub;
|
final TerminalHub hub;
|
||||||
final TerminalLayout layout;
|
final TerminalLayout layout;
|
||||||
final bool cupertino;
|
|
||||||
final bool present;
|
final bool present;
|
||||||
final Animation<double> reveal;
|
final Animation<double> reveal;
|
||||||
final FocusScopeNode focus;
|
final FocusScopeNode focus;
|
||||||
@@ -76,7 +74,6 @@ class TerminalStage extends StatelessWidget {
|
|||||||
key: const ValueKey('terminal-panel'),
|
key: const ValueKey('terminal-panel'),
|
||||||
hub: hub,
|
hub: hub,
|
||||||
layout: layout,
|
layout: layout,
|
||||||
cupertino: cupertino,
|
|
||||||
available: constraints.maxHeight,
|
available: constraints.maxHeight,
|
||||||
focus: focus,
|
focus: focus,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class TerminalSurface extends StatefulWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.hub,
|
required this.hub,
|
||||||
required this.layout,
|
required this.layout,
|
||||||
required this.cupertino,
|
this.cupertino,
|
||||||
required this.child,
|
required this.child,
|
||||||
this.shortcutHere = true,
|
this.shortcutHere = true,
|
||||||
this.windows,
|
this.windows,
|
||||||
@@ -40,7 +40,9 @@ class TerminalSurface extends StatefulWidget {
|
|||||||
|
|
||||||
final TerminalHub hub;
|
final TerminalHub hub;
|
||||||
final TerminalLayout layout;
|
final TerminalLayout layout;
|
||||||
final bool cupertino;
|
|
||||||
|
/// Kept for callers migrating from the former alternate host; ignored.
|
||||||
|
final bool? cupertino;
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
|
||||||
/// Whether the current page offers the phone shortcut to reopen the
|
/// Whether the current page offers the phone shortcut to reopen the
|
||||||
@@ -189,12 +191,7 @@ class _TerminalSurfaceState extends State<TerminalSurface>
|
|||||||
Future<void> _openPage() async {
|
Future<void> _openPage() async {
|
||||||
unawaited(openTerminalIfNone(widget.hub));
|
unawaited(openTerminalIfNone(widget.hub));
|
||||||
setState(() {});
|
setState(() {});
|
||||||
await _page.show(
|
await _page.show(context, hub: widget.hub, layout: widget.layout);
|
||||||
context,
|
|
||||||
hub: widget.hub,
|
|
||||||
layout: widget.layout,
|
|
||||||
cupertino: widget.cupertino,
|
|
||||||
);
|
|
||||||
if (mounted) setState(() {});
|
if (mounted) setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,13 +209,9 @@ class _TerminalSurfaceState extends State<TerminalSurface>
|
|||||||
if (show)
|
if (show)
|
||||||
PositionedDirectional(
|
PositionedDirectional(
|
||||||
end: 12,
|
end: 12,
|
||||||
top: TerminalShortcutBubble.topOf(
|
top: TerminalShortcutBubble.topOf(context),
|
||||||
context,
|
|
||||||
cupertino: widget.cupertino,
|
|
||||||
),
|
|
||||||
child: TerminalShortcutBubble(
|
child: TerminalShortcutBubble(
|
||||||
running: running,
|
running: running,
|
||||||
cupertino: widget.cupertino,
|
|
||||||
onOpen: () => unawaited(_openPage()),
|
onOpen: () => unawaited(_openPage()),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -234,7 +227,6 @@ class _TerminalSurfaceState extends State<TerminalSurface>
|
|||||||
builder: (context, child) => TerminalStage(
|
builder: (context, child) => TerminalStage(
|
||||||
hub: widget.hub,
|
hub: widget.hub,
|
||||||
layout: widget.layout,
|
layout: widget.layout,
|
||||||
cupertino: widget.cupertino,
|
|
||||||
// Kept while the hide motion runs.
|
// Kept while the hide motion runs.
|
||||||
present: !_narrow && (widget.layout.visible || !_reveal.isDismissed),
|
present: !_narrow && (widget.layout.visible || !_reveal.isDismissed),
|
||||||
reveal: _curve,
|
reveal: _curve,
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'terminal_hub.dart';
|
import 'terminal_hub.dart';
|
||||||
@@ -18,14 +17,12 @@ class TerminalTabStrip extends StatelessWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.hub,
|
required this.hub,
|
||||||
required this.layout,
|
required this.layout,
|
||||||
required this.cupertino,
|
|
||||||
this.trailing = const [],
|
this.trailing = const [],
|
||||||
this.showModes = true,
|
this.showModes = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
final TerminalHub hub;
|
final TerminalHub hub;
|
||||||
final TerminalLayout layout;
|
final TerminalLayout layout;
|
||||||
final bool cupertino;
|
|
||||||
final List<Widget> trailing;
|
final List<Widget> trailing;
|
||||||
|
|
||||||
/// False on the narrow page, which has no panel or window to choose.
|
/// False on the narrow page, which has no panel or window to choose.
|
||||||
@@ -57,11 +54,9 @@ class TerminalTabStrip extends StatelessWidget {
|
|||||||
_newTerminal(),
|
_newTerminal(),
|
||||||
if (showModes)
|
if (showModes)
|
||||||
TerminalMenuButton<_Option>(
|
TerminalMenuButton<_Option>(
|
||||||
cupertino: cupertino,
|
|
||||||
label: 'Terminal options',
|
label: 'Terminal options',
|
||||||
info: TerminalShortcutLabels.current().summary,
|
info: TerminalShortcutLabels.current().summary,
|
||||||
icon: Icons.more_vert,
|
icon: Icons.more_vert,
|
||||||
cupertinoIcon: CupertinoIcons.ellipsis,
|
|
||||||
choices: [
|
choices: [
|
||||||
for (final mode in TerminalMode.values)
|
for (final mode in TerminalMode.values)
|
||||||
TerminalChoice(
|
TerminalChoice(
|
||||||
@@ -113,10 +108,8 @@ class TerminalTabStrip extends StatelessWidget {
|
|||||||
final machines = hub.connected;
|
final machines = hub.connected;
|
||||||
if (machines.length > 1) {
|
if (machines.length > 1) {
|
||||||
return TerminalMenuButton<String>(
|
return TerminalMenuButton<String>(
|
||||||
cupertino: cupertino,
|
|
||||||
label: 'New terminal',
|
label: 'New terminal',
|
||||||
icon: Icons.add,
|
icon: Icons.add,
|
||||||
cupertinoIcon: CupertinoIcons.add,
|
|
||||||
choices: [
|
choices: [
|
||||||
for (final machine in machines)
|
for (final machine in machines)
|
||||||
TerminalChoice(
|
TerminalChoice(
|
||||||
|
|||||||
@@ -7,14 +7,12 @@ import 'terminal_shortcuts.dart';
|
|||||||
/// The shell bar's Terminal button: shows or hides the terminal (also
|
/// The shell bar's Terminal button: shows or hides the terminal (also
|
||||||
/// Alt+T, Ctrl+T, Cmd+T and Ctrl+`, where the platform delivers them).
|
/// Alt+T, Ctrl+T, Cmd+T and Ctrl+`, where the platform delivers them).
|
||||||
class TerminalToggleButton extends StatelessWidget {
|
class TerminalToggleButton extends StatelessWidget {
|
||||||
const TerminalToggleButton({
|
const TerminalToggleButton({super.key, required this.layout, this.cupertino});
|
||||||
super.key,
|
|
||||||
required this.layout,
|
|
||||||
required this.cupertino,
|
|
||||||
});
|
|
||||||
|
|
||||||
final TerminalLayout layout;
|
final TerminalLayout layout;
|
||||||
final bool cupertino;
|
|
||||||
|
/// Kept for callers migrating from the former alternate host; ignored.
|
||||||
|
final bool? cupertino;
|
||||||
|
|
||||||
/// The tooltip, naming the platform's most convenient shortcut.
|
/// The tooltip, naming the platform's most convenient shortcut.
|
||||||
static String get label => TerminalShortcutLabels.current().button;
|
static String get label => TerminalShortcutLabels.current().button;
|
||||||
|
|||||||
@@ -149,8 +149,8 @@ class TerminalWindowKind extends WindowKind {
|
|||||||
builder: (context, _) => Column(
|
builder: (context, _) => Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
TerminalTabStrip(hub: hub, layout: layout, cupertino: false),
|
TerminalTabStrip(hub: hub, layout: layout),
|
||||||
Expanded(child: TerminalBody(hub: hub, cupertino: false)),
|
Expanded(child: TerminalBody(hub: hub)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import 'list_detail.dart';
|
|||||||
import 'list_pane_widths.dart';
|
import 'list_pane_widths.dart';
|
||||||
import 'shell_bar.dart';
|
import 'shell_bar.dart';
|
||||||
import 'shell_list_shortcuts.dart';
|
import 'shell_list_shortcuts.dart';
|
||||||
|
import 'shell_search_shortcut_labels.dart';
|
||||||
import 'tab_history.dart';
|
import 'tab_history.dart';
|
||||||
import '../ui/input/keyboard_owner.dart';
|
import '../ui/input/keyboard_owner.dart';
|
||||||
|
|
||||||
@@ -36,8 +37,7 @@ class AdaptiveShell extends StatefulWidget {
|
|||||||
|
|
||||||
final Map<AppDestination, WidgetBuilder> destinationBodies;
|
final Map<AppDestination, WidgetBuilder> destinationBodies;
|
||||||
|
|
||||||
/// Retained for callers that still pass it; the shell always draws the
|
/// Retained for callers that still pass it; the shell always draws Material.
|
||||||
/// Material controls and scaffold whether this is set or not.
|
|
||||||
final bool cupertino;
|
final bool cupertino;
|
||||||
|
|
||||||
/// The destination a route owner selected. When null the shell keeps its own
|
/// The destination a route owner selected. When null the shell keeps its own
|
||||||
@@ -383,7 +383,7 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
|||||||
IconButton(
|
IconButton(
|
||||||
key: const ValueKey('shell.search'),
|
key: const ValueKey('shell.search'),
|
||||||
onPressed: onSearch,
|
onPressed: onSearch,
|
||||||
tooltip: 'Search',
|
tooltip: 'Search (${shellSearchShortcutLabels().join(', ')})',
|
||||||
icon: const Icon(Icons.search),
|
icon: const Icon(Icons.search),
|
||||||
),
|
),
|
||||||
...widget.barActions,
|
...widget.barActions,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class AttentionDestinationIcon extends StatelessWidget {
|
|||||||
const AttentionDestinationIcon({
|
const AttentionDestinationIcon({
|
||||||
super.key,
|
super.key,
|
||||||
required this.count,
|
required this.count,
|
||||||
required this.cupertino,
|
this.cupertino = false,
|
||||||
required this.child,
|
required this.child,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ class ActivityBadge extends StatelessWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.count,
|
required this.count,
|
||||||
required this.label,
|
required this.label,
|
||||||
required this.cupertino,
|
this.cupertino = false,
|
||||||
required this.child,
|
required this.child,
|
||||||
this.bottom = false,
|
this.bottom = false,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
enum AppDestination { pipelines, runs, chat, search, settings }
|
enum AppDestination { pipelines, runs, chat, search, settings }
|
||||||
@@ -22,34 +21,32 @@ AppDestination shellTabFor(AppDestination destination) =>
|
|||||||
|
|
||||||
/// The label and icons for [value].
|
/// The label and icons for [value].
|
||||||
///
|
///
|
||||||
/// [cupertinoIcon] is retained in the record for callers that still read it;
|
|
||||||
/// the shell itself draws [icon] on its Material path.
|
|
||||||
({String label, IconData icon, IconData cupertinoIcon}) destinationDetails(
|
({String label, IconData icon, IconData cupertinoIcon}) destinationDetails(
|
||||||
AppDestination value,
|
AppDestination value,
|
||||||
) => switch (value) {
|
) => switch (value) {
|
||||||
AppDestination.pipelines => (
|
AppDestination.pipelines => (
|
||||||
label: 'Pipelines',
|
label: 'Pipelines',
|
||||||
icon: Icons.account_tree_outlined,
|
icon: Icons.account_tree_outlined,
|
||||||
cupertinoIcon: CupertinoIcons.arrow_branch,
|
cupertinoIcon: Icons.account_tree_outlined,
|
||||||
),
|
),
|
||||||
AppDestination.runs => (
|
AppDestination.runs => (
|
||||||
label: 'Runs',
|
label: 'Runs',
|
||||||
icon: Icons.play_circle_outline,
|
icon: Icons.play_circle_outline,
|
||||||
cupertinoIcon: CupertinoIcons.play_circle,
|
cupertinoIcon: Icons.play_circle_outline,
|
||||||
),
|
),
|
||||||
AppDestination.chat => (
|
AppDestination.chat => (
|
||||||
label: 'Chat',
|
label: 'Chat',
|
||||||
icon: Icons.chat_bubble_outline,
|
icon: Icons.chat_bubble_outline,
|
||||||
cupertinoIcon: CupertinoIcons.chat_bubble_2,
|
cupertinoIcon: Icons.chat_bubble_outline,
|
||||||
),
|
),
|
||||||
AppDestination.search => (
|
AppDestination.search => (
|
||||||
label: 'Search',
|
label: 'Search',
|
||||||
icon: Icons.search,
|
icon: Icons.search,
|
||||||
cupertinoIcon: CupertinoIcons.search,
|
cupertinoIcon: Icons.search,
|
||||||
),
|
),
|
||||||
AppDestination.settings => (
|
AppDestination.settings => (
|
||||||
label: 'Settings',
|
label: 'Settings',
|
||||||
icon: Icons.settings_outlined,
|
icon: Icons.settings_outlined,
|
||||||
cupertinoIcon: CupertinoIcons.gear,
|
cupertinoIcon: Icons.settings_outlined,
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -61,10 +61,13 @@ bool shellSearchShortcut(
|
|||||||
TargetPlatform? platform,
|
TargetPlatform? platform,
|
||||||
}) =>
|
}) =>
|
||||||
event is KeyDownEvent &&
|
event is KeyDownEvent &&
|
||||||
event.logicalKey == LogicalKeyboardKey.slash &&
|
!keyboard.isShiftPressed &&
|
||||||
shellPrimaryModifier(keyboard, platform: platform) &&
|
(shellPrimaryModifier(keyboard, platform: platform)
|
||||||
!keyboard.isAltPressed &&
|
? !keyboard.isAltPressed && event.logicalKey == LogicalKeyboardKey.slash
|
||||||
!keyboard.isShiftPressed;
|
: keyboard.isAltPressed &&
|
||||||
|
!keyboard.isControlPressed &&
|
||||||
|
!keyboard.isMetaPressed &&
|
||||||
|
event.physicalKey == PhysicalKeyboardKey.slash);
|
||||||
|
|
||||||
const _digits = [
|
const _digits = [
|
||||||
LogicalKeyboardKey.digit1,
|
LogicalKeyboardKey.digit1,
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
|
/// Search chords supported by the shell, independent of theme overrides.
|
||||||
|
List<String> shellSearchShortcutLabels([TargetPlatform? platform]) {
|
||||||
|
final target = platform ?? defaultTargetPlatform;
|
||||||
|
final apple = target == TargetPlatform.macOS || target == TargetPlatform.iOS;
|
||||||
|
return [
|
||||||
|
apple ? 'Option+/' : 'Alt+/',
|
||||||
|
if (target == TargetPlatform.macOS) 'Cmd+/',
|
||||||
|
'Ctrl+/',
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -21,3 +21,17 @@ Evidence:
|
|||||||
No browser fixture was run in this implementation stage; browser terminal
|
No browser fixture was run in this implementation stage; browser terminal
|
||||||
fixture support and full-app rendered evidence remain for the appropriate
|
fixture support and full-app rendered evidence remain for the appropriate
|
||||||
review stage.
|
review stage.
|
||||||
|
|
||||||
|
## Manager browser integration
|
||||||
|
|
||||||
|
Verified the merged full-app fixture with
|
||||||
|
`chats=2&header=1&terminals=1&terminal=float` at 1800×1000. Floated the second
|
||||||
|
chat, clicked the exposed Terminal content to focus it, then pressed Ctrl+Y.
|
||||||
|
Before typing, the browser's active element was the chat's `TEXTAREA`, labelled
|
||||||
|
`Work on demo`. Typing `Typed immediately after Ctrl+Y` appeared in that chat
|
||||||
|
without another click; the chat was visibly above Terminal.
|
||||||
|
|
||||||
|
Inspected `06-typed.png`. Capture reports, semantics snapshots and screenshots
|
||||||
|
are retained under run 369's `public/manager-integration-ctrl-y/`. This verifies
|
||||||
|
the actual Terminal/Chat widgets and browser focus handoff with a fake gateway,
|
||||||
|
not a live shell backend or native device installation.
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# Keyboard shortcuts help
|
||||||
|
|
||||||
|
Added a Settings → Tools → Help entry that opens a root-layered, bounded Material help
|
||||||
|
surface on desktop and the existing adaptive sheet on narrow layouts. The
|
||||||
|
registry reuses the terminal, floating-chat, Center Stage and window-cycle
|
||||||
|
label helpers, and records browser caveats for shortcuts that may be reserved.
|
||||||
|
Search and its tooltip share platform-aware labels for Option/Alt+/, macOS
|
||||||
|
Cmd+/, and Ctrl+/. The separately reviewed Search handler change (run 367)
|
||||||
|
is integrated into this candidate before landing the help.
|
||||||
|
Floating-chat help describes the new Terminal-to-composer focus handoff
|
||||||
|
instead of the obsolete macOS shell-yank exception.
|
||||||
|
Chat list numbering likewise uses Command only on macOS, matching the shell
|
||||||
|
rule on iOS and other platforms.
|
||||||
|
|
||||||
|
Focused verification:
|
||||||
|
|
||||||
|
- `tool/memwatch/full.sh 'test/features/settings/keyboard_shortcuts_help_test.dart test/features/settings/settings_screen_test.dart'`
|
||||||
|
— 15 passed, 0 failed.
|
||||||
|
- `tool/analyze.sh` — clean.
|
||||||
|
|
||||||
|
Browser/full-app capture was not run in this implementation stage; ui-review
|
||||||
|
should verify desktop light/dark, scaled text, keyboard traversal, and phone
|
||||||
|
constraints with the full-app fixture.
|
||||||
|
|
||||||
|
Manager merged-tree verification after Search integration: 24 focused help,
|
||||||
|
Settings, Search-shortcut and chat-keyboard tests passed; analysis was clean.
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# Material chat Cupertino cleanup
|
||||||
|
|
||||||
|
- Removed dead Material-only conversation helpers and the unused Cupertino icon
|
||||||
|
metadata from the thread header; `ChatBarAction.cupertinoIcon` remains an
|
||||||
|
optional ignored compatibility parameter for callers in other chat lanes.
|
||||||
|
- Removed unused `cupertino` arguments from transcript bubbles and copy-button
|
||||||
|
construction while preserving the existing Material widgets and behavior.
|
||||||
|
- Focused UI states covered: transcript bubble color rendering, message layout,
|
||||||
|
and chat thread view/header behavior.
|
||||||
|
- Checks: `tool/memwatch/full.sh 'test/features/chat/ui/transcript/chat_bubble_color_test.dart test/features/chat/ui/transcript/chat_message_view_test.dart test/features/chat/conversation/chat_thread_view_test.dart'`
|
||||||
|
— PASS (24 passed); `tool/analyze.sh` — clean.
|
||||||
|
- No visual redesign or browser/device capture was needed: the edits remove
|
||||||
|
unused parameters and alternate icon metadata without changing rendered
|
||||||
|
Material controls, layout, focus, scrolling, or navigation behavior.
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# Material chat and graph probes
|
||||||
|
|
||||||
|
- Removed Cupertino imports, host branches, and local style flags from the assigned chat and graph/stage-definition Dart probes.
|
||||||
|
- Preserved Material scaffolds, dark/light themes, text scaling, fixture data, callbacks, and browser interaction states.
|
||||||
|
- Focused watchdog tests: 39 passed across graph widgets and chat thread/composer coverage.
|
||||||
|
- `tool/analyze.sh`: clean, 0 errors, 0 warnings.
|
||||||
|
- Node syntax checks passed for the corresponding probe drivers. No browser capture was run; this cleanup does not alter intended Material rendering.
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# Material-only terminal and chat shell cleanup
|
||||||
|
|
||||||
|
- Removed Cupertino icon imports, alternate icon metadata, and ignored host
|
||||||
|
flags from terminal and chat-shell widgets while retaining the existing
|
||||||
|
Material controls and terminal keyboard/focus/resize behavior.
|
||||||
|
- `TerminalSurface.cupertino` and `TerminalToggleButton.cupertino` remain
|
||||||
|
optional ignored compatibility parameters for the application lane's
|
||||||
|
existing `app_terminals.dart` callers; they have no rendering effect and are
|
||||||
|
ready for removal after those callers migrate.
|
||||||
|
- Focused check: `tool/memwatch/full.sh` with the nine terminal/chat-shell test
|
||||||
|
paths, 52 passed, 0 failed, 0 skipped.
|
||||||
|
- Analysis: `tool/analyze.sh` clean.
|
||||||
|
- No visual redesign or capture was performed; the changed widgets continue to
|
||||||
|
use the same Material palette, controls, layout, and semantics.
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# Material startup and shell cleanup
|
||||||
|
|
||||||
|
- Consolidated application startup, onboarding, routing pages, connection
|
||||||
|
states, Search, Templates, Schedules, and the navigation shell onto Material
|
||||||
|
composition on every platform.
|
||||||
|
- Kept legacy `cupertino` constructor arguments optional/ignored where callers
|
||||||
|
still pass them; no Cupertino widgets or platform host selection remain in
|
||||||
|
the changed application paths.
|
||||||
|
- Focused watchdog command ran the mirrored application/routing/navigation and
|
||||||
|
shell tests: 38 passed and 7 failed. The seven failures were teardown
|
||||||
|
assertions for the pre-existing 15-second `LaunchUpdateChecker` timer in
|
||||||
|
`PipelinesApp`; no Material cleanup assertion failed.
|
||||||
|
- `tool/analyze.sh`: clean (exit 0).
|
||||||
|
- No rendered capture was performed; this cleanup preserves the existing
|
||||||
|
Material scaffold, bars, connection states, focus, and navigation semantics.
|
||||||
|
|
||||||
|
## Manager recovery
|
||||||
|
|
||||||
|
The navigation and template-wiring fixtures were inadvertently invoking native
|
||||||
|
update plugins. They now explicitly disable updates, while dedicated startup
|
||||||
|
update tests retain and exercise the real update-check behavior.
|
||||||
|
|
||||||
|
The focused routing, app, schedules, template-wiring, split-bar, startup-update
|
||||||
|
check and startup-update-flow tests passed: 39 passed, zero failed. No production
|
||||||
|
update behavior was changed to hide the teardown failures.
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# Open Search with Alt+/ and Command+/
|
||||||
|
|
||||||
|
- Updated `shellSearchShortcut` to accept an exact Alt+/ chord by physical
|
||||||
|
slash position, including macOS Option dead-key logical values.
|
||||||
|
- Existing Ctrl+/ and macOS Command+/ matching remains logical-slash based;
|
||||||
|
Shift and mixed/extra modifiers remain rejected.
|
||||||
|
- Search destination routing, focus, query retention, and composer drafts were
|
||||||
|
left unchanged.
|
||||||
|
- Focused checks: `tool/memwatch/full.sh 'test/shell/search_shortcuts_test.dart
|
||||||
|
test/shell/destination_shortcuts_test.dart test/shell/list_shortcuts_test.dart
|
||||||
|
test/features/chat/chat_keyboard_focus_test.dart'` — PASS (13 passed, 0
|
||||||
|
failed, 0 skipped).
|
||||||
|
- `tool/analyze.sh` — clean.
|
||||||
|
- Browser capture was not run in this implementation stage; UI review owns
|
||||||
|
full-app Alt+/ and Meta+/ interaction evidence.
|
||||||
@@ -37,6 +37,8 @@ Future<void> pumpApp(
|
|||||||
PipelinesApp(
|
PipelinesApp(
|
||||||
server: webServer(),
|
server: webServer(),
|
||||||
client: client,
|
client: client,
|
||||||
|
// Navigation fixtures do not exercise native update plugins.
|
||||||
|
androidSupported: false,
|
||||||
cupertino: false,
|
cupertino: false,
|
||||||
routeInformationProvider: provider,
|
routeInformationProvider: provider,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ Future<void> pumpApp(
|
|||||||
PipelinesApp(
|
PipelinesApp(
|
||||||
server: webServer(),
|
server: webServer(),
|
||||||
client: client,
|
client: client,
|
||||||
|
// This fixture tests template routing, not native update plugins.
|
||||||
|
androidSupported: false,
|
||||||
cupertino: false,
|
cupertino: false,
|
||||||
routeInformationProvider: provider,
|
routeInformationProvider: provider,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import 'package:pipelines_app/core/api_gateway.dart';
|
|||||||
import 'package:pipelines_app/features/chat/screen.dart';
|
import 'package:pipelines_app/features/chat/screen.dart';
|
||||||
import 'package:pipelines_app/features/chat/ui/sessions/session_actions.dart';
|
import 'package:pipelines_app/features/chat/ui/sessions/session_actions.dart';
|
||||||
import 'package:pipelines_app/features/chat/workspace/chat_workspace.dart';
|
import 'package:pipelines_app/features/chat/workspace/chat_workspace.dart';
|
||||||
|
import 'package:pipelines_app/features/search/search_screen.dart';
|
||||||
|
import 'package:pipelines_app/features/search/ui/search_bar_controls.dart';
|
||||||
import 'package:pipelines_app/shell/adaptive_shell.dart';
|
import 'package:pipelines_app/shell/adaptive_shell.dart';
|
||||||
import 'package:pipelines_app/shell/destination.dart';
|
import 'package:pipelines_app/shell/destination.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
@@ -51,6 +53,11 @@ Future<void> _setup(WidgetTester tester) async {
|
|||||||
destination: AppDestination.chat,
|
destination: AppDestination.chat,
|
||||||
destinationBodies: {
|
destinationBodies: {
|
||||||
AppDestination.chat: (_) => ChatScreen(gateway: gateway),
|
AppDestination.chat: (_) => ChatScreen(gateway: gateway),
|
||||||
|
AppDestination.search: (_) => SearchScreen(
|
||||||
|
gateway: gateway,
|
||||||
|
onOpen: (_) {},
|
||||||
|
embedded: true,
|
||||||
|
),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -104,8 +111,8 @@ void main() {
|
|||||||
expect(await _slash(tester), isFalse);
|
expect(await _slash(tester), isFalse);
|
||||||
expect(_editable(tester, 'a').focusNode.hasPrimaryFocus, isTrue);
|
expect(_editable(tester, 'a').focusNode.hasPrimaryFocus, isTrue);
|
||||||
|
|
||||||
// Shift+/ (a question mark) and Alt+/ are not the shortcut; Ctrl+/ is
|
// Shift+/ (a question mark) is not the shortcut. Alt+/ opens the Search
|
||||||
// the shell's own Search chord.
|
// destination, while Ctrl+/ remains the shell's own Search chord.
|
||||||
await _focusSidebar(tester);
|
await _focusSidebar(tester);
|
||||||
await tester.sendKeyDownEvent(LogicalKeyboardKey.shiftLeft);
|
await tester.sendKeyDownEvent(LogicalKeyboardKey.shiftLeft);
|
||||||
await tester.sendKeyEvent(LogicalKeyboardKey.slash, character: '?');
|
await tester.sendKeyEvent(LogicalKeyboardKey.slash, character: '?');
|
||||||
@@ -114,7 +121,11 @@ void main() {
|
|||||||
await tester.sendKeyEvent(LogicalKeyboardKey.slash);
|
await tester.sendKeyEvent(LogicalKeyboardKey.slash);
|
||||||
await tester.sendKeyUpEvent(LogicalKeyboardKey.altLeft);
|
await tester.sendKeyUpEvent(LogicalKeyboardKey.altLeft);
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
expect(_editable(tester, 'a').focusNode.hasPrimaryFocus, isFalse);
|
expect(find.byKey(searchFieldKey), findsOneWidget);
|
||||||
|
expect(
|
||||||
|
tester.widget<TextField>(find.byKey(searchFieldKey)).focusNode!.hasFocus,
|
||||||
|
isTrue,
|
||||||
|
);
|
||||||
await tester.pumpWidget(const SizedBox.shrink());
|
await tester.pumpWidget(const SizedBox.shrink());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ void main() {
|
|||||||
}) async {
|
}) async {
|
||||||
final bubble = ChatBubbleColor(
|
final bubble = ChatBubbleColor(
|
||||||
name: color,
|
name: color,
|
||||||
child: const ChatUserBubble(cupertino: false, child: Text('Hello')),
|
child: const ChatUserBubble(child: Text('Hello')),
|
||||||
);
|
);
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
@@ -68,9 +68,7 @@ void main() {
|
|||||||
testWidgets('a bubble with no colour scope stays neutral', (tester) async {
|
testWidgets('a bubble with no colour scope stays neutral', (tester) async {
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
const MaterialApp(
|
const MaterialApp(
|
||||||
home: Scaffold(
|
home: Scaffold(body: ChatUserBubble(child: Text('Hello'))),
|
||||||
body: ChatUserBubble(cupertino: false, child: Text('Hello')),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
final context = tester.element(find.byType(ChatUserBubble));
|
final context = tester.element(find.byType(ChatUserBubble));
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:pipelines_app/features/settings/keyboard_shortcuts_help.dart';
|
||||||
|
import 'package:pipelines_app/features/settings/keyboard_shortcuts_registry.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
const registry = KeyboardShortcutRegistry(
|
||||||
|
platform: TargetPlatform.macOS,
|
||||||
|
web: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
test('registry uses platform labels and browser caveats', () {
|
||||||
|
final entries = registry.entries;
|
||||||
|
final terminal = entries.firstWhere(
|
||||||
|
(entry) => entry.action == 'Show or hide terminal',
|
||||||
|
);
|
||||||
|
final search = entries.firstWhere((entry) => entry.action == 'Open Search');
|
||||||
|
|
||||||
|
expect(terminal.keys, contains('Option+T'));
|
||||||
|
expect(terminal.keys, isNot(contains('Cmd+T')));
|
||||||
|
expect(search.keys, 'Option+/, Cmd+/, Ctrl+/');
|
||||||
|
expect(search.caveat, contains('browser'));
|
||||||
|
});
|
||||||
|
|
||||||
|
test('uses the shell primary modifier rule on iOS', () {
|
||||||
|
final entries = const KeyboardShortcutRegistry(
|
||||||
|
platform: TargetPlatform.iOS,
|
||||||
|
web: false,
|
||||||
|
).entries;
|
||||||
|
expect(
|
||||||
|
entries
|
||||||
|
.firstWhere((entry) => entry.action == 'Open a chat list item')
|
||||||
|
.keys,
|
||||||
|
'Ctrl+1…9',
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
entries.firstWhere((entry) => entry.action == 'Open Search').keys,
|
||||||
|
'Option+/, Ctrl+/',
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
entries
|
||||||
|
.firstWhere((entry) => entry.action == 'Show or hide floating chats')
|
||||||
|
.caveat,
|
||||||
|
contains('focuses its message input'),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
testWidgets('help is readable and keyboard traversable', (tester) async {
|
||||||
|
await tester.pumpWidget(
|
||||||
|
MaterialApp(
|
||||||
|
home: Scaffold(
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: KeyboardShortcutsHelp(registry: registry),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(find.text('Keyboard shortcuts'), findsOneWidget);
|
||||||
|
expect(find.text('Show or hide floating chats'), findsOneWidget);
|
||||||
|
expect(find.text('Option+Y, Ctrl+Y, Cmd+Y'), findsOneWidget);
|
||||||
|
expect(
|
||||||
|
tester.getSemantics(find.bySemanticsLabel('Keyboard shortcuts help')),
|
||||||
|
matchesSemantics(
|
||||||
|
scopesRoute: true,
|
||||||
|
namesRoute: true,
|
||||||
|
label: 'Keyboard shortcuts help',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
await tester.sendKeyEvent(LogicalKeyboardKey.tab);
|
||||||
|
expect(find.byTooltip('Close keyboard shortcuts'), findsOneWidget);
|
||||||
|
});
|
||||||
|
|
||||||
|
testWidgets('narrow help content scrolls', (tester) async {
|
||||||
|
await tester.pumpWidget(
|
||||||
|
MediaQuery(
|
||||||
|
data: const MediaQueryData(
|
||||||
|
size: Size(400, 640),
|
||||||
|
textScaler: TextScaler.linear(2),
|
||||||
|
),
|
||||||
|
child: MaterialApp(
|
||||||
|
home: Scaffold(body: KeyboardShortcutsHelp(registry: registry)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(find.byType(SingleChildScrollView), findsOneWidget);
|
||||||
|
expect(find.text('Keyboard shortcuts'), findsOneWidget);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -84,7 +84,6 @@ class TerminalTestAppState extends State<TerminalTestApp> {
|
|||||||
Widget build(BuildContext context) => TerminalSurface(
|
Widget build(BuildContext context) => TerminalSurface(
|
||||||
hub: widget.hub,
|
hub: widget.hub,
|
||||||
layout: widget.layout,
|
layout: widget.layout,
|
||||||
cupertino: false,
|
|
||||||
shortcutHere: widget.shortcutHere,
|
shortcutHere: widget.shortcutHere,
|
||||||
floating: floating,
|
floating: floating,
|
||||||
windows: WindowHost(manager: manager),
|
windows: WindowHost(manager: manager),
|
||||||
@@ -92,7 +91,7 @@ class TerminalTestAppState extends State<TerminalTestApp> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('App'),
|
title: const Text('App'),
|
||||||
actions: [
|
actions: [
|
||||||
TerminalToggleButton(layout: widget.layout, cupertino: false),
|
TerminalToggleButton(layout: widget.layout),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: const TextField(key: appField),
|
body: const TextField(key: appField),
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ void main() {
|
|||||||
home: TerminalSurface(
|
home: TerminalSurface(
|
||||||
hub: hub,
|
hub: hub,
|
||||||
layout: layout,
|
layout: layout,
|
||||||
cupertino: false,
|
|
||||||
child: AdaptiveShell(
|
child: AdaptiveShell(
|
||||||
destination: AppDestination.chat,
|
destination: AppDestination.chat,
|
||||||
destinationBodies: {
|
destinationBodies: {
|
||||||
|
|||||||
@@ -75,6 +75,27 @@ void main() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test('Alt+/ uses the physical slash key for Option dead-key delivery', () {
|
||||||
|
const event = KeyDownEvent(
|
||||||
|
physicalKey: PhysicalKeyboardKey.slash,
|
||||||
|
logicalKey: LogicalKeyboardKey(0x00BF),
|
||||||
|
character: '¿',
|
||||||
|
timeStamp: Duration.zero,
|
||||||
|
);
|
||||||
|
expect(shellSearchShortcut(event, _AltHeld()), isTrue);
|
||||||
|
expect(
|
||||||
|
shellSearchShortcut(
|
||||||
|
const KeyUpEvent(
|
||||||
|
physicalKey: PhysicalKeyboardKey.slash,
|
||||||
|
logicalKey: LogicalKeyboardKey(0x00BF),
|
||||||
|
timeStamp: Duration.zero,
|
||||||
|
),
|
||||||
|
_AltHeld(),
|
||||||
|
),
|
||||||
|
isFalse,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
for (final platform in [TargetPlatform.macOS, TargetPlatform.windows]) {
|
for (final platform in [TargetPlatform.macOS, TargetPlatform.windows]) {
|
||||||
testWidgets(
|
testWidgets(
|
||||||
'Search chord opens and refocuses retained query on $platform',
|
'Search chord opens and refocuses retained query on $platform',
|
||||||
@@ -130,3 +151,14 @@ void main() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class _AltHeld extends HardwareKeyboard {
|
||||||
|
@override
|
||||||
|
bool get isAltPressed => true;
|
||||||
|
@override
|
||||||
|
bool get isControlPressed => false;
|
||||||
|
@override
|
||||||
|
bool get isMetaPressed => false;
|
||||||
|
@override
|
||||||
|
bool get isShiftPressed => false;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:pipelines_app/features/chat/ui/transcript/chat_turn_activity_view.dart';
|
import 'package:pipelines_app/features/chat/ui/transcript/chat_turn_activity_view.dart';
|
||||||
|
|
||||||
const _style = String.fromEnvironment('PROBE_STYLE', defaultValue: 'material');
|
|
||||||
|
|
||||||
/// Visual check for the streaming activity line: the pending dots beside
|
/// Visual check for the streaming activity line: the pending dots beside
|
||||||
/// "Responding Ns" at a few text sizes, in light and dark.
|
/// "Responding Ns" at a few text sizes, in light and dark.
|
||||||
void main() {
|
void main() {
|
||||||
@@ -23,14 +20,9 @@ void main() {
|
|||||||
);
|
);
|
||||||
final body = ListView(children: [line(1), line(1.5), line(2)]);
|
final body = ListView(children: [line(1), line(1.5), line(2)]);
|
||||||
runApp(
|
runApp(
|
||||||
_style == 'cupertino'
|
MaterialApp(
|
||||||
? CupertinoApp(
|
theme: ThemeData(brightness: Brightness.dark),
|
||||||
theme: const CupertinoThemeData(brightness: Brightness.dark),
|
home: Scaffold(body: SafeArea(child: body)),
|
||||||
home: CupertinoPageScaffold(child: SafeArea(child: body)),
|
),
|
||||||
)
|
|
||||||
: MaterialApp(
|
|
||||||
theme: ThemeData(brightness: Brightness.dark),
|
|
||||||
home: Scaffold(body: SafeArea(child: body)),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:pipelines_app/core/api_gateway.dart';
|
import 'package:pipelines_app/core/api_gateway.dart';
|
||||||
@@ -130,11 +129,6 @@ class _ApprovalsGateway implements ApiGateway {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const _style = String.fromEnvironment(
|
|
||||||
'CHAT_APPROVALS_PROBE_STYLE',
|
|
||||||
defaultValue: 'material',
|
|
||||||
);
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
final gateway = _ApprovalsGateway();
|
final gateway = _ApprovalsGateway();
|
||||||
final thread = ChatThreadView(
|
final thread = ChatThreadView(
|
||||||
@@ -143,15 +137,6 @@ void main() {
|
|||||||
title: 'Probe conversation',
|
title: 'Probe conversation',
|
||||||
onBack: () {},
|
onBack: () {},
|
||||||
);
|
);
|
||||||
if (_style == 'cupertino') {
|
|
||||||
runApp(
|
|
||||||
CupertinoApp(
|
|
||||||
theme: const CupertinoThemeData(brightness: Brightness.dark),
|
|
||||||
home: CupertinoPageScaffold(child: SafeArea(child: thread)),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
runApp(
|
runApp(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:pipelines_app/core/api_gateway.dart';
|
import 'package:pipelines_app/core/api_gateway.dart';
|
||||||
@@ -203,12 +202,7 @@ Widget _framed(Widget child) => _probeWidth == 0
|
|||||||
child: SizedBox(width: _probeWidth.toDouble(), child: child),
|
child: SizedBox(width: _probeWidth.toDouble(), child: child),
|
||||||
);
|
);
|
||||||
|
|
||||||
const _probeStyle = String.fromEnvironment(
|
/// Browser overrides: `?theme=dark|light`,
|
||||||
'CHAT_COMPOSER_PROBE_STYLE',
|
|
||||||
defaultValue: 'material',
|
|
||||||
);
|
|
||||||
|
|
||||||
/// Browser overrides: `?platform=cupertino|material`, `?theme=dark|light`,
|
|
||||||
/// `?long=1`, `?paras=1` (a chunked multi-paragraph reply), `?tasks=<n>`, `?mode=0` (no permission mode recorded) and
|
/// `?long=1`, `?paras=1` (a chunked multi-paragraph reply), `?tasks=<n>`, `?mode=0` (no permission mode recorded) and
|
||||||
/// `?model=0` (a backend without models). `?perf=<n>` and `?stream=<n>` are
|
/// `?model=0` (a backend without models). `?perf=<n>` and `?stream=<n>` are
|
||||||
/// the long-transcript performance fixture (see chat_perf_fixture.dart).
|
/// the long-transcript performance fixture (see chat_perf_fixture.dart).
|
||||||
@@ -222,8 +216,7 @@ int get _probeTasks => int.tryParse(_query['tasks'] ?? '') ?? 0;
|
|||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
final gateway = _ProbeGateway();
|
final gateway = _ProbeGateway();
|
||||||
final cupertino = (_query['platform'] ?? _probeStyle) == 'cupertino';
|
final dark = _query['theme'] == 'dark';
|
||||||
final dark = _query['theme'] == null ? cupertino : _query['theme'] == 'dark';
|
|
||||||
final thread = ChatThreadView(
|
final thread = ChatThreadView(
|
||||||
gateway: gateway,
|
gateway: gateway,
|
||||||
sessionId: 'probe-composer',
|
sessionId: 'probe-composer',
|
||||||
@@ -262,17 +255,6 @@ void main() {
|
|||||||
() => _press('chat-composer-primary'),
|
() => _press('chat-composer-primary'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (cupertino) {
|
|
||||||
runApp(
|
|
||||||
CupertinoApp(
|
|
||||||
theme: CupertinoThemeData(
|
|
||||||
brightness: dark ? Brightness.dark : Brightness.light,
|
|
||||||
),
|
|
||||||
home: CupertinoPageScaffold(child: _framed(SafeArea(child: thread))),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
runApp(
|
runApp(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
@@ -290,7 +272,6 @@ void _press(String key) {
|
|||||||
void visit(Element element) {
|
void visit(Element element) {
|
||||||
final widget = element.widget;
|
final widget = element.widget;
|
||||||
if (widget.key == Key(key)) {
|
if (widget.key == Key(key)) {
|
||||||
if (widget is CupertinoButton) widget.onPressed?.call();
|
|
||||||
if (widget is ButtonStyleButton) widget.onPressed?.call();
|
if (widget is ButtonStyleButton) widget.onPressed?.call();
|
||||||
if (widget is IconButton) widget.onPressed?.call();
|
if (widget is IconButton) widget.onPressed?.call();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:pipelines_app/features/chat/ui/transcript/chat_markdown_view.dart';
|
import 'package:pipelines_app/features/chat/ui/transcript/chat_markdown_view.dart';
|
||||||
|
|
||||||
const _style = String.fromEnvironment(
|
|
||||||
'CHAT_MARKDOWN_PROBE_STYLE',
|
|
||||||
defaultValue: 'material',
|
|
||||||
);
|
|
||||||
|
|
||||||
const _sample = '''
|
const _sample = '''
|
||||||
# Heading one
|
# Heading one
|
||||||
## Heading two
|
## Heading two
|
||||||
@@ -36,21 +30,12 @@ Bare https://example.com/auto link.
|
|||||||
<b>literal html</b> and ~~strikethrough~~ stay text.
|
<b>literal html</b> and ~~strikethrough~~ stay text.
|
||||||
''';
|
''';
|
||||||
|
|
||||||
/// One assistant markdown sample for the Material and Cupertino dark captures.
|
/// One assistant markdown sample for a Material dark capture.
|
||||||
void main() {
|
void main() {
|
||||||
final content = ListView(
|
final content = ListView(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
children: const [ChatMarkdownView(text: _sample)],
|
children: const [ChatMarkdownView(text: _sample)],
|
||||||
);
|
);
|
||||||
if (_style == 'cupertino') {
|
|
||||||
runApp(
|
|
||||||
CupertinoApp(
|
|
||||||
theme: const CupertinoThemeData(brightness: Brightness.dark),
|
|
||||||
home: CupertinoPageScaffold(child: SafeArea(child: content)),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
runApp(
|
runApp(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:pipelines_app/core/api_gateway.dart';
|
import 'package:pipelines_app/core/api_gateway.dart';
|
||||||
@@ -10,7 +9,7 @@ import 'package:pipelines_app/features/chat/screen.dart';
|
|||||||
/// the real thread render one server-shaped conversation whose assistant text
|
/// the real thread render one server-shaped conversation whose assistant text
|
||||||
/// is formatted markdown and whose user text must stay byte-exact.
|
/// is formatted markdown and whose user text must stay byte-exact.
|
||||||
///
|
///
|
||||||
/// Material and Cupertino hosts are the same fixture built with
|
/// The Material host is the same fixture built with
|
||||||
/// `CHAT_MARKDOWN_WIRE_PROBE_STYLE`.
|
/// `CHAT_MARKDOWN_WIRE_PROBE_STYLE`.
|
||||||
class _FixtureGateway implements ApiGateway {
|
class _FixtureGateway implements ApiGateway {
|
||||||
final _frames = StreamController<JsonMap>.broadcast();
|
final _frames = StreamController<JsonMap>.broadcast();
|
||||||
@@ -86,28 +85,11 @@ const String _answer =
|
|||||||
'\n'
|
'\n'
|
||||||
'Literal <b>markup</b> and [unsafe](javascript:alert) stay visible.';
|
'Literal <b>markup</b> and [unsafe](javascript:alert) stay visible.';
|
||||||
|
|
||||||
const _style = String.fromEnvironment(
|
|
||||||
'CHAT_MARKDOWN_WIRE_PROBE_STYLE',
|
|
||||||
defaultValue: 'material',
|
|
||||||
);
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
final screen = ChatScreen(
|
final screen = ChatScreen(
|
||||||
gateway: _FixtureGateway(),
|
gateway: _FixtureGateway(),
|
||||||
onSessionSelected: null,
|
onSessionSelected: null,
|
||||||
);
|
);
|
||||||
if (_style == 'cupertino') {
|
|
||||||
runApp(
|
|
||||||
CupertinoApp(
|
|
||||||
theme: const CupertinoThemeData(brightness: Brightness.dark),
|
|
||||||
home: CupertinoPageScaffold(
|
|
||||||
navigationBar: const CupertinoNavigationBar(middle: Text('Chat')),
|
|
||||||
child: SafeArea(child: screen),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
runApp(
|
runApp(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:pipelines_app/features/chat/domain/chat_transcript.dart';
|
import 'package:pipelines_app/features/chat/domain/chat_transcript.dart';
|
||||||
import 'package:pipelines_app/features/chat/ui/transcript/chat_message_view.dart';
|
import 'package:pipelines_app/features/chat/ui/transcript/chat_message_view.dart';
|
||||||
|
|
||||||
const _style = String.fromEnvironment(
|
|
||||||
'CHAT_MESSAGE_PROBE_STYLE',
|
|
||||||
defaultValue: 'material',
|
|
||||||
);
|
|
||||||
|
|
||||||
/// Visible fixture for one user row, one folded assistant turn and one live
|
/// Visible fixture for one user row, one folded assistant turn and one live
|
||||||
/// turn whose newest reasoning step grows every half second. The unknown part
|
/// turn whose newest reasoning step grows every half second. The unknown part
|
||||||
/// and the tool body start collapsed so the browser probe has to open them.
|
/// and the tool body start collapsed so the browser probe has to open them.
|
||||||
@@ -61,15 +55,6 @@ void main() {
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
final content = _LiveTranscript(rows: rows);
|
final content = _LiveTranscript(rows: rows);
|
||||||
if (_style == 'cupertino') {
|
|
||||||
runApp(
|
|
||||||
CupertinoApp(
|
|
||||||
theme: const CupertinoThemeData(brightness: Brightness.dark),
|
|
||||||
home: CupertinoPageScaffold(child: SafeArea(child: content)),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
runApp(
|
runApp(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:pipelines_app/core/api_gateway.dart';
|
import 'package:pipelines_app/core/api_gateway.dart';
|
||||||
@@ -124,11 +123,6 @@ class _FixtureGateway implements ApiGateway {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const _probeStyle = String.fromEnvironment(
|
|
||||||
'CHAT_PROBE_STYLE',
|
|
||||||
defaultValue: 'material',
|
|
||||||
);
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
final dark = Uri.base.queryParameters['dark'] == '1';
|
final dark = Uri.base.queryParameters['dark'] == '1';
|
||||||
final unseen = Uri.base.queryParameters['unseen'] == '1';
|
final unseen = Uri.base.queryParameters['unseen'] == '1';
|
||||||
@@ -145,19 +139,6 @@ void main() {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
final home = ChatSessionsScreen(gateway: gateway, onOpen: (_) {});
|
final home = ChatSessionsScreen(gateway: gateway, onOpen: (_) {});
|
||||||
// `?platform=cupertino` overrides the compile-time style.
|
|
||||||
final style = Uri.base.queryParameters['platform'] ?? _probeStyle;
|
|
||||||
if (style == 'cupertino') {
|
|
||||||
runApp(
|
|
||||||
CupertinoApp(
|
|
||||||
theme: CupertinoThemeData(
|
|
||||||
brightness: dark ? Brightness.dark : Brightness.light,
|
|
||||||
),
|
|
||||||
home: home,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
runApp(
|
runApp(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:pipelines_app/core/api_gateway.dart';
|
import 'package:pipelines_app/core/api_gateway.dart';
|
||||||
@@ -218,28 +217,11 @@ class _FixtureGateway implements ApiGateway {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const _style = String.fromEnvironment(
|
|
||||||
'CHAT_WIRE_PROBE_STYLE',
|
|
||||||
defaultValue: 'material',
|
|
||||||
);
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
final screen = ChatScreen(
|
final screen = ChatScreen(
|
||||||
gateway: _FixtureGateway(),
|
gateway: _FixtureGateway(),
|
||||||
onSessionSelected: null,
|
onSessionSelected: null,
|
||||||
);
|
);
|
||||||
if (_style == 'cupertino') {
|
|
||||||
runApp(
|
|
||||||
CupertinoApp(
|
|
||||||
theme: const CupertinoThemeData(brightness: Brightness.dark),
|
|
||||||
home: CupertinoPageScaffold(
|
|
||||||
navigationBar: const CupertinoNavigationBar(middle: Text('Chat')),
|
|
||||||
child: SafeArea(child: screen),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
runApp(
|
runApp(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:pipelines_app/core/api_gateway.dart';
|
import 'package:pipelines_app/core/api_gateway.dart';
|
||||||
@@ -36,35 +35,22 @@ JsonMap _definition() => <String, dynamic>{
|
|||||||
|
|
||||||
/// Isolated browser fixture for `DefinitionGraphView` only.
|
/// Isolated browser fixture for `DefinitionGraphView` only.
|
||||||
///
|
///
|
||||||
/// Not wired into the app or shell. `style=cupertino` selects the native
|
/// Not wired into the app or shell. `scale=2` applies a real 2x text scale to the graph viewport,
|
||||||
/// Cupertino host, `scale=2` applies a real 2x text scale to the graph viewport,
|
|
||||||
/// and a click reports the exact stage key in the status line.
|
/// and a click reports the exact stage key in the status line.
|
||||||
void main() {
|
void main() {
|
||||||
final parameters = Uri.base.queryParameters;
|
final parameters = Uri.base.queryParameters;
|
||||||
final cupertino = parameters['style'] == 'cupertino';
|
|
||||||
final scale = double.tryParse(parameters['scale'] ?? '') ?? 1;
|
final scale = double.tryParse(parameters['scale'] ?? '') ?? 1;
|
||||||
runApp(_ProbeApp(cupertino: cupertino, scale: scale));
|
runApp(_ProbeApp(scale: scale));
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ProbeApp extends StatelessWidget {
|
class _ProbeApp extends StatelessWidget {
|
||||||
const _ProbeApp({required this.cupertino, required this.scale});
|
const _ProbeApp({required this.scale});
|
||||||
|
|
||||||
final bool cupertino;
|
|
||||||
final double scale;
|
final double scale;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final page = _ProbePage(scale: scale);
|
final page = _ProbePage(scale: scale);
|
||||||
if (cupertino) {
|
|
||||||
return CupertinoApp(
|
|
||||||
home: CupertinoPageScaffold(
|
|
||||||
navigationBar: const CupertinoNavigationBar(
|
|
||||||
middle: Text('Definition graph'),
|
|
||||||
),
|
|
||||||
child: SafeArea(child: page),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
theme: ThemeData(platform: TargetPlatform.android),
|
theme: ThemeData(platform: TargetPlatform.android),
|
||||||
darkTheme: ThemeData(
|
darkTheme: ThemeData(
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:pipelines_app/features/graph/domain/graph_definition.dart';
|
import 'package:pipelines_app/features/graph/domain/graph_definition.dart';
|
||||||
@@ -22,9 +21,7 @@ const _nodes = [
|
|||||||
/// A fixture-only page: one measured node per definition identity, with the
|
/// A fixture-only page: one measured node per definition identity, with the
|
||||||
/// selected key reported so a browser click can prove the exact callback.
|
/// selected key reported so a browser click can prove the exact callback.
|
||||||
class _Probe extends StatefulWidget {
|
class _Probe extends StatefulWidget {
|
||||||
const _Probe({required this.cupertino});
|
const _Probe();
|
||||||
|
|
||||||
final bool cupertino;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<_Probe> createState() => _ProbeState();
|
State<_Probe> createState() => _ProbeState();
|
||||||
@@ -64,27 +61,22 @@ class _ProbeState extends State<_Probe> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
return widget.cupertino
|
return Scaffold(body: SafeArea(child: page));
|
||||||
? CupertinoPageScaffold(child: SafeArea(child: page))
|
|
||||||
: Scaffold(body: SafeArea(child: page));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
final cupertino = Uri.base.queryParameters['style'] == 'cupertino';
|
|
||||||
runApp(
|
runApp(
|
||||||
cupertino
|
MaterialApp(
|
||||||
? CupertinoApp(home: const _Probe(cupertino: true))
|
theme: ThemeData(platform: TargetPlatform.android),
|
||||||
: MaterialApp(
|
// Stock dark theme so the forced `prefers-color-scheme` capture is
|
||||||
theme: ThemeData(platform: TargetPlatform.android),
|
// a real dark render rather than a duplicate light one.
|
||||||
// Stock dark theme so the forced `prefers-color-scheme` capture is
|
darkTheme: ThemeData(
|
||||||
// a real dark render rather than a duplicate light one.
|
platform: TargetPlatform.android,
|
||||||
darkTheme: ThemeData(
|
brightness: Brightness.dark,
|
||||||
platform: TargetPlatform.android,
|
),
|
||||||
brightness: Brightness.dark,
|
themeMode: ThemeMode.system,
|
||||||
),
|
home: const _Probe(),
|
||||||
themeMode: ThemeMode.system,
|
),
|
||||||
home: const _Probe(cupertino: false),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
// PROBE_VARIANT=material OPENCODE_ARTIFACT_DIR=DIR node tool/graph_zoom_probe.mjs
|
// PROBE_VARIANT=material OPENCODE_ARTIFACT_DIR=DIR node tool/graph_zoom_probe.mjs
|
||||||
//
|
//
|
||||||
// Server-shaped fixtures only; no server, run or operator session is touched.
|
// Server-shaped fixtures only; no server, run or operator session is touched.
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:pipelines_app/core/api_gateway.dart';
|
import 'package:pipelines_app/core/api_gateway.dart';
|
||||||
@@ -72,37 +71,20 @@ void main() {
|
|||||||
runApp(
|
runApp(
|
||||||
_ProbeApp(
|
_ProbeApp(
|
||||||
runMode: parameters['view'] == 'run',
|
runMode: parameters['view'] == 'run',
|
||||||
cupertino: parameters['style'] == 'cupertino',
|
|
||||||
scale: double.tryParse(parameters['scale'] ?? '') ?? 1,
|
scale: double.tryParse(parameters['scale'] ?? '') ?? 1,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ProbeApp extends StatelessWidget {
|
class _ProbeApp extends StatelessWidget {
|
||||||
const _ProbeApp({
|
const _ProbeApp({required this.runMode, required this.scale});
|
||||||
required this.runMode,
|
|
||||||
required this.cupertino,
|
|
||||||
required this.scale,
|
|
||||||
});
|
|
||||||
|
|
||||||
final bool runMode;
|
final bool runMode;
|
||||||
final bool cupertino;
|
|
||||||
final double scale;
|
final double scale;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final page = _ProbePage(runMode: runMode, scale: scale);
|
final page = _ProbePage(runMode: runMode, scale: scale);
|
||||||
if (cupertino) {
|
|
||||||
return CupertinoApp(
|
|
||||||
theme: const CupertinoThemeData(brightness: Brightness.dark),
|
|
||||||
home: CupertinoPageScaffold(
|
|
||||||
navigationBar: const CupertinoNavigationBar(
|
|
||||||
middle: Text('Graph viewport'),
|
|
||||||
),
|
|
||||||
child: SafeArea(child: page),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
theme: ThemeData(platform: TargetPlatform.android),
|
theme: ThemeData(platform: TargetPlatform.android),
|
||||||
darkTheme: ThemeData(
|
darkTheme: ThemeData(
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:pipelines_app/features/pipelines/screen.dart';
|
import 'package:pipelines_app/features/pipelines/screen.dart';
|
||||||
@@ -7,15 +6,13 @@ import 'pipelines_probe_fixture.dart';
|
|||||||
|
|
||||||
/// Browser fixture for the pipeline detail's real Graph tab.
|
/// Browser fixture for the pipeline detail's real Graph tab.
|
||||||
///
|
///
|
||||||
/// `style=cupertino` selects the Cupertino host, `dark=1` its dark theme and
|
/// `dark=1` selects the dark theme and `scale=2` a real 2x text scale. The screen, its list, detail, Graph tab and
|
||||||
/// `scale=2` a real 2x text scale. The screen, its list, detail, Graph tab and
|
|
||||||
/// definition pane are the same widgets the app registers; only the replies
|
/// definition pane are the same widgets the app registers; only the replies
|
||||||
/// come from the in-memory fixture.
|
/// come from the in-memory fixture.
|
||||||
void main() {
|
void main() {
|
||||||
final parameters = Uri.base.queryParameters;
|
final parameters = Uri.base.queryParameters;
|
||||||
runApp(
|
runApp(
|
||||||
_PipelineGraphTabProbe(
|
_PipelineGraphTabProbe(
|
||||||
cupertino: parameters['style'] == 'cupertino',
|
|
||||||
dark: parameters['dark'] == '1',
|
dark: parameters['dark'] == '1',
|
||||||
scale: double.tryParse(parameters['scale'] ?? '') ?? 1,
|
scale: double.tryParse(parameters['scale'] ?? '') ?? 1,
|
||||||
),
|
),
|
||||||
@@ -23,13 +20,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _PipelineGraphTabProbe extends StatelessWidget {
|
class _PipelineGraphTabProbe extends StatelessWidget {
|
||||||
const _PipelineGraphTabProbe({
|
const _PipelineGraphTabProbe({required this.dark, required this.scale});
|
||||||
required this.cupertino,
|
|
||||||
required this.dark,
|
|
||||||
required this.scale,
|
|
||||||
});
|
|
||||||
|
|
||||||
final bool cupertino;
|
|
||||||
final bool dark;
|
final bool dark;
|
||||||
final double scale;
|
final double scale;
|
||||||
|
|
||||||
@@ -45,20 +37,6 @@ class _PipelineGraphTabProbe extends StatelessWidget {
|
|||||||
gateway: PipelinesProbeGateway(),
|
gateway: PipelinesProbeGateway(),
|
||||||
embedded: true,
|
embedded: true,
|
||||||
);
|
);
|
||||||
if (cupertino) {
|
|
||||||
return CupertinoApp(
|
|
||||||
title: 'Pipeline graph fixture',
|
|
||||||
debugShowCheckedModeBanner: false,
|
|
||||||
theme: CupertinoThemeData(
|
|
||||||
brightness: dark ? Brightness.dark : Brightness.light,
|
|
||||||
),
|
|
||||||
builder: scaled,
|
|
||||||
// The application shell owns the navigation bar; the probe keeps the
|
|
||||||
// same embedded screen inside a host-native page instead of adding a
|
|
||||||
// second bar that would overlay the detail header.
|
|
||||||
home: CupertinoPageScaffold(child: SafeArea(child: screen)),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
title: 'Pipeline graph fixture',
|
title: 'Pipeline graph fixture',
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
// Server-shaped fixtures only: a fake gateway answers the same get_run envelope
|
// Server-shaped fixtures only: a fake gateway answers the same get_run envelope
|
||||||
// the app consumes. The run's own pinned graph and recorded steps drive the
|
// the app consumes. The run's own pinned graph and recorded steps drive the
|
||||||
// Graph tab; no server or operator run is touched.
|
// Graph tab; no server or operator run is touched.
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:pipelines_app/core/api_gateway.dart';
|
import 'package:pipelines_app/core/api_gateway.dart';
|
||||||
import 'package:pipelines_app/features/runs/data/runs_repository.dart';
|
import 'package:pipelines_app/features/runs/data/runs_repository.dart';
|
||||||
@@ -83,22 +82,18 @@ JsonMap _run({required bool graph}) => <String, dynamic>{
|
|||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
final params = Uri.base.queryParameters;
|
final params = Uri.base.queryParameters;
|
||||||
final cupertino = params['platform'] == 'cupertino';
|
|
||||||
final dark = params['theme'] == 'dark';
|
final dark = params['theme'] == 'dark';
|
||||||
final scale = double.tryParse(params['scale'] ?? '') ?? 1;
|
final scale = double.tryParse(params['scale'] ?? '') ?? 1;
|
||||||
final run = _run(graph: params['case'] != 'missing');
|
final run = _run(graph: params['case'] != 'missing');
|
||||||
runApp(_ProbeBody(cupertino: cupertino, dark: dark, scale: scale, run: run));
|
runApp(_ProbeBody(dark: dark, scale: scale, run: run));
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ProbeBody extends StatefulWidget {
|
class _ProbeBody extends StatefulWidget {
|
||||||
const _ProbeBody({
|
const _ProbeBody({
|
||||||
required this.cupertino,
|
|
||||||
required this.dark,
|
required this.dark,
|
||||||
required this.scale,
|
required this.scale,
|
||||||
required this.run,
|
required this.run,
|
||||||
});
|
});
|
||||||
|
|
||||||
final bool cupertino;
|
|
||||||
final bool dark;
|
final bool dark;
|
||||||
final double scale;
|
final double scale;
|
||||||
final JsonMap run;
|
final JsonMap run;
|
||||||
@@ -139,14 +134,6 @@ class _ProbeBodyState extends State<_ProbeBody> {
|
|||||||
).copyWith(textScaler: TextScaler.linear(widget.scale)),
|
).copyWith(textScaler: TextScaler.linear(widget.scale)),
|
||||||
child: app!,
|
child: app!,
|
||||||
);
|
);
|
||||||
if (widget.cupertino) {
|
|
||||||
return CupertinoApp(
|
|
||||||
title: 'Run graph fixture',
|
|
||||||
theme: CupertinoThemeData(brightness: theme),
|
|
||||||
builder: scaled,
|
|
||||||
home: CupertinoPageScaffold(child: SafeArea(child: detail)),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
title: 'Run graph fixture',
|
title: 'Run graph fixture',
|
||||||
theme: ThemeData(brightness: theme, platform: TargetPlatform.android),
|
theme: ThemeData(brightness: theme, platform: TargetPlatform.android),
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:pipelines_app/core/api_gateway.dart';
|
import 'package:pipelines_app/core/api_gateway.dart';
|
||||||
@@ -86,15 +85,14 @@ JsonMap _finishedRun() => <String, dynamic>{
|
|||||||
|
|
||||||
/// Isolated browser fixture for `RunGraphView` only.
|
/// Isolated browser fixture for `RunGraphView` only.
|
||||||
///
|
///
|
||||||
/// `style=cupertino` selects the Cupertino host, `dark=1` its dark theme and
|
/// `dark=1` selects the dark theme and `scale=2` a real 2x text scale.
|
||||||
/// `scale=2` a real 2x text scale. `case=finished` records a resolved success
|
/// `case=finished` records a resolved success
|
||||||
/// terminal instead of the running path; `case=missing` omits the graph. A
|
/// terminal instead of the running path; `case=missing` omits the graph. A
|
||||||
/// click reports the exact visited stage key; unvisited nodes report nothing.
|
/// click reports the exact visited stage key; unvisited nodes report nothing.
|
||||||
void main() {
|
void main() {
|
||||||
final parameters = Uri.base.queryParameters;
|
final parameters = Uri.base.queryParameters;
|
||||||
runApp(
|
runApp(
|
||||||
_ProbeApp(
|
_ProbeApp(
|
||||||
cupertino: parameters['style'] == 'cupertino',
|
|
||||||
dark: parameters['dark'] == '1',
|
dark: parameters['dark'] == '1',
|
||||||
scale: double.tryParse(parameters['scale'] ?? '') ?? 1,
|
scale: double.tryParse(parameters['scale'] ?? '') ?? 1,
|
||||||
fixture: parameters['case'] ?? 'running',
|
fixture: parameters['case'] ?? 'running',
|
||||||
@@ -104,13 +102,10 @@ void main() {
|
|||||||
|
|
||||||
class _ProbeApp extends StatelessWidget {
|
class _ProbeApp extends StatelessWidget {
|
||||||
const _ProbeApp({
|
const _ProbeApp({
|
||||||
required this.cupertino,
|
|
||||||
required this.dark,
|
required this.dark,
|
||||||
required this.scale,
|
required this.scale,
|
||||||
required this.fixture,
|
required this.fixture,
|
||||||
});
|
});
|
||||||
|
|
||||||
final bool cupertino;
|
|
||||||
final bool dark;
|
final bool dark;
|
||||||
final double scale;
|
final double scale;
|
||||||
final String fixture;
|
final String fixture;
|
||||||
@@ -122,19 +117,6 @@ class _ProbeApp extends StatelessWidget {
|
|||||||
graph: fixture == 'missing' ? null : _graph(),
|
graph: fixture == 'missing' ? null : _graph(),
|
||||||
run: fixture == 'finished' ? _finishedRun() : _runningRun(),
|
run: fixture == 'finished' ? _finishedRun() : _runningRun(),
|
||||||
);
|
);
|
||||||
if (cupertino) {
|
|
||||||
return CupertinoApp(
|
|
||||||
theme: CupertinoThemeData(
|
|
||||||
brightness: dark ? Brightness.dark : Brightness.light,
|
|
||||||
),
|
|
||||||
home: CupertinoPageScaffold(
|
|
||||||
navigationBar: const CupertinoNavigationBar(
|
|
||||||
middle: Text('Run graph'),
|
|
||||||
),
|
|
||||||
child: SafeArea(child: page),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
platform: TargetPlatform.android,
|
platform: TargetPlatform.android,
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:pipelines_app/core/api_gateway.dart';
|
import 'package:pipelines_app/core/api_gateway.dart';
|
||||||
import 'package:pipelines_app/features/graph/widgets/stage_definition_view.dart';
|
import 'package:pipelines_app/features/graph/widgets/stage_definition_view.dart';
|
||||||
import 'package:pipelines_app/ui/adaptive/host.dart';
|
|
||||||
|
|
||||||
/// A definition with an authored stage (including an unknown future field), a
|
/// A definition with an authored stage (including an unknown future field), a
|
||||||
/// declared route to a terminal, and no declaration for `ghost`.
|
/// declared route to a terminal, and no declaration for `ghost`.
|
||||||
@@ -44,14 +42,13 @@ JsonMap _graph() => <String, dynamic>{
|
|||||||
|
|
||||||
/// Isolated browser fixture for the read-only stage definition pane.
|
/// Isolated browser fixture for the read-only stage definition pane.
|
||||||
///
|
///
|
||||||
/// `style=cupertino` selects the Cupertino host, `dark=1` its dark theme,
|
/// `dark=1` selects the dark theme and `scale=2` a real 2x text scale.
|
||||||
/// `scale=2` a real 2x text scale. Every button opens the exact helper the
|
/// Every button opens the exact helper the
|
||||||
/// pipeline graph hook will call; nothing contacts a server or reads a run.
|
/// pipeline graph hook will call; nothing contacts a server or reads a run.
|
||||||
void main() {
|
void main() {
|
||||||
final parameters = Uri.base.queryParameters;
|
final parameters = Uri.base.queryParameters;
|
||||||
runApp(
|
runApp(
|
||||||
_ProbeApp(
|
_ProbeApp(
|
||||||
cupertino: parameters['style'] == 'cupertino',
|
|
||||||
dark: parameters['dark'] == '1',
|
dark: parameters['dark'] == '1',
|
||||||
scale: double.tryParse(parameters['scale'] ?? '') ?? 1,
|
scale: double.tryParse(parameters['scale'] ?? '') ?? 1,
|
||||||
),
|
),
|
||||||
@@ -59,13 +56,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _ProbeApp extends StatelessWidget {
|
class _ProbeApp extends StatelessWidget {
|
||||||
const _ProbeApp({
|
const _ProbeApp({required this.dark, required this.scale});
|
||||||
required this.cupertino,
|
|
||||||
required this.dark,
|
|
||||||
required this.scale,
|
|
||||||
});
|
|
||||||
|
|
||||||
final bool cupertino;
|
|
||||||
final bool dark;
|
final bool dark;
|
||||||
final double scale;
|
final double scale;
|
||||||
|
|
||||||
@@ -77,20 +69,6 @@ class _ProbeApp extends StatelessWidget {
|
|||||||
).copyWith(textScaler: TextScaler.linear(scale)),
|
).copyWith(textScaler: TextScaler.linear(scale)),
|
||||||
child: child ?? const SizedBox.shrink(),
|
child: child ?? const SizedBox.shrink(),
|
||||||
);
|
);
|
||||||
if (cupertino) {
|
|
||||||
return CupertinoApp(
|
|
||||||
theme: CupertinoThemeData(
|
|
||||||
brightness: dark ? Brightness.dark : Brightness.light,
|
|
||||||
),
|
|
||||||
builder: scaled,
|
|
||||||
home: const CupertinoPageScaffold(
|
|
||||||
navigationBar: CupertinoNavigationBar(
|
|
||||||
middle: Text('Stage definition fixture'),
|
|
||||||
),
|
|
||||||
child: SafeArea(child: _Launcher()),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
platform: TargetPlatform.android,
|
platform: TargetPlatform.android,
|
||||||
@@ -124,7 +102,6 @@ class _Launcher extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final cupertino = usesCupertinoHost(context);
|
|
||||||
return ListView(
|
return ListView(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
children: [
|
children: [
|
||||||
@@ -132,15 +109,10 @@ class _Launcher extends StatelessWidget {
|
|||||||
for (final key in <String>['plan', '#failure', 'ghost'])
|
for (final key in <String>['plan', '#failure', 'ghost'])
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8),
|
padding: const EdgeInsets.only(top: 8),
|
||||||
child: cupertino
|
child: FilledButton(
|
||||||
? CupertinoButton.filled(
|
onPressed: () => _open(context, key),
|
||||||
onPressed: () => _open(context, key),
|
child: Text('$key definition'),
|
||||||
child: Text('$key definition'),
|
),
|
||||||
)
|
|
||||||
: FilledButton(
|
|
||||||
onPressed: () => _open(context, key),
|
|
||||||
child: Text('$key definition'),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user