feat(app): segmented glass top bar across the app
Extract the chat's segmented bar into lib/ui/adaptive (SegmentedBar, GlassPill, SegmentedBarOverlay) and use it for the shell bar, DetailPane and every page-level bar. Pieces are frosted glass over a fading scrim; only pills take taps. Actions keep their natural width so the title gives way before a model name. The chat transcript scrolls behind its header.
This commit is contained in:
@@ -31,6 +31,21 @@ class _ProbeGateway implements ApiGateway {
|
||||
return {
|
||||
'chat_history': {
|
||||
'messages': [
|
||||
// A long history scrolls behind the floating header.
|
||||
if (_probeLong)
|
||||
for (var i = 0; i < 12; i++)
|
||||
{
|
||||
'id': 'probe-history-$i',
|
||||
'role': i.isEven ? 'user' : 'assistant',
|
||||
'parts': [
|
||||
{
|
||||
'type': 'text',
|
||||
'text':
|
||||
'Earlier message ${i + 1}: a line of history so '
|
||||
'the transcript is taller than the window.',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
'id': 'probe-user',
|
||||
'role': 'user',
|
||||
@@ -97,6 +112,22 @@ class _ProbeGateway implements ApiGateway {
|
||||
String nextOperation() => 'probe-op-${++_sequence}';
|
||||
}
|
||||
|
||||
const _probeLong = bool.fromEnvironment('CHAT_COMPOSER_PROBE_LONG');
|
||||
const _probeModel = String.fromEnvironment(
|
||||
'CHAT_COMPOSER_PROBE_MODEL',
|
||||
defaultValue: 'claude-opus-5-5',
|
||||
);
|
||||
|
||||
/// A phone-width frame inside a wider browser window (headless Chrome crops
|
||||
/// windows narrower than about 500px); zero uses the whole window.
|
||||
const _probeWidth = int.fromEnvironment('CHAT_COMPOSER_PROBE_WIDTH');
|
||||
|
||||
Widget _framed(Widget child) => _probeWidth == 0
|
||||
? child
|
||||
: Center(
|
||||
child: SizedBox(width: _probeWidth.toDouble(), child: child),
|
||||
);
|
||||
|
||||
const _probeStyle = String.fromEnvironment(
|
||||
'CHAT_COMPOSER_PROBE_STYLE',
|
||||
defaultValue: 'material',
|
||||
@@ -111,7 +142,7 @@ void main() {
|
||||
session: const {
|
||||
'id': 'probe-composer',
|
||||
'backend': 'opencode',
|
||||
'model': 'claude-opus-5-5',
|
||||
'model': _probeModel,
|
||||
'directory': '/Users/ada/repos/tank',
|
||||
},
|
||||
onBack: () {},
|
||||
@@ -122,7 +153,7 @@ void main() {
|
||||
runApp(
|
||||
CupertinoApp(
|
||||
theme: const CupertinoThemeData(brightness: Brightness.dark),
|
||||
home: CupertinoPageScaffold(child: SafeArea(child: thread)),
|
||||
home: CupertinoPageScaffold(child: _framed(SafeArea(child: thread))),
|
||||
),
|
||||
);
|
||||
return;
|
||||
@@ -133,7 +164,7 @@ void main() {
|
||||
platform: TargetPlatform.android,
|
||||
brightness: Brightness.light,
|
||||
),
|
||||
home: Scaffold(body: SafeArea(child: thread)),
|
||||
home: Scaffold(body: _framed(SafeArea(child: thread))),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user