108 lines
5.6 KiB
Markdown
108 lines
5.6 KiB
Markdown
# Chat chrome fixes (style review F5, F23, F29, F14, F24, F1-chat)
|
||
|
||
Findings from the whole-app style review (`/tmp/app-style-review/report.md`),
|
||
chat screens only (`lib/features/chat/**`). Shared primitives in
|
||
`lib/ui/adaptive/` are used, not changed.
|
||
|
||
## F5 — floating glass composer
|
||
|
||
- `ChatThreadView` no longer stacks the transcript above the composer in a
|
||
`Column`. The transcript fills the page inside `FloatingBarOverlay(bar:
|
||
ChatComposerBar, child: SegmentedBarOverlay(header, transcript))`: the header
|
||
floats over its top, the composer over its bottom, and history scrolls behind
|
||
both.
|
||
- The list pads its end by `MediaQuery.paddingOf(context).bottom + 8` (the
|
||
composer's measured height from the overlay), so at rest the last message sits
|
||
fully above the composer. The follow logic is unchanged: a taller composer
|
||
(multi-line draft, attachments, notices) changes the list's extent, and a
|
||
following view stays pinned to the end (`_onScrollMetrics`). Jump to latest
|
||
floats 16 above the composer.
|
||
- `ChatComposerBar._pill` is a `GlassPill` (rounded rectangle, radius 28), key
|
||
`chat-composer-pill`. The attachment strip, upload/attachment-error/command
|
||
report/queued/error notices now sit inside the glass above the field row; the
|
||
command palette (an opaque card/menu) still floats above the pill. Keyboard
|
||
insets, `SafeArea(top: false)`, Send/Stop, attach and every key are unchanged.
|
||
The space beside and above the pill passes taps through to the transcript.
|
||
|
||
## F23 — no "0 tasks"
|
||
|
||
`ChatBackgroundTasks` builds nothing when no task runs (also while the first
|
||
read is loading); with tasks it is a quiet neutral control (`onSurfaceVariant` /
|
||
`secondaryLabel`, a layers icon and "n task(s)") inside the composer pill,
|
||
before Send. A list that cannot be read still shows "Tasks" so its refusal stays
|
||
reachable. Key `chat-background-tasks-button` kept.
|
||
|
||
## F29 — reading width
|
||
|
||
`chat_reading_width.dart`: `kChatReadingWidth = 760`, `chatReadingInset(width)`.
|
||
The transcript `ListView` still spans the window (its margins scroll it) and
|
||
pads each side by the inset; the composer is centred and capped at the same
|
||
760, so the pill lines up with the rows (both keep the 16 margins).
|
||
|
||
## F14 — header controls
|
||
|
||
- No fixed 160/140 caps: the controls take their natural width while the bar
|
||
has room ("Ask for permission" whole at 560 and 1200 in Material). Under
|
||
pressure the mode keeps at most half the actions pill and the model ellipsises
|
||
first (`SegmentedBar` still caps the whole pill at the title's 25% share).
|
||
- A session without both `mode` and `mode_name` gets no mode control, and with
|
||
no model either there are no actions, so `SegmentedBar` draws no (empty)
|
||
actions pill.
|
||
- Neutral colours (`chat_bar_control_style.dart`): Material `TextButton` in
|
||
`onSurfaceVariant` (the bar's icon buttons' role), Cupertino content in
|
||
`CupertinoColors.label`.
|
||
|
||
## F24 / F1 — chat list
|
||
|
||
- The standalone Material list's "New chat" FAB is gone; the bar's +
|
||
(`chat-new-chat`) is the one create action. The hide/undo bar sits 8 from the
|
||
bottom on every host.
|
||
- The standalone list scrolls behind its bar: Material drops the top-only
|
||
`SafeArea` (the default `ListView` padding takes the bar height), Cupertino
|
||
keeps `SafeArea(top: false)` and the list pads its top by the media top. The
|
||
body is built under the scaffold (`Builder`) so it reads the scaffold's
|
||
padding, and a load-error notice is pushed below the bar while the list under
|
||
it drops the inset. Under the shell (`embedded`) nothing changes; the shell
|
||
owns that.
|
||
|
||
## Tests
|
||
|
||
New: `test/features/chat/conversation/chat_floating_chrome_test.dart` (both
|
||
hosts: composer is a `GlassPill` over a full-height transcript and the last
|
||
message rests above it, then scrolls behind; 1200 window caps pill and rows to
|
||
the centred 760 column while the list spans the window; 560 pill = width − 32;
|
||
no empty actions pill without model/mode; at 1200 neither control is truncated;
|
||
neutral colours), `test/features/chat/ui/sessions/chat_sessions_floating_bar_test.dart`
|
||
(both hosts: list reaches under the bar, first section starts below it; no FAB,
|
||
one New chat in the bar).
|
||
Updated: background-task tests (no control and never "0 tasks" for an empty
|
||
snapshot or after a session switch; the control sits inside the pill beside
|
||
Send in neutral colour; the owner-disposal test now has a task to open), the
|
||
three create-dialog tests tap `chat-new-chat` instead of the removed FAB, and
|
||
`expand_closed.dart` centres the Closed heading before tapping it (at the top
|
||
edge it is under the floating bar).
|
||
|
||
## Evidence
|
||
|
||
Headless Chrome (`/tmp/fix-b-scripts/shoot.mjs`, a copy of the review's
|
||
script) in `/tmp/fix-b-evidence/`:
|
||
- `cc-*`: `tool/chat_composer_probe_entry.dart`, which now also reads
|
||
`?platform=`, `?theme=`, `?long=1`, `?tasks=n`, `?mode=0`, `?model=0`:
|
||
560/1200 × light/dark × Material/Cupertino, scrolled behind the composer,
|
||
with tasks, without model/mode, and a three-line draft at 1200.
|
||
- `cs-*`: `tool/chat_sessions_probe_entry.dart` (now `?platform=` and
|
||
`?many=1`): 560/1200 × light/dark × Material/Cupertino, scrolled behind the
|
||
bar.
|
||
- `app-*`: the full web build over the runs fixture (thread 560/1200
|
||
light/dark, the command palette above the pill, the shell chat list).
|
||
|
||
## Not done / notes
|
||
|
||
- Cupertino dark glass is nearly invisible against black (review F17); that is
|
||
`GlassPill`'s fill, owned by another batch.
|
||
- The conversation header is not width-capped (it spans the pane like every
|
||
other segmented bar).
|
||
- No device run; Android/iOS keyboard behaviour is unverified on hardware
|
||
(the structure keeps the scaffold's inset handling and the composer's
|
||
`SafeArea`).
|