Fix "Show more" button display when more folder content exists - #6102
Open
LianaHarris360 wants to merge 1 commit into
Open
Fix "Show more" button display when more folder content exists#6102LianaHarris360 wants to merge 1 commit into
LianaHarris360 wants to merge 1 commit into
Conversation
…ied and call it before lookup. Adds tests covering a cached full page and the final page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request resolves the bug that prevented the “Show more” button from appearing and loading additional content after opening a folder from the left sidebar, when the folder contains more than 25 resources. Opening the same folder from the main panel functioned as intended.
The implemented fix updates the timing of when the default sort order gets applied.
Resource.wherelooks up a saved note that tells it "there is more after this”.IndexedDBResource.wherefills in a default sort order when the caller didn't give one.IndexedDBResource.wherewas doing that on the caller's own object, and it ran after the lookup but before the note was filed. So the lookup saw no sort order and the filing saw one, and the two never matched.Now the default is applied at the top of
Resource.where, on a copy. The lookup and the filing see the same thing, so the saved note, that causes the “Show more” button to appear, is found.This pull request also updates
resources.spec.jswith 4 new tests:Show morebutton will show, with nothing to load. Clicking it does nothing, besides causing the button to disappear. The alternative to fix this causes the original bug to return.Corrected behavior:
CorrectShowMoreBehavior.mp4
References
Fixes #6052
Reviewer guidance
To avoid building a folder with 25+ children, temporarily lower the
max_resultsin actions.js:78 from 25 to 3, then use any folder with 3+ children.AI usage
I used Claude Code to help identify the root cause of the bug. I then implemented a fix, prompted Claude to review the code and tests, and iterated based on its feedback. I manually tested and checked the final output for correctness and removed any unnecessary changes before opening a PR.