Repository navigation
feat(mobile): hide the tablet sidebar and open threads beside the chat - #9568
FL-TechCouncil wants to merge 10 commits into
Conversation
🔐 Codex Security Review
|
joahg
left a comment
There was a problem hiding this comment.
🤖 I reviewed the full diff at e074f87 and ran conversation_tablet_layout_test.dart, which passes. This changes the tablet UI, so I'm leaving a comment rather than an approval: it needs a design or core-team reviewer. I found nothing blocking. Two P2s look worth fixing first.
P2: a thread opened on a pushed page outlives that page. openThreadPane (adaptive_conversation_pane.dart:932) checks only selectedId and the sidebar scope, and threadBuilder is cleared only by open(), clear() and closeThread(). Steps on a tablet:
- In channel A, tap a
#channel-blink.openChannelLinkpushesChannelDetailPage(B)onto the detail navigator. - Open a thread in B. It opens in the pane.
- Press Back to A. B's thread is still showing beside A.
The reverse also happens: A's open thread stays beside B. Possible fixes:
- Use the pane only when the caller is the base route (
isBaseRouteOf), and push otherwise. - Or close the thread when the detail navigator pushes or pops.
P2: keyboard focus stays on the hidden sidebar after the overlay closes. The restore in the focus effect (~line 263) runs while the detail and thread panes are still ExcludeFocus'd by the 240 ms close animation, so the request is dropped. A probe test showed primary focus still on conversation-list after Escape or after picking a chat. On an iPad with a keyboard, typing goes nowhere until you tap the composer. Restoring focus once overlaid turns false should fix it.
P3s:
openThreadPanecallsConversationPaneScope.maybeOf, which usesdependOnInheritedWidgetOfExactType. That subscribes every caller (bubbles, rows, swipe reply, and_MessageListthrough the initial-thread effect) to the controller. As a result, the message list rebuilds on every sidebar toggle and thread open or close, which is what theisActiveOfdoc comment set out to avoid. A non-subscribing lookup (getInheritedWidgetOfExactType(...)?.notifier) is enough in event handlers.- The stale-overlay reset (~line 343) runs only when
layout != null && docked. If the window goes compact with the overlay open (for example in Split View),sidebarOverlaystays true, and the overlay reappears by itself when the window widens again. - The minimum list width moved from 280 to 288 for every wide pane, including Settings and Duo, which the description lists as unchanged. Should it apply only when
tabletis set? - The Ctrl+Cmd+S activator repeats while the keys are held;
includeRepeats: falsewould stop the sidebar flickering. deep_link_dispatcher.dartstill pushes a full-screenChannelDetailPagewithinitialThreadRootId, so notification and link taps on a tablet don't use the side pane. That's fine if it's out of scope.
Tests:
- In the journey test, the
conversation-fieldtap (~line 369) lands on the frosted app bar title (it logs a hit-test warning). - Nothing asserts focus after the overlay closes, which is how the focus P2 slipped through.
- In the updated
channel_detail_page_test.dartcase, addingexpect(find.byKey(const ValueKey('conversation-thread')), findsOneWidget)would check that the thread really opened in the pane.
What I checked and found correct:
- The
ConversationLayout.resolvewidth math: conversation ≥ 480, a beside thread ≥ 320, and the dock boundary is consistent. - Divider clamping, the mid-drag hold and the slider semantics.
- Keyed panes keep their state, and drafts survive rotation.
- The Back order: overlay, then thread, then conversation. The disabled
NavigatorPopHandlerguard is correct. - Every
ThreadDetailPageconstruction goes throughopenThreadPanewith the same arguments as before. - The phone path pushes the same route as before.
- Nested threads stack inside the pane.
- The home bar conditions reduce to the old expressions on phones.
I didn't run anything on a device or on Android.
|
Thanks for the thorough review. I've addressed it in c171409: P2: thread outliving a pushed page. I did both of the fixes you suggested:
P2: focus after the overlay closes. The detail and thread panes now stop excluding focus as soon as the overlay starts closing, rather than when the slide ends, so focus returns to where it was. When you pick a different chat, there's nothing to return to, so focus isn't restored. P3s:
Tests: I added journey steps for:
I also added your I retested it on the iPad (11-inch, both orientations, with a hardware keyboard) and it's ready for another look. |
joahg
left a comment
There was a problem hiding this comment.
🤖 I re-reviewed c171409 against my earlier notes. Both P2s and the P3s are fixed. conversation_tablet_layout_test.dart (2) and channel_detail_page_test.dart (478) pass.
- Thread after Back:
openThreadPaneuses the pane only for the selected page (selectionKey), and pages pushed above it push their threads._ThreadClosersits only on the detail navigator, so pushes inside the thread pane, sheets and dialogs leave the thread open. I checked that a plainshowDialogkeeps it. - Focus:
ExcludeFocusfollowsoverlayOpen, andExcludeSemanticsstill followsoverlaid, so screen readers stay out until the slide ends. After Escape, focus is back on the composer while the scrim is still fading. When you pick a different chat, focus lands in the new detail route's scope, and ⌃⌘S and Escape keep working. - P3s:
- The pane lookup is non-subscribing.
- A compact window clears a pending overlay.
- The 288 pt minimum applies only to tablets.
includeRepeats: falseis set.
One new P2: the full-screen media viewer now closes the thread (adaptive_conversation_pane.dart:1042-1044).
openImageViewerandopenVideoViewer(media_viewer_page.dart) push aPageRouteBuilderonto the detail navigator. That is aPageRoutewhose settings aren't aPage, so_ThreadClosercloses the thread.- In landscape with a thread open, tapping an image in the conversation removes the thread, and closing the viewer doesn't bring it back. On e074f87 the thread stayed.
- Possible fixes:
- Close only for conversation-bearing pages.
- Mark the viewer routes to opt out (a
RouteSettings.nameor a small mixin checked indidPush). - Hide the pane while such a route is on top and restore it on pop.
P3s, not blocking:
- Since
overlayOpengoes false on the first frame of the close, a second Back within the ~240 ms animation now closes the conversation. Earlier, the animation swallowed it. The code comment says this is intended. If it isn't wanted, keep Back on the overlay whileoverlaid. ModalRoute.of(context)inopenThreadPanestill subscribes callers to route changes. A non-dependent lookup would finish the earlier rebuild fix.
This is still a UI change, so it needs a design or core-team reviewer for approval.
|
Thanks for the re-review. I've addressed the new findings in cc14bd5: P2: the media viewer closes the thread. The image and video viewers now use a route marked P3s:
Tests: I added journey steps for the viewer keeping the thread, Back closing the viewer first, and the second Back during the slide. Each step fails when I undo its fix. Format, analyze and the full suite pass. |
joahg
left a comment
There was a problem hiding this comment.
🤖 Thanks, the earlier findings are addressed:
- The full-screen image/video viewers now push a route marked
KeepsConversationThread, and_DetailRoutes.didPushskipscloseThread()for it, so opening the viewer no longer closes the thread. The tablet journey test covers open → thread still there → Back closes the viewer only. - A second Back during the overlay slide-out is swallowed, and
openThreadPaneusesModalRoute.settingsOfso it no longer subscribes to route changes.
One remaining nit:
- P3,
adaptive_conversation_pane.dart_DetailRoutes: it overridesdidPush/didPop/didRemovebut notdidReplace, so a route arriving viapushReplacementnever enters_aboveand Back would go to the thread instead. I don't see a caller doing that today.
Leaving this as a comment since it changes mobile UI; it needs a design or core-team reviewer for approval.
|
Thanks. I've fixed the |
joahg
left a comment
There was a problem hiding this comment.
🤖 Re-reviewed at 24c0f7d. The didReplace nit is fixed. _DetailRoutes now swaps the old route for the new one, so a pushReplacement page takes Back before the thread, and the journey test covers it. I have nothing further. I'm leaving this as a comment because it changes mobile UI and needs a design or core-team reviewer.
On tablets the conversation sidebar can now be hidden from the conversation header (or Ctrl+Cmd+S). It hides itself when the conversation would get too narrow, such as on an 11-inch iPad in portrait, and the toggle then shows it over the conversation above a scrim. Tapping the scrim, Escape, system Back or picking a chat closes it. Threads open in a pane beside the conversation when both fit, and the sidebar steps aside to make room. Otherwise the thread covers the conversation as before. Drafts survive switching between the two on rotation. A draggable divider resizes the thread pane, and screen readers adjust it as a slider. Home's Search / New / avatar bar moves into the sidebar on tablets, so it no longer overlaps the composer. Phones, Surface Duo and Settings keep their current layouts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Robert Albrecht <139878933+FL-TechCouncil@users.noreply.github.com>
- Close the thread pane when a page is pushed above the selected conversation, and push threads opened from such pages instead of showing them in the pane. - Return focus to the composer as soon as the sidebar overlay starts closing, instead of dropping it while the panes still excluded focus. - Look the pane up without subscribing in openThreadPane, so rows and lists don't rebuild on every sidebar or thread change. - Clear a pending overlay when the window turns compact. - Keep the 280 pt minimum sidebar for Settings and Duo; only tablets use 288 pt. - Don't repeat the sidebar shortcut while it is held. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Robert Albrecht <139878933+FL-TechCouncil@users.noreply.github.com>
The image and video viewers push a page onto the conversation navigator, which closed the thread pane. They now use a route marked KeepsConversationThread, so the thread stays open beside them. Back now closes routes pushed above the conversation before the thread, so it closes the viewer (or a sheet) first rather than the thread. A second Back while the sidebar overlay slides away is spent on the overlay instead of closing the conversation, and openThreadPane reads the route through ModalRoute.settingsOf so callers don't rebuild on route changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Robert Albrecht <139878933+FL-TechCouncil@users.noreply.github.com>
_DetailRoutes now handles didReplace, so a route that arrives via pushReplacement takes Back before the thread pane and closes the thread like a push would. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Robert Albrecht <139878933+FL-TechCouncil@users.noreply.github.com>
24c0f7d to
2e56c31
Compare
|
🤖 I tested this on an iPad simulator, merged with #9024 into Checks (pinned Flutter 3.47.9, Xcode 26.3)
On the simulator (iPad Pro 11-inch (M5), iPadOS 26.3.1, signed in to a self-hosted community with a test identity)
One observation. In landscape with a thread open beside the conversation, the XCUITest accessibility snapshot contains the thread pane only. No conversation element is in it: not the composer, "View thread", "Start Huddle" or the sidebar button. The conversation is still visible and still takes taps, since tapping the sidebar button by coordinate opens the overlay. With the thread closed, those elements are all present. The Dart reads as if they should stay ( One thing unrelated to this PR: on Xcode 26.3, |
…cape Lying flat in landscape, the iPhone Duo reports no hinge division, so its list and conversation were a plain two-pane layout that the tablet sidebar excluded only because of the side strip. The tablet layout now resolves beside the strip, with the edge panes reaching under it and content insets keeping their controls clear. The header toggle hides and shows the list as on iPad, and a thread opens beside the conversation. The list stays docked by default, as before, and a Duo held like a book keeps its hinge-bound panes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Robert Albrecht <139878933+FL-TechCouncil@users.noreply.github.com>
The Duo landscape journey now checks that only the pane reaching the side strip keeps clear of it, and a table covers docking beside the strip at both Duo inner widths, with and without a thread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Robert Albrecht <139878933+FL-TechCouncil@users.noreply.github.com>
… a thread The thread pane's page routes block semantics for everything painted before them in their container, which was the whole pane: with a thread beside it, the conversation and the sidebar dropped out of the screen-reader tree. The thread pane now has its own semantics container, so the block stays inside it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Robert Albrecht <139878933+FL-TechCouncil@users.noreply.github.com>
Each pane's routes block screen readers only inside the pane's own semantics container, so a sheet over the thread or the conversation left the other panes reachable behind it. The pane now tracks pop-up routes over the conversation and thread navigators, and while one is open the other panes leave the semantics tree (the sidebar also leaves input and focus). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Robert Albrecht <139878933+FL-TechCouncil@users.noreply.github.com>
|
Thanks for testing this. Your observation was real: with a thread open beside the conversation, the thread pane's page route blocked semantics for the whole pane, so the conversation and the sidebar dropped out of the accessibility tree. It's fixed in 184ba90, which gives the thread pane its own semantics container. 74269b1 then keeps sheets modal: while a sheet is open over the thread or the conversation, the other panes leave the tree. The tablet journey now asserts both, and fails without each fix. I also checked it with VoiceOver on an iPhone Duo. The Xcode 26.3 build error on |
|
Thanks for flagging the Xcode 26.3 compile failure on |
Resolve the conflict in adaptive_conversation_pane.dart by keeping the thread-pane Navigator and adding main's diagnostic screen observer to it. Move MediaQueryOverride into its own file to keep the pane under the 1200-line limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Robert Albrecht <139878933+FL-TechCouncil@users.noreply.github.com>
Keep main's in-page reply (onReply) ahead of opening a thread, and open threads through openThreadPane in main's new initial-route helper and thread media reply. Keep the thread builder beside main's requireFoldForSplit check in the pane. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Robert Albrecht <139878933+FL-TechCouncil@users.noreply.github.com>
|
@brow, could you take a look at this when you have time, or point me to whoever should review the tablet UI? joahg's review found nothing blocking but said it needs a design or core-team reviewer. The branch is up to date with |
On tablets, the conversation sidebar can now be hidden, and threads open beside the conversation instead of replacing it. This follows the sidebar model of iPadOS apps such as Mail and Notes. It builds on #9024, which makes the app run full screen on iPad.
What changes
Sidebar
Threads
iPhone Duo lying open in landscape
Other changes
openThreadPane, which pushes a page as before when there is no tablet pane.NavigatorPopHandlerno longer pops the conversation when system Back is blocked. Before this, Back with a thread open on an Android tablet closed the conversation instead of the thread.Unchanged: phones, a Duo held like a book (hinge-bound panes) and Settings (its list is its only navigation).
Testing
mobile/test/shared/widgets/conversation_tablet_layout_test.dart:FoldTestPose.duoInnerLandscape): the list docked by default, hidden and shown with the conversation reaching under the strip and a draft kept, a thread beside the conversation with both keeping their minimum widths clear of the strip, and the book pose keeping the list with no button. It fails when the strip exclusion is restored or the Duo docking rule is removed.channel_detail_page_test.dart, "Activity reopens a thread draft after Back": on a tablet the Activity list now steps aside while the thread is open, so the test checks that the thread opened in the pane and shows the draft.dart format,flutter analyzeand the fullflutter testsuite pass (5,926 tests after the Duo change). An agent review of the Duo commit found no blockers; its two test gaps (strip content insets, the docking width table) are now covered. The mobile file-size check passes.Not tested
Status
Ready. A later fix made screen readers reach the conversation beside a thread: the thread pane's page routes had blocked semantics across the whole pane. The thread pane now has its own semantics container. Because each pane's sheets then block screen readers only inside that pane, the pane also tracks pop-up routes (sheets, menus) over the conversation and the thread, and hides the other panes from screen readers while one is open. The tablet journey asserts both, and each assertion fails without its fix.
An agent review of the fix found the sheet problem, which the second commit fixes. The author tested the fixes with VoiceOver on an iPhone Duo, after the earlier tests on iPad and iPhone Duo.
buzz-review-completed
🤖 Generated with Claude Code