|
| 1 | +# Keep a scrolled-up reader's place in a long session |
| 2 | + |
| 3 | +## Identity |
| 4 | + |
| 5 | +- Workday: 2026-10-04 |
| 6 | +- Session: `ses_ef81ca107ffet5DwnFLaGWlUap` |
| 7 | +- Agent/platform: `Sisyphus - ultraworker` on `anthropic/claude-opus-5-5` (variant high) / linux, Vibeterm |
| 8 | +- Repository: `~/projekty/webapps/opencode` |
| 9 | +- Integration branch: `dev-nowaker` |
| 10 | +- Development branch(es): `fix-scroll-follow` (worktree under `.vibeterm/worktrees/`, off upstream `dev` `907b3bc518`) |
| 11 | +- Upstream base: `907b3bc518` (upstream `dev`, contains `v1.18.34`); unchanged |
| 12 | +- Source result commit(s): `6ff168d896` (cherry-pick of `ecfa7cb318` on `fix-scroll-follow`) |
| 13 | +- Forklog commit: this file's introducing commit |
| 14 | + |
| 15 | +## User requests |
| 16 | + |
| 17 | +Spawned by coordinator `ses_ef8235798ffejGr4sa22eXmVNv` (item 1 of "opencode |
| 18 | +TUI improvements"), quoting the user: |
| 19 | + |
| 20 | +> when i scroll up in chat log, and stay there, so i can read, ai activity |
| 21 | +> constantly interrupts me, and scrolls the content down as it generates |
| 22 | +> responses. this is a clear bug, needs a fix. |
| 23 | +
|
| 24 | +## Goals |
| 25 | + |
| 26 | +- Reproduce on vanilla `dev`, fix it, open an upstream PR, land on |
| 27 | + `dev-nowaker`, and build both hosts. |
| 28 | + |
| 29 | +## Constraints and non-goals |
| 30 | + |
| 31 | +- Submit-time scrolling is item 2, another session. |
| 32 | +- No TUI tab, vibeterm tmux server or `opencode-serve-*` unit restarted. |
| 33 | + |
| 34 | +## Branch and upstream movement |
| 35 | + |
| 36 | +| Repository | Branch | Before | After | Action | |
| 37 | +|---|---|---|---|---| |
| 38 | +| `opencode` (GitHub fork + GitLab) | `fix-scroll-follow` | - | `ecfa7cb318` | new branch off upstream `dev` `907b3bc518`; head of PR #53219 | |
| 39 | +| `opencode` | `dev-nowaker` | `0b0357e848` | `6ff168d896` | cherry-pick, fast-forward; pushed to `origin` and `nowaker-github` | |
| 40 | +| `opencode` (m4max) | `dev-nowaker` | `0b0357e848` | `6ff168d896` | fast-forward from `origin` | |
| 41 | + |
| 42 | +## Features touched |
| 43 | + |
| 44 | +| Feature | Outcome | Evidence | |
| 45 | +|---|---|---| |
| 46 | +| [Keep a scrolled-up reader's place in a long session](../features/2026-10-04-scroll-anchor.md) | introduced | regression test fails without the fix; isolated TUI before/after samples | |
| 47 | +| [TUI streaming render throttle](../features/2026-08-25-tui-stream-throttle.md) | re-verified, unchanged | installed fork binary held a scrolled-up view through a streamed agent run under 100 messages, same as vanilla | |
| 48 | + |
| 49 | +## Other delivered work |
| 50 | + |
| 51 | +- No new upstream issue. Searching for "scroll jumps while streaming", |
| 52 | + "scrolled up auto scroll", "scroll position long session", |
| 53 | + "auto-scroll interrupts reading" and "sticky scroll" found open issue |
| 54 | + #41243. It records the same root cause; its PR #41247 was closed by |
| 55 | + `automated-pr-cleanup` on 2026-09-08 without review. PR #53219 closes |
| 56 | + #41243. |
| 57 | + |
| 58 | +## Verification |
| 59 | + |
| 60 | +- Vanilla `dev` from source, TUI in tmux socket `oc-tui-scroll`, isolated XDG |
| 61 | + dirs, local fake OpenAI-compatible servers in the worktree's `tmp/`: |
| 62 | + - under 100 messages, plain text, then a multi-step agent run with |
| 63 | + reasoning and bash tool calls: wheel, PageUp and line-up hold for 8-20 s |
| 64 | + while the stream continues; `End` shows the stream moved on; |
| 65 | + - a session past 100 messages, token-sized markdown: the scrolled-up view |
| 66 | + slides from `Step 96` to `Step 101` in 20 s; |
| 67 | + - instrumented run: `scrollTop` and the manual-scroll flag stay fixed while |
| 68 | + the first child's offset jumps by its height on every prune. |
| 69 | +- Fix from source, same session past 100 messages: view stays at |
| 70 | + `Step 586 closing` / `Step 587 bullet two` for 40 s; `End` resumes |
| 71 | + following at `Step 596`. |
| 72 | +- `packages/tui`: `bun test test/util/scroll.test.tsx` 2 pass (anchor test |
| 73 | + fails with the hook disabled); full `bun test` on `dev-nowaker` + fix: |
| 74 | + 219 pass, 1 skip, 0 fail; `bun typecheck` passes. On upstream `dev` the full |
| 75 | + suite had one failure in `DiffViewerFileTree`, which passed twice alone. |
| 76 | + |
| 77 | +## Build and install |
| 78 | + |
| 79 | +- Build command: `.vibeterm/build.sh` in each host's primary checkout. |
| 80 | +- Installed artifact: desktop and m4max both `1.18.34-vt-78-907b3bc518`, |
| 81 | + built at `6ff168d896`; desktop inode `49955453`. Both binaries contain the |
| 82 | + `layout-changed` anchor and the retry-header marker. |
| 83 | +- Running services: none restarted on either host; running TUIs pick up the |
| 84 | + build only after their own restart. |
| 85 | + |
| 86 | +## Commit provenance |
| 87 | + |
| 88 | +- `6ff168d896` - fix and regression test. |
| 89 | +- Required trailer: `AI-Session-ID: ses_ef81ca107ffet5DwnFLaGWlUap` |
| 90 | + |
| 91 | +## Unknowns and blocked verification |
| 92 | + |
| 93 | +- The installed binaries were not driven in a session past 100 messages; the |
| 94 | + source build was. |
0 commit comments