diff --git a/app/PARITY.md b/app/PARITY.md index 92c870fe..82a80c56 100644 --- a/app/PARITY.md +++ b/app/PARITY.md @@ -22,7 +22,7 @@ or scratch servers only, never real operator sessions/runs/workflows. | Area | Current state | Remaining acceptance | | --- | --- | --- | | Shared transport/settings connection | Preview | foreground recovery, persisted endpoint boot, protocol warning, complete refresh semantics | -| Native shell/run URLs | Preview: full route vocabulary including pipeline/version/stage, template detail, run visit/stage and decide, runs pipeline filter; pipeline and template links open their detail | run visit/stage and decide destinations still open the run only; no native OS deep-link registration | +| Native shell/run URLs | Preview: full route vocabulary; pipeline/version/stage, template detail and run visit/stage links open their detail/pane | `?action=decide` opening the prompt, runs pipeline filter, native OS deep-link registration | | Pipeline list/filter/sort/detail/source/versions | Preview: recorded row metadata and miniature, pinned detail URLs, filter/sort | none outstanding on the list/detail read path | | Definition graph | Preview: measured native canvas, pipeline Graph tab, pan/zoom, expanded view, stage definition pane, pipeline stage deep link | live activity pulse on the run graph (tracked below) | | Start a pipeline | Preview: native Run action, prompt/workspace/notify dialog, pinned run request, response-loss check/retry | Report format, recent-directory suggestions, pending intent across a reload | @@ -45,12 +45,12 @@ or scratch servers only, never real operator sessions/runs/workflows. | Chat message surfaces | Preview: formatted assistant markdown (safe links/headings/lists/tables/fences), user text exact, disclosures plain | exact attachments, unknown-part rendering beyond retained placeholders | | Chat activity/reasoning/tools | Preview: one activity line, expanded native overlay with lifecycle/input/output/error/duration/edit diff | compaction wording variants | | Chat composer | Preview: field, Send/Stop, persisted draft, queued/refusal lines; one verified send in the real app flow | attachments, paste and slash palette remain | -| Chat attachments | Preview: host picker, bounded 1 MiB draft, composer chips with removal, base64 wire payload | paste, send wiring in the composer, history reconciliation | +| Chat attachments | Preview: host picker, bounded 1 MiB draft, composer chips, base64 wire payload | send wiring in the composer, paste, history reconciliation | | Chat permissions/questions | Source: native approval/risk and question cards in the conversation view | authenticated smoke with a real pending approval/question; live multi-client resolution; no production decision sent | | Chat model/Info/background tasks | Source: numeric Info sheet (unknown != 0) landed | current-model selection, bounded background-task pages | -| Chat commands/notices/scroll | Source: dismissible local notices landed | slash palette/actions, unknown-command send-as-message, saved scroll/follow intent | +| Chat commands/notices/scroll | Preview: dismissible local notices with reconnect clearing | slash palette/actions, unknown-command send-as-message, saved scroll/follow intent | | Saved schedule list | Preview: Settings row, /schedules route, read-only list; a row opens the owning pipeline detail (Summary by default) | authenticated smoke | -| Schedule editor | Preview: pipeline Summary section creates/edits/pauses/deletes with the lossless draft and revision guard; conflict keeps the draft and shows the server words | Schedule-this-run seeding, schedules list entry/route | +| Schedule editor | Preview: pipeline Summary creates/edits/pauses/deletes with the lossless draft and revision guard; conflict keeps the draft and shows the server words | Schedule-this-run seeding | | Search | Preview: exact target model and navigation to pipeline, pinned version, run and recorded stage; unresolvable hits stay read-only | field/artifact hits open the run (their pane selection is a later slice) | | Needs you | Preview: runs-list bell/count, native sheet, dismiss/clear persistence, live fold, transition notifications, Settings permission tile | authenticated preview smoke | | Notifications | Preview: Settings permission tile over live platform state, transition-only dedupe, tap opens the run | background question notices; permission/browser smoke only in fixtures | diff --git a/app/WORK.md b/app/WORK.md index 5ec6a152..2f426346 100644 --- a/app/WORK.md +++ b/app/WORK.md @@ -71,6 +71,11 @@ All work under app/. Existing applications remain running and unchanged. | Chat sessions | Create/rename/star/close/hide | run98 retained + canceled | oversized run cancelled after 3h; manager verified 155 chat tests, rebased, merged; 1259 suite | merged main | directory groups/search | | Turn documents | Gallery document slots | run102 retained + canceled | oversized run cancelled; 148 artifact tests, rebased; manager fixed visit drill-down to keep session.html out of stage files | merged main | 1284 suite | | Attach picker | Host file input seam | run112 micro | single behaviour; 193 chat tests | merged main | chips/send next | +| Chat notices | Dismissible local notices | run121 / merged | micro; 1387 suite; reconnect clears | merged main | preview published 8098 | +| Stage deep link | Pipeline stage from the route | run122 / merged | 1h27m for one behaviour (3 Code visits); tree green | merged main | - | +| Attach send | Composer send with attachments | run123 running | - | - | - | +| Decide route | Decision prompt from the URL | run124 running | - | - | - | +| Model picker | Recorded model chooser | run125 running | - | - | - | | Routes | Full URL vocabulary | run113 micro | parse/serialise every web route form; 1327 suite | merged main | stage panes next | | Session export | Recorded state surface | run110 micro | state wording + reasons read-only | merged main | repair request next | | Activity overlay | Expanded recorded activity | run111 micro | expand/collapse with recorded fields | merged main | - | diff --git a/app/android/app/src/main/AndroidManifest.xml b/app/android/app/src/main/AndroidManifest.xml index 8491ba8a..75d27286 100644 --- a/app/android/app/src/main/AndroidManifest.xml +++ b/app/android/app/src/main/AndroidManifest.xml @@ -1,4 +1,6 @@ + + (cupertino ? CupertinoTheme.of(context).textTheme.textStyle diff --git a/app/lib/features/runs/ui/run_detail_tab_strip.dart b/app/lib/features/runs/ui/run_detail_tab_strip.dart index f9373687..c55e7f3f 100644 --- a/app/lib/features/runs/ui/run_detail_tab_strip.dart +++ b/app/lib/features/runs/ui/run_detail_tab_strip.dart @@ -125,7 +125,10 @@ class ScrollWhenOverflowing extends StatelessWidget { child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: ConstrainedBox( - constraints: BoxConstraints(minWidth: constraints.maxWidth), + // Content width, not the pane width: the web's tabs are compact + // and left-aligned, not a full-width segmented bar. The scroll + // view still reveals every segment on a narrow pane. + constraints: const BoxConstraints(), child: child, ), ), diff --git a/app/lib/features/runs/ui/runs_list.dart b/app/lib/features/runs/ui/runs_list.dart index 66b8dfb2..f266c5cc 100644 --- a/app/lib/features/runs/ui/runs_list.dart +++ b/app/lib/features/runs/ui/runs_list.dart @@ -52,29 +52,10 @@ class RunsList extends StatelessWidget { return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16, 8, 16, 0), - child: Align( - alignment: AlignmentDirectional.centerEnd, - child: NeedsYouRunsHeading( - rows: controller.runs, - frames: controller.repository.gateway.frames, - onOpen: (entry) => onSelected(entry.runId), - syncToken: syncToken, - store: attentionStore, - now: attentionNow, - notifications: notifications, - ), - ), - ), - if (controller.usage != null) - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: Text('Usage: ${controller.usage}'), - ), + _heading(context), if (controller.error != null) _inlineError(context), Padding( - padding: const EdgeInsets.all(16), + padding: const EdgeInsetsDirectional.fromSTEB(16, 12, 16, 4), child: usesCupertinoHost(context) ? CupertinoSearchTextField( placeholder: 'Filter runs', @@ -92,8 +73,10 @@ class RunsList extends StatelessWidget { Expanded( child: controller.visibleRuns.isEmpty ? const Center(child: Text('No runs found.')) - : ListView.builder( + : ListView.separated( itemCount: controller.visibleRuns.length, + separatorBuilder: (context, index) => + const Divider(height: 1), itemBuilder: (context, index) => _runTile(context, controller.visibleRuns[index]), ), @@ -102,6 +85,29 @@ class RunsList extends StatelessWidget { ); } + Widget _heading(BuildContext context) => Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16, 8, 16, 0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: controller.usage == null + ? const SizedBox.shrink() + : Text('Usage: ${controller.usage}'), + ), + NeedsYouRunsHeading( + rows: controller.runs, + frames: controller.repository.gateway.frames, + onOpen: (entry) => onSelected(entry.runId), + syncToken: syncToken, + store: attentionStore, + now: attentionNow, + notifications: notifications, + ), + ], + ), + ); + Widget _emptyError(BuildContext context) => Center( child: Column( mainAxisSize: MainAxisSize.min, diff --git a/app/lib/shell/adaptive_shell.dart b/app/lib/shell/adaptive_shell.dart index 2d26eb04..007c6b9c 100644 --- a/app/lib/shell/adaptive_shell.dart +++ b/app/lib/shell/adaptive_shell.dart @@ -99,22 +99,35 @@ class _AdaptiveShellState extends State { ), ), child: SafeArea( - child: Column( - children: [ - Expanded(child: _destinationStack(contents, index)), - CupertinoTabBar( - currentIndex: index, - onTap: (value) => _select(AppDestination.values[value]), - items: _items((destination) { - final item = destinationDetails(destination); - return BottomNavigationBarItem( - icon: Icon(item.cupertinoIcon), - label: item.label, - ); - }), - ), - ], - ), + child: wide + // The web keeps a destination rail on a wide window. A native + // Cupertino sidebar list is the same idea with the host's own + // controls; the tab bar stays the narrow-window navigation. + ? Row( + children: [ + _CupertinoSidebar( + selected: _selected, + onSelected: _select, + ), + Expanded(child: _destinationStack(contents, index)), + ], + ) + : Column( + children: [ + Expanded(child: _destinationStack(contents, index)), + CupertinoTabBar( + currentIndex: index, + onTap: (value) => _select(AppDestination.values[value]), + items: _items((destination) { + final item = destinationDetails(destination); + return BottomNavigationBarItem( + icon: Icon(item.cupertinoIcon), + label: item.label, + ); + }), + ), + ], + ), ), ); } @@ -172,3 +185,48 @@ class _AdaptiveShellState extends State { Widget _destinationStack(List contents, int index) => IndexedStack(index: index, children: contents); } + +/// The wide-window Cupertino destination list: the web's 200px rail with the +/// host's own grouped list controls. +class _CupertinoSidebar extends StatelessWidget { + const _CupertinoSidebar({required this.selected, required this.onSelected}); + + final AppDestination selected; + final ValueChanged onSelected; + + @override + Widget build(BuildContext context) { + final theme = CupertinoTheme.of(context); + return Container( + width: 200, + decoration: BoxDecoration( + color: CupertinoColors.secondarySystemGroupedBackground.resolveFrom( + context, + ), + border: Border( + right: BorderSide( + color: CupertinoColors.separator.resolveFrom(context), + ), + ), + ), + child: ListView( + padding: const EdgeInsets.symmetric(vertical: 8), + children: [ + for (final destination in AppDestination.values) + CupertinoListTile( + key: ValueKey('shell.destination.${destination.name}'), + leading: Icon(destinationDetails(destination).cupertinoIcon), + title: Text(destinationDetails(destination).label), + trailing: destination == selected + ? Icon( + CupertinoIcons.checkmark_alt, + color: theme.primaryColor, + ) + : null, + onTap: () => onSelected(destination), + ), + ], + ), + ); + } +} diff --git a/app/test/widget_test.dart b/app/test/widget_test.dart index 774496bc..5561ad7f 100644 --- a/app/test/widget_test.dart +++ b/app/test/widget_test.dart @@ -38,16 +38,42 @@ void main() { ); } - testWidgets('Cupertino shell uses native navigation controls', ( + testWidgets('Cupertino shell uses a tab bar on a narrow window', ( tester, ) async { + tester.view.physicalSize = const Size(390, 844); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); await tester.pumpWidget(const MyApp(cupertino: true)); expect(find.byType(CupertinoNavigationBar), findsOneWidget); expect(find.byType(CupertinoTabBar), findsOneWidget); expect(find.text('Pipelines — Not implemented'), findsOneWidget); }); + testWidgets('Cupertino shell uses a sidebar on a wide window', ( + tester, + ) async { + tester.view.physicalSize = const Size(1280, 900); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); + await tester.pumpWidget(const MyApp(cupertino: true)); + expect(find.byType(CupertinoTabBar), findsNothing); + expect( + find.byKey(const ValueKey('shell.destination.pipelines')), + findsOneWidget, + ); + await tester.tap(find.byKey(const ValueKey('shell.destination.runs'))); + await tester.pumpAndSettle(); + expect(find.text('Runs — Not implemented'), findsOneWidget); + }); + testWidgets('Cupertino content stays inside safe area', (tester) async { + tester.view.physicalSize = const Size(390, 844); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); tester.view.padding = const FakeViewPadding(top: 36, bottom: 28); addTearDown(tester.view.resetPadding); await tester.pumpWidget(const MyApp(cupertino: true)); diff --git a/app/tool/runs_probe.mjs b/app/tool/runs_probe.mjs index 486c5558..37a9badb 100644 --- a/app/tool/runs_probe.mjs +++ b/app/tool/runs_probe.mjs @@ -532,12 +532,23 @@ try { await clickText('Chat'); await clickText('Probe conversation', { contains: true }); await assertBody('User message'); - // The empty composer exposes a hint, not an accessible label, so focus it by - // clicking its visible strip above the navigation bar; JS focus alone is not - // Flutter's editing connection and would swallow the text. + // The empty composer exposes a hint, not an accessible label. Locate the + // semantics text field and click its centre: a fixed point misses once an + // attachment strip grows the composer, and JS focus alone is not Flutter's + // editing connection. + const composerPoint = await evaluate(`(() => { + const fields = [...document.querySelectorAll('flt-semantics[role="textbox"], input, textarea')]; + const rects = fields + .map((el) => el.getBoundingClientRect()) + .filter((r) => r.width > 40 && r.height > 10); + if (!rects.length) return null; + const lowest = rects.sort((a, b) => b.bottom - a.bottom)[0]; + return { x: lowest.left + lowest.width / 2, y: lowest.top + lowest.height / 2 }; + })()`); + if (!composerPoint) throw new Error('The composer text field is not exposed'); for (const type of ['mousePressed', 'mouseReleased']) { await send('Input.dispatchMouseEvent', { - type, x: 150, y: 700, button: 'left', clickCount: 1, + type, x: composerPoint.x, y: composerPoint.y, button: 'left', clickCount: 1, }, session); } await delay(400);