- gpt_markdown renders through its own Material port, whose Theme.of falls back to a light theme: code panels stayed light and their text black in the dark theme. The chat now wraps markdown in a matching `mui.Theme`. - Folding a run changed the height below its header and threw the header out of view. The toggle remembers the header's screen position, corrects the scroll offset, and parks the header at the top when the run is longer than the viewport. - Step details show what a tool actually did: the command and its output for shell steps, the remaining inputs and the result for the rest, in monospace; toolOutput falls back to metadata. A read/write/edit of an image is no longer foldable — its path opens the preview. - The event stream now times out without a heartbeat, so a half-open connection is noticed and reopened; returning to the foreground restarts the stream, refreshes the session list and the open chat, and reloadTail merges the newest page instead of dropping loaded history. - A page shorter than the limit means there is nothing older, so short sessions no longer offer "load earlier". - Version 0.3.4 (code 304).
71 lines
1.8 KiB
Dart
71 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'screens/servers_screen.dart';
|
|
import 'screens/sessions_screen.dart';
|
|
import 'state.dart';
|
|
|
|
void main() {
|
|
runApp(const OpenChamberApp());
|
|
}
|
|
|
|
class OpenChamberApp extends StatefulWidget {
|
|
const OpenChamberApp({super.key});
|
|
@override
|
|
State<OpenChamberApp> createState() => _OpenChamberAppState();
|
|
}
|
|
|
|
class _OpenChamberAppState extends State<OpenChamberApp>
|
|
with WidgetsBindingObserver {
|
|
final AppState app = AppState();
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
WidgetsBinding.instance.addObserver(this);
|
|
app.init();
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
WidgetsBinding.instance.removeObserver(this);
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
void didChangeAppLifecycleState(AppLifecycleState state) {
|
|
// The socket often dies while the app sits in the background; nothing
|
|
// reports it, so reopen the stream and refresh the open chat on return.
|
|
if (state == AppLifecycleState.resumed) app.onResumed();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ListenableBuilder(
|
|
listenable: app,
|
|
builder: (context, _) {
|
|
final home = app.client == null
|
|
? ServersScreen(app: app)
|
|
: SessionsScreen(app: app);
|
|
return MaterialApp(
|
|
title: 'OpenChamber',
|
|
theme: ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(
|
|
seedColor: const Color(0xFF6C5CE7),
|
|
brightness: Brightness.light,
|
|
),
|
|
useMaterial3: true,
|
|
),
|
|
darkTheme: ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(
|
|
seedColor: const Color(0xFF6C5CE7),
|
|
brightness: Brightness.dark,
|
|
),
|
|
useMaterial3: true,
|
|
),
|
|
home: home,
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|