fix: custom background file picker shows an empty file dialog#62221
Open
mvanhorn wants to merge 1 commit into
Open
fix: custom background file picker shows an empty file dialog#62221mvanhorn wants to merge 1 commit into
mvanhorn wants to merge 1 commit into
Conversation
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
8 tasks
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 is a regression introduced by commit 15c336f (2026-07-01, "adjust file picker for background image to allow folder navigation"), which replaced the working image filter
.setFilter((node) => node.mime.startsWith('image/'))with.setMimeTypeFilter(['image/*'])in thepickFile()function. The intent of that change was correct (a baresetFilterpredicate hides folders too, so users could not navigate into subfolders), but the['image/*']mimetype-filter path yields an empty browse list in practice, while the other image picker in the codebase (apps/settings/src/components/PersonalInfo/AvatarSection.vue) uses explicit types['image/png', 'image/jpeg']rather than the glob. FixpickFile()by restoring a working image filter that also keeps directories visible for navigation: replace.setMimeTypeFilter(['image/*'])with a folder-aware predicate.setFilter((node) => node.type === 'folder' || node.mime?.startsWith('image/'))(this mirrors the FilePicker's own internal rule of always showing folders plus matching files, and restores the pre-regression image display without reintroducing the folder-navigation problem). This is the delta versus the 2026-07-01 change: it keeps folder navigation but stops the browse list from coming back empty. The fix is self-contained inUserSectionBackground.vue; its only consumer,apps/theming/src/views/UserTheming.vue, needs no change. Add a focused unit test that mocks@nextcloud/dialogs(to capture the filter callback passed to the builder) and@nextcloud/initial-state(the component reads severalloadStatevalues at module load), then asserts the predicate accepts a folder node and animage/pngnode and rejects atext/plainnode.Checklist
AI (if applicable)