Skip to content

fix(session-view): smooth execute sheet, pin code actions, and fix composer/send timeline motion - #2476

Open
kitlangton wants to merge 3 commits into
devfrom
execute-sheet-and-codemode-align
Open

kitlangton wants to merge 3 commits into
devfrom
execute-sheet-and-codemode-align

Conversation

@kitlangton

@kitlangton kitlangton commented Dec 5, 2026 •

Copy link
Copy Markdown
Collaborator

Opening the Code Mode script sheet, resizing the composer, sending follow-up prompts, and switching session tabs now animate smoothly without timeline jumps or replayed assistant replies.
Code Mode's </> button also stays pinned to the right edge of every tool row, and the script sheet's horizontal scrollbar and line numbers stay anchored inside their lanes. Scrolled-up timelines remain untouched when the composer grows or shrinks.

🔍 Origin: seen in daily use

❌ Before

  1. ❌ Opening or closing the </> script sheet snapped instantly, its horizontal scrollbar ran under the line-number gutter, and scrolling wide lines let the gutter drift.
  2. ❌ Flattened Code Mode tool rows left the </> button floating right after short labels instead of at the row's right edge.
  3. ❌ Growing or shrinking the composer (typing, recalling history, adding/removing chips, or dictating) made a bottom-pinned timeline lag behind on a separate scroll slack timer.
  4. ❌ Sending after closing a popover/history browse, shrinking a multi-line composer under a still pointer, expanding a bottom prompt, or sending from dictation/held-submit skipped the smooth slide flight and hard-jumped.
  5. ❌ Submitting a follow-up or switching tabs to an already-streamed session could make earlier or already-displayed assistant replies collapse and animate their words in a second time.

✅ After

  1. ✅ The script sheet scales and fades smoothly on open, Escape, backdrop click, and × (fading only under Reduce Motion), with its horizontal scrollbar offset past the gutter and line numbers anchored on the left.
  2. ✅ Every Code Mode row pins </> to the trailing right edge while keeping label truncation fades and hover/focus states intact.
  3. ✅ Every composer height change locks a bottom-pinned timeline 1:1 to the composer's top edge while leaving scrolled-up timelines where they are.
  4. ✅ Prompts consistently launch on the slide spring without hover or popover instant commits cancelling the flight.
  5. ✅ Completed and already-streamed assistant replies stay settled on both follow-up submits and tab switches; only new bytes arriving while viewing the session animate.
- view_code / close -> tx.instant() + wrapper teardown; h-scrollbar at x=0
+ view_code / close / Escape -> spring fade+scale on scrim+dialog; h-track offset by gutter_w

- composer resize -> unprompted scroll slack; composer hover-leave -> window-wide tx.instant()
+ composer resize -> tx.follow_edge(); send at bottom -> tx.animated() + SLIDE launch

- line_reveal -> skip !live seen tracking + drip from 0 on tab switch (prior_len == None) / completed steps
+ line_reveal -> track seen at rest (FIFO 1024) + full-len on tab entry & completed steps; settled -> no reveal

📊 Cases

Case Before After
ExecuteDetails open / Escape / backdrop / × ❌ Instant cut; Escape fell through ✅ Smooth fade + 0.96 scale (opacity-only under Reduce Motion)
ExecuteDetails wide code horizontal scroll ❌ Scrollbar overlapped gutter; gutter drifted ✅ Track starts past gutter; line numbers stay pinned left
Code Mode </> button alignment ❌ Floated beside short tool text ✅ Pinned to trailing right edge on all tool rows
Bottom-pinned timeline during composer height change ❌ Lagged behind on slack timer ✅ Tracks composer edge 1:1 (follow_edge)
Prompt send flight after popover / multi-line shrink / dictation ❌ Hard-jumped (instant / unprompted commit) ✅ Smooth SLIDE launch
Earlier assistant replies on follow-up submit or tab switch ❌ Re-dripped / re-faded already-shown text ✅ Stays settled; only live arriving bytes animate

👀 Read: crates/session-view/src/line_reveal.rs and crates/session-view/src/composer/mod.rs, where tab switches (prior_len.is_none()), completed assistant steps under active subagent subtrees, and follow-up turns sitting in inboxes before transcript delivery could re-drip settled text, and where composer hover-leave called window-wide tx.instant() mid-flight. The rest is routine.

🔍 Verified with workspace guardrails and desktop, standalone session-view, and wasm32 compile checks

Checks run
  • cargo check --bin opencode-desktop: pass
  • cargo check -p session-view --examples: pass
  • cargo check -p opencode-web --target wasm32-unknown-unknown: pass
  • bash scripts/guardrails.sh: 12/12 pass

kitlangton added a commit that referenced this pull request Dec 5, 2026
- Gate `tx.animated()` on `smooth_timeline()` (and `!reduced_motion()`) in `composer::land`, `composer::land_in_place`, and `send.rs` queue launches so disabled smooth motion preserves `tx.instant()` from open popovers and unprompted commits.
- Keep already-active current-turn drips alive across appended `Idle` notices and `live` flips in `line_reveal::poll` (passing `part_live` relative to `last_idle`) so buffered text drains smoothly over 80 ms instead of snapping at turn end.
- Ignore trailing notices and skips after `Entry::Idle` when computing `trailing_live` (`TurnBuild::has_step_since_idle`) so background wake-up notices do not reopen a finished run's turn before a new assistant step arrives.
- Split consecutive grouped `Read` and `Skill` runs (and `Calls::Reads` blocks) at `sourceCallID` boundaries so Code Mode read/skill groups retain their `</>` action when adjacent to direct calls or other scripts.
…mposer/send timeline motion

- Animate ExecuteDetails scrim and dialog open/shut (scale+fade, opacity-only under Reduce Motion), wire Escape in overlay.tool_details, offset the horizontal scrollbar past the line-number gutter, and stretch code rows full-width so sticky_left keeps line numbers anchored.
- Pin the Code Mode `</>` action button to the trailing right edge across all tool trigger, MCP, catalog search, error, and grouped Read/Skill rows.
- Call `tx.follow_edge()` across composer height-change paths (typing/pasting, prompt history step/apply/restore, attachment/context/quote/comment chips, dropzone, and dictation) so pinned timelines track 1:1 while scrolled-up timelines stay put.
- Prevent send hard-jumps by clearing prior `tx.instant()` and opting poll sends into `SLIDE` via `tx.animated()`, dropping window-wide `tx.instant()` on composer hover transitions, keeping `Ends` in sync in `anchor_grow`, and routing busy/queued waiting outbox items to `inboxes`.
- Prevent settled assistant replies from re-dripping or re-fading after submitting a follow-up prompt.
- Gate `tx.animated()` on `smooth_timeline()` (and `!reduced_motion()`) in `composer::land`, `composer::land_in_place`, and `send.rs` queue launches so disabled smooth motion preserves `tx.instant()` from open popovers and unprompted commits.
- Keep already-active current-turn drips alive across appended `Idle` notices and `live` flips in `line_reveal::poll` (passing `part_live` relative to `last_idle`) so buffered text drains smoothly over 80 ms instead of snapping at turn end.
- Ignore trailing notices and skips after `Entry::Idle` when computing `trailing_live` (`TurnBuild::has_step_since_idle`) so background wake-up notices do not reopen a finished run's turn before a new assistant step arrives.
- Split consecutive grouped `Read` and `Skill` runs (and `Calls::Reads` blocks) at `sourceCallID` boundaries so Code Mode read/skill groups retain their `</>` action when adjacent to direct calls or other scripts.
…witch

- Start text already present on the first poll of a newly entered session (`prior_len.is_none()`), already-completed assistant steps (`a.completed.is_some()`), and non-trailing parts at full `text.len()` in `line_reveal::poll`, while keeping `Poll::Current` populated on idle and freshly started sessions so new replies arriving while watching still drip from 0.
- Treat `a.completed.is_some()` as non-live in `line_reveal::poll`, `turns::fold_with_flags`, and grouped `Step::Text` rows so completed assistant steps drain and settle immediately even while child subagents keep `subtree_busy` true, and avoid marking inactive-session drip pruning as `changed` on tab switch.
- Propagate `tx.follow_edge()` to the `type_to_compose` and Windows `CF_DIB` clipboard image paste paths added on `dev`.
@kitlangton
kitlangton force-pushed the execute-sheet-and-codemode-align branch from 5ee3b44 to 20dfe43 Compare December 6, 2026 05:53

This branch has not been deployed

No deployments
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