fix: improve card open performance on boards with many cards#8112
Open
nemphys wants to merge 1 commit into
Open
fix: improve card open performance on boards with many cards#8112nemphys wants to merge 1 commit into
nemphys wants to merge 1 commit into
Conversation
Signed-off-by: Dimitris Kazakos <nemphys@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
205e059 to
e80e189
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes severe UI lag when opening a card on boards with a large number of cards (e.g. 200+). Clicking a card to open its details could block the main thread for several seconds due to forced layout recalculations.
Problem
On boards with many cards, opening a card's sidebar was unbearably slow. Chrome DevTools showed multi-second main-thread blocks dominated by Recalculate Style, triggered from Vue's
<transition-group>update logic (hasMove→getTransitionInfo).Two issues compounded:
<transition-group>on card labels — EachCardItemwrapped its label list in a<transition-group>. On any component update, Vue checks whether children have moved by reading layout from the DOM. With hundreds of cards (each potentially having multiple labels), this caused thousands of forced reflows on every interaction that updated the card list.$routein a computed property —currentCarddepended on$route.params.cardId, so every card component re-rendered whenever the route changed (e.g. opening or closing the card sidebar), not just the previously selected and newly selected card.Solution
<transition-group>with a plain<ul>. Label add/remove zoom animations are dropped, which is an acceptable trade-off for large boards.isCurrentCarddata, updated via a route watcher that only mutates state when this card's selection actually changes. Only the two affected cards re-render for the highlight border.Checklist
Recalculate Styleblock fromhasMoveshould be gone