Keep the Chats header clear at narrow widths by moving the phone terminal entry into the chat action bar and disabling the duplicate floating shortcut. Add focused widget coverage for the single terminal entry and header layout.
3.9 KiB
Phone chat list: terminal button over the Chats header
Defect
At 430px the floating terminal shortcut (TerminalShortcutBubble, end 12,
top = safe top + 64) sat on the chat list's Chats section header at
[370,64,48,48]. It hid the header's count and collapse chevron and left a
stray glyph beside it. Evidence: /tmp/ui-review/base-light-430x900/07-chat.png,
/tmp/ui-review/chatmenus-light-430x900/01-chatlist-more.png.
Run 393 had removed a duplicate terminal icon from the narrow list bar, so the list had only the floating bubble.
Change
lib/features/chat/ui/sessions/chat_sessions_screen.dart:_actions(context)now appendsterminalChatBarAction(context)after New chat and Refresh. It is null on wide layouts (the shell bar keeps Terminal there) and with no terminal surface, so it appears only on a narrow layout with a surface.lib/application/pipelines_app.dart: the floating bubble'sonChatis nowfalseon every route. On a narrow layout every Chat-tab bar carries Terminal itself (the list's top bar, and an open chat's bar viachat_thread_view.dart'sterminalChatBarAction), so the bubble has no remaining place. The earlier rule (kind == chat && chatSessionId != null) still showed it on an open chat, duplicating that chat's Terminal entry.lib/application/app_terminals.dart: doc comment forsurround(onChat:)now says pages whose own bar carries Terminal pass false. No behaviour change.
Result on a phone: exactly one terminal entry on the chat list (top bar) and on an open chat (its bar), and no floating control over any header.
Focused tests (memwatch, from app/)
-
test/application/phone_chat_terminal_entries_test.dart: new, 2 tests at 430x900 through the app shell./chatand/chat/abc123each have noTerminalShortcutBubbleand exactly one TerminalChatBarAction. Against the previousonChatrule the open-chat test FAILS (the bubble is shown), so it guards the reviewer's finding. Restored after that check. -
test/features/chat/ui/sessions/chat_list_terminal_action_test.dart: 4 tests. Narrow top bar carries Terminal beside New chat and Refresh, and tapping it toggles. The Chats heading sits below the bar. Wide has no list terminal. No terminal surface has no list terminal. -
Users of the changed wiring, all in the same run:
test/application/pipelines_app_test.darttest/features/terminal/terminal_surface_test.darttest/features/chat/ui/sessions/chat_sessions_floating_bar_test.darttest/features/chat/ui/sessions/chat_sessions_screen_test.dart
Combined run of these six plus the list test: PASS 28/28 (
memwatch: PASS, exit 0), run after the final edit. -
Not re-run in this pass:
test/features/chat/shell/chat_shell_terminal_test.dartandchat_shell_terminal_session_test.dart(listed as users in an earlier pass). TheonChatchange does not touch the shell's wide path. -
tool/analyze.sh: clean (0 errors, 0 warnings, 0 infos) after the final edit.
Not verified here
- No rendered capture. The before/after screenshots at 430x900 are for ui-review.
- The open-chat test checks the Terminal action by label, not by semantics identifier. In the open chat's bar the identifier lookup found nothing even though the action is present, so this is a limit of the probe, not evidence of a missing entry. A capture is needed to confirm what is drawn.
Open limitations
TerminalShortcutBubbleis now never shown by the app shell (onChatis always false). It andTerminalSurface's shortcut code remain, with their own tests. Removing them is a follow-up if the owner agrees.- A narrow Chat-tab route with no chat bar would now have no terminal entry at all. None was found in the code, but this was not exhaustively checked.
- The bubble's old top edge on an open chat was not checked against that chat's bar; with the bubble gone that check is moot.