-
Notifications
You must be signed in to change notification settings - Fork 177
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
Stack Trace and Breadcrumbs table polish #112
Conversation
🦋 Changeset detectedLatest commit: ec9bf7b The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
4f53f2d
to
f5b4a61
Compare
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.
Mainly just style thoughts, two other things:
Do you think we can switch displayedTab
in the LogSidePanel to show the trace view if it's an exception by default? The parsed property tab is still kind of useful (mainly for us for debugging I suspect 😅) but the trace view is much better.
Minor scope creep, do you think you could add a ?? '[]'
fallback case in the <ExceptionSubpanel breadcrumbs={JSON.parse...
call? It looks like those properties might not exist sometimes.
I can create a follow up ticket otherwise.
tr { | ||
td { | ||
padding: 6px 12px; | ||
border-bottom: 1px solid $slate-950; |
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.
}; | ||
|
||
export const StacktraceRow = ({ row }: { row: Row<StacktraceFrame> }) => { | ||
const [lineContextOpen, setLineContextOpen] = React.useState(false); |
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 think it's a bit more intuitive to have the line context open (as it feels like the most helpful part!)
packages/app/src/LogSidePanel.tsx
Outdated
<Table | ||
hideHeader | ||
columns={stacktraceColumns} | ||
data={firstException.stacktrace?.frames ?? []} |
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.
packages/app/src/LogSidePanel.tsx
Outdated
</CollapsibleSection> | ||
|
||
<CollapsibleSection title="Breadcrumbs" initiallyCollapsed> |
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 also think it'd be nice if this was default open
header: 'Message', | ||
size: UNDEFINED_WIDTH, | ||
cell: ({ row }) => | ||
row.original.message || <span className="text-slate-500">Empty</span>, |
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 think it'd be nice here if can also make use of the fetch/xhr categories, as they currently show up as empty (maybe a follow up PR?) Here's a few examples if helpful of the data structure I see:
{
"category": "fetch",
"data": {
"method": "GET",
"status_code": 200,
"url": "http://localhost:8080/__nextjs_original-stack-frame"
},
"timestamp": 1700379487.918,
"type": "http"
}
{
"category": "xhr",
"data": {
"method": "POST",
"status_code": 200,
"url": "http://localhost:4318/v1/traces"
},
"timestamp": 1700379491.015,
"type": "http"
}
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'll do it in a separate pr
@@ -0,0 +1,333 @@ | |||
import * as React from 'react'; |
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'm curious how do we differentiate what should belong here vs LogSidePanel? Is this like a generic util elements for the LogSidePanel?
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.
yep, that's the idea
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.
?
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.
oops, removed
b4ca772
to
0da725f
Compare
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'm assuming we'll leave changing displayedTab
to trace
for exceptions for a follow up PR as well?
packages/app/src/LogSidePanel.tsx
Outdated
'breadcrumbs', | ||
) | ||
], | ||
) ?? [] |
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.
Actually I believe in this case we need to do
JSON.parse(
selectedLogData?.['string.values']?.[
selectedLogData?.['string.names']?.indexOf(
'breadcrumbs',
)
] ?? '[]')
as the undefined value into JSON.parse
will throw a parse error
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.
good point. moved JSON.parse
calls into separate memo'd consts with try/catch
block just in case
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'm assuming we'll leave changing displayedTab to trace for exceptions for a follow up PR as well?
yes, will do in a separate PR, this one already becomes a bit unwieldy :D
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.
made changes here: #118
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.
🚢🚢🚢
Log Side Panel polish
Screen.Recording.2023-11-18.at.6.12.03.PM.mov