Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ntp: virtual list for favorites #1269

Merged
merged 8 commits into from
Nov 26, 2024
Merged

Conversation

shakyShane
Copy link
Contributor

@shakyShane shakyShane commented Nov 25, 2024

Asana Task/Github Issue: https://app.asana.com/0/1201141132935289/1208792034336660/f

Description

  • only render the rows of favorites that are visible
    • this addresses a major pain-point from our native desktop browsers
  • when expanded, defer rendering children until the main thread is free
    • this means users on the very slowest devices still get an instant feedback on click

Example

Part of this PR is optimizing the expand/collapse action of the favorites list. On slow devices this can cause over a second of input delay since the act of rendering a screen full of favorites can be an expensive main-thread-blocking operation.

To combat this problem, I separated the expand/collapse action from the rendering of the actual tiles, which had the following impact: 💪🏻

BEFORE (20x CPU slowdown)
Screenshot 2024-11-26 at 10 13 02 AM

AFTER (20x CPU slowdown)

Screenshot 2024-11-26 at 10 22 32 AM

TODO:

  • add some perf metrics to explain the change

Testing Steps

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

@shakyShane
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

netlify bot commented Nov 25, 2024

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit 5444764
🔍 Latest deploy log https://app.netlify.com/sites/content-scope-scripts/deploys/6745b6e7a7cf080008477dbb
😎 Deploy Preview https://deploy-preview-1269--content-scope-scripts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented Nov 25, 2024

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

github-actions bot commented Nov 25, 2024

[Beta] Generated file diff

Time updated: Tue, 26 Nov 2024 11:55:14 GMT

Integration
    - integration/pages/new-tab/js/index.css
  • integration/pages/new-tab/js/index.js

File has changed

Windows
    - windows/pages/new-tab/js/index.css
  • windows/pages/new-tab/js/index.js

File has changed

Apple
    - dist/pages/new-tab/js/index.css
  • dist/pages/new-tab/js/index.js

File has changed

@shakyShane shakyShane marked this pull request as ready for review November 25, 2024 22:38
@shakyShane shakyShane requested review from mgurgel and a team as code owners November 25, 2024 22:38
@shakyShane shakyShane force-pushed the 11-25-ntp_virtual_list_for_favorites branch from 2e9bdc5 to 5444764 Compare November 26, 2024 11:54
@shakyShane
Copy link
Contributor Author

I have tested this on Windows ✅

@shakyShane shakyShane merged commit 12f5579 into main Nov 26, 2024
13 checks passed
@shakyShane shakyShane deleted the 11-25-ntp_virtual_list_for_favorites branch November 26, 2024 12:04
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.

3 participants