Show the terminal bar button on the Chat tab only
Pipelines and Runs no longer carry it; the keyboard shortcut still toggles the terminal everywhere.
This commit is contained in:
@@ -747,7 +747,12 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
final runsRoute = tab(AppDestination.runs);
|
||||
final chatRoute = tab(AppDestination.chat);
|
||||
return AdaptiveShell(
|
||||
barActions: [_terminals.toggle(cupertino: _cupertino)],
|
||||
// The terminal button sits on the Chat tab only; the keyboard
|
||||
// shortcut still toggles the terminal everywhere.
|
||||
barActions: [
|
||||
if (_destinationOf(route.kind) == AppDestination.chat)
|
||||
_terminals.toggle(cupertino: _cupertino),
|
||||
],
|
||||
attentionCount: attentionCount,
|
||||
cupertino: _cupertino,
|
||||
destination: _destinationOf(route.kind),
|
||||
|
||||
@@ -239,9 +239,14 @@ void main() {
|
||||
final pipelinesRunsId =
|
||||
pipelineRequest(channel, 'list_runs')!['id'] as String;
|
||||
|
||||
// The terminal's bar button belongs to the Chat tab only.
|
||||
const terminalButton = ValueKey('shell.terminal');
|
||||
expect(find.byKey(terminalButton), findsNothing);
|
||||
|
||||
await tester.tap(find.byKey(const ValueKey('shell.destination.runs')));
|
||||
await tester.pump();
|
||||
expect(provider.value.uri.path, '/runs');
|
||||
expect(find.byKey(terminalButton), findsNothing);
|
||||
|
||||
final runsRequest = await waitForLaterRequest(
|
||||
tester,
|
||||
@@ -286,6 +291,12 @@ void main() {
|
||||
await tester.pump();
|
||||
expect(findNativeBack(), findsNothing);
|
||||
expect(find.byKey(const ValueKey('run-detail-pane')), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byKey(const ValueKey('shell.destination.chat')));
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(provider.value.uri.path, startsWith('/chat'));
|
||||
expect(find.byKey(terminalButton), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('a malformed boot path is corrected to /pipelines', (
|
||||
|
||||
Reference in New Issue
Block a user