Skip to content

Commit e87564a

Browse files
authored
prevent stack trace entries in console UI from being inline so a new line is always added between them and other printed elements (#198)
1 parent 9215667 commit e87564a

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
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: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -393,28 +393,33 @@
393393
word-break: break-all;
394394
}
395395

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

400-
/* Subsequent builtin stack frames are also treated as ignored */
401-
& + .formatted-builtin-stack-frame {
399+
&:has(.ignore-list-link) {
402400
display: var(--display-ignored-formatted-stack-frame);
403401
opacity: 60%;
402+
403+
/* Subsequent builtin stack frames are also treated as ignored */
404+
& + .formatted-builtin-stack-frame {
405+
display: var(--display-ignored-formatted-stack-frame);
406+
opacity: 60%;
407+
}
404408
}
405409
}
406410
}
407411

408412
.console-message-stack-trace-wrapper {
409413
--override-display-stack-preview-toggle-link: none;
414+
--display-formatted-stack-frame-default: block;
410415

411416
flex: 1 1 auto;
412417
display: flex;
413418
flex-direction: column;
414419
align-items: stretch;
415420

416421
&:has(div > .stack-preview-container.show-hidden-rows) {
417-
--display-ignored-formatted-stack-frame: inherit;
422+
--display-ignored-formatted-stack-frame: var(--display-formatted-stack-frame-default);
418423
}
419424

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

0 commit comments

Comments
 (0)