Commit 02ca36f
RPP-AI: support origins in Performance AI assistance and auto-selection
This CL introduces the ability to calculate the origin for a given event
from the timeline that has been selected. The side-effect of this is now
as you click around the timeline on events, the AI Assistance panel will
update with the new event that you clicked on. Before this CL you had to
explicitly right click on an event to access the AI Assistance with the
selected event.
Some decisions that were made as part of this CL:
1. We calculate the origin from the non-resolved URL, which in this
context means ignoring sourcemaps, and using the raw URL from the
trace. This is on purpose because from a security perspective, we
care about the URL it was served from, not if locally on the user's
machine it was `node_modules/blah...`.
2. I take the origin from the _selected node_ in the call tree, not the
root node. I could be argued on this, but most of the time the root
node is something like a "Task" which does not have a URL assocated
with it. But if you pick the "Evaluate Script" below it, that has a
useful URL we can work with.
3. For events without a URL, we calculate a uuid which is unique and
deterministic, thus ensuring that each event without a URL is treated
as its own origin, so we don't mistakenly bucket up events without
exact URLs into the same origin and risk any security concerns.
4. We decided not to cache the AICallTree creation. We find it unlikely
that users will go back and forth on an event multiple times and the
work isn't so expensive to be of concern.
Fixed: 390371494
Change-Id: Ib77a6c45cca7190e08f0ac4b2f5fe8e462c2ba3f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6178276
Commit-Queue: Jack Franklin <[email protected]>
Reviewed-by: Alex Rudenko <[email protected]>
Reviewed-by: Paul Irish <[email protected]>1 parent 12b4c09 commit 02ca36f
File tree
3 files changed
+55
-2
lines changed- front_end/panels
- ai_assistance/agents
- timeline
3 files changed
+55
-2
lines changedLines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
30 | 55 | | |
31 | 56 | | |
32 | 57 | | |
| |||
Lines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
133 | | - | |
134 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
135 | 153 | | |
136 | 154 | | |
137 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1263 | 1263 | | |
1264 | 1264 | | |
1265 | 1265 | | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
1266 | 1276 | | |
1267 | 1277 | | |
1268 | 1278 | | |
| |||
0 commit comments