Skip to content

Commit 15d6638

Browse files
Connor ClarkDevtools-frontend LUCI CQ
authored andcommitted
[RPP] Add link to save trace docs
Fixed: 461811056 Change-Id: I7a8508d4f01b94db2bb04034d9b6f38e8e17e61e Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7169743 Reviewed-by: Paul Irish <[email protected]> Commit-Queue: Connor Clark <[email protected]> Auto-Submit: Connor Clark <[email protected]>
1 parent 51f0ad7 commit 15d6638

File tree

4 files changed

+34
-6
lines changed

4 files changed

+34
-6
lines changed

front_end/panels/timeline/components/ExportTraceOptions.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import * as Dialogs from '../../../ui/components/dialogs/dialogs.js';
1414
import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
1515
import * as UI from '../../../ui/legacy/legacy.js';
1616
import * as Lit from '../../../ui/lit/lit.js';
17+
import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
1718

1819
import exportTraceOptionsStyles from './exportTraceOptions.css.js';
1920

@@ -44,6 +45,10 @@ const UIStrings = {
4445
* @description Text for the compression option.
4546
*/
4647
shouldCompress: 'Compress with gzip',
48+
/**
49+
* @description Text for the explanation link
50+
*/
51+
explanation: 'Explanation',
4752
/**
4853
* @description Text for the save trace button
4954
*/
@@ -292,7 +297,16 @@ export class ExportTraceOptions extends HTMLElement {
292297
'script-source-maps',
293298
this.#includeSourceMapsCheckbox, i18nString(UIStrings.includeSourcemap), this.#state.includeSourceMaps): ''}
294299
${this.#renderCheckbox('compress-with-gzip', this.#shouldCompressCheckbox, i18nString(UIStrings.shouldCompress), this.#state.shouldCompress)}
295-
<div class='export-trace-options-row'><div class='export-trace-blank'></div><devtools-button
300+
<div class='export-trace-options-row export-trace-options-row-last'>
301+
<div class="export-trace-explanation">
302+
<x-link
303+
href="https://developer.chrome.com/docs/devtools/performance/save-trace"
304+
class=devtools-link
305+
jslog=${VisualLogging.link().track({click: true, keydown:'Enter|Space'}).context('save-trace-explanation')}>
306+
${i18nString(UIStrings.explanation)}
307+
</x-link>
308+
</div>
309+
<devtools-button
296310
class="setup-button"
297311
data-export-button
298312
@click=${this.#onExportClick.bind(this)}

front_end/panels/timeline/components/exportTraceOptions.css

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,22 @@
1919
height: 24px;
2020
}
2121

22-
.export-trace-blank {
22+
.export-trace-explanation {
2323
flex: 1;
24-
min-width: var(--sys-size-25)
24+
min-width: var(--sys-size-25);
2525
}
2626
}
2727

28+
.export-trace-options-row-last {
29+
align-items: center;
30+
}
31+
2832
.info-tooltip-container {
2933
max-width: var(--sys-size-28);
3034
white-space: normal;
3135
}
36+
37+
x-link {
38+
color: var(--sys-color-primary);
39+
text-decoration-line: underline;
40+
}

front_end/ui/visual_logging/KnownContextValues.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3218,6 +3218,7 @@ export const knownContextValues = new Set([
32183218
'save-image',
32193219
'save-name',
32203220
'save-player-info',
3221+
'save-trace-explanation',
32213222
'scale',
32223223
'scheme',
32233224
'sci',

test/e2e_non_hosted/performance/trace-app_test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,12 @@ async function searchAndClickOnStackTrace(
4242
await devToolsPage.raf();
4343
await devToolsPage.timeout(3000);
4444

45-
const topStackFrameLink =
46-
await devToolsPage.$('.devtools-link', await devToolsPage.$('.timeline-details-stack-values'));
45+
// Prefer stack trace if present.
46+
const containerEl =
47+
await devToolsPage.$('.timeline-details-stack-values') ?? await devToolsPage.$('.timeline-details-view');
48+
assert.isOk(containerEl);
49+
50+
const topStackFrameLink = await devToolsPage.$('.devtools-link', containerEl);
4751
assert.isOk(topStackFrameLink);
4852
assert.strictEqual(await topStackFrameLink.evaluate(el => el.textContent), expectedSourceLocation);
4953
await topStackFrameLink.click();
@@ -87,7 +91,7 @@ describe('trace_app.html', function() {
8791
await searchAndClickOnStackTrace(devToolsPage, 'pooopInTheTrace', 'pooopInTheTrace', '(index):399:26');
8892
});
8993

90-
it('linkifies to CSS resoures', async ({devToolsPage, inspectedPage}) => {
94+
it('linkifies to CSS resources', async ({devToolsPage, inspectedPage}) => {
9195
await loadTrace(devToolsPage, inspectedPage, 'performance/timeline/enhanced-trace.json.gz');
9296
await searchAndClickOnStackTrace(
9397
devToolsPage, 'fonts.googleapis.com', '/* latin */',

0 commit comments

Comments
 (0)