Matthias Nott
2026-03-25 9aea0e7837ae0ea3d417f3d2afd8554cd71f123d
lib/screens/chat_screen.dart
....@@ -160,6 +160,14 @@
160160 _ws!.onStatusChanged = (status) {
161161 if (mounted) {
162162 ref.read(wsStatusProvider.notifier).state = status;
163
+ if (status == ConnectionStatus.connected) {
164
+ ref.read(connectionDetailProvider.notifier).state = '';
165
+ }
166
+ }
167
+ };
168
+ _ws!.onStatusDetail = (detail) {
169
+ if (mounted) {
170
+ ref.read(connectionDetailProvider.notifier).state = detail;
163171 }
164172 };
165173 _ws!.onMessage = _handleMessage;
....@@ -1301,6 +1309,7 @@
13011309 final messages = ref.watch(messagesProvider);
13021310 final wsStatus = ref.watch(wsStatusProvider);
13031311 final isTyping = ref.watch(isTypingProvider);
1312
+ final connectionDetail = ref.watch(connectionDetailProvider);
13041313 final sessions = ref.watch(sessionsProvider);
13051314 final activeSession = ref.watch(activeSessionProvider);
13061315 final unreadCounts = ref.watch(unreadCountsProvider);
....@@ -1319,9 +1328,20 @@
13191328 _scaffoldKey.currentState?.openDrawer();
13201329 },
13211330 ),
1322
- title: Text(
1323
- activeSession?.name ?? 'PAILot',
1324
- style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
1331
+ title: Column(
1332
+ crossAxisAlignment: CrossAxisAlignment.center,
1333
+ mainAxisSize: MainAxisSize.min,
1334
+ children: [
1335
+ Text(
1336
+ activeSession?.name ?? 'PAILot',
1337
+ style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
1338
+ ),
1339
+ if (connectionDetail.isNotEmpty && wsStatus != ConnectionStatus.connected)
1340
+ Text(
1341
+ connectionDetail,
1342
+ style: TextStyle(fontSize: 11, color: Colors.grey.shade400),
1343
+ ),
1344
+ ],
13251345 ),
13261346 actions: [
13271347 StatusDot(status: wsStatus),