Skip to content

fix(threads): expand the composer without shifting the timeline - #578

Merged
nixuuu merged 1 commit into
devfrom
fix/composer-expand-overlay
Nov 12, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/composer-expand-overlay

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Focusing the collapsed thread composer fed every intermediate footer height into the timeline spacer and scroll anchoring. Expansion, collapse and draft growth now stay in the bottom overlay, with a fixed reserve for the collapsed input and safe gap.

  • Observe the fixed footer rail instead of the animated composer. Preserve row measurements, reader intent, streaming follow-end and turn navigation.
  • Animate one bottom-aligned, clipped composer height using existing motion tokens. Its internal folds switch immediately; reduced motion switches the outer height immediately too. Keep the opaque backing and fade attached to the overlay.
  • Anchor “Jump to latest” above the collapsed edge and fade it while covered by the expanded composer.
  • Native thread folding already preserved its reserve, but multiline drafts and attachments still enlarged it. Give thread feeds a fixed collapsed reserve and latest-button anchor, while keeping measured keyboard geometry separate. Mobile changes are JS only.
  • Update the related Polish layout and performance documentation.

Validation passed: bun install --frozen-lockfile, bun run gen:check, bun run typecheck, bun run lint, bun run format:check, the web build and git diff --check. Svelte reported zero errors and warnings. CI's four test shards, generated-code checks, static checks and builds passed on this head. No web UI test suite was added or run; browser automation was disposable diagnostic tooling.

The real seeded thread was reviewed in Chromium 155.0.8059.84 on Linux x86_64 with Bun 1.4.4. Coverage included light/dark, widths 1440/820/390 at height 900, normal/reduced motion, latest/scrolled-up, expansion/collapse, multiline drafts and eight uploaded attachments with long names. All 60 sampled scenarios reported 0 px scroll-position drift, 0 px scroll-height change and 0 px visible-message anchor drift. The latest button retained its coordinates and became inert while covered. Screenshot review found no horizontal overflow or see-through seams. A focused reduced-motion pass recorded only endpoint heights, with no interpolation. No browser JavaScript errors were observed.

The focused Performance trace maps the timeline's 1,734 DOM nodes to CDP backend node IDs and checks Layout roots and invalidations during three real expansion/collapse cycles. Marks begin at the composer's state change; collapse follows a real 100 px reader wheel gesture.

Trace interval Timeline layout events
Expansion 1 / 2 / 3 0 / 0 / 0
Collapse 1 / 2 / 3 0 / 0 / 1
Positive control: change a timeline border by 1 px 1

Each interval lasted 503–507 ms. Expansion had zero timeline layout invalidations. Each collapse had two timeline invalidations during the reader scroll/range update; the third included one timeline layout. There was no repeated timeline layout during the animation. Composer/global layout continued during its height transition: 18–22 events and 3.986–5.578 ms total per interval. These global events are not counted as timeline layout. The positive control confirms that an actual timeline layout is detected. This is a focused layout result, not a broad CPU or frame-rate benchmark.

EAS CLI 27.4.1 fingerprints with the production build profile match the pre-change baseline on both platforms:

Platform Before = after
iOS 6ddec9ef559ee0095ac33e94ff9418a942053b17
Android 5f6eae3ab278f1cd543e9ed763f923a319b65ec9

Screenshots, raw trace and diagnostic summaries are retained outside the repository. No native device runtime was exercised. The expanded overlay deliberately leaves the timeline fixed and can cover its bottom rows.

UI copy is unchanged; the copy audit for changed strings does not apply. History places the animated-reserve coupling before the recent PRs below; these links provide context rather than identifying a new regression introducer.

Related: #497, #551, #554, #568

Reserve the collapsed composer height independently of its floating overlay. Animate one outer height and keep the latest control on a fixed edge. Native thread feeds also retain a fixed reserve during draft growth; keyboard geometry stays separate.

Related: #497, #551, #554, #568
@nixuuu
nixuuu marked this pull request as ready for review November 12, 2026 20:26
@nixuuu
nixuuu merged commit 9a42e10 into dev Nov 12, 2026
11 checks passed
@nixuuu
nixuuu deleted the fix/composer-expand-overlay branch November 12, 2026 20:28
nixuuu added a commit that referenced this pull request Nov 12, 2026
Collapsed composers hid citation drafts while leaving Send enabled. Add
compact icon and count chips for citations, attachments and each mention
type beside the first draft line. Empty groups are omitted; activating a
summary expands the overlay and focuses the editor. Send remains usable
with one click while collapsed.

Web keeps its existing 72 px collapsed height and fixed timeline
reserve. Long text truncates beside the summary. Mobile uses the same
counts, folds the full chip trays, and allows pending drafts to collapse
while keeping mention suggestions and blocking questions open. The
mobile changes are JavaScript only.

Related: #578

### Verification

- Disposable SSH environment: `bun install --frozen-lockfile`, `bun run
gen:check`, `bun run typecheck`, `bun run lint`, `bun run format:check`,
and `bun run --filter @canopy/web build` passed. Relevant web/mobile
type checks were repeated after final edits. No web UI tests were added
or run.
- Chromium review: 0, 1 and 10 citations; attachments plus citations;
multiline draft text; file and thread mentions; light/dark themes; 1280,
760 and 390 px widths; reduced motion; pointer and keyboard focus. The
phone viewport had no horizontal overflow. Citation-only and mixed-draft
sends reached the gateway and cleared the draft.
- Collapse/expand preserved timeline scrollTop (19496) and viewport
height (585 px); collapsed composer height stayed 72 px. Reduced motion
reported 0 s transitions.
- Native fingerprints matched byte for byte before and after using the
installed `@expo/fingerprint` engine: iOS
`74705db3a68907bc28379bb9b1080a227bc0755b`, Android
`7d38be8f5c9bf842d62060c75820a206f99c87e3`. The EAS CLI command was
attempted but requires an Expo login on the verification computer. No
native device review was performed.

### Copy audit — docs/copy.md §8

- Previously no summary labels → `1 citation` / `10 citations`, `2
attachments`, `1 file`, `1 thread`, and matching plural labels for the
remaining chip types. Counts use locale formatting and correct
singular/plural forms; labels use sentence case and no punctuation.
- Added `citation` to the glossary. Existing action labels and
placeholder copy remain. Mobile adds the action hint `Expand message`.
- Each chip has an accessible count/type label; web tooltips use the
same label. Counts remain visible on touch screens, with no dependence
on color. Empty groups are omitted.
- No errors, confirmations, empty states, external-gap messages or
sentences with “soul” were added. No duplicated explanatory copy was
added to the surface.
- Reviewed short, typical and long citation text, a long draft and long
mentioned-thread text at desktop, narrow and phone widths. Names stay in
the expanded chips; the collapsed summary contains only icons and
counts.
nixuuu added a commit that referenced this pull request Nov 12, 2026
Measure the complete composer coverage for scrollable end space. Synchronize following on the compositor/UI thread and preserve reader anchors. Restore element-level composer motion around the overlay shell.

Fixes: #578
nixuuu added a commit that referenced this pull request Nov 12, 2026
Measure the complete composer coverage for scrollable end space. Synchronize following on the compositor/UI thread and preserve reader anchors. Restore element-level composer motion around the overlay shell.

Fixes: #578
nixuuu added a commit that referenced this pull request Nov 12, 2026
Measure the complete composer coverage for scrollable end space. Synchronize following on the compositor/UI thread and preserve reader anchors. Restore element-level composer motion around the overlay shell.

Fixes: #578
nixuuu added a commit that referenced this pull request Nov 12, 2026
Measure the complete composer coverage for scrollable end space. Synchronize following on the compositor/UI thread and preserve reader anchors. Restore element-level composer motion around the overlay shell.

Fixes: #578
nixuuu added a commit that referenced this pull request Nov 12, 2026
Measure the complete composer coverage for scrollable end space. Synchronize following on the compositor/UI thread and preserve reader anchors. Restore element-level composer motion around the overlay shell.

Fixes: #578
nixuuu added a commit that referenced this pull request Nov 12, 2026
Measure the complete composer coverage for scrollable end space. Synchronize following on the compositor/UI thread and preserve reader anchors. Restore element-level composer motion around the overlay shell.

Fixes: #578
nixuuu added a commit that referenced this pull request Nov 12, 2026
Measure the complete composer coverage for scrollable end space. Synchronize following on the compositor/UI thread and preserve reader anchors. Restore element-level composer motion around the overlay shell.

Fixes: #578
nixuuu added a commit that referenced this pull request Nov 12, 2026
Measure the complete composer coverage for scrollable end space. Synchronize following on the compositor/UI thread and preserve reader anchors. Restore element-level composer motion around the overlay shell.

Fixes: #578
nixuuu added a commit that referenced this pull request Nov 12, 2026
The expanded composer covered the final message and its actions even at
the physical end of the timeline. Measure the full composer stack for
the scrollable end space on mobile, web and desktop, including multiline
drafts, citations, files, pending summaries, the footer and safe area.
Readers at latest follow the growing composer smoothly; readers in
history retain their view.

Web/desktop commits the target end space once and synchronizes a
compositor translation with the overlay's shell. Restore the
toolbar/footer fades and rise, hint motion and editor/send-button
position transitions, using the pre-#578 slow-open/medium-close tokens.
Reduced motion switches instantly. Mobile measures the complete stack on
the UI thread and updates native scroll insets, separately from keyboard
gesture geometry; no native configuration or dependencies change.

Natural size changes commit the full target reserve once. An
equal-and-opposite compositor translation preserves the visible position
and eases to the new end alongside the shell. A reader near the end
retains the minimum scroll extent if shrinking would otherwise clamp
their offset; returning to latest releases it smoothly. Large citation
trays and long inputs scroll internally, leaving room for the final
action row at phone width. The surface, ring and send button move
together without a clipped border or see-through seam.

Validation: `bun install --frozen-lockfile`, `gen:check`, `typecheck`,
`lint`, `format:check` and the web build pass. CI is green on
`2b37c6f81f65b3777fd5b15c5493736dd3fe8910`, including all four
unit/integration test shards with their temp-directory checks. No
persistent web UI tests are added. UI copy is unchanged.

Real Chromium review of the final head passes all 24 configurations: web
and desktop renderer styling (the shared renderer, without launching
native Electron), widths 1440/820/390, light/dark and normal/reduced
motion. The 456 final-action-row visibility assertions cover
empty/expanded input, return from the collapsed state, 0/1/5/10
citations with and without four uploaded attachments, and multiline
input. Every physical-bottom check leaves the complete action row above
the composer, with at least 52 px clearance and no document overflow.
Across 168 animation samples, history anchor, scroll offset and Jump to
latest anchor drift are all 0 px; maximum following-gap drift is
0.015625 px. Screenshots were inspected at desktop, narrow and phone
widths, including wrapped citations and attachments.

Additional short-window checks (667 px high) pass for both renderer
modes at all three widths with ten citations, four retained attachments
and a 30-line draft together: six cases, 51.859375 px minimum action-row
clearance. Two touch-emulated phone cases also pass. Removing ten
citations while reading 40 px above the end preserves the view (0 px
drift); returning to latest releases the held scroll extent and leaves
the action row 52 px above the composer. The interrupted browser
configurations were rerun after a review-machine restart; those reruns
pass as well.

Chromium 155.0.8059.84 Performance trace, 1440 × 900, 1,000 synthetic
turns and 2,364 inventoried timeline DOM nodes:

| Operation | Timeline Layout events |
| --- | --- |
| Expand/collapse while reading history, three cycles | 1 per transition
|
| At latest: citations 0 → 5 → 10 → 1 → 0 | 1 per change |
| Return to latest and expand | 1 |
| Positive control: add a 1 px feed border | 1, detected |

All 11 measured composer changes have one timeline layout; none repeats
during the animation. The shell and surface still lay out within the
isolated overlay (26–50 total page Layout events and 7.47–12.26 ms
aggregate layout work per 500–625 ms capture). Those are overlay costs,
not repeated timeline reflows. The content retains a stable containing
block between transform animations, and the same virtual tail window is
used near the end so returning to latest does not mount another row
mid-resize. The observer measures natural content, never the animated
shell.

The maintainer reviewed the before/after frame strip locally and
requested this text comparison instead of an image upload. The baseline
is `9b99ffe0335d2ec661476c8ca221e45510f3f6a1`, the parent of #578.
Sample times relative to each captured gesture:

| Capture | Frames (ms) |
| --- | --- |
| Before #578, expand | 0, 76, 99, 203, 303, 453 |
| Before #578, collapse | 3, 80, 94, 190, 292, 457 |
| Fixed, expand | 2, 84, 101, 194, 293, 444 |
| Fixed, collapse | 4, 82, 95, 192, 292, 442 |

The fixed captures restore intermediate toolbar/footer opacity and rise,
hint opacity and travel, editor/send-button movement and a continuous
shell/surface resize. Opening uses the existing 400 ms `slow` token;
closing uses 350 ms `medium`, both with `smoothOut`. There was no
pre-#578 stagger to restore. The baseline geometry used 25 distinct
opening heights and 21 closing heights; the fixed capture has 24 and 21.
The fixed toolbar has 25/23 distinct opacity values and the send button
25/22 distinct positions across expand/collapse, confirming intermediate
states. The hint now stays mounted for its fade. Reduced motion switches
instantly. Screenshots, recordings and trace artifacts stay outside the
repository.

Mobile production fingerprints match the baseline with no native
dependency/configuration changes (`nice -n 19`): iOS
`6ddec9ef559ee0095ac33e94ff9418a942053b17`; Android
`5f6eae3ab278f1cd543e9ed763f923a319b65ec9`.

Device checklist for the maintainer (native execution intentionally
deferred):

- [ ] On iOS and Android, check collapsed and expanded empty input, long
multiline input and maximum-height input. In each state, scroll to the
physical bottom: the final message's last lines and entire action row
must sit above the composer's top edge.
- [ ] Repeat with 0, 1, 5 and 10 citations (including wrapping into
several rows), multiple attachments, citations plus attachments, and
#587's collapsed pending-item summary chips. Add and remove chips
individually and clear the draft; check the complete action row at the
bottom after each change.
- [ ] Repeat every state with the keyboard open and closed, including
interactive dismissal, then rotate or use a narrow viewport. The footer
and safe area must be counted once, without a gap or see-through seam.
- [ ] While at latest, expand/collapse and grow/shrink the draft or
chips: the last message must track the composer smoothly with no snap.
Scroll up first and repeat: the visible message stays fixed. Return to
latest and verify the action row clears the composer.
- [ ] Repeat in light/dark and reduced motion. Reduced motion must
switch instantly; latest navigation and reader gestures must still work.

Fixes: #578
nixuuu added a commit that referenced this pull request Nov 14, 2026
nixuuu added a commit that referenced this pull request Nov 14, 2026
nixuuu added a commit that referenced this pull request Nov 14, 2026
The compact composer used a fixed fade, while Jump to latest lived on a
separate fixed rail that could sit beneath the footer or disappear when
the composer expanded.

The fade now uses 12.5% of the measured footer height, clamped to 12–32
px, and the thread canvas token in both themes. Jump to latest shares
the composer's containing block, sits 8 px above the fade with an opaque
surface, border and shadow, and follows the measured footer in both
composer states. Its existing token-based rise transition remains
outside layout; the composer content keeps its clipping independently.

Mobile uses the existing JS/Reanimated stack: a 16–32 dp fade follows
the fold progress, and Show latest sits above the visible measured
stack, outside its clipping and scroll reserve. It remains available
while the composer is expanded. No dependencies, native configuration,
EAS commands or publication changed.

Fixes: #578

Related: #734

## Validation

- Passed: `bun install`, full workspace `bun run typecheck`, `bun run
lint`, `bun run format:check`, and `bun run --filter @canopy/web build`.
Commands used `nice` and temporary files under `/var/tmp`.
- Passed: Android and iOS `expo export` with Hermes bundles. These
validate JS packaging; native device behavior was not exercised.
- Browser review used an isolated review-host checkout and database,
with a synthetic 1000-turn thread. At 390, 640, 1024, 1280, 1600 and
1920 px, both themes and both composer states passed 24 baseline
geometry checks. Another 64 checks covered widths 1024–1920 with every
sidebar/Files open/closed combination, both themes and both composer
states, including docked and pill summaries.
- All 88 geometry checks measured 0 px difference between the button and
composer centre, an 8 px gap above the fade, no composer overlap, and an
unobstructed button centre. The compact fade measured 15 px; expanded
measured 29.75–31.75 px. Visual review at phone and desktop widths
showed matching canvas colors and no seam. Toggling the docked summary
preserved alignment; clicking Jump to latest reached the end and removed
the control.
- No UI test suites added or run. Review servers, database container,
tunnel and temporary files were removed after review.

CI on the first revision also reported a failure in the untouched
`tests/integration/proxy-accounts.test.ts:180` (expected five accounts
in state `ok`, received an empty response). The final head starts a
fresh CI run; its result is still pending at handoff. The initial
static-check failure was the mobile function-size/spacing finding,
corrected and verified by the final local lint run.

## Copy audit (§8)

No UI text changed. Existing action labels remain Jump to latest and
Show latest messages. Polish UI-scale and mobile documentation now
describe the proportional fade and measured anchor.
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