You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Fix [#96](#96) — `bumpy add`
snapped focus to the bottom when navigating a package list taller than
the terminal.
The interactive bump-select prompt rendered every package at once and
used `\x1B[NA` (cursor up) to clear the previous frame before each
re-render. Once the rendered output exceeded terminal height, earlier
lines had scrolled off-screen and the cursor-up no longer reached the
original anchor — so subsequent frames drew at the wrong position.
**Approach** — windowed viewport rendering:
- Build a flat row structure (`Changed` header → changed items →
separator → `Unchanged` header → unchanged items) with a `displayIdx →
rowIdx` map
- Compute window size from `stdout.rows` minus fixed chrome (header +
footer)
- Track a `scroll` offset that adjusts to keep the focused row inside
the window
- Show `▲ N more` / `▼ N more` indicators when content is hidden
above/below
- Pin a sticky section header to the top of the window once the natural
`Changed` or `Unchanged` header scrolls out of view, so the user always
knows which section they're in
- Re-render on `SIGWINCH` so resizing reflows the viewport
Total rendered output is now bounded by terminal height, so the
cursor-up redraw always works.
## Test plan
- [x] `bun run check` (lint + format + typecheck)
- [x] `bun run test` (258 tests passing)
- [x] Manual: tested locally in a 30-package pnpm workspace with 5
packages marked changed
- Cursor stays visible when navigating past viewport edges
- Changing levels with `←/→` from a scrolled position does not snap
focus to terminal bottom
- `▲ N more` / `▼ N more` indicators appear correctly
- Sticky `Unchanged` header pins once the natural header scrolls off
- Resizing the terminal mid-prompt reflows the viewport
Co-authored-by: CI <ci@example.com>
Fix scrolling in `bumpy add` when there are many packages. The interactive bump-select prompt now renders a viewport that fits within the terminal, scrolling the package list (with `▲ N more` / `▼ N more` indicators) as the cursor moves. Previously, when the list exceeded terminal height, navigating up would snap the cursor back to the bottom because the redraw cursor-up lost its anchor once content scrolled off-screen. Closes #96.
0 commit comments