Skip to content

fix(zbugs-rune): keep a new issue's row in view at the list's top - #196

Merged
tmm merged 1 commit into
mainfrom
fix/zbugs-rune-new-issue-highlight
Nov 13, 2026
Merged

tmm merged 1 commit into
mainfrom
fix/zbugs-rune-new-issue-highlight

Conversation

@tmm

@tmm tmm commented Nov 13, 2026

Copy link
Copy Markdown
Member

In zbugs-rune, creating an issue opened it in the issue pane, but no row in the list showed highlighted. The new issue's row was there, just out of view above the list's top.

Cause. Rune's virtual rows keep the top row in place when a new row comes in above it, even with the list at offset 0 (Rune's own test a_page_prepended_above_the_reader_at_the_top_keeps_them_in_place). A new issue sorts first, so it landed just above the viewport while it showed as selected. The same thing happened with an issue created or reopened in another app. A reorder, where an issue edited elsewhere rises to the top, slides the rows without anchoring, so it never hid. That's why the recording shows it only after issues were created.

Fix. The list records its scroll offset (El::on_scroll_offset into a Live<f32>). When new rows arrive and the list is at its top, it scrolls back to 0, the way zbugs-gpui's keep_scroll_anchor behaves ("At the top, the list stays at the top") and zbugs-swift's list does in the recording. A scrolled-down list still holds its rows in place.

Checked on a Mac against zbugs' backend (apps/zbugs-swift/server), headless with --snap:

  • Creating an issue from the sheet. Before: the new row's rect is y=0, above the list viewport at y=53, and the list starts at "Leaking listeners". After: the row is first and highlighted.
  • Reopening a closed issue from Postgres while the list is at its top. Before: y=0, out of view. After: first row, with the selected issue still highlighted below it.
  • Scrolled down, then an issue moves to the top. The rows stay in place, unchanged.
  • e2e.sh gets a new run that creates an issue and checks that its row is on screen and highlighted. It fails without the fix and passes with it; all 12 checks pass. That run uses --snap because Rune anchors to the row it drew, and without drawing the bug doesn't show.
  • cargo fmt --check, clippy -D warnings, and cargo test pass.

Creating an issue opened it in the issue pane, but its row in the list
stayed out of view, so no row showed highlighted: Rune's virtual rows hold
the reader's top row in place when a new row comes above it, even at
offset 0, so the new issue landed just above the viewport. An issue
created or reopened in another app did the same. A reorder (an issue
edited elsewhere rising to the top) slides rows without anchoring, so it
never hid.

The list now records its scroll offset (`El::on_scroll_offset`) and, at
its top, scrolls back to 0 when new rows arrive, as zbugs-gpui's
`keep_scroll_anchor` and zbugs-swift's list do. Scrolled down, it still
holds its rows in place.

e2e.sh creates an issue from the New Issue sheet with the list at its top
and checks its row is on screen and highlighted; it fails without the fix
(the row sits at y=0, above the list's viewport at y=53).

Amp-Thread-ID: https://ampcode.com/threads/T-01a1d634-9fac-7561-a14a-d552061a006c
Co-authored-by: tmm <tmm@tmm.dev>
@tmm
tmm merged commit ecedda1 into main Nov 13, 2026
19 checks passed
@tmm
tmm deleted the fix/zbugs-rune-new-issue-highlight branch November 13, 2026 19:14
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.

2 participants