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:
@@ -14,21 +14,31 @@ const String chatShellShareLabel = 'Send to agent';
|
||||
const String chatShellSharingLabel = 'Sending…';
|
||||
const String chatShellSharedLabel = 'Sent to agent';
|
||||
const String chatShellFullScreenLabel = 'Full screen';
|
||||
const String chatShellExpandLabel = 'Expand';
|
||||
const String chatShellCollapseLabel = 'Collapse';
|
||||
|
||||
/// The card's host buttons: Stop while running; Copy output, Send to agent
|
||||
/// once finished; Full screen for the terminal.
|
||||
/// once finished; Expand or Collapse (when [onExpand] is given) and Full
|
||||
/// screen for the terminal.
|
||||
class ChatShellCardActions extends StatefulWidget {
|
||||
const ChatShellCardActions({
|
||||
super.key,
|
||||
required this.run,
|
||||
required this.controller,
|
||||
required this.onFullScreen,
|
||||
this.expanded = false,
|
||||
this.onExpand,
|
||||
});
|
||||
|
||||
final ChatShellRun run;
|
||||
final ChatShellRunsController controller;
|
||||
final VoidCallback onFullScreen;
|
||||
|
||||
/// Whether the terminal is expanded, and the toggle (null: nothing to
|
||||
/// expand, the output fits collapsed).
|
||||
final bool expanded;
|
||||
final VoidCallback? onExpand;
|
||||
|
||||
@override
|
||||
State<ChatShellCardActions> createState() => _ChatShellCardActionsState();
|
||||
}
|
||||
@@ -100,6 +110,15 @@ class _ChatShellCardActionsState extends State<ChatShellCardActions> {
|
||||
? () => unawaited(controller.share(run.id))
|
||||
: null,
|
||||
),
|
||||
if (widget.onExpand case final toggle?)
|
||||
_button(
|
||||
key: const Key('chat-shell-run-size'),
|
||||
label: widget.expanded
|
||||
? chatShellCollapseLabel
|
||||
: chatShellExpandLabel,
|
||||
material: widget.expanded ? Icons.unfold_less : Icons.unfold_more,
|
||||
onPressed: toggle,
|
||||
),
|
||||
if (run.running || run.output.isNotEmpty)
|
||||
_button(
|
||||
key: const Key('chat-shell-run-expand'),
|
||||
|
||||
Reference in New Issue
Block a user