Show chat details and file details as dialogs on desktop

Phase 2b.4 of docs/plans/floating-windows.md: both use showAppDetails (a
dialog on a wide app, a bottom sheet on a phone). Implemented by pipeline
run 305; landed by hand after its UI review found the dialog clipped, which
the helper now scrolls.
This commit is contained in:
2026-11-10 22:21:15 +00:00
parent 31f495fc18
commit 286506310c
5 changed files with 107 additions and 90 deletions
+8 -40
View File
@@ -1,6 +1,5 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../ui/adaptive/host.dart';
import '../../../ui/adaptive/app_popups.dart';
import '../../artifacts/actions/artifact_transfer.dart';
import '../../artifacts/domain/artifact_kind.dart';
import '../../artifacts/ui/artifact_external_open.dart';
@@ -18,7 +17,6 @@ void showFileDetails(
required Future<ArtifactTransferResult> Function()? download,
required ArtifactExternalOpen openExternal,
}) {
final cupertino = usesCupertinoHost(context);
Widget content(BuildContext sheet) {
Future<void> open() async {
var opened = false;
@@ -37,12 +35,7 @@ void showFileDetails(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
entry.name,
style: cupertino
? CupertinoTheme.of(sheet).textTheme.navTitleTextStyle
: Theme.of(sheet).textTheme.titleLarge,
),
Text(entry.name, style: Theme.of(sheet).textTheme.titleLarge),
const SizedBox(height: 12),
Text(
'${artifactKindLabel(artifactKind(fileContentType(entry.name), entry.name))} · ${fileSizeLabel(entry.size)}',
@@ -57,42 +50,17 @@ void showFileDetails(
const SizedBox(height: 16),
if (download != null) FileDownloadButton(download: download),
if (urls != null)
cupertino
? CupertinoButton(
onPressed: open,
child: const Text('Open externally'),
)
: TextButton.icon(
onPressed: open,
icon: const Icon(Icons.open_in_new),
label: const Text('Open externally'),
),
if (cupertino)
CupertinoButton(
onPressed: () => Navigator.pop(sheet),
child: const Text('Close'),
TextButton.icon(
onPressed: open,
icon: const Icon(Icons.open_in_new),
label: const Text('Open externally'),
),
],
),
),
);
return cupertino
? CupertinoPopupSurface(
child: DefaultTextStyle(
style: CupertinoTheme.of(sheet).textTheme.textStyle,
child: body,
),
)
: body;
return body;
}
if (cupertino) {
showCupertinoModalPopup<void>(context: context, builder: content);
} else {
showModalBottomSheet<void>(
context: context,
showDragHandle: true,
builder: content,
);
}
showAppDetails<void>(context, builder: content);
}