Merge branch 'main' into worktree-agent-a1b6c249e2bec6658

This commit is contained in:
2026-12-03 22:00:26 +00:00
50 changed files with 3378 additions and 188 deletions
+51
View File
@@ -0,0 +1,51 @@
# Chat stack (phone chat navigation)
## Setting
Settings → Mobile chat navigation: Quick switch (default, the next chat's
peek under the current one) or Chat stack. Per device
(`pipelines.mobile-chat-navigation.v1`, `MobileChatNavigationController`,
restored in `bootstrap.dart`), applied live, and only on a phone-width layout
(`!showsListBesideDetail`). A wide window keeps its panes and shows no stack.
## Behaviour
- The stack's chats are the workspace's panes: the same open-chat set the
server syncs (`ChatOpenWorkspaceController`). Choosing one opens it as a tap
on its list row does (`_openBySelection`); Add chat is the pane menu's Add
chat pane picker (searchable, the list's own rows) titled "Add chat";
long press removes the chat's pane, with an Undo snack bar that re-adds it
and keeps the chat on screen.
- Collapsed: up to four avatars piled with small offsets and turns, the chat
on screen on top; a count badge when more are open, and a bell when another
open chat waits on the operator. It sits bottom-end in the active chat's
transcript area, just above the composer, so it never covers Send; the
transcript pads its last line and Jump to latest above it. It hides while
the on-screen keyboard is up (the window's view insets).
- Expanded: a scrim, and a column rising from the stack's slot. The chats keep
the open-chat order bottom-up (stable positions for muscle memory); the chat
on screen wears a ring in its colour; each avatar keeps its list badges
(waiting, working, background tasks) and has a name pill tinted with its
colour. Add chat is the last item, at the top: the reachable bottom slots
go to switching, the frequent action. Tap outside, Back or Escape folds it.
- Motion: one controller, 280 ms open (staggered, a slight-overshoot ease),
220 ms fold (top first). Items move through `ChatStackPoseTransition`, a
repaint-only transform render object that reuses its matrix and layer; no
per-frame rebuilds, no blur. Reduced motion: a 120 ms plain fade in place.
- Design tokens: circle discs with a short shadow under Default; the design's
square corners and no shadow under flat designs (Terminal, Paper); label
pills take the design radius and frame.
## Structure
- `lib/features/chat/stack/`: setting, pose, motion, disc/label, column, FAB,
anchor (a `LayerLink` the active pane's transcript marks; the one stack
above the workspace follows it, so it survives switching chats).
- `lib/features/chat/chat_screen_stack.dart`: entries, open/add/remove.
- `chat_thread_view.dart`: anchor target, bottom clearance, Jump offset.
- `tool/search_selection_probe_entry.dart`: `?chatNav=stack`.
## Not verified
On-device behaviour (Android keyboard insets, haptics) was not run on a
device; web captures used Chrome's touch emulation at 390x844.
@@ -0,0 +1,44 @@
# Foldable menus, hidden chat list, Terminal by default
## Top bar menus far below the bar on an unfolded foldable
Cause: `showAppChoiceMenu` (model, mode/permission, thinking, the narrow
bar's Chat settings panel, Add chat pane, Claude account) measured its anchor
in the root overlay's coordinates, then laid the panel out inside a
`SafeArea`. On Android the app draws edge to edge, so the overlay's
`MediaQuery.padding.top` is the status bar (and cutout): the `SafeArea`
moved the layout's origin down by that inset while the anchor rect stayed in
overlay coordinates, so every panel opened one inset (~50 dp) too low. On a
foldable's narrow pane the selectors sit in the Chat settings panel, itself
such a menu, so a selector's menu opened two insets below the bar. Phones
never showed it (they get bottom sheets below 600 dp) and neither did the
web (no insets). Overflow menus (`AppMenuAnchor` / `MenuAnchor`) were right.
Fix: `AnchoredMenuLayout` (`lib/ui/adaptive/anchored_menu_layout.dart`) lays
out in the overlay's own coordinates and treats the insets (plus the
keyboard) only as bounds; a half-opened hinge confines the panel to the
anchor's side (`DisplayFeatureSubScreen`). The panel's content has the
padding removed, so a sheet's own `SafeArea` adds nothing inside it.
Tests: `test/ui/adaptive/app_popups_foldable_test.dart` (884x1104, 52/24
insets, a fold; wide and narrow panes; above-anchor; hinge).
Captures on web: `?inset=52,24&fold=1` (`tool/fixture_host/inset_view.dart`)
gives the fixture app an Android phone's insets and a fold.
## Hiding the chat list
Beside an open chat on a wide window the list can be hidden entirely:
Ctrl+B (Cmd+B on Apple; a focused terminal keeps Ctrl+B), Hide chat list in
the list's bar and in the pane's More menu. While hidden the top-left pane's
bar starts with Show chat list. `ListDetailPanes.listHidden` slides the list
to zero width (`Motion.standard`, instant with reduced motion) and brings it
back in its previous expanded or compact mode; the divider is not offered
while hidden. Device-local: `pipelines.chat.listHidden.v1`
(`ChatListHiddenController`). Ctrl/Alt+K and Ctrl+Tab are unaffected.
## Terminal is the default design
No stored (or an unknown) design id resolves to Terminal, including the boot
spinner and detached windows (same controller). A stored choice is kept; the
former Default keeps its stored id `default` and is now labelled Classic in
the picker.