Skip to content

Keep flip list cards mounted after the page loads - #1569

Merged
Ekwav merged 1 commit into
mainfrom
crafts-hydration-flake
Nov 2, 2026
Merged

Ekwav merged 1 commit into
mainfrom
crafts-hydration-flake

Conversation

@Ekwav

@Ekwav Ekwav commented Nov 2, 2026

Copy link
Copy Markdown
Member

Behaviour: Flip lists (crafts, NPC, bazaar, forge, kat and the other GenericFlipList pages) no longer replace every card with a spinner right after the page loads. Before, a click on a card in that moment opened its detail dialog on a card that was then thrown away: no dialog, no request. That made crafts.cy.ts fail on #1567's CI (cy.wait('@plan'): no request ever occurred).

Cause: On mount, useSortedAndFilteredItems sets isProcessing while it sorts, and GenericFlipList rendered the spinner instead of the list whenever isProcessing was set. Every card unmounted and its open state was lost.

Change:

  • GenericFlipList shows the spinner only while there is nothing to show. During a sort or filter run the current cards stay.
  • useSortedAndFilteredItems sorts and filters synchronously for its first state. The server now renders the order the client settles on, so cards no longer jump after load. A card can no longer cross the blurred top-2 boundary and remount (review finding).
  • The ad placeholder used the same React key as the card next to it; it now uses -ad like the other ad branch.
  • market-analysis.cy.ts: the heading-order check counts only visible headings. A stale copy in the hidden streaming container made it fail once locally (same pattern the file already uses elsewhere).

Test: crafts.cy.ts now counts craft cards removed from the page and expects none. On the unfixed build it fails in about 5 of 7 runs (the bug itself is timing-dependent); with the fix it passed every run. Full suite locally on the fixed build: 283/283.

Risk: The first sort now runs during server render and hydration instead of in a timeout. For the list sizes on these pages that is a few milliseconds.

🤖 Generated with Claude Code

@Ekwav
Ekwav merged commit 6476c72 into main Nov 2, 2026
4 checks passed
@Ekwav
Ekwav deleted the crafts-hydration-flake branch November 2, 2026 00:29
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