Skip to content

fix(threads): keep final message actions above the composer - #589

Merged
nixuuu merged 1 commit into
devfrom
fix/composer-reserve-height
Nov 12, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/composer-reserve-height

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

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 feat(threads): show pending items in collapsed composer #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
nixuuu force-pushed the fix/composer-reserve-height branch 7 times, most recently from 9bff42b to 97d1179 Compare November 12, 2026 21:59
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
nixuuu force-pushed the fix/composer-reserve-height branch from 97d1179 to 2b37c6f Compare November 12, 2026 22:01
@nixuuu
nixuuu marked this pull request as ready for review November 12, 2026 22:18
@nixuuu
nixuuu merged commit 689d119 into dev Nov 12, 2026
12 checks passed
@nixuuu
nixuuu deleted the fix/composer-reserve-height branch November 12, 2026 22:19
nixuuu added a commit that referenced this pull request Nov 12, 2026
## Change

The pull request panel now scrolls its header, tabs and content
together. After the full header scrolls away, a compact sticky bar
retains the PR state, repository and number, truncated title with
tooltip, check status, primary lifecycle action, menu and close button.
The tabs, Timeline filter and Code controls stack below it with opaque
backgrounds.

The full header keeps its flow height, so switching to the compact bar
changes neither the content offset nor scroll position.
IntersectionObserver supplies a 16 px hysteresis band; ResizeObserver
updates dimensions on resize. The transition uses existing motion tokens
and becomes instant with reduced motion. Each tab retains its own
session scroll position. The compact primary action shares the original
lifecycle controller and confirmation dialog. Long action labels
truncate within the compact button without covering the menu.

This applies to web/desktop and the phone-width web sheet. Native mobile
has a separate virtualized-list layout whose headers already scroll with
their lists; its code is unchanged. Rebased onto dev after #589.

Related: #551, #555

## Verification

- Dependency installation, `bun run gen:check`, full typecheck, lint,
format check and web build passed on the review machine. The final build
used `nice -n 10`. Final-head CI static checks and web/Linux builds
passed; the full test suite with temp-directory checks is running in
GitHub CI at the maintainer's request. No web UI tests added.
- Fixture-only Chromium review covered a 200-comment timeline, 90-file
Code tab with a 1,500-line expanded diff, short PR, long
names/title/branches, 320/576/1056 px panel widths, 390 px phone width,
light/dark, reduced motion, menu, title tooltip, close and
primary-action confirmation. No application errors. No live GitHub calls
from the fixture app. Review processes, containers and scratch checkout
were cleaned up.
- Slow threshold crossings retained the compact state across the 16 px
deadband. Content flow position stayed at 300 px through compaction;
requested scroll positions did not change. Timeline 1600 px and Code 900
px positions restored on tab switches. Diff scrolling remained
horizontal per file; no nested vertical viewport. Reduced-motion
transition duration was 0s. Sticky surfaces had no visible gaps or
see-through seams.
- Chromium 155 Performance traces on the final source: 180
animation-frame samples each. Timeline: 3 layout events totaling 1.038
ms; expanded diff: 0 layout events. Both: 0 long tasks, maximum frame
interval 16.8 ms, 0 intervals above 25 ms. Evidence remains outside the
repository.
- EAS fingerprints before/after, generated locally with `nice -n 19`,
are unchanged: iOS `74705db3a68907bc28379bb9b1080a227bc0755b`; Android
`7d38be8f5c9bf842d62060c75820a206f99c87e3`.

Copy audit (§8): compact controls reuse existing state, check and
lifecycle labels. Refresh remains available in the compact menu
(`Refresh pull request`, reused wording). Icons retain accessible
labels. Truncation retains the full title in a verified tooltip, the PR
number stays visible, and primary actions retain their full accessible
labels and tooltips. Short and long text was checked at narrow, wide and
phone widths. No new errors, empty states, glossary terms or humorous
copy.
nixuuu added a commit that referenced this pull request Nov 12, 2026
The Link pull request picker used three-line rows, a wrapping status
column and a separate URL form button. Web/desktop and mobile now use
two-line rows with compact branch/linked icons, short ages, reserved
status space and a single header containing the repository, optional
account switcher and Open/All control.

Search uses “Search or paste a link”. A number or GitHub PR URL adds
“Link #123” or “Link <url>” as the first selectable result. The existing
Combobox handles keyboard navigation. Direct links use the existing
owner-scoped gateway action; failed direct links retain the
repository-access form. The separate “Link by URL” button is removed.
Mobile changes are JavaScript only.

Fixes: #553

## Verification

- Rebased on current `dev`, including #589 and #592. `bun install
--frozen-lockfile`, `gen:check`, `typecheck`, `lint`, `format:check` and
the web build passed on the dedicated review computer with `nice -n 10`.
`git diff --check` passed. GitHub CI runs the full test shards with
their temp-directory checks. No web UI tests were added or run.
- Reviewed actual picker components in one Chromium session using
temporary in-memory API fixtures: 0, 1 and 50 PRs; short and long
titles, branches and account names; current branch + linked icons;
Open/All; account selection; internal scrolling; numeric and URL linking
with the keyboard; failed-link recovery; URL linking without a GitHub
remote. Covered light/dark, desktop 1280×800 and phone 390×844, plus a
320px width check. No real GitHub API calls. Browser review caught and
fixed long account-name overflow; the 390px page has no horizontal
overflow. Temporary fixture files and processes were removed.
- EAS CLI 27.4.1 production fingerprints generated locally with `nice -n
19` match `dev`: iOS `6ddec9ef559ee0095ac33e94ff9418a942053b17`, Android
`5f6eae3ab278f1cd543e9ed763f923a319b65ec9`. Mobile changes are
JavaScript only. The native mobile sheet was typechecked but not
reviewed in a simulator.

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

- “#123, title, branch, author or URL” → “Search or paste a link”: the
maintainer-requested short search hint retains the accessible “Find a
pull request” label.
- “Link by URL” → first result “Link #123” / “Link <url>”: verb-led
actions in sentence case; no duplicate input or permanent footer action.
- Visible “Current branch”, “Yours” and “Linked” text → labelled icons
(tooltips on web, accessible labels on mobile). Reserved space prevents
status changes from shifting the title. Long metadata uses truncation
and the shared compact age formatter.
- Existing connection/access/rate-limit messages and recovery actions
remain. No new glossary terms, jargon, humor, or color-only status cues.
Short/typical/long text was reviewed across desktop/phone and
light/dark. Audit checklist §8: sentence case and concise actions,
glossary unchanged, verb-led linking actions, actionable errors, concise
empty states, no duplicate status text, dependency recovery preserved,
no “soul” copy, long names checked, icon states have accessible labels.
nixuuu added a commit that referenced this pull request Nov 12, 2026
## Change

Cite now inserts an atomic citation token at the composer's saved caret,
so quoted passages can sit between sentences. The floating action,
desktop selection context menu and shortcut use the same insertion path.
Tokens show a compact excerpt, reveal the full passage and source on
hover/focus, and open an editor with a source action. They survive
composer copy/paste and undo, render inline in sent user bubbles, and
replace the old tray on web and mobile. Mobile uses the existing JS text
badge editor without native changes and keeps the system selection menu.

The gateway stores UTF-16 ranges and expands each quote into a clearly
delimited block at that position for Claude, Codex and Grok. Proto
fields are additive; older clients retain their existing quote-note
format. Source references are owner-scoped, and queue editing preserves
or replaces citation ranges. Old saved drafts normalize to inline tokens
when opened.

The collapsed composer omits the separate citation count: excerpts
already appear in the first draft line. Attachment and mention counts
remain. Rebased on `dev` at `cafed16af`, retaining #589's measured
composer coverage and expand/collapse animations and #592/#593's PR
panel changes.

Related: #587

## Verification

- Passed: `bun install`, `bun run gen:check`, `bun run typecheck`, `bun
run lint`, `bun run format:check`, and the web build on the isolated
review host.
- Final focused gateway integration across the stack: 12 tests pass, 122
assertions, no temp leftovers. Covers all three fake CLIs, quote
order/placement and persistence, mention shifts, legacy clients, queued
edits/removal, invalid ranges, cross-owner rejection and cached PR
citations. Full GitHub CI is green: static checks, all four test shards
and web/Linux builds.
- Remote monolithic `check:tmp`: 2,540 pass, 166 opt-in skips, one
existing import memory-budget failure late in the long-lived process.
The unchanged 160 MB import test passed in isolation at +127 MB against
its 400 MB budget (11 ms scan). The full CI shards pass it too. Both
remote runs left no test temp directories.
- Manual Chromium review: 1, 3 and 10 citations at different positions;
edit, atomic deletion, undo/redo, composer copy/paste, long multiline
quotes, thread and bot source navigation, sent bubbles and reload.
Checked light/dark at desktop, narrow and phone widths. The desktop
context menu shows Cite/Copy text, inserts the citation, and restores
composer focus; Copy text was verified by pasting into the composer.
Final rebased build reviewed. No web UI test suite added.
- Final development-profile EAS fingerprints, generated with `nice -n
19`, match the bottom-layer baseline: iOS
`86872d18eade9d3c6e0c54b0c328bccd5e5d226c`, Android
`d67c35d4de5511168d4b7c568c1f42c5df4f293d`. The iOS fingerprint JSON
comparison is empty. Native project generation and both Android/iOS JS
exports pass. Expo Doctor passes 19/20 checks; its only finding is newer
patch versions for 13 unchanged dependencies. Native device interactions
have not been reviewed.

## Copy audit

- Tray controls → `Edit citation`, `Quoted passage`, `Comment
(optional)`, `Jump to source`, `Cancel`, `Save`: compact sentence case,
verb-led actions, and the existing citation/quote glossary distinction.
Updated the glossary definition for inline tokens.
- Icon-only excerpt → `Citation: <excerpt>` accessibility labels; full
passage, author, source kind and time remain available without relying
on color or icon shape.
- Missing-source message → `Could not find the source. Try loading
earlier messages.` (web) / `Could not find the source. Retry to load it
again.` (mobile): states the failure and a recovery action.
- Desktop native selection menu → `Cite` / `Copy text`, with the
existing shortcut hint. `Could not copy the text. Select it and try
again.` gives a recovery action; `Copied` confirms success.
- Removed redundant citation counters and the separate tray. No new
empty states, marketing copy, jargon, or decorative sentences. Short
excerpts, typical content and long multiline text reviewed in both
themes at the requested widths.
nixuuu added a commit that referenced this pull request Nov 12, 2026
)

## Change

Pull request comments, published and pending inline review comments,
review summaries, failed checks/jobs and displayed log excerpts now
offer **Send to agent**. The action adds a PR citation at the thread
composer's saved caret and focuses the composer, so the user can write
around it before sending. Web also offers Cite for a selected passage.
Mobile uses the existing JS text badge and editable-excerpt sheet, with
Cite in the item menu.

Tokens show a PR mark, author and excerpt. Their preview includes the
full quoted passage, repository/PR number, source URL, time and review
file/line. Sent bubbles retain the inline source. The gateway resolves
source metadata from the owner's selected account cache and current
access revision, requires the PR to remain linked to the destination
thread, and includes up to 8,000 characters of cached diff hunk context.
Sending or editing a queued message never fetches from GitHub. Proto
changes are additive.

Stacked on #591 using `gh stack`; the bottom PR targets `dev`. Both
branches were rebased onto `dev` at `cafed16af`, retaining #589's
composer coverage and motion changes plus #592/#593's PR header and
compact picker.

## Verification

- Generated contracts with `bun run gen`; changed files formatted and
linted individually on the local host.
- Added gateway → real worker → fake Claude/Codex/Grok CLI integration
coverage for text position, source metadata, bounded cached diff
context, persistence and no GitHub requests on send. Additional cases
cover failed checks/jobs/log excerpts, foreign-owner sources, missing
resources, unlinked PRs and revoked access revisions.
- Passed remotely: `bun install`, `bun run gen:check`, `bun run
typecheck`, `bun run lint`, `bun run format:check` and the web build.
Final focused gateway integration across both PRs: 12 tests pass, 122
assertions, no temp leftovers. Full GitHub CI is green: static checks,
all four test shards and web/Linux builds. One shard needed a retry
after a computer-move fixture connectivity failure; those cases also
passed in the full remote run.
- Remote monolithic `check:tmp`: 2,540 pass, 166 opt-in skips, one
existing import memory-budget failure late in the long-lived process.
The unchanged 160 MB import test passed in isolation at +127 MB against
its 400 MB budget (11 ms scan). The full CI shards pass it too. Both
remote runs left no test temp directories.
- Manual Chromium review with fixtures: failed check, failed job, log
excerpt, review summary, selected comment and inline code comment; icon
and item-menu actions; insertion between surrounding text; source
metadata; edit, atomic delete/undo; sending multiple source types in
order and inline sent bubbles. Reviewed light/dark, desktop/narrow/phone
widths with long titles and multiline quotes. The phone action closes
the PR sheet and keeps composer focus after navigation. Native device
interactions are unverified.
- Mobile changes are JS-only. Final development-profile EAS
fingerprints, generated with `nice -n 19`, match the bottom PR exactly
on both platforms: iOS `86872d18eade9d3c6e0c54b0c328bccd5e5d226c`,
Android `d67c35d4de5511168d4b7c568c1f42c5df4f293d`. The iOS fingerprint
JSON comparison is empty. Native project generation and both Android/iOS
JS exports pass. Expo Doctor passes 19/20 checks; its only finding is
newer patch versions for 13 unchanged dependencies. No native
configuration or dependency changes.

## Copy audit

- Actions: `Send to agent`, `Cite`, `Item actions`, `Open on GitHub`.
Sentence case, verb-led, shared across surfaces. Send to agent adds a
draft citation and does not submit a message.
- Citation tokens keep `Citation: <excerpt>` accessibility labels. The
preview names the repository, author, time and file/line without relying
on the icon or color.
- Recovery: `Citation source unavailable. Refresh the pull request and
add it again.` and `Quote limit reached. Remove a quote, then retry.`
Each explains the state and gives the next action.
- Reused existing edit/cancel/save copy and compact kit components. No
new empty states or marketing copy. Short, typical and worst-case
excerpts, long PR titles and multiline quotes reviewed at
desktop/narrow/phone widths in light/dark themes.
nixuuu added a commit that referenced this pull request Nov 13, 2026
nixuuu added a commit that referenced this pull request Nov 13, 2026
nixuuu added a commit that referenced this pull request Nov 13, 2026
Composer trays showed a downward chevron before revealing content
upward, and the composer slot disabled their height transition. Make
queue rows and headers slightly denser, share the correct disclosure
direction across the queue, subagents, pending requests and
background-task menu, and keep the header focus outline inside its
rounded corner.

Web trays use the existing grid accordion with height, fade, a small
slide and chevron rotation: `slow` open, `medium` close, `smoothOut`.
The footer reserve follows the animated tray height without starting
another shell animation; ordinary composer resizing retains its existing
behavior. Desktop headers are 28 px and queue rows 32 px; phone headers
and rows are at least 48 px. Text sizes are unchanged.

Native queue, subagent and background-task overlays share the upward
chevron and a Reanimated height/fade/slide transition. Wait for anchor
measurement before the entrance starts. Keep their existing portal
layout, feed reserve, typography and 48 dp touch targets, with slightly
tighter horizontal spacing. Request sheets retain their navigation
chevron. Reduced motion skips the transitions.

Validation: `nice -n 19` install, `gen:check`, typecheck, lint,
formatting checks and web builds pass. All CI jobs for this head pass,
including all four test shards. The full local `check:tmp` completed
with 2675 pass, 166 skip and 12 fail across 503 files; its private temp
directory is clean. Failures are in `bots-harness.test.ts` (one Grok
session-recovery timeout), `linked-thread-liveness.test.ts` (five
snapshot/checkpoint recovery failures), `linked-timeouts.test.ts` (three
deadline/recovery failures), and `remote-threads.test.ts` (three
linked-thread failures). The isolated Grok retry passed in 2.89 s with
no temporary files left. This PR does not change gateway or worker code.
The full local run is not green despite the successful CI run. No UI
tests were added.

Real-browser review used an isolated remote stack and Chromium:
light/dark, widths 1440/820/390, and 1/3/12 queued messages, including
long previews. The 18 configurations have no horizontal overflow. After
the view settles, expand/collapse keeps history anchors at 0 px drift
and following clearance within 1 px. Recordings and frame strips confirm
intermediate heights, opacity and rotation. An actual reduced-motion
Chromium run has 0 s height/fade/chevron transitions, no active
disclosure animations, 0 px history drift and a 41 px following gap.
Review artifacts stay outside the repository; the disposable stack is
cleaned up. Native motion is typechecked and reviewed, without device
execution.

UI copy is unchanged; no copy audit changes are required.

Fixes: #589
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