Skip to content

feat: infinite scroll, configurable commit count, and performance improvements#109

Open
Sagargupta16 wants to merge 1 commit into
NirmalScaria:mainfrom
Sagargupta16:feat/infinite-scroll-configurable-perf
Open

feat: infinite scroll, configurable commit count, and performance improvements#109
Sagargupta16 wants to merge 1 commit into
NirmalScaria:mainfrom
Sagargupta16:feat/infinite-scroll-configurable-perf

Conversation

@Sagargupta16

Copy link
Copy Markdown

Summary

This PR addresses three related enhancement requests by improving the commit loading experience:

Changes

File What changed
manifest.json Added storage permission, added getCommitsPerPage.js to content scripts
js/getCommitsPerPage.js New - helper to read user's commits-per-page preference
js/popup.js Settings load/save for commits-per-page dropdown
html/popup.html Added settings UI section below the demo image
js/fetchCommits.js Deduplicated query into buildBranchQuery(), uses configurable page size
js/fetchFilteredCommits.js Uses configurable page size in filtered queries
js/sortCommits.js Uses configurable page size for initial slice
js/fetchFurther.js Uses configurable page size for pagination threshold and slice
js/showCommits.js Infinite scroll via IntersectionObserver in addNextPageButton(), configurable page size

How to test

  1. Load the extension unpacked in Chrome (chrome://extensions > Load unpacked)
  2. Visit any GitHub repo and click the Commits tab
  3. Scroll down - commits should auto-load without clicking "Load More"
  4. Click the extension icon - change "Commits per page" to 50
  5. Reload the page and click Commits - should show 50 commits initially
  6. Test on a repo with many branches (e.g., flutter/flutter) - should load faster with larger page size

Screenshots

Settings in popup:

The dropdown appears below the existing demo image with options 10/20/30/50/100.

Closes #93, Closes #92, Addresses #41

- Replace "Load More" button with IntersectionObserver-based infinite
  scroll that auto-loads commits as user scrolls (NirmalScaria#93)
- Add configurable commits-per-page setting in extension popup with
  options for 10/20/30/50/100, default changed from 10 to 30 (NirmalScaria#92)
- Reduce duplicate GraphQL query code in fetchCommits.js with shared
  query builder function
- Use configurable page size throughout: sortCommits, fetchFurther,
  fetchCommits, fetchFilteredCommits, and showCommits
- Add chrome.storage.sync for persisting user preferences
- Add "storage" permission to manifest.json

Closes NirmalScaria#93, Closes NirmalScaria#92, Addresses NirmalScaria#41
@Sagargupta16 Sagargupta16 force-pushed the feat/infinite-scroll-configurable-perf branch from 3e47c96 to 654d13c Compare April 11, 2026 13:07
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.

Autoload commits when we scroll down rather than having a "load more" button Allow to configure a bigger number of commits loaded by default

1 participant