You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: keep popovers open while the on-screen keyboard resizes the viewport - #22756
On a touch device the image picker's autofocused search input raises the on-screen keyboard; if that resizes the layout viewport, the resize handler in usePopoverViewportDismiss closed the picker immediately (reported on Samsung Internet, App Mode, Load Image). On a coarse primary pointer with the viewport width unchanged, a resize no longer dismisses when the height grows or stays the same (the keyboard hiding, including one that was already up when the popover opened, or a repeated event), or when it shrinks while a keyboard-capable field is focused (text-like input, textarea, contenteditable; not read-only or inputmode="none"). Width changes, shrinks with no keyboard-capable focus, and every fine-pointer (desktop) resize still dismiss; kept-open popovers are repositioned by floating-ui autoUpdate. After a keyboard resize that grew the viewport, a scroll of an anchor ancestor is ignored only when it is the browser clamping that scroller: its scrollTop recorded at open was above the new maximum and now sits within 1px of it (once per scroller per growth). Deliberate scrolls, popup-content scrolls, outside-pointer and Escape behave as before. iOS Safari document panning is not addressed or verified. The viewport snapshot is now taken only when the popover opens, so a closed popover no longer touches window at setup (SSR with an initially open popover already failed on main and still does).
PrimeVue's Popover (used before #16272) skipped resize dismissal on touch devices for this reason; the declarative popovers dropped that exemption.
Unit, usePopoverViewportDismiss.test.ts (25 cases): keyboard open under focus; keyboard already up at open then hiding; same-size repeat; keyboard hiding in steps after blur; shrink after that closing; widget-list clamp kept; panel and list both clamping; clamp at each hiding step; repeated resize before the clamp; clamp 1px short of the maximum; popup content clamping first; closes on a scroll to the end after a growth that clamped nothing, on a scroll short of the end, on a second scroll, on clamps the viewport did not cause, after reopen, and when measured from the last clamp; desktop, checkbox, read-only, inputmode="none", no-focus shrinks; rotation. Against main's composable 10 fail and 15 pass; removing each guard fails at least one case.
E2E, browser_tests/tests/appMode/mobileImagePicker.spec.ts (@mobile, Pixel 5 emulation): open the picker in App Mode, shrink only the viewport height, then filter with the search over two mocked, test-owned images (object_info and /api/view routes; nothing written to the input folder): "dog" leaves only the dog image, a non-matching query shows "No items". A second case removes the default graph's checkpoint loader (its missing-model warning collapses the widget list on backends without that model), shortens the viewport, scrolls only the widget list to put the image widget at its top, opens the picker, restores the height, asserts the list's scrollTop was clamped, and after three frames asserts the picker is still open; it fails without the clamp check. Against main the picker is gone after the resize; rotation still closes it.
Emulation event trace before the fix: focusin INPUT (search autofocus) → resize → focusout INPUT → focus returns to the trigger; no scroll events.
Not verified: real Samsung Internet + Android keyboard. The emulated setViewportSize approximates a keyboard that resizes the layout viewport; there is no device trace showing Samsung Internet fires resize this way rather than, for example, a keyboard-driven document scroll. Needs a check on the reporter's device.
…port
The image picker's search input autofocuses when the picker opens. On a
touch device that raises the on-screen keyboard, which can shorten the
layout viewport and fire a window resize. usePopoverViewportDismiss
closed every popover on any resize, so the picker opened and closed at
once and the keyboard dropped with it (reported on Samsung Internet,
App Mode, Load Image).
A resize is now treated as the on-screen keyboard, and ignored, only when
the primary pointer is coarse, a text-entry field has focus, the width is
unchanged and the height actually changed. Desktop resizes, rotations,
same-size resize events and resizes with a non-text control focused still
dismiss. Scroll, outside-pointer and Escape dismissal are unchanged.
PrimeVue's Popover, used here before #16272, skipped resize dismissal on
touch devices for the same reason; the declarative popovers dropped it.
Fixes#22753
🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measure
No verdict is available. Open the workflow run to confirm the check was intentionally skipped, or fix the collection failure and re-run it.
Findings and check details
Executes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight ecosystem-matrix shard checks are a harness self-test; the pack verdict is matrix-verdict.
The matrix runs on same-repository version-bump PRs with relevant changes, main-branch pushes, and manual dispatches. This candidate does not qualify, so every expensive stage was skipped.
# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
🌾 Fallow: ✅ Passed
Findings and check details
Fallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened.
# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since 9855faca628f5b732ac6f7a2570e3494c0813582
🏛️ Architecture: ✅ Passed
Findings and check details
Warnings (352)
billing path matches no source files: src/platform/billing/composables/activateBillingScope.testUtils.ts. Remove or update it in docs/architecture/domains/records/billing.domain.json.
error-handling path matches no source files: src/utils/errorUtil.ts. Remove or update it in docs/architecture/domains/records/error-handling.domain.json.
graph-model path matches no source files: src/types/linkTopology.ts. Remove or update it in docs/architecture/domains/records/graph-model.domain.json.
graph-model path matches no source files: src/types/nodeState.ts. Remove or update it in docs/architecture/domains/records/graph-model.domain.json.
job-queue path matches no source files: src/platform/remote/comfyui/jobs/**. Remove or update it in docs/architecture/domains/records/job-queue.domain.json.
linear-mode path matches no source files: src/utils/appMode.ts. Remove or update it in docs/architecture/domains/records/linear-mode.domain.json.
link-connection path matches no source files: src/lib/litegraph/src/infrastructure/LinkConnectorEventMap.ts. Remove or update it in docs/architecture/domains/records/link-connection.domain.json.
node-widgets path matches no source files: src/types/widgetState.ts. Remove or update it in docs/architecture/domains/records/node-widgets.domain.json.
subgraphs path matches no source files: src/lib/litegraph/src/infrastructure/SubgraphEventMap.ts. Remove or update it in docs/architecture/domains/records/subgraphs.domain.json.
vue-node-widgets path matches no source files: src/types/positionConfig.ts. Remove or update it in docs/architecture/domains/records/vue-node-widgets.domain.json.
workspace path matches no source files: src/platform/workspace/fixtures/**. Remove or update it in docs/architecture/domains/records/workspace.domain.json.
packages/api-client/src/abortSignal.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/api-client/src/abortSignal.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/api-client/src/fetchRouteTemplate.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/api-client/src/fetchWithRetry.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/api-client/src/fetchWithRetry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/api-client/src/retryPolicy.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/api-client/src/retryPolicy.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/api-client/src/statusRetryTelemetry.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/api-client/src/statusRetryTelemetry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/formatUtil.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/formatUtil.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/geometry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/loadExternalScript.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/networkUtil.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/telemetry.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/telemetry.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/urlSafety.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/shared-frontend-utils/src/urlSafety.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
packages/tailwind-utils/src/index.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/TopbarActions.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/searchbox/v2/filterChip.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/videoConcat/VideoConcatClipStrip.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/videoConcat/VideoConcatClipTile.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/videoConcat/VideoConcatPanel.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/videoConcat/VideoConcatPanel.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/videoConcat/VideoConcatPlaybackBar.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/videoConcat/WidgetVideoConcat.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/videoConcat/WidgetVideoConcat.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/videoConcat/__fixtures__/clipTiles.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/widgetHistory/WidgetHistoryButtons.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/components/widgetHistory/WidgetHistoryButtons.vue is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/composables/graph/menuOption.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/composables/useAgentExtensionActions.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/composables/useAgentExtensionActions.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/composables/useAgentExtensionNotices.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/composables/useAgentExtensionNotices.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/composables/useAgentSidebarTabs.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/composables/useLiveGraphNode.test.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
src/composables/useLiveGraphNode.ts is not claimed by any domain. Add it to a module in docs/architecture/domains/records.
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
The popover now distinguishes qualifying keyboard-related viewport changes from other resizes and suppresses scroll dismissal until the next animation frame after a qualifying resize. Unit and browser tests cover resize, focus, scroll timing, and mobile image-picker behavior.
The handler records viewport dimensions. On coarse-pointer devices, qualifying changes keep the popover open; other resizes close it. Scroll dismissal is suppressed until the next animation frame after a qualifying resize.
Test resize and scroll dismissal packages/design-system/src/components/popover/usePopoverViewportDismiss.test.ts
Unit tests cover focus eligibility, keyboard appearance and closure, desktop resizing, rotation, viewport shortening, and scroll timing.
Verify mobile image-picker behavior browser_tests/fixtures/helpers/MobileAppHelper.ts, browser_tests/tests/appMode/mobileImagePicker.spec.ts
The helper resizes the viewport and waits for matching browser dimensions and the next frame. Browser tests check picker visibility, search results, and dismissal during viewport changes.
#22753 reports that the App Mode Load Image picker closes when the Android keyboard appears. This change handles qualifying keyboard-related viewport resizes and adds mobile picker tests, but Samsung Internet behavior remains unverified.
Local testing may require an input image, and a scroll during resizing may leave a picker open. These risks are bounded and have workarounds.
Pre-merge checks: 6
Check name
Status
Explanation
Title check
The title names the main change: keeping popovers open while the on-screen keyboard resizes the viewport. The changeset adds coarse-pointer resize handling in usePopoverViewportDismiss, which matches …
Linked Issues check
[#22753] requires the Load Image picker in App Mode to stay open on Samsung Internet, while intentional outside-pointer, Escape, and scroll dismissal are preserved, with mobile regression coverage. Th…
Out of Scope Changes check
The whole-PR diff (merge base 546bbe2 to head dac9d05) touches four areas. (1) usePopoverViewportDismiss.ts implements the keyboard-resize keep-open rule and the one-frame scroll suppression that th…
End-To-End Test Suggestion For User-Facing Changes
PASS. The PR changes frontend behavior in packages/design-system/src/components/popover/usePopoverViewportDismiss.ts to fix keyboard-related popover dismissal. It also adds `browser_tests/tests/appM…
Adr Compliance For Entity/Litegraph Changes
The PR changes popover dismissal logic, mobile test helpers, and an App Mode image-picker test. None of the changed files are under src/lib/litegraph/, src/ecs/, or related to graph entities. The …
Description check
The description follows the required Summary and Verification structure. It explains the problem, behavior, design decisions, test coverage, results, known gaps, and remaining real-device verification…
Full details: Title check
Explanation
The title names the main change: keeping popovers open while the on-screen keyboard resizes the viewport. The changeset adds coarse-pointer resize handling in usePopoverViewportDismiss, which matches the title. The title uses the fix: prefix and is a single, specific sentence.
Full details: Linked Issues check
Explanation
[#22753] requires the Load Image picker in App Mode to stay open on Samsung Internet, while intentional outside-pointer, Escape, and scroll dismissal are preserved, with mobile regression coverage. The reviewed head implements the keep-open path in usePopoverViewportDismiss.ts. A resize stays open only when all of these hold: a coarse primary pointer, an unchanged width, and either a non-decreasing height or a keyboard-capable focused element. Keyboard-capable means a text-like input, a non-read-only textarea, or a contenteditable element, and inputmode="none" is excluded. Other resizes still close the popover. Scroll dismissal is suppressed only until the next animation frame after an accepted keyboard resize. Outside-pointer and Escape handling are not changed in the diff. Coverage exists in usePopoverViewportDismiss.test.ts (keep-open and dismiss cases) and in the @mobile App Mode E2E test in mobileImagePicker.spec.ts, which uses the new MobileAppHelper.resizeViewport. The issue root cause is a hypothesis, and real Samsung Internet behavior is not verified. This is a verification gap, not a missing coding requirement, so it does not cause a FAIL. The residual risk is that the emulated resize may not match the reporter's device.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff (merge base 546bbe2 to head dac9d05) touches four areas. (1) usePopoverViewportDismiss.ts implements the keyboard-resize keep-open rule and the one-frame scroll suppression that the objectives describe for [#22753]. The viewport snapshot is taken on open, which the PR description says avoids a window access in closed popovers during setup. This follows from the keep-open logic and does not add product behavior. (2) usePopoverViewportDismiss.test.ts covers the new cases and the existing dismissal cases. (3) MobileAppHelper.resizeViewport is a test helper used only by the new E2E test. (4) mobileImagePicker.spec.ts is the App Mode regression test for [#22753]. No unrelated product behavior or unrelated test scope is found. One documentation inconsistency exists: the PR description says scroll dismissal is unchanged, but the code suppresses scroll dismissal for one frame after an accepted keyboard resize. The objectives name this follow-up, so the code is in scope. The description should match the code.
Full details: End-To-End Test Suggestion For User-Facing Changes
Explanation
PASS. The PR changes frontend behavior in packages/design-system/src/components/popover/usePopoverViewportDismiss.ts to fix keyboard-related popover dismissal. It also adds browser_tests/tests/appMode/mobileImagePicker.spec.ts, which exercises the affected mobile image-picker trigger and confirms that height-only viewport changes keep the picker open while rotation closes it.
Full details: Adr Compliance For Entity/Litegraph Changes
Explanation
The PR changes popover dismissal logic, mobile test helpers, and an App Mode image-picker test. None of the changed files are under src/lib/litegraph/, src/ecs/, or related to graph entities. The ADR-LAYOUT and ADR-ECS checks do not apply.
Full details: Description check
Explanation
The description follows the required Summary and Verification structure. It explains the problem, behavior, design decisions, test coverage, results, known gaps, and remaining real-device verification.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Tip
🎯 Customize your risk assessments
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
CodeRabbit Verify
Run CodeRabbit Verify to test the changes in this pull request.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
🟢 Low — isTextEntryFocused looks at document.activeElement across the whole page. Any focused text field outside the popover or its anchor therefore suppresses dismissal on height-only resizes. So do readOnly or disabled inputs and inputmode="none" fields, none of which raise a keyboard. Inside a shadow root, activeElement is the host, so a real keyboard resize there is missed. Limit the check to an editable field inside the popover content or anchor, and exclude fields that cannot open a keyboard. Raised by 4 of 6 reviewers (claude-opus-5-5-xhigh adversarial, kimi-k3-high adversarial, claude-opus-5-5-xhigh edge-case, kimi-k3-high edge-case).
The reason will be displayed to describe this comment to others. Learn more.
Partly fixed in c0ffa1b: read-only and inputmode="none" fields no longer count (unit cases added). Not changed: limiting to fields inside the popover (the composable only knows the anchor, and a keyboard raised by any focused field resizes the viewport the same way) and shadow-root focus (no shadow-DOM consumers of these popovers).
The reason will be displayed to describe this comment to others. Learn more.
🟢 Low — Any height change with an unchanged width, on a coarse pointer with a text field focused, is treated as the keyboard, and there is no minimum change in size. That includes split-screen divider drags, browser toolbar collapse, PWA or floating-window resizes, and touch laptops using a hardware keyboard. Each accepted resize also resets the baseline (line 56), so a genuine resize delivered in small steps never dismisses, and the popover stays anchored to stale geometry. Raised by 3 of 6 reviewers (gpt-5.6-sol-xhigh adversarial, kimi-k3-high adversarial, kimi-k3-high edge-case).
The reason will be displayed to describe this comment to others. Learn more.
Not changed. The kept-open popover is not stale: Reka's PopperContent runs floating-ui autoUpdate (reka-ui dist/Popper/PopperContent.js:212), which repositions on window resize. The exemption is limited to a coarse primary pointer, unchanged width, and a keyboard-capable focus or a return toward the opened height after an accepted keyboard resize, so a split-screen or toolbar height change keeps the popover open only in that narrow state.
The reason will be displayed to describe this comment to others. Learn more.
Update for 1678c51: on a coarse pointer, a same-width height growth now keeps the popover open regardless of focus; shrinks still need a keyboard-capable focus. The repositioning argument above (floating-ui autoUpdate) is what makes keeping it open safe.
The reason will be displayed to describe this comment to others. Learn more.
🟢 Low — (pointer: coarse) checks only the primary pointer. Some hybrid devices still show an on-screen keyboard but report pointer: fine: Windows 2-in-1s, Chromebooks in tablet mode, and iPads with a trackpad. On those devices the keyboard resize still closes the popover. (any-pointer: coarse) would match devices with any touch input, which is closer to what the unit test already simulates through maxTouchPoints. Raised by 3 of 6 reviewers (claude-opus-5-5-xhigh adversarial, claude-opus-5-5-xhigh edge-case, gpt-5.6-sol-xhigh edge-case).
The reason will be displayed to describe this comment to others. Learn more.
Not changed. (any-pointer: coarse) also matches touchscreen laptops driven by a mouse, which would stop ordinary desktop height-only resizes from dismissing there; keeping desktop dismissal was an explicit requirement. Hybrid tablet-mode devices that report pointer: fine keep today's behaviour.
…etup
- Accept a height increase back toward the opened size, and a same-size
repeat, once a keyboard resize has been accepted during this open, so the
picker survives the keyboard closing after focus moves to another control.
- Accept a same-size resize while a keyboard-capable field is focused.
- Ignore read-only and inputmode="none" fields, which raise no keyboard.
- Take the viewport snapshot only when the popover opens, so a closed
popover does not read window during setup.
- E2E filters the picker after the resize instead of reselecting the
current image.
A popover could open while the keyboard was already up, for example from a
prompt textarea or next to a focused picker search. Its opened height was
then the shortened one, so the keyboard hiding afterwards grew past it and
dismissed the popover.
On a coarse pointer with the width unchanged, a resize now keeps the
popover open when the height grows or stays the same, and when it shrinks
only while a keyboard-capable field is focused. This drops the per-open
keyboard state, so a same-size event can no longer leave a stale keyboard
height behind. Width changes and fine-pointer resizes still dismiss.
When the keyboard hides, the App Mode widget list grows and the browser
clamps its scrollTop. The resulting scroll event reaches the capture-phase
scroll dismissal right after the accepted resize and closed the picker
(reproduced in mobile-chrome emulation: resize then scroll on the widget
list SECTION). Scroll events are now ignored until the next animation
frame after an accepted keyboard resize; later scrolls still dismiss.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium — The dac9d05 reply fixes the Chromium scrollTop clamp, but it does not cover the iOS Safari case raised in the same finding. The round 1 reply notes that an iOS keyboard fires no window resize, so isSettlingKeyboardResize never arms on iOS. When Safari scrolls the document to reveal the focused search input, the event reaches this event.target === document branch and still closes the picker. The new specs are tagged only @mobile, so the mobile-safari (@mobile-ios) project never runs them. Consider ignoring document and window scrolls while a keyboard-capable field is focused, or driving this from visualViewport. Raised by 2 of 6 reviewers (claude-opus-5-5-xhigh edge-case, gpt-5.6-sol-xhigh edge-case).
The reason will be displayed to describe this comment to others. Learn more.
Not changed in this PR. #22753 is Samsung Internet on Android, and all the evidence here is Chromium emulation. I have no reproducible iOS Safari case or device trace, and the mobile-safari project emulates WebKit without an on-screen keyboard, so it could not show the document pan either. Ignoring document scrolls whenever a text field is focused would also stop a deliberate document scroll from dismissing on touch, which this PR keeps. iOS behaviour is unverified and left for a follow-up with a real-device trace.
…iewport
The one-frame scroll window could swallow a genuine scroll in a frame
that also carried an accepted resize, and could miss a clamp dispatched
after the next animation frame. A growing keyboard resize now arms a
single check: the next scroll is ignored only when its target sits at its
maximum scrollTop, and any scroll or reopen clears it. Other scrolls keep
dismissing.
The mobile picker E2E now mocks the LoadImage options and their previews,
so filtering is asserted on two test-owned images without relying on (or
writing to) the backend input directory, and it waits extra frames before
asserting the picker survived the restore.
The reason will be displayed to describe this comment to others. Learn more.
🟢 Low — isScrolledToEnd accepts only an Element, but the root scroller reports its scroll events on document. So when a viewport growth clamps document.scrollingElement, for a consumer of this shared hook on a page where the document itself scrolls, the check always fails and the handler goes on to the event.target === document branch and closes the popover. Map a document or window target to document.scrollingElement before checking whether it is at its end. Raised by 1 of 6 reviewers (gpt-5.6-sol-xhigh edge-case).
The reason will be displayed to describe this comment to others. Learn more.
Not changed. Current consumers of this hook (FormDropdown and its sort/filter sub-popovers, PackVersionBadge, CanvasModeSelector, ModelImportProgressDialog) all render inside the full-viewport app shell, where the document itself does not scroll. I have no reproducible case of a document-level clamp here, so document and window scrolls keep dismissing as on main.
The clamp check now compares each anchor ancestor's scrollTop recorded at
open (and refreshed after an ignored clamp) with its new maximum: a scroll
is a clamp only if the recorded top exceeded the new maximum and the
current top sits within 1px of it. A growth that clamps nothing no longer
lets a later deliberate scroll to the end through.
Only scrolls that move the anchor (document, window, anchor ancestors) are
considered, so popup content scrolling cannot use the allowance. Each
ancestor may clamp once per accepted growth, so nested scrollers and a
keyboard that hides in steps are covered, and a repeated resize between a
growth and its clamp no longer disarms the check.
The scrolled-list E2E deletes the default graph's checkpoint loader, whose
missing-model warning on backends without that model collapsed the widget
list to zero height and made the image trigger untappable, scrolls only the
widget list to put the image widget in view, and asserts the restore
actually clamped the list.
Fallow flagged the capture-phase scroll handler (cyclomatic 10, CRAP 31.6
over the 30 threshold). Moving the anchor-movement and clamp-after-growth
conditions into named functions leaves the handler with two branches and
no behaviour change.
This branch has not been deployed
No deployments
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
cursor-reviewTrigger multi-model Cursor agent review on this PRrisk:highPR risk grade (advisory shadow check; grader-owned)
1 participant
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
On a touch device the image picker's autofocused search input raises the on-screen keyboard; if that resizes the layout viewport, the
resizehandler inusePopoverViewportDismissclosed the picker immediately (reported on Samsung Internet, App Mode, Load Image). On a coarse primary pointer with the viewport width unchanged, a resize no longer dismisses when the height grows or stays the same (the keyboard hiding, including one that was already up when the popover opened, or a repeated event), or when it shrinks while a keyboard-capable field is focused (text-likeinput,textarea, contenteditable; not read-only orinputmode="none"). Width changes, shrinks with no keyboard-capable focus, and every fine-pointer (desktop) resize still dismiss; kept-open popovers are repositioned by floating-uiautoUpdate. After a keyboard resize that grew the viewport, a scroll of an anchor ancestor is ignored only when it is the browser clamping that scroller: its scrollTop recorded at open was above the new maximum and now sits within 1px of it (once per scroller per growth). Deliberate scrolls, popup-content scrolls, outside-pointer and Escape behave as before. iOS Safari document panning is not addressed or verified. The viewport snapshot is now taken only when the popover opens, so a closed popover no longer toucheswindowat setup (SSR with an initially open popover already failed on main and still does).PrimeVue's Popover (used before #16272) skipped resize dismissal on touch devices for this reason; the declarative popovers dropped that exemption.
Fixes #22753
Verification
usePopoverViewportDismiss.test.ts(25 cases): keyboard open under focus; keyboard already up at open then hiding; same-size repeat; keyboard hiding in steps after blur; shrink after that closing; widget-list clamp kept; panel and list both clamping; clamp at each hiding step; repeated resize before the clamp; clamp 1px short of the maximum; popup content clamping first; closes on a scroll to the end after a growth that clamped nothing, on a scroll short of the end, on a second scroll, on clamps the viewport did not cause, after reopen, and when measured from the last clamp; desktop, checkbox, read-only,inputmode="none", no-focus shrinks; rotation. Against main's composable 10 fail and 15 pass; removing each guard fails at least one case.browser_tests/tests/appMode/mobileImagePicker.spec.ts(@mobile, Pixel 5 emulation): open the picker in App Mode, shrink only the viewport height, then filter with the search over two mocked, test-owned images (object_infoand/api/viewroutes; nothing written to the input folder): "dog" leaves only the dog image, a non-matching query shows "No items". A second case removes the default graph's checkpoint loader (its missing-model warning collapses the widget list on backends without that model), shortens the viewport, scrolls only the widget list to put the image widget at its top, opens the picker, restores the height, asserts the list's scrollTop was clamped, and after three frames asserts the picker is still open; it fails without the clamp check. Against main the picker is gone after the resize; rotation still closes it.focusin INPUT(search autofocus) →resize→focusout INPUT→ focus returns to the trigger; no scroll events.setViewportSizeapproximates a keyboard that resizes the layout viewport; there is no device trace showing Samsung Internet firesresizethis way rather than, for example, a keyboard-driven document scroll. Needs a check on the reporter's device.