nmc/5808-web-android-files-search-is-not-showing-all-results-2 - #501
Merged
memurats merged 1 commit intoSep 9, 2026
Merged
Conversation
…is open On Android Chrome the unified search dialog autofocuses its input on open, so the on-screen keyboard is always up while searching. The keyboard only shrinks the visual viewport; the layout viewport is untouched, and per the CSS Values 4 spec the viewport-percentage units (vh, dvh, svh, lvh) are explicitly allowed to ignore it, which Chrome on Android does. The dialog was therefore laid out at full height while the keyboard covered roughly the bottom 45% of the screen, stranding the last results and the "Load more results" button behind it with nothing left to scroll. A prior attempt (143915d) swapped vh for dvh, but dvh does not track the keyboard either, so it could not fix this. It also set a --dialog-height custom property that no version of @nextcloud/vue or Nextcloud core reads. window.visualViewport is the only source of truth for what is actually visible, so add src/js/viewportmetrics.js to mirror it onto the document element as --nmc-viewport-height, --nmc-viewport-offset-top, and a coarse [data-nmc-viewport] tier (roomy/tight/minimal) for layout that cannot be expressed as a length alone. Wire it into the build (webpack.config.cjs) and load it on every page (BeforeTemplateRenderedListener.php), alongside the existing theme scripts. Bind every modal to these values in css/layouts/modal.scss instead of just the search dialog, since the same keyboard-vs-viewport mismatch affects any dialog with a text input (rename, share, file picker, tag). The tier overrides are expressed as inherited custom properties (--nmc-modal-inset/-padding/-margin, defined in css/nmcdefault.scss) so they never have to out-specify the base modal-container rules. In css/components/search.scss: - Fix .modal-container__content, which NcModal ships as flex: 0 1 auto; min-height: 52px. Squeezing the container collapsed it to 52px, and .dialog's height: 100% then resolved against that, shrinking the results list to zero height. - Make .unified-search-modal__results an explicit shrinkable scroller and override core's rule that disables its scrolling under 400px of viewport height, which removed the only way to reach "Load more results" exactly where room is tightest. - Add the tight/minimal tier rules that reclaim fixed chrome (dialog heading hidden accessibly, denser rows, filters hidden only in the landscape+keyboard case) so results stay usable as the visible area shrinks. - Remove the dead --dialog-height declaration. Verified against the live dev instance across 9 viewport sizes (320x568 through 1440x900, portrait and landscape) by driving the real bundle with a simulated visualViewport resize: the modal now ends exactly at the simulated keyboard line and "Load more results" stays reachable and functional (pagination confirmed 5 -> 10 -> 15 results) in every case. Desktop layout is unchanged (--nmc-viewport-height resolves to the window height there, so min() still resolves to the existing 80dvh cap). Other dialogs (move-or-copy, new folder) were spot-checked and unaffected on both mobile and desktop.
psawalka
approved these changes
Sep 9, 2026
memurats
approved these changes
Sep 9, 2026
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.
The bug: on Android, the search dialog's keyboard is always up (input autofocuses), which only shrinks the visual viewport — not the layout viewport that vh/dvh/% size against. So the dialog kept its full height while the keyboard covered the bottom ~45% of the screen, stranding the last results and "Load more results" with nothing to scroll to them.
Scope: applies to every modal (rename, share, file picker, tag), not just search — same root cause everywhere. Desktop is unchanged.
Verified: measured against the live dev instance across 9 viewport sizes (320×568–1440×900, portrait/landscape); not yet confirmed on a physical Android device.