Skip to content

Commit 7d43eb4

Browse files
Adriana IxbaDevtools-frontend LUCI CQ
authored andcommitted
[RPP] Avoid 3P tree expanding on keydown
drive by "Third party" case fix Bug:393420237 Change-Id: I74b5959904186d39be721087486f6971c180175c Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6217307 Reviewed-by: Adam Raine <[email protected]> Reviewed-by: Paul Irish <[email protected]> Commit-Queue: Adriana Ixba <[email protected]>
1 parent 12820ef commit 7d43eb4

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

front_end/panels/timeline/ThirdPartyTreeView.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const UIStrings = {
1818
/**
1919
*@description Title for the name of either 1st or 3rd Party entities.
2020
*/
21-
firstOrThirdPartyName: '1st / 3rd Party',
21+
firstOrThirdPartyName: '1st / 3rd party',
2222
/**
2323
*@description Title referencing transfer size.
2424
*/
@@ -47,6 +47,11 @@ export class ThirdPartyTreeViewWidget extends TimelineTreeView.TimelineTreeView
4747
this.element.setAttribute('jslog', `${VisualLogging.pane('third-party-tree').track({hover: true})}`);
4848
this.init();
4949
this.dataGrid.markColumnAsSortedBy('self', DataGrid.DataGrid.Order.Descending);
50+
/**
51+
* By default data grids always expand when arrowing.
52+
* For 3P table, we don't use this feature.
53+
*/
54+
this.dataGrid.expandNodesWhenArrowing = false;
5055
}
5156

5257
override buildTree(): Trace.Extras.TraceTree.Node {
@@ -74,6 +79,13 @@ export class ThirdPartyTreeViewWidget extends TimelineTreeView.TimelineTreeView
7479
this.groupingFunction());
7580
}
7681

82+
/**
83+
* Third party tree view doesn't require the select feature, as this expands the node.
84+
*/
85+
override selectProfileNode(): void {
86+
return;
87+
}
88+
7789
protected groupingFunction(): ((arg0: Trace.Types.Events.Event) => string)|null {
7890
return this.domainByEvent.bind(this);
7991
}

front_end/panels/timeline/TimelinePanel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ const UIStrings = {
333333
/**
334334
* @description Title for the Dim 3rd Parties checkbox.
335335
*/
336-
dimThirdParties: 'Dim 3rd Parties',
336+
dimThirdParties: 'Dim 3rd parties',
337337
/**
338338
* @description Description for the Dim 3rd Parties checkbox tooltip describing how 3rd parties are classified.
339339
*/

front_end/ui/legacy/components/data_grid/DataGrid.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
227227

228228
this.editing = false;
229229
this.selectedNode = null;
230-
this.expandNodesWhenArrowing = false;
230+
/** Currently by default this is true to expand nodes when arrowing with keyboard. */
231+
this.expandNodesWhenArrowing = true;
231232
this.setRootNode(new DataGridNode<T>());
232233

233234
this.setHasSelection(false);
@@ -1174,6 +1175,10 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
11741175
}
11751176
}
11761177
} else if (event.key === 'ArrowRight') {
1178+
/** We do not want to expand if this setting is disabled. */
1179+
if (!this.expandNodesWhenArrowing) {
1180+
return;
1181+
}
11771182
if (!this.selectedNode.revealed) {
11781183
this.selectedNode.reveal();
11791184
handled = true;

0 commit comments

Comments
 (0)