feat(EventActionMenu): add option to copy raw event data#885
Open
akulistus wants to merge 8 commits into
Open
Conversation
…atch markdown header, replace section title 'addons' with 'additional data'
neSpecc
reviewed
Jun 10, 2026
Co-authored-by: Peter <specc.dev@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new action in the event “more” menu to copy the event’s raw payload (formatted) to the clipboard, supported by new i18n strings and a payload-to-text utility.
Changes:
- Added
event.copytranslation strings (EN/RU). - Introduced
stringifyEventPayloadutility to format event payload sections (title/backtrace/context/addons). - Wired
EventHeader→EventActionsMenuwitheventPayloadprop and added a “Copy event” menu item that writes to clipboard.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/i18n/messages/ru.json | Adds Russian label for the new “copy event” action. |
| src/i18n/messages/en.json | Adds English label for the new “copy event” action. |
| src/components/utils/events/stringifiedEventPayload.ts | New formatter that converts an event payload into a multi-section text block. |
| src/components/event/EventHeader.vue | Passes the event payload into the actions menu popover. |
| src/components/event/EventActionsMenu.vue | Adds “Copy event” action and clipboard write logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
349
to
352
| projectId: this.projectId, | ||
| eventId: this.$route.params.eventId, | ||
| eventPayload: this.$props.event.payload, | ||
| onClose: () => this.hidePopover(), |
Comment on lines
+94
to
+108
| async function copyRawEventData(): Promise<void> { | ||
| const { | ||
| eventPayload, | ||
| } = props; | ||
|
|
||
| const stringifiedEvent = stringifyEventPayload(eventPayload); | ||
|
|
||
| await navigator.clipboard.writeText(stringifiedEvent); | ||
|
|
||
| notifier.show({ | ||
| message: i18n.global.t('common.copiedNotification'), | ||
| style: 'success', | ||
| time: 2000, | ||
| }); | ||
| } |
Comment on lines
+119
to
+122
| onActivate: () => { | ||
| props.onClose?.(); | ||
| copyRawEventData(); | ||
| }, |
Comment on lines
+18
to
+42
| const traverse = (obj: object, level: number = 0): void => { | ||
| Object.entries(obj).forEach(([key, value]) => { | ||
| const prefix = ' '.repeat(level); | ||
|
|
||
| if (isObject(value)) { | ||
| lineArray.push(`${prefix}${key}: {`); | ||
| traverse(value, level + 1); | ||
| lineArray.push(`${prefix}}`); | ||
| } else if (Array.isArray(value)) { | ||
| lineArray.push(`${prefix}${key}: [`); | ||
| value.map((el, index) => { | ||
| const prefix = ' '.repeat(level + 1); | ||
|
|
||
| lineArray.push(`${prefix}{`); | ||
| traverse(el, level + 2); | ||
| lineArray.push(`${prefix}}`); | ||
| if (index !== value.length - 1) { | ||
| lineArray[lineArray.length - 1] += ','; | ||
| } | ||
| }); | ||
| lineArray.push(`${prefix}]`); | ||
| } else { | ||
| lineArray.push(`${prefix}${key}: ${String(value)}`); | ||
| } | ||
| }); |
Comment on lines
+123
to
+126
| return sections | ||
| .filter(Boolean) | ||
| .join('\n\n'); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
implement event data copy functionality
Example