Skip to content

fix(tickets): scroll viewport on cmd+up/down jump#117

Merged
StuBehan merged 1 commit into
mainfrom
fix/tickets-jump-scroll
Jul 1, 2026
Merged

fix(tickets): scroll viewport on cmd+up/down jump#117
StuBehan merged 1 commit into
mainfrom
fix/tickets-jump-scroll

Conversation

@StuBehan

@StuBehan StuBehan commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Problem

On the Tickets tab, ⌘↑/↓ (jump to first/last row) moved the selection highlight but not the scroll viewport — the pane only caught up on the next regular ↑/↓ press.

Root cause

The scroll was driven by:

.onChange(of: nav.outcomeSelectedIndex) { _ in
    guard let selectedRowID else { return }
    proxy.scrollTo(selectedRowID, anchor: .center)
}

It watched the raw index and scrolled to a separately-derived selectedRowID captured from the body, which lagged one keypress behind the index change. Stepping ±1 hid it (the row stays near the viewport), but a jump to the far end left the viewport parked until the next press advanced the scroll.

Fix

Watch selectedRowID directly and scroll to the id onChange delivers — mirroring the working Sessions tab (onChange(of: store.selectedPID) { newValue in proxy.scrollTo(newValue) }). No behaviour change for stepping; the jump now moves the viewport on the first press. Kept the deliberate no-animation snap.

Testing

  • swiftc -typecheck panel/*.swift shared/*.swift — clean.
  • Verified locally: ⌘↑/↓ snaps the Tickets pane to the first/last row immediately.

🤖 Generated with Claude Code

The Tickets list watched outcomeSelectedIndex and scrolled to a
separately-captured selectedRowID that lagged one keypress behind — so
cmd+up/down moved the selection but not the viewport until the next
arrow press. Watch selectedRowID directly and scroll to the id onChange
delivers, mirroring the Sessions tab.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@StuBehan StuBehan merged commit 6e22d30 into main Jul 1, 2026
6 checks passed
@StuBehan StuBehan deleted the fix/tickets-jump-scroll branch July 1, 2026 15:54
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