Skip to content

Fix cards past a column's first page vanishing on refresh - #3141

Merged
flavorjones merged 2 commits into
mainfrom
research-column-pagination-567
Sep 29, 2026
Merged

flavorjones merged 2 commits into
mainfrom
research-column-pagination-567

Conversation

@flavorjones

@flavorjones flavorjones commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Motivation

Board columns show cards in pages: the first 15, then 30, and so on. Each page after the first loads when its "load more" link scrolls into view. The pagination controller then stops observing the link and adds a frame for the next page next to the current one.

A Turbo page refresh, such as one broadcast to the board, reloads the column frame. The reload returns only the first page, and the morph removes the later pages' frames. The link element survives the morph, but nothing observes it any more, so the later pages never come back. A column of 17 cards shows 15 until the board is reloaded.

This regressed in #1327 (8c8dbe88), which stopped removing the link after its page loads. Before that, a reload rendered the link again as a new element, which Stimulus connected and observed, so the page came back. #1327 also patched Turbo so page morphs keep refresh=morph frames, and #1413 (860ba1f2) replaced that patch with upstream Turbo. Neither protects the column reload that #1174 added in f5c7d3d3, which calls Turbo.morphChildren with no callbacks.

Details

  • Keep pagination links observed, so a link whose page frame is gone loads that page again.
  • Skip a link whose page frame is still present. Otherwise, scrolling back to an activity timeline link, which stays visible after its day loads, would load that day a second time.
  • Handle every intersection entry, and unobserve links that are removed.
  • Add system tests for a column refresh and for scrolling back over the activity timeline.

A column with more than 15 cards lost every card past its first page
when a Turbo refresh reloaded it, and scrolling never brought them back.

Keep pagination links observed so a page loads again once a refresh
removes its frame, and skip links whose page is already loaded.
Copilot AI balanced review requested due to automatic review settings September 29, 2026 01:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The test failed on CI's MySQL jobs because a page past the first had not
loaded within Capybara's default wait, and its scroll could run before
the column's frame loaded.

Wait for the link before scrolling to it, and allow each page load up to
10 seconds.
@flavorjones
flavorjones merged commit a703bf1 into main Sep 29, 2026
14 checks passed
@flavorjones
flavorjones deleted the research-column-pagination-567 branch September 29, 2026 16:07
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