Terminal round 3: readable palettes, panel and card sizing, rail, tabs
- Colours: terminal background is the theme's lowest surface; the 16 ANSI colours come from a chosen palette (Theme colours, Classic, Calm, Vivid; Settings > Terminal > Colours, saved as `palette`) adjusted in lightness to the background: colours 4.5:1, bright ones lighter than normal, white light and black dark in both themes so white-on-red/blue/magenta and black-on-green/yellow/cyan (ls setuid, setgid, sticky) keep 3:1. Selection, find matches and the current match keep text at 4.5:1. - Bottom panel opens at 40% of the window, at least 16 rows, until dragged; the dragged height is remembered (old saved 300 px default reads as never resized). - Navigation rail scrolls its tabs (and below 240 px Settings too), so items never overlap under a tall panel. - Chat command cards: Expand / Collapse grows a live terminal to 60% of the window (finished output only to its rows); collapsed stays 12 rows. - Terminal tabs: ellipsised titles (220 px) with the whole title in the tooltip, selected tab filled, outlined and bold, close buttons are IconButtons (48 px touch, 40 px desktop). - Capture fixture: ?terminalColors=1 and ?terminalPalette=. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -77,6 +77,30 @@ void main() {
|
||||
expect(saved().containsKey('font_size'), isFalse);
|
||||
});
|
||||
|
||||
testWidgets('the colour palette is chosen in Settings, saved and '
|
||||
'restored', (tester) async {
|
||||
await pump(tester);
|
||||
expect(find.text('Colours'), findsOneWidget);
|
||||
await tester.tap(find.byType(DropdownMenu<TerminalPalette>));
|
||||
await tester.pumpAndSettle();
|
||||
for (final palette in TerminalPalette.values) {
|
||||
expect(find.text(palette.label), findsWidgets);
|
||||
}
|
||||
await tester.tap(find.text('Calm').last);
|
||||
await tester.pumpAndSettle();
|
||||
expect(layout.palette, TerminalPalette.calm);
|
||||
expect(saved()['palette'], 'calm');
|
||||
final restored = TerminalLayout(store: store);
|
||||
await restored.restore();
|
||||
expect(restored.palette, TerminalPalette.calm);
|
||||
});
|
||||
|
||||
test('an unknown saved palette restores the theme colours', () async {
|
||||
store.saved = jsonEncode({'palette': 'nonesuch'});
|
||||
await layout.restore();
|
||||
expect(layout.palette, TerminalPalette.theme);
|
||||
});
|
||||
|
||||
testWidgets('a zoom from the keyboard shows in the menu at once', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
Reference in New Issue
Block a user