-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DT-340] Add stack trace on expanded event details #1128
[DT-340] Add stack trace on expanded event details #1128
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Should we make those equal height? /cc @canvanooo |
@@ -25,15 +25,27 @@ | |||
export let inline = false; | |||
|
|||
const { workflow, namespace } = $page.params; | |||
$: codeBlockValue = getCodeBlockValue(value); | |||
$: stackTrace = | |||
codeBlockValue?.stackTrace || codeBlockValue?.cause?.stackTrace; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it makes sense to just recursively iterate down the object and look for a stackTrace
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could do that instead! I was hoping we could avoid that as it looks like there aren't that many places it could be, but I definitely could have missed some possibilities 😅
> | ||
<div> | ||
<p class="text-sm">{format(key)}</p> | ||
<CodeBlock content={codeBlockValue} class="h-auto" {inline} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hot take: Should we move this logic into the CodeBlock
itself? And then the CodeBlock
looks at the JSON and figures out if it should recursively add another CodeBlock
. The advantage here would be that it would Just Work™ anywhere code blocks are found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make those equal height? /cc @canvanooo
@stevekinney yes good call out, same height would look better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted for keeping this logic here as I think we probably want to keep CodeBlock
as agnostic as possible. Open to discussion around how data dependent we want our Holocene components to be though!
I'm also not sure if we will always want that second code block (e.g. if the CodeBlock
is inline
).
What was changed
Conditionally renders a
Stack trace
code block next to theFailure
block on expanded event details if there is astackTrace
property.Why?
Easier to view the stack trace for debugging.
Checklist
Closes:
DT-340
How was this tested:
Stack trace
block if there is aFailure
on an event with astackTrace
propertyStack trace
block is responsiveStack trace
block if there is aFailure
on an event without astackTrace
property