Repository navigation
fix(ui): mount My Tasks widget cards only when scrolled into view (2.0) - #37944
Conversation
Each description task card renders a read-only BlockEditor per changed diff line. The widget mounted all PAGE_SIZE_BASE cards on My Data load, blocking the main thread (Sentry long-animation-frame on /my-data). Cards now mount once they enter the widget's visible scroll area.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved 🟡 Medium riskDeferring My Tasks card rendering until intersection changes when cards become available and could delay them if visibility detection does not trigger as expected. Defers mounting My Tasks widget cards until they scroll into view on 2.0, wrapping each card in a VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Fixes a Sentry "Blocking Operation" (long animation frames, ~1.4s total) on
/my-datafor 2.0 deployments.On 2.0 the My Tasks widget mounts all
PAGE_SIZE_BASE(15) task cards on load, although its scroll area shows two or three. A description task card renders its diff throughDiffViewNew→TaskDescriptionPreviewer, which mounts a read-onlyBlockEditorper changed line, so the home page sets up dozens of editors right after/api/v1/tasks/visiblereturns.Each card is now wrapped in a
DeferredTaskCard(useInView,triggerOnce) that mounts the card once it enters the widget's visible scroll area; until then it reserves a 150px slot.DeferredWidgetwas not reused because it forcesheight: 100%, which would stretch every slot to the list height.2.1+ is unaffected: the widget was replaced in #34770, which is too large to backport, so this is a 2.0-only targeted fix. The shared
TaskFeedCardFromTaskand the other task lists are unchanged.Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
Unit tests
mounts a task card only once it scrolls into viewtoMyTaskWidget.test.tsx; it fails with the fix reverted. All 6 tests in the file pass.Not done
CustomizeWidgets.spec.ts) clicks the first card, which is in view on load.tscreports one pre-existing error in this file ('open'argument at thegetTaskDatacall), already onorigin/2.0.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge, with no outstanding findings.Summary
The PR delays mounting My Tasks cards until they enter view and keeps revealed cards mounted.
Reviews (2) · Last reviewed commit: "test(ui): assert a revealed My Tasks car..." · Reviewed by Greptile