Migrate DOMBreakpointsSidebarPane according to ui eng vision [devtools/devtools-frontend : main]

0 views
Skip to first unread message

Kim-Anh Tran (Gerrit)

unread,
4:00 AM (11 hours ago) 4:00 AM
to Simon Zünd, Devtools-frontend LUCI CQ, devtools-rev...@chromium.org
Attention needed from Simon Zünd

Kim-Anh Tran added 1 comment

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Kim-Anh Tran . resolved

Hi Simon, ui eng migration, ptal! The web test needs to be updated, I'll disable it as soon as this CL is approved.

Open in Gerrit

Related details

Attention is currently required from:
  • Simon Zünd
Submit Requirements:
  • requirement 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: devtools/devtools-frontend
Gerrit-Branch: main
Gerrit-Change-Id: I8b0c981d66f7ebf4b07a3ae229e2a36cf44e7415
Gerrit-Change-Number: 7562072
Gerrit-PatchSet: 6
Gerrit-Owner: Kim-Anh Tran <kim...@chromium.org>
Gerrit-Reviewer: Kim-Anh Tran <kim...@chromium.org>
Gerrit-Reviewer: Simon Zünd <szu...@chromium.org>
Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Attention: Simon Zünd <szu...@chromium.org>
Gerrit-Comment-Date: Tue, 03 Mar 2026 09:00:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Simon Zünd (Gerrit)

unread,
4:24 AM (10 hours ago) 4:24 AM
to Kim-Anh Tran, Devtools-frontend LUCI CQ, devtools-rev...@chromium.org
Attention needed from Kim-Anh Tran

Simon Zünd voted and added 9 comments

Votes added by Simon Zünd

Code-Review+1

9 comments

Patchset-level comments
Simon Zünd . resolved

lgtm overall but with some suggestions

File front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.test.ts
Line 16, Patchset 6 (Latest):describeWithEnvironment('DOMBreakpointsSidebarPane', () => {
Simon Zünd . unresolved

nit: Use `describe` and call `setupLocaleHooks` instead.

Line 134, Patchset 6 (Latest):describeWithMockConnection('DOMBreakpointsSidebarPane', () => {
Simon Zünd . unresolved

nit: Use `describe` and call `setupRuntimeHooks()` and `setupSettingsHooks()` and `setupLocaleHooks()` instead.

File front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts
Line 110, Patchset 6 (Latest): breakpoints: SDK.DOMDebuggerModel.DOMBreakpoint[];
Simon Zünd . unresolved

Alternative: Instead of passing the raw SDK `DOMBreakpoint` here we could have a small wrapper:

```
export interface Breakpoint {
breakpoint: SDK.DOMDebuggerModel.DOMBreakpoint;
label: string;
isHighlighted: boolean;
isFocused: boolean;
}
```

No strong opinion though if you prefer to handle this logic in the view function.

Line 129, Patchset 6 (Latest): <div class=${hasBreakpoints ? 'hidden' : 'placeholder'}>
Simon Zünd . unresolved

Why use `hidden` at all? Do tests assume the old DOM structure? Why not

```
${hasBreakpoints
? html`<div class="placeholder">...</div>`
: html`<div class="brekapoint-list">...</div>`
}
```
Line 140, Patchset 6 (Latest): const breakpointTypeLabel = BreakpointTypeLabels.get(breakpoint.type);
Simon Zünd . unresolved

nit: You could shortcut this: `BreakpointTypeLabels.get(breakpoint.type)?.() ?? ''`

Line 183, Patchset 6 (Latest): private readonly breakpoints: SDK.DOMDebuggerModel.DOMBreakpoint[] = [];
private highlightedBreakpoint: SDK.DOMDebuggerModel.DOMBreakpoint|null = null;
private focusedBreakpoint: SDK.DOMDebuggerModel.DOMBreakpoint|null = null;
private readonly view: View;
Simon Zünd . unresolved

nit: Lets keep private fields here and not move to the `private` keyword.

Line 222, Patchset 6 (Latest): if (this.focusedBreakpoint && !this.breakpoints.includes(this.focusedBreakpoint)) {
this.focusedBreakpoint = null;
}
if (!this.focusedBreakpoint && this.breakpoints.length > 0) {
this.focusedBreakpoint = this.breakpoints[0];
}
Simon Zünd . unresolved

Having this logic in `performUpdate` is odd. Any chance we can move this into the the `set` accessor `focusedBreakpoint` or handle these when we modify `this.breakpoints`?

Line 330, Patchset 6 (Latest): update(): void {
Simon Zünd . unresolved

This function is brittle because every exit path needs to remember to call `this.requestUpdate`. I think a better approach would be to have a set accessor for `highlightedBreakpoint` and `focusedBreakpoint` that calls `requestUpdate` when set automatically.

Open in Gerrit

Related details

Attention is currently required from:
  • Kim-Anh Tran
Submit Requirements:
  • requirement 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: devtools/devtools-frontend
Gerrit-Branch: main
Gerrit-Change-Id: I8b0c981d66f7ebf4b07a3ae229e2a36cf44e7415
Gerrit-Change-Number: 7562072
Gerrit-PatchSet: 6
Gerrit-Owner: Kim-Anh Tran <kim...@chromium.org>
Gerrit-Reviewer: Kim-Anh Tran <kim...@chromium.org>
Gerrit-Reviewer: Simon Zünd <szu...@chromium.org>
Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Attention: Kim-Anh Tran <kim...@chromium.org>
Gerrit-Comment-Date: Tue, 03 Mar 2026 09:24:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Kim-Anh Tran (Gerrit)

unread,
11:05 AM (4 hours ago) 11:05 AM
to Simon Zünd, Devtools-frontend LUCI CQ, devtools-rev...@chromium.org
Attention needed from Simon Zünd

Kim-Anh Tran added 9 comments

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Kim-Anh Tran . resolved

Hi Simon, I've updated the code, ptal 😊!

File front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.test.ts
Line 16, Patchset 6:describeWithEnvironment('DOMBreakpointsSidebarPane', () => {
Simon Zünd . resolved

nit: Use `describe` and call `setupLocaleHooks` instead.

Kim-Anh Tran

Done

Line 134, Patchset 6:describeWithMockConnection('DOMBreakpointsSidebarPane', () => {
Simon Zünd . resolved

nit: Use `describe` and call `setupRuntimeHooks()` and `setupSettingsHooks()` and `setupLocaleHooks()` instead.

Kim-Anh Tran

Ah, noted, thanks!

File front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts
Line 110, Patchset 6: breakpoints: SDK.DOMDebuggerModel.DOMBreakpoint[];
Simon Zünd . resolved

Alternative: Instead of passing the raw SDK `DOMBreakpoint` here we could have a small wrapper:

```
export interface Breakpoint {
breakpoint: SDK.DOMDebuggerModel.DOMBreakpoint;
label: string;
isHighlighted: boolean;
isFocused: boolean;
}
```

No strong opinion though if you prefer to handle this logic in the view function.

Kim-Anh Tran

Done

Line 129, Patchset 6: <div class=${hasBreakpoints ? 'hidden' : 'placeholder'}>
Simon Zünd . resolved

Why use `hidden` at all? Do tests assume the old DOM structure? Why not

```
${hasBreakpoints
? html`<div class="placeholder">...</div>`
: html`<div class="brekapoint-list">...</div>`
}
```
Kim-Anh Tran

TBH, it is a bit long ago that I worked on the first version, and it indeed was connected to tests, but I don't remember the details anymore. In any case, we can remove that now! Thanks!

Line 140, Patchset 6: const breakpointTypeLabel = BreakpointTypeLabels.get(breakpoint.type);
Simon Zünd . resolved

nit: You could shortcut this: `BreakpointTypeLabels.get(breakpoint.type)?.() ?? ''`

Kim-Anh Tran

Done

Line 183, Patchset 6: private readonly breakpoints: SDK.DOMDebuggerModel.DOMBreakpoint[] = [];

private highlightedBreakpoint: SDK.DOMDebuggerModel.DOMBreakpoint|null = null;
private focusedBreakpoint: SDK.DOMDebuggerModel.DOMBreakpoint|null = null;
private readonly view: View;
Simon Zünd . resolved

nit: Lets keep private fields here and not move to the `private` keyword.

Kim-Anh Tran

Ah sorry, missed this, thanks for pointing out!

Line 222, Patchset 6: if (this.focusedBreakpoint && !this.breakpoints.includes(this.focusedBreakpoint)) {

this.focusedBreakpoint = null;
}
if (!this.focusedBreakpoint && this.breakpoints.length > 0) {
this.focusedBreakpoint = this.breakpoints[0];
}
Simon Zünd . unresolved

Having this logic in `performUpdate` is odd. Any chance we can move this into the the `set` accessor `focusedBreakpoint` or handle these when we modify `this.breakpoints`?

Kim-Anh Tran

Hmm you're right, I've added a new function now that synchronizes the focused breakpoint, ptal!

Line 330, Patchset 6: update(): void {
Simon Zünd . resolved

This function is brittle because every exit path needs to remember to call `this.requestUpdate`. I think a better approach would be to have a set accessor for `highlightedBreakpoint` and `focusedBreakpoint` that calls `requestUpdate` when set automatically.

Kim-Anh Tran

Ahh good idea. I've added setters, but I'm keeping the access through #focusedBreakpoint. Let me know if you want me to add getters too.

Open in Gerrit

Related details

Attention is currently required from:
  • Simon Zünd
Submit Requirements:
  • requirement 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: devtools/devtools-frontend
Gerrit-Branch: main
Gerrit-Change-Id: I8b0c981d66f7ebf4b07a3ae229e2a36cf44e7415
Gerrit-Change-Number: 7562072
Gerrit-PatchSet: 9
Gerrit-Owner: Kim-Anh Tran <kim...@chromium.org>
Gerrit-Reviewer: Kim-Anh Tran <kim...@chromium.org>
Gerrit-Reviewer: Simon Zünd <szu...@chromium.org>
Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Attention: Simon Zünd <szu...@chromium.org>
Gerrit-Comment-Date: Tue, 03 Mar 2026 16:05:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Simon Zünd <szu...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages