Match chat terminal buttons to responsive UI
Remove the duplicate terminal action from narrow shell bars and expose the terminal in open chat bars only where appropriate. Use the shared plain bar-button styling and add focused light/dark responsive widget coverage.
This commit is contained in:
@@ -8,6 +8,7 @@ import '../features/terminal/terminal_machines.dart';
|
||||
import '../features/terminal/terminal_surface.dart';
|
||||
import '../features/terminal/terminal_toggle_button.dart';
|
||||
import '../features/terminal/terminal_window.dart';
|
||||
import '../shell/list_detail_policy.dart';
|
||||
import '../shell/windows/window_manager.dart';
|
||||
|
||||
/// The app's machine terminals: one hub over every connected machine (the
|
||||
@@ -66,6 +67,14 @@ class AppTerminals {
|
||||
/// The bar button showing or hiding the terminal.
|
||||
Widget toggle() => TerminalToggleButton(layout: layout);
|
||||
|
||||
/// The Chat tab's shell-bar button. Only a wide layout shows the shell bar
|
||||
/// over an open chat, so only there is it kept. A narrow layout has none:
|
||||
/// its open chat's own bar carries the terminal (see
|
||||
/// `terminalChatBarAction`), and a chat list's bar has none (the shortcut
|
||||
/// still shows the terminal).
|
||||
Widget? barToggle(BuildContext context) =>
|
||||
showsListBesideDetail(context) ? toggle() : null;
|
||||
|
||||
void dispose() {
|
||||
floating?.dispose();
|
||||
hub.dispose();
|
||||
|
||||
@@ -820,13 +820,14 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
final runsRoute = tab(AppDestination.runs);
|
||||
final chatRoute = tab(AppDestination.chat);
|
||||
return AdaptiveShell(
|
||||
// The terminal button sits on the Chat tab only; the keyboard
|
||||
// The terminal button sits on the Chat tab's shell bar on wide layouts;
|
||||
// a narrow layout has it in the chat's own bar instead. The keyboard
|
||||
// shortcut still toggles the terminal everywhere.
|
||||
barActions: [
|
||||
// Shown on every tab while the app has floating windows.
|
||||
WindowsMenuButton(manager: _windows),
|
||||
if (_destinationOf(route.kind) == AppDestination.chat)
|
||||
_terminals.toggle(),
|
||||
?_terminals.barToggle(context),
|
||||
],
|
||||
attentionCount: counts.attention,
|
||||
runningRunCount: counts.running,
|
||||
|
||||
Reference in New Issue
Block a user