[Context-Input] Prevent context menu jumping during tab selection [chromium/src : main]

0 views
Skip to first unread message

Ananya Seelam (Gerrit)

unread,
11:05 AM (7 hours ago) 11:05 AM
to Wenhu Cheng, Chromium LUCI CQ, James Leung, chromium...@chromium.org, oshima...@chromium.org
Attention needed from James Leung and Wenhu Cheng

Ananya Seelam added 3 comments

Commit Message
Line 31, Patchset 9 (Latest):https://screencast.googleplex.com/cast/NjQzNjY1NzI5MjExNTk2OHxiODJkMjE2NS0wZA
Ananya Seelam . unresolved

Hi wenhu! I patched this CL and tested on the arm where the realbox stays open and I'm noticing the context menu is closing after first tab selection: https://screencast.googleplex.com/cast/NjUwMTUyODQ3ODE1NDc1MnwyYTk2NDc4Mi0wMg

we might be closing it when it shouldn't be closed.

Line 36, Patchset 9 (Latest):
Ananya Seelam . unresolved

nit: can you also add a screencast with context management disabled. thank you!!

File ui/webui/resources/cr_components/composebox/contextual_action_menu.ts
Line 323, Patchset 9 (Latest): if (rect.width === 0 && rect.height === 0 && rect.top === 0 &&
rect.left === 0) {
this.close();
return;
}
Ananya Seelam . unresolved

if the position is gets set to (0,0), this would cause the menu to close even when it should stay open right?

Open in Gerrit

Related details

Attention is currently required from:
  • James Leung
  • Wenhu Cheng
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Icddc6c0c670594fe7134a6bfd71d1c2e8139786c
Gerrit-Change-Number: 8061569
Gerrit-PatchSet: 9
Gerrit-Owner: Wenhu Cheng <wen...@google.com>
Gerrit-Reviewer: Ananya Seelam <ananya...@google.com>
Gerrit-Reviewer: James Leung <james...@google.com>
Gerrit-Reviewer: Wenhu Cheng <wen...@google.com>
Gerrit-Attention: Wenhu Cheng <wen...@google.com>
Gerrit-Attention: James Leung <james...@google.com>
Gerrit-Comment-Date: Wed, 08 Jul 2026 15:04:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Wenhu Cheng (Gerrit)

unread,
2:10 PM (4 hours ago) 2:10 PM
to Chromium LUCI CQ, Ananya Seelam, chromium...@chromium.org, oshima...@chromium.org
Attention needed from Ananya Seelam

Wenhu Cheng added 3 comments

Hi wenhu! I patched this CL and tested on the arm where the realbox stays open and I'm noticing the context menu is closing after first tab selection: https://screencast.googleplex.com/cast/NjUwMTUyODQ3ODE1NDc1MnwyYTk2NDc4Mi0wMg

we might be closing it when it shouldn't be closed.

Wenhu Cheng

Done

Line 36, Patchset 9:
Ananya Seelam . resolved

nit: can you also add a screencast with context management disabled. thank you!!

Wenhu Cheng

Done

File ui/webui/resources/cr_components/composebox/contextual_action_menu.ts
Line 323, Patchset 9: if (rect.width === 0 && rect.height === 0 && rect.top === 0 &&

rect.left === 0) {
this.close();
return;
}
Ananya Seelam . resolved

if the position is gets set to (0,0), this would cause the menu to close even when it should stay open right?

Wenhu Cheng

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ananya Seelam
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Icddc6c0c670594fe7134a6bfd71d1c2e8139786c
    Gerrit-Change-Number: 8061569
    Gerrit-PatchSet: 11
    Gerrit-Owner: Wenhu Cheng <wen...@google.com>
    Gerrit-Reviewer: Ananya Seelam <ananya...@google.com>
    Gerrit-Reviewer: Wenhu Cheng <wen...@google.com>
    Gerrit-Attention: Ananya Seelam <ananya...@google.com>
    Gerrit-Comment-Date: Wed, 08 Jul 2026 18:09:58 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Ananya Seelam <ananya...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Ananya Seelam (Gerrit)

    unread,
    3:41 PM (2 hours ago) 3:41 PM
    to Wenhu Cheng, Chromium LUCI CQ, chromium...@chromium.org, oshima...@chromium.org
    Attention needed from Wenhu Cheng

    Ananya Seelam voted and added 1 comment

    Votes added by Ananya Seelam

    Code-Review+1

    1 comment

    Patchset-level comments
    File-level comment, Patchset 11 (Latest):
    Ananya Seelam . resolved

    lgtm!! thanks for doing extra testing!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Wenhu Cheng
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Icddc6c0c670594fe7134a6bfd71d1c2e8139786c
    Gerrit-Change-Number: 8061569
    Gerrit-PatchSet: 11
    Gerrit-Owner: Wenhu Cheng <wen...@google.com>
    Gerrit-Reviewer: Ananya Seelam <ananya...@google.com>
    Gerrit-Reviewer: Wenhu Cheng <wen...@google.com>
    Gerrit-Attention: Wenhu Cheng <wen...@google.com>
    Gerrit-Comment-Date: Wed, 08 Jul 2026 19:41:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Wenhu Cheng (Gerrit)

    unread,
    4:09 PM (2 hours ago) 4:09 PM
    to Ananya Seelam, Chromium LUCI CQ, chromium...@chromium.org, oshima...@chromium.org

    Wenhu Cheng voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Icddc6c0c670594fe7134a6bfd71d1c2e8139786c
    Gerrit-Change-Number: 8061569
    Gerrit-PatchSet: 11
    Gerrit-Owner: Wenhu Cheng <wen...@google.com>
    Gerrit-Reviewer: Ananya Seelam <ananya...@google.com>
    Gerrit-Reviewer: Wenhu Cheng <wen...@google.com>
    Gerrit-Comment-Date: Wed, 08 Jul 2026 20:09:23 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    4:55 PM (1 hour ago) 4:55 PM
    to Wenhu Cheng, Ananya Seelam, chromium...@chromium.org, oshima...@chromium.org

    Chromium LUCI CQ submitted the change

    Change information

    Commit message:
    [Context-Input] Prevent context menu jumping during tab selection

    When selecting tabs in the flyout, the context menu would previously
    jump around the screen or momentarily teleport to (0,0).

    This occurred because of two main reasons:
    1. Tab selection updates `tabSuggestions` which previously triggered a full `showAt()` call instead of `reposition_()`. This discarded the menu's locked alignment configuration.

    2. Measuring `getBoundingClientRect()` before browser layout completed
    during Realbox-to-Composebox transitions returned all zeros (0,0).

    This CL resolves the context menu positioning issues by:
    - Enforcing alignment persistence: Prioritizing `reposition_()` over `showAt()` when `tabSuggestions` are updated and the flyout is open. This prevents directional flipping when tab lists re-order.
    - Synchronizing with browser layout: Deferring the menu opening by one
    animation frame (`requestAnimationFrame`) during container transitions to guarantee accurate physical dimension measurements.
    - Adding layout safeguards: Aborting the positioning updates if the
    anchor element's bounding client rect measures as exactly 0x0 (unlaid-out or detached DOM elements).

    Before fix:
    Bug is reproducible when realbox keeps menu open on tab select enabled
    https://screencast.googleplex.com/cast/NTM4MTQxMDY5NjIwMDE5Mnw3MmNmYmQyYy1iNQ

    After fix:
    Screencast to verify fix realbox keeps menu open on tab select enabled
    https://screencast.googleplex.com/cast/NTUwNjI1MjE0OTg4Mjg4MHw1NGJlMTVmNC1iNQ

    Screencast to verify no side effect on Enabled/realbox closes menu on tab select enabled/disabled
    https://screencast.googleplex.com/cast/NjA4MTQ4MTQ4MTkxMjMyMHw2NjkzN2MxYi04OQ
    https://screencast.googleplex.com/cast/NTExODU5NzI5MzY3MDQwMHwxN2NkODU5ZC1hZA
    https://screencast.googleplex.com/cast/NDYwNjkwODU0NjY3ODc4NHxlNmYzZjM0NC0zNw


    Fixed: b:532192485
    Change-Id: Icddc6c0c670594fe7134a6bfd71d1c2e8139786c
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8061569
    Commit-Queue: Wenhu Cheng <wen...@google.com>
    Reviewed-by: Ananya Seelam <ananya...@google.com>
    Cr-Commit-Position: refs/heads/main@{#1659039}
    Files:
    • M chrome/test/data/webui/cr_components/composebox/contextual_action_menu_test.ts
    • M ui/webui/resources/cr_components/composebox/contextual_action_menu.ts
    • M ui/webui/resources/cr_components/composebox/contextual_entrypoint_and_menu.ts
    Change size: M
    Delta: 3 files changed, 52 insertions(+), 5 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Ananya Seelam
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Icddc6c0c670594fe7134a6bfd71d1c2e8139786c
    Gerrit-Change-Number: 8061569
    Gerrit-PatchSet: 12
    Gerrit-Owner: Wenhu Cheng <wen...@google.com>
    Gerrit-Reviewer: Ananya Seelam <ananya...@google.com>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Wenhu Cheng <wen...@google.com>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages