Files
pipelines/app/lib/application/chat_destination.dart
T
alan c6c6dcfe18 fix(app): float content behind top bars and give each wide pane its own bar row
- Top-bar clearance helpers (withTopBarClearance, withBarClearance,
  SliverTopBarClearance, BelowTopBar, TopBarNotices); shell, DetailPane and
  the runs/pipelines/templates/artifacts/stage definition/filter/usage pages
  drop their top SafeArea and pad their own lists, pinned headers pin at the
  inset.
- Wide windows: the shell bar narrows to the list pane (ShellPaneSplit) and
  the open item's bar shares its row; item tabs float at the pane's top
  (PageTabsEdge) instead of stacking on the shell's tab bar; the floating
  tab pill no longer swells over leftover media padding.
- Pipeline detail is a DetailPane on wide too; Run/Runs move from FABs into
  the bar's actions; name and identity live in the title pill.
- Run detail title pill shows the real title with Run N, pipeline and
  version (the pill links to the pipeline); the body keeps only status,
  actions and notices; standalone detail draws the same segmented bar.
- One Runs tab badge: attention outranks running.
- Tests for content-behind-bar padding and the no-stacking wide layout;
  notes/app-chrome-fixes.md.
2026-10-31 03:36:22 +00:00

74 lines
2.2 KiB
Dart

import 'package:flutter/material.dart';
import '../features/chat/screen.dart';
import '../ui/adaptive/host.dart';
import '../ui/adaptive/top_bar_notices.dart';
import 'app_session.dart';
import 'connection_status.dart';
import 'server_endpoint.dart';
/// The Chat destination: the shared session list and one read-only thread.
///
/// Before the shared socket accepts its first connection nothing is requested,
/// so an offline launch cannot look like an empty chat list. After that the
/// screen stays mounted through drops; a reconnect advances [syncToken] so the
/// open conversation re-subscribes and re-reads without losing its selection.
class ChatDestination extends StatelessWidget {
const ChatDestination({
super.key,
required this.session,
required this.server,
this.initialSessionId,
this.onSessionSelected,
this.onBack,
});
final AppSession session;
final ServerEndpoint server;
final String? initialSessionId;
final ValueChanged<String>? onSessionSelected;
final VoidCallback? onBack;
@override
Widget build(BuildContext context) => AnimatedBuilder(
animation: session,
builder: (context, _) {
final cupertino = usesCupertinoHost(context);
if ((server.requiresConfiguration || server.error != null) &&
session.endpoint == null) {
return ConnectionGate(
session: session,
server: server,
cupertino: cupertino,
);
}
if (!session.everConnected) {
if (session.connected) return _chatScreen();
return ConnectionGate(
session: session,
server: server,
cupertino: cupertino,
);
}
// The banner stays below the top bar; without it the chat screen
// reaches the top edge (an open chat beside the list draws its own bar
// there).
return TopBarNotices(
notices: [
if (!session.connected)
ConnectionBanner(session: session, cupertino: cupertino),
],
child: _chatScreen(),
);
},
);
Widget _chatScreen() => ChatScreen(
gateway: session.gateway,
initialSessionId: initialSessionId,
syncToken: session.connectionEpoch,
onSessionSelected: onSessionSelected,
onBack: onBack,
);
}