Skip to content

fix(ui): mount My Tasks widget cards only when scrolled into view (2.0) - #37944

Merged
Rohit0301 merged 2 commits into
2.0from
Rohit0301/2.0-my-task-widget-defer-cards
Nov 17, 2026
Merged

Rohit0301 merged 2 commits into
2.0from
Rohit0301/2.0-my-task-widget-defer-cards

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes a Sentry "Blocking Operation" (long animation frames, ~1.4s total) on /my-data for 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 through DiffViewNew → TaskDescriptionPreviewer, which mounts a read-only BlockEditor per changed line, so the home page sets up dozens of editors right after /api/v1/tasks/visible returns.

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. DeferredWidget was not reused because it forces height: 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 TaskFeedCardFromTask and the other task lists are unchanged.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • My Data page with many open description tasks: only the cards visible in the My Tasks widget mount; the rest mount on scroll.

Unit tests

  • Added mounts a task card only once it scrolls into view to MyTaskWidget.test.tsx; it fails with the fix reverted. All 6 tests in the file pass.

Not done

  • Not profiled against a running 2.0 stack, so the main-thread saving is not measured.
  • Playwright not run. The only 2.0 spec touching this widget (CustomizeWidgets.spec.ts) clicks the first card, which is in view on load.
  • tsc reports one pre-existing error in this file ('open' argument at the getTaskData call), already on origin/2.0.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence 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.

  • My Tasks mounts each task card only when its slot enters view.

Reviews (2) · Last reviewed commit: "test(ui): assert a revealed My Tasks car..." · Reviewed by Greptile

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.
@Rohit0301
Rohit0301 requested a review from a team as a code owner November 17, 2026 06:25
@Rohit0301
Rohit0301 requested review from karanh37 and removed request for a team November 17, 2026 06:26
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@gitar-bot

gitar-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Deferring 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 DeferredTaskCard that reserves a 150px slot until useInView fires, which avoids setting up dozens of read-only BlockEditor instances on /my-data. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@Rohit0301
Rohit0301 merged commit 12ed02d into 2.0 Nov 17, 2026
60 of 63 checks passed
@Rohit0301
Rohit0301 deleted the Rohit0301/2.0-my-task-widget-defer-cards branch November 17, 2026 06:56
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