Skip to content

♻️ Add infinite scrolling for files in UploadModal to improve UX when uploading large amount of files - #1172

Merged
aaronleopold merged 1 commit into
stumpapp:nightlyfrom
balazs-szucs:infinite-scroll
May 26, 2026
Merged

aaronleopold merged 1 commit into
stumpapp:nightlyfrom
balazs-szucs:infinite-scroll

Conversation

@balazs-szucs

@balazs-szucs balazs-szucs commented May 26, 2026 •

Copy link
Copy Markdown
Contributor

This PR adds infinite scroll to the upload dialog so that users may use that to upload large amount of books in one sitting.

Previously, if there were too many books loaded there was layout overflow, that:

  • was not scroll-able
  • made it impossible to go forward with the upload
  • loaded every book into DOM (though, not necessary problematic, but not exactly a great thing either)

Before

The modal expands off-screen, scrollbar is missing, the list is not scrollable at all, buttons are unreachable
image

After

Autumn theme:

image

White theme:

image

Dark theme:

image

First PR so feel free to let me know if I forgot something. Thanks!

@balazs-szucs

balazs-szucs commented May 26, 2026 •

Copy link
Copy Markdown
Contributor Author

As for autumn theme, i think that black/dark list div does not look very good, may need to do follow up on this. But it is also just visual problem, so no big deal there.

@balazs-szucs
balazs-szucs marked this pull request as ready for review May 26, 2026 17:38
@balazs-szucs

Copy link
Copy Markdown
Contributor Author

And fixed grammar mistakes sorry about that. 50 book, is also just a magic number, i have no particular attachment to that, it may be 100 or any reasonable number imho.

@balazs-szucs
balazs-szucs changed the base branch from main to nightly May 26, 2026 18:56

@aaronleopold aaronleopold left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I had one suggestion if we wanted to take this a step further, but I think this is good as-is!

As for autumn theme, i think that black/dark list div does not look very good, may need to do follow up on this. But it is also just visual problem, so no big deal there.

I agree, I have another branch where I am working on theming for web so will make a note to give it a look there.

And fixed grammar mistakes sorry about that. 50 book, is also just a magic number, i have no particular attachment to that

No worries about grammar! I don't have a preference, I think 50 is totally fine. I honestly didn't even consider that folks would be uploading that many at a time when I added support for this feature 😅

Comment on lines +57 to +65
const handleScroll = useCallback(
(e: React.UIEvent<HTMLDivElement>) => {
const target = e.currentTarget
if (target.scrollHeight - target.scrollTop <= target.clientHeight + 150) {
setVisibleCount((prev) => Math.min(prev + 50, files.length))
}
},
[files.length],
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[previously this modal] loaded every book into DOM (though, not necessary problematic, but not exactly a great thing either)

This is definitely an improvement, but it will still load everything into the DOM once you reach the end. If we wanted to improve this further, I'd suggest virtualizing the list so it can properly cycle things out from the DOM for us as you scroll. The web app uses both virtuoso and tanstack/virtual so there should be a couple of examples to pull from (e.g., DirectoryPickerModal).

@balazs-szucs balazs-szucs May 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, that is true. Well, provided the user scroll down the bottom :'D

Feels like good improvement for future, i can make follow up on this.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah I think a follow-up is totally fine. I'll merge this as-is shortly, then. Thank you!!

@aaronleopold
aaronleopold merged commit f540698 into stumpapp:nightly May 26, 2026
8 checks passed
@balazs-szucs
balazs-szucs deleted the infinite-scroll branch May 26, 2026 20:42
aaronleopold added a commit that referenced this pull request May 29, 2026
A smaller release, mostly so I can get `nightly` into a cleaner slate to allow for a longer testing time for a couple of larger changes, and a few vulnerability patches

## 0.1.4 (2026-05-28)

### Added

- ✨ (expo): Support volume-based reader navigation ([#1161](#1161)) [[5e5a2e0](5e5a2e0)]
- ✨ Support tag-based filtering on backend ([#1160](#1160)) [[6b3fefd](6b3fefd)]

### Changed

- ⬆️ Fix vulnerabilities (&#x60;ws&#x60;, &#x60;qs&#x60;, &#x60;uuid&#x60;, &#x60;js-cookie&#x60;) ([#1179](#1179)) [[9a93695](9a93695)]
- ♻️ Add infinite scrolling for files in UploadModal ([#1172](#1172)) [[f540698](f540698)]
- 🍱 Update docs hero images [[f4c8854](f4c8854)]

### Fixed

- 🐛 Fix &#x60;AccessAPIKeys&#x60; permission mismatch ([#1171](#1171)) [[666bd01](666bd01)]
- 🐛 (expo): Fix Android themed icon ([#1162](#1162)) [[359ebf0](359ebf0)]
- 💚 Fix CVE check workflow [[609788d](609788d)]

### Miscellaneous

- 🌐 Update translations ([#1164](#1164)) [[1aba2c9](1aba2c9)]
- 📝 Add &#x60;Security.md&#x60; [[3feba0a](3feba0a)]
- 📝 Update documentation, readmes, and contributing guidelines [[984c953](984c953)]
- 🌐 Update translations ([#1148](#1148)) [[4d6cc34](4d6cc34)]
- 📝 Add docs for AUR package [[44c9791](44c9791)]
- 📝 Fix overflow issues on documentation hero [[ffd2ec0](ffd2ec0)]
- 🩹 Fix leftover link in SteppedFormSceneHeader [[7eaa73a](7eaa73a)]
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