Implement ScrollToolJavaScriptFeature. [chromium/src : main]

0 views
Skip to first unread message

Kirubel Aklilu (Gerrit)

unread,
Apr 3, 2026, 2:16:21 PM (2 days ago) Apr 3
to AyeAye, Ginny Huang, Chromium LUCI CQ, ios-revie...@chromium.org, marq+...@chromium.org, bling-ai-foundatio...@google.com, ios-r...@chromium.org
Attention needed from Ginny Huang

Kirubel Aklilu added 3 comments

File ios/chrome/browser/intelligence/actor/tools/model/scroll_tool_java_script_feature.h
Line 43, Patchset 1: void ExecuteScrollAction(
Ginny Huang . unresolved

Nit: Would you mind elaborate the comments? Until I look into scroll_tool.ts, I keep wondering whether this executes as a "scroll from" or "scroll to" action.

The comments on `Scroll` and `ScrollTo` could use some elaboration as well. It would be nice to distinguish between "scrolling on an **already scrollable** element" and "scrolling something (that might be on out-of-frame on a parent scroll view) into visibility."

Kirubel Aklilu

I elaborated a bit more here in the helper comment. I considered writing more in the main method comments but I didn't want to cover implementation in depth there
(e.g. the target may be scrollable, or might not exist, etc).

IIRC function comments are supposed to just explain the contract, not the details. WDYT?

File ios/chrome/browser/intelligence/actor/tools/model/scroll_tool_java_script_feature.mm
Line 42, Patchset 1: CHECK(action.has_target());
Ginny Huang . resolved

Please handle cases where there is not a target specified.

Kirubel Aklilu

Thanks for catching this! I've added a TODO to handle this in a followup since we'll need to update both the JS and this class to handle when the target it omitted.

Line 64, Patchset 1: CHECK(target.has_coordinate() ||
(target.has_content_node_id() && target.has_document_identifier()));
Ginny Huang . resolved

I'm starting to think whether we should have performed `CHECK` on the `action` object or anything from it. IIUC the `action` object is provided by Gemini, so performing `CHECK` on this might violate this guideline: https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/c++/checks.md#failures-beyond-chromium_s-control

Maybe we should just return an `ActorToolError` for these cases?

Kirubel Aklilu
Open in Gerrit

Related details

Attention is currently required from:
  • Ginny Huang
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: I726919942232c46b421918410b926cd26a6a6964
Gerrit-Change-Number: 7727390
Gerrit-PatchSet: 4
Gerrit-Owner: Kirubel Aklilu <kak...@chromium.org>
Gerrit-Reviewer: Ginny Huang <ginny...@chromium.org>
Gerrit-Reviewer: Kirubel Aklilu <kak...@chromium.org>
Gerrit-Attention: Ginny Huang <ginny...@chromium.org>
Gerrit-Comment-Date: Fri, 03 Apr 2026 18:16:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ginny Huang <ginny...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Ginny Huang (Gerrit)

unread,
Apr 3, 2026, 2:46:54 PM (2 days ago) Apr 3
to Kirubel Aklilu, AyeAye, Chromium LUCI CQ, ios-revie...@chromium.org, marq+...@chromium.org, bling-ai-foundatio...@google.com, ios-r...@chromium.org
Attention needed from Kirubel Aklilu

Ginny Huang voted and added 2 comments

Votes added by Ginny Huang

Code-Review+1

2 comments

File ios/chrome/browser/intelligence/actor/tools/model/scroll_tool_java_script_feature.h
Line 43, Patchset 1: void ExecuteScrollAction(
Ginny Huang . unresolved

Nit: Would you mind elaborate the comments? Until I look into scroll_tool.ts, I keep wondering whether this executes as a "scroll from" or "scroll to" action.

The comments on `Scroll` and `ScrollTo` could use some elaboration as well. It would be nice to distinguish between "scrolling on an **already scrollable** element" and "scrolling something (that might be on out-of-frame on a parent scroll view) into visibility."

Kirubel Aklilu

I elaborated a bit more here in the helper comment. I considered writing more in the main method comments but I didn't want to cover implementation in depth there
(e.g. the target may be scrollable, or might not exist, etc).

IIRC function comments are supposed to just explain the contract, not the details. WDYT?

Ginny Huang

LGTM to the current version of `ExecuteScrollAction`. I still think `Scroll` and `ScrollTo` should be better differentiated, but up to you :)

IIRC function comments are supposed to just explain the contract, not the details. WDYT?

Agree but we should still "explain the contract." Right now the difference between "Scroll" (I personally think its been given a bad name by the designer of actions_data) and "ScrollTo" is too far from self-explanatory for people without context. IMO, to unwitting debuggers, the difference between "Attempts to scroll an element in the given WebFrame." and "Attempts to scroll the given WebFrame to an element." looks a bit subtle 🤔

File ios/chrome/browser/intelligence/actor/tools/model/scroll_tool_java_script_feature.mm
Line 44, Patchset 4 (Latest): // TODO: crbug.com/472289079 - Add support for ScrollAction with the target
Ginny Huang . resolved

TIL... thanks!

(We usually do `TODO(crbug.com/123123123): Thing to do.` but if it passes presubmit check, it must be good to use!)

Open in Gerrit

Related details

Attention is currently required from:
  • Kirubel Aklilu
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: I726919942232c46b421918410b926cd26a6a6964
    Gerrit-Change-Number: 7727390
    Gerrit-PatchSet: 4
    Gerrit-Owner: Kirubel Aklilu <kak...@chromium.org>
    Gerrit-Reviewer: Ginny Huang <ginny...@chromium.org>
    Gerrit-Reviewer: Kirubel Aklilu <kak...@chromium.org>
    Gerrit-Attention: Kirubel Aklilu <kak...@chromium.org>
    Gerrit-Comment-Date: Fri, 03 Apr 2026 18:46:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Kirubel Aklilu <kak...@chromium.org>
    Comment-In-Reply-To: Ginny Huang <ginny...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kirubel Aklilu (Gerrit)

    unread,
    Apr 3, 2026, 3:29:59 PM (2 days ago) Apr 3
    to Ginny Huang, AyeAye, Chromium LUCI CQ, ios-revie...@chromium.org, marq+...@chromium.org, bling-ai-foundatio...@google.com, ios-r...@chromium.org

    Kirubel Aklilu added 1 comment

    File ios/chrome/browser/intelligence/actor/tools/model/scroll_tool_java_script_feature.h
    Line 43, Patchset 1: void ExecuteScrollAction(
    Ginny Huang . resolved

    Nit: Would you mind elaborate the comments? Until I look into scroll_tool.ts, I keep wondering whether this executes as a "scroll from" or "scroll to" action.

    The comments on `Scroll` and `ScrollTo` could use some elaboration as well. It would be nice to distinguish between "scrolling on an **already scrollable** element" and "scrolling something (that might be on out-of-frame on a parent scroll view) into visibility."

    Kirubel Aklilu

    I elaborated a bit more here in the helper comment. I considered writing more in the main method comments but I didn't want to cover implementation in depth there
    (e.g. the target may be scrollable, or might not exist, etc).

    IIRC function comments are supposed to just explain the contract, not the details. WDYT?

    Ginny Huang

    LGTM to the current version of `ExecuteScrollAction`. I still think `Scroll` and `ScrollTo` should be better differentiated, but up to you :)

    IIRC function comments are supposed to just explain the contract, not the details. WDYT?

    Agree but we should still "explain the contract." Right now the difference between "Scroll" (I personally think its been given a bad name by the designer of actions_data) and "ScrollTo" is too far from self-explanatory for people without context. IMO, to unwitting debuggers, the difference between "Attempts to scroll an element in the given WebFrame." and "Attempts to scroll the given WebFrame to an element." looks a bit subtle 🤔

    Kirubel Aklilu

    I agree that the naming could be confusing and that the prior comments only differed subtly. I elaborated a bit more in the latest comment and I think it should make it clearer.

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not 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: I726919942232c46b421918410b926cd26a6a6964
      Gerrit-Change-Number: 7727390
      Gerrit-PatchSet: 5
      Gerrit-Owner: Kirubel Aklilu <kak...@chromium.org>
      Gerrit-Reviewer: Ginny Huang <ginny...@chromium.org>
      Gerrit-Reviewer: Kirubel Aklilu <kak...@chromium.org>
      Gerrit-Comment-Date: Fri, 03 Apr 2026 19:29:52 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Kirubel Aklilu (Gerrit)

      unread,
      Apr 3, 2026, 3:30:19 PM (2 days ago) Apr 3
      to Ginny Huang, AyeAye, Chromium LUCI CQ, ios-revie...@chromium.org, marq+...@chromium.org, bling-ai-foundatio...@google.com, ios-r...@chromium.org

      Kirubel Aklilu voted Commit-Queue+2

      Commit-Queue+2
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not 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: I726919942232c46b421918410b926cd26a6a6964
      Gerrit-Change-Number: 7727390
      Gerrit-PatchSet: 5
      Gerrit-Owner: Kirubel Aklilu <kak...@chromium.org>
      Gerrit-Reviewer: Ginny Huang <ginny...@chromium.org>
      Gerrit-Reviewer: Kirubel Aklilu <kak...@chromium.org>
      Gerrit-Comment-Date: Fri, 03 Apr 2026 19:30:13 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Kirubel Aklilu (Gerrit)

      unread,
      Apr 3, 2026, 3:33:37 PM (2 days ago) Apr 3
      to Gauthier Ambard, Ginny Huang, AyeAye, Chromium LUCI CQ, ios-revie...@chromium.org, marq+...@chromium.org, bling-ai-foundatio...@google.com, ios-r...@chromium.org
      Attention needed from Gauthier Ambard

      Kirubel Aklilu added 1 comment

      Patchset-level comments
      File-level comment, Patchset 5 (Latest):
      Kirubel Aklilu . resolved

      gambard@, can you review the change to ios/chrome/browser/web/model/chrome_web_client.mm?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Gauthier Ambard
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not 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: I726919942232c46b421918410b926cd26a6a6964
      Gerrit-Change-Number: 7727390
      Gerrit-PatchSet: 5
      Gerrit-Owner: Kirubel Aklilu <kak...@chromium.org>
      Gerrit-Reviewer: Gauthier Ambard <gam...@chromium.org>
      Gerrit-Reviewer: Ginny Huang <ginny...@chromium.org>
      Gerrit-Reviewer: Kirubel Aklilu <kak...@chromium.org>
      Gerrit-Attention: Gauthier Ambard <gam...@chromium.org>
      Gerrit-Comment-Date: Fri, 03 Apr 2026 19:33:27 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Kirubel Aklilu (Gerrit)

      unread,
      Apr 3, 2026, 3:47:15 PM (2 days ago) Apr 3
      to Rohit Rao, Ginny Huang, AyeAye, Chromium LUCI CQ, ios-revie...@chromium.org, marq+...@chromium.org, bling-ai-foundatio...@google.com, ios-r...@chromium.org
      Attention needed from Rohit Rao

      Kirubel Aklilu added 1 comment

      Patchset-level comments
      Kirubel Aklilu . resolved

      rohitrao@, can you review the change to ios/chrome/browser/web/model/chrome_web_client.mm?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Rohit Rao
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not 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: I726919942232c46b421918410b926cd26a6a6964
      Gerrit-Change-Number: 7727390
      Gerrit-PatchSet: 5
      Gerrit-Owner: Kirubel Aklilu <kak...@chromium.org>
      Gerrit-Reviewer: Ginny Huang <ginny...@chromium.org>
      Gerrit-Reviewer: Kirubel Aklilu <kak...@chromium.org>
      Gerrit-Reviewer: Rohit Rao <rohi...@chromium.org>
      Gerrit-Attention: Rohit Rao <rohi...@chromium.org>
      Gerrit-Comment-Date: Fri, 03 Apr 2026 19:47:07 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages