-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
feat(issues-stacktrace): Add copy stacktrace button to ellipsis menu #82107
base: master
Are you sure you want to change the base?
Conversation
@@ -1,20 +1,16 @@ | |||
import {Component, Fragment} 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.
This file is responsible for actually wrangling the stacktrace into the stacktrace string that's displayed when "Raw stacktrace" is selected. I have moved two methods, getContent
and getAppleCrashreportEndpoint
to the utils.tsx
file to make for better reusability.
dce1ab5
to
5617fa7
Compare
@@ -51,6 +60,28 @@ export function Exception({ | |||
|
|||
const stackTraceNotFound = !(data.values ?? []).length; | |||
|
|||
const copyableStackTrace = | |||
data.values && !isNative |
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.
native platforms appears to have a threaded stacktraces a lot of the time. If that's the case, this component is not even used. For the sake of simplicity, I've just excluded native platforms from this feature - implementing it for native will be significantly more complex since we may need to fetch crash reports (at least for Cocoa).
</Button> | ||
</SectionedOverlayFooter> | ||
) | ||
} |
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.
Ideally, the dropdown would close after this button was clicked, though I couldn't find a state-less way to achieve this. It's a small thing, but lmk if anyone knows if this is easily achievable without needing to take control over the open state of the menu.
const {content} = getContent( | ||
false, | ||
exc, | ||
'original', | ||
projectSlug, | ||
event.id, | ||
api, | ||
event.platform, | ||
false, | ||
false, | ||
'', | ||
organization |
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.
what is this madness
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.
this is the function to create the raw stacktrace string, and yes, it is insanely ugly and complex for some reason – I extracted this out of rawContent.tsx
and put it into a separate utils.tsx
folder so it could be re-used here to be copyable.
export const getContent = ( | ||
isNative: boolean, | ||
exc: any, | ||
type: 'original' | 'minified', | ||
projectSlug: string, | ||
eventId: string, | ||
api: Client, | ||
platform?: PlatformKey, | ||
loading?: boolean, | ||
error?: boolean, | ||
crashReport?: string, | ||
organization?: Organization | ||
) => { |
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's probably something else we can do here. looks like we wanted both a component and to use the output
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
closes #55030
Adds a "Copy raw stacktrace" button to the ellipsis menu in the stacktrace section of an issue.
Does not work for native platforms - getting that to work is surprisingly complex and would definitely require a separate PR.