Skip to content

Collection Page: Prevent infinite scrolling into blank space - #1050

Open
youseihuayu-wonderful wants to merge 1 commit into
IQSS:developfrom
youseihuayu-wonderful:fix/1030-collection-scroll-blank-space
Open

Collection Page: Prevent infinite scrolling into blank space#1050
youseihuayu-wonderful wants to merge 1 commit into
IQSS:developfrom
youseihuayu-wonderful:fix/1030-collection-scroll-blank-space

Conversation

@youseihuayu-wonderful

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Prevents the Collection Page from scrolling into blank space after repeatedly loading results through infinite scrolling.

In the affected layout, the page-level scroll range can grow as more results are added to the internal results list, even though the rendered page content and footer remain in the same bounds.

This PR:

  • Adds a local positioning context to the collection items scroll container.
  • Keeps the page-level scroll range aligned with the rendered page and footer.
  • Adds regression coverage for repeated infinite-scroll loading.
  • Verifies that the sticky results header and Sort control continue to work.
  • Verifies that search, sort, and filter changes continue resetting the results list scroll position.
  • Covers empty, small-result, and large-result states.

The change is intentionally limited to the collection items scroll container. It does not redesign the scrolling architecture or introduce broader CSS containment changes.

Which issue(s) this PR closes:

Suggestions on how to test this:

  1. Open a Collection Page containing enough results for multiple infinite-scroll loads.
  2. Repeatedly scroll the results list to the bottom.
  3. Confirm that additional results load inside the list.
  4. Confirm that the results header and Sort control remain sticky.
  5. Use the page-level scrollbar and scroll to the bottom.
  6. Confirm that the page ends at the footer and cannot scroll into blank space.
  7. Perform a search, change sorting, and change a filter.
  8. Confirm that each action resets the results list to the top.

Does this PR introduce a user interface change?

No intended visual change. It corrects the page scroll boundary.

Is there a release notes or changelog update needed for this change?

No.

Testing performed:

  • Collection items component tests: 94 passed
  • Targeted Cypress E2E verification using the locally served branch with the Harvard Dataverse backend
  • Typecheck
  • ESLint, Stylelint, and Prettier checks
  • Production build

@ChengShi-1 ChengShi-1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good with the fix! I left a comment about tests below, and could you also add a changelog entry?

cy.findByTestId('collection-items-list-infinite-scroll-skeleton').should('exist')
})

it('keeps repeated infinite scrolling within the items list page boundary', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These two tests are failing on my local end due to some environment-dependent rounding differences. I suggest changing the strict equality assertions to allow a 1px tolerance with closeTo(..., 1), avoiding flaky browser-specific layout measurements.

@ChengShi-1 ChengShi-1 moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Aug 19, 2026
@ChengShi-1 ChengShi-1 added bug Something isn't working SPA Size: 0.5 A percentage of a sprint. 0.35 hours labels Aug 20, 2026
@cmbz cmbz added FY27 Sprint 4 FY27 Sprint 4 (2026-08-12 - 2026-08-26) FY27 Sprint 5 FY27 Sprint 5 (2026-08-26 - 2026-09-09) labels Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working FY27 Sprint 4 FY27 Sprint 4 (2026-08-12 - 2026-08-26) FY27 Sprint 5 FY27 Sprint 5 (2026-08-26 - 2026-09-09) Size: 0.5 A percentage of a sprint. 0.35 hours SPA

Projects

Status: In Review 🔎

Development

Successfully merging this pull request may close these issues.

Collection Page: Infinite Scrolling Allows the Page to Scroll into Blank Space

3 participants