Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

fix(terminal): add showHeader so the phone can hide the title row

tonyeed23d7c832c
diff --git a/desktop/lib/widgets/terminal_panel.dart b/desktop/lib/widgets/terminal_panel.dart
index 8b451ab92..8e431e0d6 100644
--- a/desktop/lib/widgets/terminal_panel.dart
+++ b/desktop/lib/widgets/terminal_panel.dart
@@ -62,6 +62,13 @@ class TerminalPanel extends StatefulWidget {
final (String, int)? paneLocation;
final (int, int, int?)? layoutRequest;
final bool compactHeader;
+
+ /// Whether the title row is built at all. False on the phone, where
+ /// [PhoneHeader] already names the agent above this panel and the pane is
+ /// given the full remaining height. Find has no way in there — every
+ /// [TerminalFindAction] caller lives in the desktop screens — so the row's
+ /// Find overlay goes with it.
+ final bool showHeader;
final int focusRequest;
/// Whether this tile's composer textbox is showing. Only consulted for a remote machine.
@@ -90,6 +97,7 @@ class TerminalPanel extends StatefulWidget {
this.paneLocation,
this.layoutRequest,
this.compactHeader = false,
+ this.showHeader = true,
this.focusRequest = 0,
this.composerVisible = false,
this.readOnly = false,
@@ -1129,73 +1137,79 @@ class _TerminalPanelState extends State<TerminalPanel>
color: grid.AppPalette.windowBg,
child: Column(
children: [
- Stack(
- children: [
- Visibility(
- visible: _find == null,
- maintainSize: true,
- maintainAnimation: true,
- maintainState: true,
- child: _buildHeader(context),
- ),
- // Attach the focused pane's input before Find is requested.
- // Hidden/unfocused panes need no dormant editor or index.
- if (_find != null || (widget.visible && widget.focused))
- Positioned.fill(
- child: Offstage(
- offstage: _find == null,
- child: LayoutBuilder(
- builder: (context, constraints) => Row(
- children: [
- if (constraints.maxWidth > 520)
- Expanded(
+ if (widget.showHeader)
+ Stack(
+ children: [
+ Visibility(
+ visible: _find == null,
+ maintainSize: true,
+ maintainAnimation: true,
+ maintainState: true,
+ child: _buildHeader(context),
+ ),
+ // Attach the focused pane's input before Find is requested.
+ // Hidden/unfocused panes need no dormant editor or index.
+ if (_find != null || (widget.visible && widget.focused))
+ Positioned.fill(
+ child: Offstage(
+ offstage: _find == null,
+ child: LayoutBuilder(
+ builder: (context, constraints) => Row(
+ children: [
+ if (constraints.maxWidth > 520)
+ Expanded(
+ child: Padding(
+ padding: const EdgeInsets.symmetric(
+ horizontal: _stripPadding,
+ ),
+ child: Text(
+ session.agentName,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: const TextStyle(
+ fontSize: 13,
+ color: Colors.white70,
+ ),
+ ),
+ ),
+ )
+ else
+ const Spacer(),
+ SizedBox(
+ width: math.min(constraints.maxWidth, 380),
child: Padding(
padding: const EdgeInsets.symmetric(
- horizontal: _stripPadding,
+ horizontal: 6,
+ vertical: 4,
),
- child: Text(
- session.agentName,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: const TextStyle(
- fontSize: 13,
- color: Colors.white70,
- ),
+ child: TerminalFindBar(
+ key: _findBarKey,
+ search: _find,
+ initialQuery: _lastFindQuery,
+ initialCaseSensitive:
+ _lastFindCaseSensitive,
+ readOnly:
+ widget.readOnly ||
+ !session.acceptsInput,
+ onQuery: _queryFind,
+ onStep: _stepFind,
+ onClose: _closeFind,
+ onFocus: () =>
+ widget.onRendererFocus?.call(),
),
),
- )
- else
- const Spacer(),
- SizedBox(
- width: math.min(constraints.maxWidth, 380),
- child: Padding(
- padding: const EdgeInsets.symmetric(
- horizontal: 6,
- vertical: 4,
- ),
- child: TerminalFindBar(
- key: _findBarKey,
- search: _find,
- initialQuery: _lastFindQuery,
- initialCaseSensitive: _lastFindCaseSensitive,
- readOnly:
- widget.readOnly || !session.acceptsInput,
- onQuery: _queryFind,
- onStep: _stepFind,
- onClose: _closeFind,
- onFocus: () => widget.onRendererFocus?.call(),
- ),
),
- ),
- ],
+ ],
+ ),
),
),
),
- ),
- ],
- ),
+ ],
+ ),
- Divider(height: 1, color: AppColors.border),
+ // Goes with the row above it: the phone draws its own rule under
+ // [PhoneHeader], and keeping this one would stack two.
+ if (widget.showHeader) Divider(height: 1, color: AppColors.border),
Expanded(
child: Stack(
children: [