Skip to content

fix(workspace): centre the chat column on the window beside the summary - #742

Merged
nixuuu merged 1 commit into
devfrom
fix/workspace-summary-centre
Nov 14, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/workspace-summary-centre

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 14, 2026

Copy link
Copy Markdown
Member

Change

User feedback on #734, with a video toggling the sidebar with the summary card open, plus two screenshots.

1. The docked card always runs to the bottom. It is pinned to the top and bottom of the thread area (12 px inset) and scrolls inside. Its height no longer depends on its content or on the sidebar. With the sidebar open it now looks and behaves exactly as with it closed.

2. The chat column is centred on the window. SummaryLayout measures the column's space in viewport coordinates and places the column with --chat-offset and --chat-column, read by .chat-column in VirtualFeed. Messages and composer always share it.

  • It centres on the window's middle, clamped between the area's left edge (clear of the sidebar and the turn rail) and the docked card (1 rem gap).
  • When a side would collide, it moves only as far as needed, then narrows, but never below 36 rem.
  • Only when the card doesn't fit beside a 36 rem column does the summary fall back to the pill and popover from fix(workspace): keep the chat column centred around the summary #734.
  • Opening or collapsing the docked card eases the column (--duration-slow, --ease-smooth-out); reduced motion makes it instant. Sidebar and window changes already move it frame by frame, and nothing animates on first load.
  • The preference is still one device-wide value, and the effective state depends on it and the available space, so switching threads never jumps. Without a placement (bot chats) .chat-column keeps the old centring.

3. Connector rows. The caption "Send a message to check tool availability" is gone. A row shows only the connector name. A compact badge appears only for a known status: Available, Available next turn, Access removed (tooltip: "Tools update next turn"), Unavailable (tooltip: "No tools available"), Error (with the reason on a second line), or the account's own status (for example, reconnect required). Mobile never showed this caption, so it is unchanged.

4. Location and branch rows, one 32 px line each, with no label row and no word-breaking.

  • Location: a worktree shows its name (the last path segment, middle-truncated). A directory shows ~/… with the leading part shortened and the name middle-truncated. The full path is in the tooltip. Clicking opens a menu with Copy path, Open folder (local) and Manage worktree, which replaces the separate Manage worktree row.
  • Branch: middle truncation keeps the distinguishing end, and the switcher chevron (or the busy spinner) has a fixed slot. The upstream appears only in the tooltip, and only when it names a different branch (new distinctUpstream in domain).
  • Mobile Thread details uses the same one-line rows (ThreadPanelLine). The location opens a sheet with the full path, Copy path and Manage worktree. The branch picker notes "Started from …" only when the upstream differs.
  • PanelField (web) and ThreadPanelField (mobile) are no longer used and are removed.

Docs: workspace.md covers the window-centred column, the docked card height and the 36 rem minimum. ui-scale.md covers the one-line placement and connector rules.

Related: #734

Verification

  • bun install, full typecheck (web and mobile), lint, format:check, the web production build, and expo export for Android all pass (with nice, temp in /var/tmp).
  • Review host, light and dark, bench stack. The seed had a long Polish title, a long branch, PR #412, 19 subagents and 2 schedules. For widths 1100, 1280, 1440, 1600, 1920 and 2560, with the sidebar open and closed and Files open and closed (24 layouts per theme), a script measured the column, the composer and the card, then collapsed the card:
    • Shared column: messages and composer have the same x and width in every run.
    • Clearance: the column never starts left of the area (no overlap with the sidebar) and always ends at least 15 px before the docked card.
    • Centring: wherever it fits, the column is exactly window-centred, for example 1600, 1920 and 2560 with Files closed and every 2560 layout. Elsewhere it is clamped, for example 1440 with the sidebar open: 14 px left of centre and narrowed from 768 to 764 px. It never goes below 576 px when docked.
    • Card height: wherever docked, the card is 928 px tall and ends 12 px above the area's bottom, identical with the sidebar open or closed.
    • Collapsing: collapsing the card moves the column only toward the centre (0 px where it was already centred). Pill mode stays at 1100, at 1280 and 1440 with the sidebar and Files open, and at 1100 with Files open.
  • Placement rows: all three cases are one line, 32 px each, in light and dark. The worktree canopy-implementujesz-docelowa-architekture-agenta-ai shows as canopy-imple…ture-agenta-ai. The directory /Users/nix/GIT/clients/itsol/very/deeply/nested/projects/gakko-monorepo-with-a-long-directory-name shows as …ects/gakko-mon…ctory-name. The branch feature/agent-resources-changes shows as feature/agen…ources-changes. The worktree menu shows Copy path and Manage worktree; the directory menu shows Copy path.
  • Screenshots, described:
    • 1440 dark, sidebar open: the column is next to the full-height card with a clear gap. Closing the sidebar moves it 4 px.
    • 1920 light, sidebar and Files open: the card runs from the top bar to the bottom, between the column and the Files panel.
    • 1100 dark, sidebar open: the pill sits top-right and the column fills the area.
  • Not checked live:
    • Connector badges: the bench worker reports no connector accounts, so only the "None" state was visible.
    • Mobile rows: type-checked and exported, but not run on a device.

Copy audit (§8)

Before After Reason
Send a message to check tool availability (every connector row) removed No information until a status is known.
Available, Available next turn, Access removed · Tools update next turn, No tools available (second lines) badges Available, Available next turn, Access removed, Unavailable, Error (+ reason line) One compact status per row; details in tooltips.
Worktree / Directory label rows, Manage worktree row, hover Open folder / Copy working directory one row; menu Copy path, Open folder, Manage worktree Verb-first menu items; the label moves into the tooltip and accessible name.
Branch label row, from origin/… line one row; tooltip … · From origin/… only when the upstream differs Shows the upstream only when it adds information.
Mobile Copy button and Manage worktree button location sheet with Copy path, Manage worktree; branch picker note Started from … Same actions as web.

The chat column is centred on the window again, clamped so it never
reaches the sidebar or the docked summary. When a side would collide it
moves only as far as needed, then narrows to a 36rem minimum; below that
the summary falls back to the pill and its popover. Messages and the
composer always share the column, and opening or collapsing the docked
card eases it to its new place.

The docked card now always runs from the top to the bottom of the thread
area and scrolls inside, the same with the sidebar open or closed.

Location and branch take one line each. A worktree shows its name and a
directory shortens its leading part, with the full path in a tooltip and
copy, open folder and Manage worktree in the row's menu. The branch
keeps its distinguishing end and names its upstream only in the tooltip
when it differs. Mobile Thread details follows the same rows.

Connector rows show just the name unless a status is known, so the
caption asking to send a message is gone.

Related: #734
@nixuuu
nixuuu merged commit 39f1f67 into dev Nov 14, 2026
27 of 31 checks passed
@nixuuu
nixuuu deleted the fix/workspace-summary-centre branch November 14, 2026 18:04
nixuuu added a commit that referenced this pull request Nov 14, 2026
Visual fixes from user feedback on the desktop app (dark, nightly),
after #738, #740 and #742.

Related: #738, #740, #742

## Changes

**1. The fade matches the thread background.** #740 changed the thread
area to `surface`, but the fade under the composer still used `canvas`.
In dark this showed as a darker rectangle. The fade and the footer
backdrop now use `surface`, the same token as the thread area. It only
imitates the composer's shadow. In light the two tokens were already
equal; in dark they now are too.

**2. "Jump to latest" sits just above the composer.** It was placed from
the footer top plus the fade, but the footer also reserves an empty 32
px Drafts strip above the composer. So the button floated about 60 px
up, over text. It was also centred on the whole feed rather than on the
column, which #742 can offset.
- Footer content now marks the boxes it actually paints with
`data-feed-edge`: the composer surface, the Drafts tab and the panels
above it.
- `footer-edge.ts` measures the topmost one (ResizeObserver +
MutationObserver, batched per frame). The button sits 8 px above that
edge, in the shared `.chat-column`.
- When the button sticks out above the footer (panels or Drafts
showing), the fade grows to cover it.

**3. The summary card sizes to its content.** The docked card is now
`top-0 max-h-full`: as tall as its content, at most to the bottom of the
thread area (12 px inset), and it scrolls inside. #742's centring and
docking logic is unchanged.

**4. Tabs.**
- The strip has no box of its own. Only the active tab is a `surface`,
with 8 px top radii and reverse corners. The corners use a 1 px soft
edge, so they have no stair-steps at DPR 1 or 2. The active tab and the
content below form one surface.
- Inactive tabs are muted text on the chrome. Hover shows a quiet inset
pill.
- A 1 px separator sits only between two inactive tabs and hides on
hover.
- The preview tab is italic, with a little padding so the slanted last
glyph isn't clipped.

**4b. The gap before `⋯`.** `ThreadSyncProgress` always rendered a fixed
`w-16` slot, so the header kept an empty 64 px gap before `⋯`. It now
renders only while syncing. It appears on the tab side, so the
right-aligned actions never move. The Windows/Linux window-control
reserve is unchanged: it was already scoped to those platforms and
releases when a side panel owns the edge.

**5. The whole summary header collapses the card.** The header is
`<h2><button aria-expanded aria-controls>` (disclosure pattern; one
control, no nested buttons). It collapses the docked card or closes the
popover, and focus returns to the pill.
- It has hover and press feedback and an inset focus ring.
- A press that turns into a drag or a text selection does not toggle.
- At phone width the summary still opens as a sheet, with the sheet's
own close.

Docs: `ui-scale.md` (fade, button anchor), `workspace.md` (card height,
tab surfaces).

## Verification

- `bun install`, `gen:check`, `typecheck`, `lint`, `format:check` and
the web build all pass (with `nice`, temp files in `/var/tmp`).
- **Review host** with the bench stack (synthetic workspace files) and
Playwright, comparing before and after in light and dark. Layouts: 1100
(pill), 1280 (expanded composer), 1440 (card docked and collapsed), 1920
(sidebar off; Files open), 2560 and 390.
- **Fade:** its colour equals the thread background in all 24 layouts.
Before, every dark layout differed: `rgb(23,25,20)` vs `rgb(32,33,28)`.
- **Jump to latest:** before, it sat 63 px above the composer (78 px
when expanded) and up to 171 px off its axis. After, it is 8 px above
the composer surface and 0 px off its axis everywhere (0.5 px at 390).
- **Card:** before, it was always as tall as the area (828/1008/1368
px). After, it is 410 px, its content height. At a 460 px viewport it
caps at 388 px, ends 12 px above the bottom and scrolls.
- **No horizontal scroll** (`scrollWidth` equals the viewport width) in
any layout.
- **Tabs:** checked at DPR 1 and 2 in both themes, with Thread, two kept
files and an active preview file, plus hover. The reverse corners show
no seams.
- **Summary header:** a drag across it doesn't toggle. Click, Enter and
Space close it in both the docked (1440) and popover (1100) variants,
and focus returns to the pill. Keyboard focus is `:focus-visible` with
the ring inside the card.
- **Not checked:** native Windows/Linux window controls (CSS reserve
unchanged) and the macOS app itself.
- No UI test suites added.

## Copy audit (§8)

No visible text changed. The header button's accessible name stays
`Collapse thread details` / `Close thread details` (the former icon
button labels) and contains the visible "Thread details" (label in
name).
nixuuu added a commit that referenced this pull request Nov 14, 2026
…755)

## Problem

On desktop, opening or closing the left sidebar made the thread content
jump. A frame-by-frame look at the user's video (60 fps) shows the
cause: on close, the message column first slid left *with* the sidebar
edge, overshot by about 100 px, and then drifted back right to its
centre over about 300 ms.

#742 placed the column with `--chat-offset`/`--chat-column`, which
`SummaryLayout` computed in JS from a ResizeObserver. During the
sidebar's width tween, that offset always landed at least one frame
behind the sidebar. Each frame, the column moved with the area's edge
and then snapped back, so it oscillated. Headless measurement at 1512
px: a column that should not move at all moved up to 59 px per frame,
with 3–11 direction reversals per toggle.

Two related flips mid-tween:
- The docked-card/pill decision used the live width, so it could flip
while the sidebar moved. At 1280 with Files open, the card went 1 → 0 →
1 during a close.
- Files `wide` likewise used the live width.

## Change

- **Column placement is CSS.** `[data-chat-placement] .chat-column`
computes its `margin-left` and `max-width` from:
  - the sidebar's live width (`--sidebar-extent`),
  - the area's width (`100%`),
  - the docked card's space (`--chat-card-space`).

The rule is the same: centred on the window, clamped between the area's
start (sidebar plus turn rail) and the card, narrowing only when it
must. There is no JS round trip, so the column moves in the same frame
as the sidebar and Files.
- **One timing for the sidebar and the column.** `--sidebar-extent` and
`--chat-card-space` are registered, **non-inherited** properties. The
sidebar column (`t-sidebar`) and the chat columns ease their own copies
with the same start, duration and curve:
- open: `--duration-slow`; close: `--duration-medium`; curve:
`--ease-smooth-out`;
  - the card space eases on `--duration-slow`.

Only those few elements restyle per frame. A first version animated an
inherited property on the shell root, which restyled the whole page and
doubled dropped frames; it was replaced.
- **`--sidebar-width` scope.** It is set only on the sidebar column and
the thread area, not the shell root, so drags don't restyle the whole
page either.
- **Layout decisions use the end state.** `sidebarTravel()` and
`ThreadWorkspace.travel()` add the distance the sidebar and Files still
have to travel to the measured width. So the docked card vs pill, and
Files beside vs over the thread, switch once at the start of the easing
and never mid-way. Files' width/draft moved into `ThreadWorkspace` for
that.
- **Reduced motion:** all of these change at once.
- **Narrow widths:** the drawer below `lg` is unchanged
(`--sidebar-extent` is 0 there).
- #750's "Jump to latest" shares `.chat-column`, so it follows the same
placement. Its `rise` is a keyframe animation, so there's no conflict.
- Docs: `workspace.md` (placement in CSS, end-state docking, sidebar
motion).

Related: #740, #742

## Verification

- `bun install`, `gen:check`, `typecheck`, `lint`, `format:check` and
the web build pass (with `nice`, temp files in `/var/tmp`). The full
`check:tmp` test run was not run: the change is web CSS/Svelte only,
which no test suite covers.
- **Review host:** bench stack, **production** web build of `dev` vs
this branch, headless Chromium. A rAF probe records the sidebar width,
column, composer, card and Files grid every frame across 6 toggles per
layout:

| | before | after |
|---|---|---|
| column direction reversals (48 toggles) | 152 | **0** |
| max column step while it should stay centred (1512, 1920, 2560) |
59–64 px | **0 px** |
| card ↔ pill changes per toggle | up to 2 (flicker 1→0→1) | **≤ 1**
(decided once, at the start) |
| Files grid flips | 0 | 0 |
| messages ↔ composer offset | 0 px | 0 px |
| dropped frames, sidebar toggles (all layouts) | 280 / 2620 (10.7 %) |
**182 / 2623 (6.9 %)** |
| dropped frames, 1512 toggles | 20 / 315 | **6 / 328** |
| dropped frames per sidebar drag (8 drags, median) | ~18 | **~5** |

- Layouts:
- 1100, 1240, 1280 (Files), 1440 (Files, pill), 1512 (card and pill),
1920 (Files and card), 2560;
  - light and dark;
- reduced motion: the column jumps once and never moves, and the sidebar
goes 288 → 0 in one frame;
- phone 390 px, light and dark, with the drawer: the column fills the
width and the drawer is unchanged.
- Where the column must move (clamped beside the sidebar at 1100–1440),
it moves monotonically with the sidebar edge. It eases only by the
card's space when the dock changes.
- Headless Chromium has classic scrollbars, so with Files open at 1920
the column now centres 10 px further left: `100%` excludes the feed's
scrollbar gutter, where the old JS measure included it. macOS overlay
scrollbars are unaffected.
- Not checked on a real Mac desktop build (darwin title-bar clearance is
unchanged code).

No UI text changed, so no copy audit is needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant