Skip to content

Fixes three bugs in the bi-directional pagination implementation#1

Closed
NamedIdentity wants to merge 1441 commits intoCasualDeveloper:devfrom
NamedIdentity:fix/pagination-bugs
Closed

Fixes three bugs in the bi-directional pagination implementation#1
NamedIdentity wants to merge 1441 commits intoCasualDeveloper:devfrom
NamedIdentity:fix/pagination-bugs

Conversation

@NamedIdentity
Copy link

  1. Failed to load: [object Object] on mouse scroll at page boundaries — The catch blocks in loadOlder/loadNewer used String(e) for non-Error thrown objects, which produces [object Object]. Now extracts .message from object-shaped errors and falls back to "Unknown error".
  2. PgUp/PgDn/line scroll/half-page scroll don't trigger page loads at boundaries — The keybind command system intercepts key events before they reach the scrollbox's onKeyDown handler. The command handlers only called scroll.scrollBy() without triggering pagination. Added setTimeout(loadOlder/loadNewer, 0) to all scroll-related command handlers.
  3. (scroll up for more) / (scroll down for more) hints shown constantly — These occupied a line of screen space even when nowhere near a page boundary. Added scroll position tracking signals so hints only appear within 20 lines of the top/bottom boundary.
  4. Missing Binary.lowerBound helper — session/index.ts references Binary.lowerBound for cursor-based pagination but the function wasn't present in packages/util/src/binary.ts. Added the standard lower-bound binary search implementation.
    How did you verify your code works?
  • Opened a long session (200+ messages) in the TUI and verified:
    • Mouse scroll, PgUp, PgDn, half-page, and line scroll all load older/newer pages at boundaries
    • Error messages display readable text instead of [object Object]
    • (scroll up/down for more) hints only appear when scrolled near the page boundary, not mid-session
    • Home/End still jump to oldest/newest as before
  • bun run typecheck passes (no new errors introduced; pre-existing upstream errors unchanged)

opencode-agent bot and others added 30 commits February 2, 2026 16:56
adamdotdevin and others added 25 commits February 6, 2026 13:45
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
…oundary hints

- Fix '[object Object]' error display: extract message from non-Error thrown objects
- Fix PgUp/PgDn/line/half-page scroll not triggering page loads at boundaries
- Make '(scroll up/down for more)' hints only show near page boundaries
- Add missing Binary.lowerBound helper that PR anomalyco#8535 referenced but didn't include
@github-actions
Copy link

github-actions bot commented Feb 7, 2026

Hey! Your PR title Fixes three bugs in the bi-directional pagination implementation doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@CasualDeveloper
Copy link
Owner

CasualDeveloper commented Feb 7, 2026

Hey Sean, quick update: I just completed a rebase and cleanup of my pagination work directly onto feat/6548-message-pagination and force-pushed the final branch state (49838f685).

FYI, it already had Binary.lowerBound (your Claude missed it I think), so I integrated just the other behavior fixes from your report (error normalization, command-path boundary loads, edge-aware hints) and added regression coverage.

Thank you for the detailed repro and patch direction, feel free to pull the latest version of my branch and test it out. I'll also close this PR for now as no further action is needed on this fork PR from your side. Feel free to just reply in the main thread if you find any further issues and I'll be glad to look into it! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.