Merge commit 'a823a6e8a398ab1327ff22f9c393d970e52a6f4b' into pipelines/run-20261111-1947-use-desktop-dialogs-for-remaining-sheets-4d07
This commit is contained in:
@@ -37,6 +37,8 @@ Future<void> pumpApp(
|
||||
PipelinesApp(
|
||||
server: webServer(),
|
||||
client: client,
|
||||
// Navigation fixtures do not exercise native update plugins.
|
||||
androidSupported: false,
|
||||
cupertino: false,
|
||||
routeInformationProvider: provider,
|
||||
),
|
||||
|
||||
@@ -78,6 +78,8 @@ Future<void> pumpApp(
|
||||
PipelinesApp(
|
||||
server: webServer(),
|
||||
client: client,
|
||||
// This fixture tests template routing, not native update plugins.
|
||||
androidSupported: false,
|
||||
cupertino: false,
|
||||
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/ui/sessions/session_actions.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/destination.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
@@ -51,6 +53,11 @@ Future<void> _setup(WidgetTester tester) async {
|
||||
destination: AppDestination.chat,
|
||||
destinationBodies: {
|
||||
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(_editable(tester, 'a').focusNode.hasPrimaryFocus, isTrue);
|
||||
|
||||
// Shift+/ (a question mark) and Alt+/ are not the shortcut; Ctrl+/ is
|
||||
// the shell's own Search chord.
|
||||
// Shift+/ (a question mark) is not the shortcut. Alt+/ opens the Search
|
||||
// destination, while Ctrl+/ remains the shell's own Search chord.
|
||||
await _focusSidebar(tester);
|
||||
await tester.sendKeyDownEvent(LogicalKeyboardKey.shiftLeft);
|
||||
await tester.sendKeyEvent(LogicalKeyboardKey.slash, character: '?');
|
||||
@@ -114,7 +121,11 @@ void main() {
|
||||
await tester.sendKeyEvent(LogicalKeyboardKey.slash);
|
||||
await tester.sendKeyUpEvent(LogicalKeyboardKey.altLeft);
|
||||
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());
|
||||
});
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ void main() {
|
||||
}) async {
|
||||
final bubble = ChatBubbleColor(
|
||||
name: color,
|
||||
child: const ChatUserBubble(cupertino: false, child: Text('Hello')),
|
||||
child: const ChatUserBubble(child: Text('Hello')),
|
||||
);
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
@@ -68,9 +68,7 @@ void main() {
|
||||
testWidgets('a bubble with no colour scope stays neutral', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: ChatUserBubble(cupertino: false, child: Text('Hello')),
|
||||
),
|
||||
home: Scaffold(body: ChatUserBubble(child: Text('Hello'))),
|
||||
),
|
||||
);
|
||||
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(
|
||||
hub: widget.hub,
|
||||
layout: widget.layout,
|
||||
cupertino: false,
|
||||
shortcutHere: widget.shortcutHere,
|
||||
floating: floating,
|
||||
windows: WindowHost(manager: manager),
|
||||
@@ -92,7 +91,7 @@ class TerminalTestAppState extends State<TerminalTestApp> {
|
||||
appBar: AppBar(
|
||||
title: const Text('App'),
|
||||
actions: [
|
||||
TerminalToggleButton(layout: widget.layout, cupertino: false),
|
||||
TerminalToggleButton(layout: widget.layout),
|
||||
],
|
||||
),
|
||||
body: const TextField(key: appField),
|
||||
|
||||
@@ -62,7 +62,6 @@ void main() {
|
||||
home: TerminalSurface(
|
||||
hub: hub,
|
||||
layout: layout,
|
||||
cupertino: false,
|
||||
child: AdaptiveShell(
|
||||
destination: AppDestination.chat,
|
||||
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]) {
|
||||
testWidgets(
|
||||
'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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user