Repository navigation
feat(threads): show pending items in collapsed composer - #587
Merged
Merged
Conversation
This was referenced Nov 12, 2026
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 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
bun install --frozen-lockfile,bun run gen:check,bun run typecheck,bun run lint,bun run format:check, andbun run --filter @canopy/web buildpassed. Relevant web/mobile type checks were repeated after final edits. No web UI tests were added or run.@expo/fingerprintengine: iOS74705db3a68907bc28379bb9b1080a227bc0755b, Android7d38be8f5c9bf842d62060c75820a206f99c87e3. 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
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.citationto the glossary. Existing action labels and placeholder copy remain. Mobile adds the action hintExpand message.