Skip to content

Commit c24ec63

Browse files
committed
prevent stack trace entries in console UI from being inline so a new line is always added between them and other printed elements
1 parent a7e4f59 commit c24ec63

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

front_end/panels/console/ConsoleViewMessage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
989989
// The Exceptiondetails include script IDs for stack frames, which allows more accurate
990990
// linking.
991991
const formatErrorStack =
992-
async(errorObj: SDK.RemoteObject.RemoteObject, includeCausedByPrefix = false): Promise<void> => {
992+
async(errorObj: SDK.RemoteObject.RemoteObject, includeCausedByPrefix: boolean): Promise<void> => {
993993
const error = SDK.RemoteObject.RemoteError.objectAsError(errorObj);
994994
const [details, cause] = await Promise.all([error.exceptionDetails(), error.cause()]);
995995
let errorElement = this.tryFormatAsError(error.errorStack, details);
@@ -1015,7 +1015,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
10151015
}
10161016
};
10171017

1018-
this.#formatErrorStackPromiseForTest = formatErrorStack(output);
1018+
this.#formatErrorStackPromiseForTest = formatErrorStack(output, /* includeCausedByPrefix */ false);
10191019

10201020
return result;
10211021
}

front_end/panels/console/consoleView.css

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444
flex: 1 1 auto;
4545
}
4646

47+
.console-sidebar-levels-info {
48+
margin-left: var(--sys-size-3);
49+
width: var(--sys-size-8);
50+
height: var(--sys-size-8);
51+
}
52+
4753
#console-issues-counter {
4854
margin-top: 0;
4955
}
@@ -358,10 +364,6 @@
358364
word-break: break-all;
359365
}
360366

361-
#console-messages .devtools-link.ignore-list-link {
362-
opacity: 60%;
363-
}
364-
365367
#console-messages .devtools-link:focus-visible {
366368
background-color: transparent;
367369
}
@@ -393,28 +395,33 @@
393395
word-break: break-all;
394396
}
395397

396-
.formatted-stack-frame:has(.ignore-list-link) {
397-
display: var(--display-ignored-formatted-stack-frame);
398-
opacity: 60%;
398+
.formatted-stack-frame {
399+
display: var(--display-formatted-stack-frame-default);
399400

400-
/* Subsequent builtin stack frames are also treated as ignored */
401-
& + .formatted-builtin-stack-frame {
401+
&:has(.ignore-list-link) {
402402
display: var(--display-ignored-formatted-stack-frame);
403403
opacity: 60%;
404+
405+
/* Subsequent builtin stack frames are also treated as ignored */
406+
& + .formatted-builtin-stack-frame {
407+
display: var(--display-ignored-formatted-stack-frame);
408+
opacity: 60%;
409+
}
404410
}
405411
}
406412
}
407413

408414
.console-message-stack-trace-wrapper {
409415
--override-display-stack-preview-toggle-link: none;
416+
--display-formatted-stack-frame-default: block;
410417

411418
flex: 1 1 auto;
412419
display: flex;
413420
flex-direction: column;
414421
align-items: stretch;
415422

416423
&:has(div > .stack-preview-container.show-hidden-rows) {
417-
--display-ignored-formatted-stack-frame: inherit;
424+
--display-ignored-formatted-stack-frame: var(--display-formatted-stack-frame-default);
418425
}
419426

420427
&:has(.formatted-stack-frame .ignore-list-link):has(.formatted-stack-frame .devtools-link:not(.ignore-list-link)) {

0 commit comments

Comments
 (0)