Use adaptive popups for chat details
Present chat turn and shell-history detail surfaces through the shared adaptive popup helpers so desktop uses dialogs while phone layouts retain bottom sheets. Update focused tests and document the verified behavior.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../shell/list_detail_policy.dart';
|
||||
import '../../../ui/adaptive/app_popups.dart';
|
||||
import '../ui/sessions/chat_adaptive.dart';
|
||||
import '../ui/transcript/chat_turn_chip.dart';
|
||||
import 'chat_shell_history.dart';
|
||||
@@ -48,35 +48,10 @@ class ChatShellHistoryChip extends StatelessWidget {
|
||||
}
|
||||
|
||||
Future<void> _open(BuildContext context, bool cupertino) {
|
||||
if (MediaQuery.sizeOf(context).width >= kListDetailMinWidth) {
|
||||
return showChatTurnSheet(
|
||||
context,
|
||||
cupertino,
|
||||
ChatShellHistoryView(controller: controller, runIds: runIds),
|
||||
);
|
||||
}
|
||||
final view = ChatShellHistoryView(
|
||||
controller: controller,
|
||||
runIds: runIds,
|
||||
inSheet: false,
|
||||
);
|
||||
const title = Text(chatShellHistoryTitle);
|
||||
return Navigator.of(context).push<void>(
|
||||
cupertino
|
||||
? CupertinoPageRoute<void>(
|
||||
fullscreenDialog: true,
|
||||
builder: (_) => CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(middle: title),
|
||||
child: SafeArea(child: view),
|
||||
),
|
||||
)
|
||||
: MaterialPageRoute<void>(
|
||||
fullscreenDialog: true,
|
||||
builder: (_) => Scaffold(
|
||||
appBar: AppBar(title: title),
|
||||
body: SafeArea(child: view),
|
||||
),
|
||||
),
|
||||
return showAppDetails<void>(
|
||||
context,
|
||||
builder: (_) =>
|
||||
ChatShellHistoryView(controller: controller, runIds: runIds),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user