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

Brave News: use a larger IntersectionObserver viewport for pagination #14170

Merged
merged 1 commit into from
Jul 14, 2022

Conversation

petemill
Copy link
Member

@petemill petemill commented Jul 13, 2022

To lessen risk that the trigger element would be "skipped" over the viewport when scrolling down fast. Previously, this easily exposed the situation where further content would not be loaded since the hidden pagination trigger element had jumped from below the viewport to above the viewport, avoiding being in the viewport and triggering intersection.

This occurred for both the first "page" of content or any subsequent "pages".

Trigger position is the same (900px from the bottom of the viewport), as previously the trigger element used 900px absolute bottom position.

Resolves brave/brave-browser#13761

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

  • Open NTP
  • Opt in to Brave News
  • Open another NTP
  • Scroll down immediately and very fast
  • Content is loaded (i.e. more than 1 card is shown)
  • Use the mouse to move the scrollbar immediately to the bottom.
  • Verify that another page of content is loaded.
  • Repeat and verify some more times. On previous versions, this easily exposed the situation where further content would not be loaded since the hidden pagination trigger element had jumped from below the viewport to above the viewport, avoiding being in the viewport and triggering intersection.

… that the trigger element would be "skipped" over the viewport when scrolling down fast. Trigger position is the same (900px from the bottom of the viewport), as previously the trigger element used 900px absolute bottom position.
@petemill petemill self-assigned this Jul 13, 2022
@github-actions github-actions bot added the CI/storybook-url Deploy storybook and provide a unique URL for each build label Jul 13, 2022
Copy link
Contributor

@nullhook nullhook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

Copy link
Contributor

@fallaciousreasoning fallaciousreasoning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@petemill petemill merged commit b72f2e2 into master Jul 14, 2022
@petemill petemill deleted the ntp-news-scroll-pagination-trigger branch July 14, 2022 13:35
@github-actions github-actions bot added this to the 1.43.x - Nightly milestone Jul 14, 2022
petemill added a commit that referenced this pull request Jul 14, 2022
Brave News: use a larger IntersectionObserver viewport for pagination
petemill added a commit that referenced this pull request Jul 14, 2022
Brave News: use a larger IntersectionObserver viewport for pagination
@kjozwiak
Copy link
Member

kjozwiak commented Jul 18, 2022

Reproduced the issue on Win 11 x64 using the following build(s):

Brave | 1.41.96 Chromium: 103.0.5060.114 (Official Build) (64-bit)
-- | --
Revision | a1c2360c5b02a6d4d6ab33796ad8a268a6128226-refs/branch-heads/5060@{#1124}
OS | Windows 11 Version 21H2 (Build 22000.795)

Example of the issue occurring using the STR/Cases outlined via both brave/brave-browser#13761 (comment) & #14170 (comment).

New.Tab.-.Brave.2022-07-18.17-27-31.mp4

Verification PASSED on Win 11 x64 using the following build(s):

Brave | 1.43.29 Chromium: 103.0.5060.114 (Official Build) nightly (64-bit)
-- | --
Revision | a1c2360c5b02a6d4d6ab33796ad8a268a6128226-refs/branch-heads/5060@{#1124}
OS | Windows 11 Version 21H2 (Build 22000.795)

Couldn't reproduce the original issue using the STR/Cases outlined via brave/brave-browser#13761 (comment) & #14170 (comment).

Example of the issue not occurring and more news articles loading once hitting the bottom of the feed:

New.Tab.-.Brave.2022-07-18.17-37-21.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/storybook-url Deploy storybook and provide a unique URL for each build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Brave News - scrolling down and get stuck; have to reload to resolve
5 participants