Registry Mirror
Skip to content

Conversation

@andreifilip123

@andreifilip123 andreifilip123 commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #793

Summary

  • Add a scroll_off config key and --scroll-off <rows> flag (0-40), mirroring Vim's scrolloff: the current line keeps that many rows clear of the viewport edge instead of only reacting once it reaches the edge.
  • Apply the margin in computeLineRevealScrollTop, consumed by both line-cursor stepping and the draft-note reveal path (the note-reveal call site was missing the new scrollOff param — now consistent with the stepping call site).
  • This is core viewport/scroll behavior shared by every review surface, not extension-appropriate.

Test plan

  • bun run typecheck
  • bun test packages/hunk/src/ui/lib/hunkScroll.test.ts packages/hunk/src/core/run/scrollOff.test.ts packages/hunk/src/core/run/config.test.ts packages/hunk/src/app/cli.test.ts (240 pass)
  • bun test packages/hunk/src/ui/components/panes/DiffPane.test.tsx (2 pass)
  • bun run test:integration — 181/186 pass; the 5 failures are pre-existing test/pty/lifecycle.test.ts SIGHUP/SIGQUIT/SIGPIPE flakes unrelated to this change (reproduce on main). test/pty/cursor-line.test.ts's dedicated scroll-off starts scrolling before the current line reaches the viewport edge test passes.
  • Not tested on Linux/Windows (developed and verified on macOS only).

Before: (notice the active line on animations = true)
file-6763c972f617cb17175ee23fd35a2168

After:
file-188ad85b315f58a5ea59f6c262a12ebf

@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Modem Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@benvinegar

Copy link
Copy Markdown
Member

Thanks for submitting this! Sorry it took me a while.

filiptaifaspayset and others added 2 commits October 12, 2026 11:48
- Add `scroll_off` config key and `--scroll-off <rows>` flag (0-40), mirroring Vim's scrolloff
- Apply margin in computeLineRevealScrollTop so stepping keeps the current line clear of the viewport edge
- Add unit and PTY coverage, update docs and changeset
@benvinegar

Copy link
Copy Markdown
Member

Rebased onto current main (16d97fc6) and resolved the generated CLI documentation conflict by regenerating the docs. Preserved the five-row default and explicit --scroll-off 0 override; no other behavioral changes.

Validation on Linux: bun run typecheck, bun run check:docs, bun run test (4,784 pass, 13 skipped), and bun run test:integration (222 pass, 1 skipped).

This comment was generated by Pi using gpt-6.1-sol

@benvinegar
benvinegar enabled auto-merge (squash) October 12, 2026 16:09
@benvinegar
benvinegar merged commit 7828628 into modem-dev:main Oct 12, 2026
13 checks passed
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.

Add a scrolloff-style setting to keep the cursor line clear of the viewport edge

3 participants