fix: align terminal more control sizing

This commit is contained in:
sladro 2026-04-06 12:45:10 +08:00
parent 12f2b7bb8c
commit 900a6f0567
2 changed files with 23 additions and 3 deletions

View File

@ -1050,15 +1050,15 @@ class _TerminalPageState extends ConsumerState<TerminalPage>
Widget _buildMoreControlsButton() {
return _buildCommandDeckAction(
OutlinedButton.icon(
RepeatableTerminalKeyButton(
key: const Key('terminal_more_controls_button'),
onPressed: () {
setState(() {
_showExpandedControls = !_showExpandedControls;
});
},
icon: Icon(_showExpandedControls ? Icons.expand_less : Icons.expand_more),
label: Text(_showExpandedControls ? 'Less' : 'More'),
icon: _showExpandedControls ? Icons.expand_less : Icons.expand_more,
label: _showExpandedControls ? 'Less' : 'More',
),
);
}

View File

@ -375,6 +375,26 @@ void main() {
},
);
testWidgets('terminal more controls button matches arrow key size', (
tester,
) async {
await _pumpApp(
tester,
projectRepository: _FakeProjectRepository(),
sessionRepository: _FakeSessionRepository(),
);
await _openProjectTerminal(tester);
final moreButtonSize = tester.getSize(
find.byKey(const Key('terminal_more_controls_button')),
);
final upKeySize = tester.getSize(find.byKey(const Key('terminal_quick_key_up')));
expect(moreButtonSize.height, upKeySize.height);
expect(moreButtonSize.width, upKeySize.width);
});
testWidgets('terminal more controls button toggles expanded quick terminal keys', (tester) async {
final transportFactory = _QueuedTerminalSocketTransportFactory();