diff --git a/app/lib/features/chat/conversation/chat_thread_view.dart b/app/lib/features/chat/conversation/chat_thread_view.dart index 0c778632..5eef36ef 100644 --- a/app/lib/features/chat/conversation/chat_thread_view.dart +++ b/app/lib/features/chat/conversation/chat_thread_view.dart @@ -93,6 +93,7 @@ class ChatThreadView extends StatefulWidget { this.paneControls = const [], this.sidebarControl, this.showBackButton, + this.useNativeBack = false, }); final ApiGateway gateway; @@ -103,6 +104,7 @@ class ChatThreadView extends StatefulWidget { final List paneControls; final Widget? sidebarControl; final bool? showBackButton; + final bool useNativeBack; /// Sets the chat's shared colour (a palette name, null for none) from the /// information sheet; null leaves the sheet without the Colour choice. @@ -1199,7 +1201,9 @@ class _ChatThreadViewState extends State { showBack: canGoBack, // A pushed page keeps the platform's stock Back (pop this route); a // standalone conversation calls its owner. - onBack: widget.showBackButton == true + onBack: widget.useNativeBack + ? null + : widget.showBackButton == true ? widget.onBack : (inShellBar ? null : widget.onBack), // Each control is its own action, so each pops in (and sinks) on its diff --git a/app/lib/features/chat/screen.dart b/app/lib/features/chat/screen.dart index 8ac22f00..73b56f22 100644 --- a/app/lib/features/chat/screen.dart +++ b/app/lib/features/chat/screen.dart @@ -432,6 +432,7 @@ class _ChatScreenState extends State with _ChatScreenWorkspace { onNextChat: _nextAfter(selected) != null ? () => _openNext(selected) : null, + useNativeBack: _page.open, showBackButton: pane == null ? null : _page.open || !showsListBesideDetail(context), diff --git a/app/notes/mobile-chat-peeks.md b/app/notes/mobile-chat-peeks.md index 54564f78..c10a3bbc 100644 --- a/app/notes/mobile-chat-peeks.md +++ b/app/notes/mobile-chat-peeks.md @@ -13,3 +13,5 @@ Checks: bounded analysis clean;7 real-screen split tests passed, including first Rendered browser evidence: `/private/tmp/mobile-panes-phone-final/` (Material/light560x1000, Add pane, draft retention, real peek taps, no native input focus after a peek switch, unfold880); `/private/tmp/mobile-panes-unfolded-final/` (Cupertino/dark880x1100 hidden sidebar, fold560x1000, switch). All8 final screenshots/contact sheet were inspected; reports have no errors. The phone film contact sheet and10 frame files show the actual220ms transition, including intermediate frames. Test browsers/servers exited. No physical Fold testing, backend change or deployment was performed in this lane. Animation follow-up: each pane now lays out against its actual animated constraints, instead of its target rectangle, so shrinking panes do not leave a transient blank area. Regression assertions compare both thread content heights against intermediate animated viewport heights. Workspace23, direct mobile2 and real-screen7 tests pass; analysis is clean. Updated actual-browser film and screenshots: `/private/tmp/mobile-panes-phone-smooth/`,16frames plus the inspected contact sheet and representative145/245msframes. The native-input no-keyboard check passes again. + +Native Back follow-up: phone-hosted pane headers request the stock Navigator Back action (`useNativeBack`) while retaining their own visible Back control. Both application scroll/top/bottom/system-Back regressions pass (2/2), and the first-phone-split integration asserts a null native BackButton callback. Screen integration7/7 and bounded analysis pass after this change. Inline workspaces retain their explicit owner Back callback. diff --git a/app/test/features/chat/chat_split_integration_test.dart b/app/test/features/chat/chat_split_integration_test.dart index f2ecd5cc..3a49b824 100644 --- a/app/test/features/chat/chat_split_integration_test.dart +++ b/app/test/features/chat/chat_split_integration_test.dart @@ -127,6 +127,12 @@ void main() { await tester.tap(find.text('Chat a').first); await tester.pumpAndSettle(); expect(find.byTooltip('Back').hitTestable(), findsOneWidget); + expect( + tester + .widget(find.byType(BackButton).hitTestable()) + .onPressed, + isNull, + ); final stateA = tester.state(_thread('a')); await tester.enterText(_input('a'), 'Phone draft A'); await tester.pumpAndSettle();