Merge commit 'c8d9f661b5285a97ff9b2fb5f670549d09ac2ebf' into pipelines/run-20261111-1811-preserve-center-stage-reading-width-with-c833
This commit is contained in:
@@ -491,6 +491,44 @@ void main() {
|
||||
);
|
||||
}
|
||||
|
||||
test('Alt+E toggles by physical key position, including Option dead keys', () {
|
||||
const event = KeyDownEvent(
|
||||
physicalKey: PhysicalKeyboardKey.keyE,
|
||||
logicalKey: LogicalKeyboardKey(0x00B4),
|
||||
character: '´',
|
||||
timeStamp: Duration.zero,
|
||||
);
|
||||
expect(chatCenterStageShortcut(event, _AltHeld()), isTrue);
|
||||
expect(
|
||||
chatCenterStageShortcut(
|
||||
const KeyUpEvent(
|
||||
physicalKey: PhysicalKeyboardKey.keyE,
|
||||
logicalKey: LogicalKeyboardKey(0x00B4),
|
||||
timeStamp: Duration.zero,
|
||||
),
|
||||
_AltHeld(),
|
||||
),
|
||||
isFalse,
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('Alt+E toggles from a focused composer without typing', (
|
||||
tester,
|
||||
) async {
|
||||
wide(tester);
|
||||
final workspace = threePanes();
|
||||
final stage = ChatCenterStageController(store: _MemoryStore());
|
||||
addTearDown(workspace.dispose);
|
||||
addTearDown(stage.dispose);
|
||||
await tester.pumpWidget(host(workspace, stage));
|
||||
await tester.tap(find.byKey(const ValueKey('input-three')));
|
||||
await tester.sendKeyDownEvent(LogicalKeyboardKey.altLeft);
|
||||
await tester.sendKeyEvent(LogicalKeyboardKey.keyE);
|
||||
await tester.sendKeyUpEvent(LogicalKeyboardKey.altLeft);
|
||||
expect(stage.value, isTrue);
|
||||
expect(find.text('e'), findsNothing);
|
||||
});
|
||||
|
||||
test('the choice is remembered', () async {
|
||||
final store = _MemoryStore();
|
||||
final first = ChatCenterStageController(store: store)..toggle();
|
||||
@@ -504,7 +542,18 @@ void main() {
|
||||
});
|
||||
|
||||
test('labels name the platform chord', () {
|
||||
expect(chatCenterStageShortcutLabel(TargetPlatform.macOS), 'Cmd+E');
|
||||
expect(chatCenterStageShortcutLabel(TargetPlatform.windows), 'Ctrl+E');
|
||||
expect(chatCenterStageShortcutLabel(TargetPlatform.macOS), 'Option+E');
|
||||
expect(chatCenterStageShortcutLabel(TargetPlatform.windows), 'Alt+E');
|
||||
});
|
||||
}
|
||||
|
||||
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