Skip to content

feat(EventActionMenu): add option to copy raw event data#885

Open
akulistus wants to merge 8 commits into
masterfrom
feat/copy-raw-event-data
Open

feat(EventActionMenu): add option to copy raw event data#885
akulistus wants to merge 8 commits into
masterfrom
feat/copy-raw-event-data

Conversation

@akulistus

Copy link
Copy Markdown
Contributor

implement event data copy functionality

Example
### Title ###
Cannot convert undefined or null to object

### Backtrace ###
traverse
http://localhost:8080/src/components/utils/events/stringifiedEventPayload.ts line 45:12
40   if (!isObject(obj)) {
41     return null;
42   }
43   const lineArray = [];
44   const traverse = (obj2, level = 0) => {
45     Object.entries(obj2).forEach(([key, value]) => {
46       const prefix = " ".repeat(level);
47       if (typeof value === "object") {
48         lineArray.push(`${prefix}${key}: {`);
49         traverse(value, level + 2);
50         lineArray.push(`${prefix}}`);


http://localhost:8080/src/components/utils/events/stringifiedEventPayload.ts line 49:9
44   const traverse = (obj2, level = 0) => {
45     Object.entries(obj2).forEach(([key, value]) => {
46       const prefix = " ".repeat(level);
47       if (typeof value === "object") {
48         lineArray.push(`${prefix}${key}: {`);
49         traverse(value, level + 2);
50         lineArray.push(`${prefix}}`);
51       } else {
52         lineArray.push(`${prefix}${key}: ${value}`);
53       }
54     });

traverse
http://localhost:8080/src/components/utils/events/stringifiedEventPayload.ts line 45:26
40   if (!isObject(obj)) {
41     return null;
42   }
43   const lineArray = [];
44   const traverse = (obj2, level = 0) => {
45     Object.entries(obj2).forEach(([key, value]) => {
46       const prefix = " ".repeat(level);
47       if (typeof value === "object") {
48         lineArray.push(`${prefix}${key}: {`);
49         traverse(value, level + 2);
50         lineArray.push(`${prefix}}`);

buildObjectString
http://localhost:8080/src/components/utils/events/stringifiedEventPayload.ts line 56:3
51       } else {
52         lineArray.push(`${prefix}${key}: ${value}`);
53       }
54     });
55   };
56   traverse(obj);
57   return lineArray.join("\n");
58 }
59 
60 
61 ;import "/@id/__x00__virtual:hawk/globals";

stringifyEventPayload
http://localhost:8080/src/components/utils/events/stringifiedEventPayload.ts line 6:29
1 import { isObject } from "/src/utils.ts";
2 export function stringifyEventPayload(payload) {
3   const sections = [
4     buildSection("Title", payload.title),
5     buildSection("Backtrace", buildBacktraceString(payload.backtrace)),
6     buildSection("Context", buildObjectString(payload.context)),
7     buildSection("Addons", buildAddonsString(payload.addons))
8   ];
9   return sections.join("\n\n");
10 }
11 ;

copyRawEventData
http://localhost:8080/src/components/event/EventActionsMenu.vue line 63:32
58     }
59     async function copyRawEventData() {
60       const {
61         eventPayload
62       } = props;
63       const stringifiedEvent = stringifyEventPayload(eventPayload);
64       await navigator.clipboard.writeText(stringifiedEvent);
65       notifier.show({
66         message: i18n.global.t("common.copiedNotification"),
67         style: "success",
68         time: 2e3

Object.onActivate
http://localhost:8080/src/components/event/EventActionsMenu.vue line 79:13
74           type: "default",
75           title: i18n.global.t("event.copy"),
76           icon: "Copy",
77           onActivate: () => {
78             props.onClose?.();
79             copyRawEventData();
80           }
81         },
82         {
83           type: "default",
84           title: i18n.global.t("event.remove"),

_ctx.item.type._ctx.item.type.createElementBlock.onClick._cache.<computed>._cache.<computed>
http://localhost:8080/node_modules/.vite/deps/@codexteam_ui_vue.js?v=bd392687 line 1028:58
1023       }, [
1024         _ctx.item.type === "default" || !_ctx.item.type ? (openBlock(), createElementBlock("div", {
1025           key: 0,
1026           class: normalizeClass([_ctx.$style["context-menu-item__default"]]),
1027           onClick: _cache[0] || (_cache[0] = //@ts-ignore
1028           (...args) => _ctx.item.onActivate && _ctx.item.onActivate(...args))
1029         }, [
1030           createBaseVNode("div", {
1031             class: normalizeClass(_ctx.$style["context-menu-item__body"])
1032           }, [
1033             _ctx.item.icon !== void 0 ? (openBlock(), createBlock(Icon, {

### Addons ###
window: {
  innerWidth: 1272
  innerHeight: 588
}
userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36 Edg/147.0.0.0
url: http://localhost:8080/project/699e0913940962eb404483c9/event/69eaa8fa8644582d93899ffb/69fc877472c51464df411e0a/overview
consoleOutput: [
  {
    method: log
    timestamp: 2026-05-07T12:37:55.522Z
    type: log
    message: Deprecated as of 10.7.0. highlightBlock will be removed entirely in v12.0
    stack:     at window.console.<computed> [as log] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at deprecated (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:632:15)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1490:9)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as log] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: log
    timestamp: 2026-05-07T12:37:55.523Z
    type: log
    message: Deprecated as of 10.7.0. Please use highlightElement now.
    stack:     at window.console.<computed> [as log] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at deprecated (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:632:15)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1491:9)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as log] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: warn
    timestamp: 2026-05-07T12:37:55.523Z
    type: warn
    message: One of your code blocks includes unescaped HTML. This is a potentially serious security risk.
    stack:     at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at highlightElement (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1349:21)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1492:16)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: warn
    timestamp: 2026-05-07T12:37:55.524Z
    type: warn
    message: https://github.com/highlightjs/highlight.js/wiki/security
    stack:     at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at highlightElement (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1350:21)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1492:16)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: warn
    timestamp: 2026-05-07T12:37:55.525Z
    type: warn
    message: The element with unescaped HTML:
    stack:     at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at highlightElement (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1351:21)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1492:16)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: warn
    timestamp: 2026-05-07T12:37:55.525Z
    type: warn
    message: "<pre class=\"code-preview__content typescript\">…</pre>"
    stack:     at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at highlightElement (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1352:21)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1492:16)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: warn
    timestamp: 2026-05-07T12:37:55.548Z
    type: warn
    message: One of your code blocks includes unescaped HTML. This is a potentially serious security risk.
    stack:     at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at highlightElement (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1349:21)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1492:16)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: warn
    timestamp: 2026-05-07T12:37:55.549Z
    type: warn
    message: https://github.com/highlightjs/highlight.js/wiki/security
    stack:     at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at highlightElement (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1350:21)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1492:16)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: warn
    timestamp: 2026-05-07T12:37:55.549Z
    type: warn
    message: The element with unescaped HTML:
    stack:     at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at highlightElement (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1351:21)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1492:16)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: warn
    timestamp: 2026-05-07T12:37:55.549Z
    type: warn
    message: "<pre class=\"code-preview__content typescript\">…</pre>"
    stack:     at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at highlightElement (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1352:21)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1492:16)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: warn
    timestamp: 2026-05-07T12:37:55.550Z
    type: warn
    message: One of your code blocks includes unescaped HTML. This is a potentially serious security risk.
    stack:     at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at highlightElement (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1349:21)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1492:16)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: warn
    timestamp: 2026-05-07T12:37:55.551Z
    type: warn
    message: https://github.com/highlightjs/highlight.js/wiki/security
    stack:     at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at highlightElement (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1350:21)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1492:16)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: warn
    timestamp: 2026-05-07T12:37:55.551Z
    type: warn
    message: The element with unescaped HTML:
    stack:     at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at highlightElement (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1351:21)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1492:16)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: warn
    timestamp: 2026-05-07T12:37:55.551Z
    type: warn
    message: "<pre class=\"code-preview__content typescript\">…</pre>"
    stack:     at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at highlightElement (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1352:21)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1492:16)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: warn
    timestamp: 2026-05-07T12:37:55.554Z
    type: warn
    message: One of your code blocks includes unescaped HTML. This is a potentially serious security risk.
    stack:     at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at highlightElement (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1349:21)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1492:16)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: warn
    timestamp: 2026-05-07T12:37:55.554Z
    type: warn
    message: https://github.com/highlightjs/highlight.js/wiki/security
    stack:     at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at highlightElement (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1350:21)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1492:16)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: warn
    timestamp: 2026-05-07T12:37:55.555Z
    type: warn
    message: The element with unescaped HTML:
    stack:     at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at highlightElement (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1351:21)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1492:16)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: warn
    timestamp: 2026-05-07T12:37:55.555Z
    type: warn
    message: "<pre class=\"code-preview__content javascript\">…</pre>"
    stack:     at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    at highlightElement (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1352:21)
    at Object.deprecateHighlightBlock [as highlightBlock] (http://localhost:8080/node_modules/.vite/deps/highlight__js.js?v=bd392687:1492:16)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:143:16
    at NodeList.forEach (<anonymous>)
    at http://localhost:8080/src/components/utils/CodeFragment.vue:142:52
    fileLine: at window.console.<computed> [as warn] (http://localhost:8080/node_modules/.vite/deps/@hawk__so_javascript.js?v=bd392687:933:19)
    styles: [
    ]
  },
  {
    method: error
    timestamp: 2026-05-07T12:37:57.937Z
    type: UnhandledRejection
    message: Cannot convert undefined or null to object
    stack: TypeError: Cannot convert undefined or null to object
    at Object.entries (<anonymous>)
    at traverse (http://localhost:8080/src/components/utils/events/stringifiedEventPayload.ts:45:12)
    at http://localhost:8080/src/components/utils/events/stringifiedEventPayload.ts:49:9
    at Array.forEach (<anonymous>)
    at traverse (http://localhost:8080/src/components/utils/events/stringifiedEventPayload.ts:45:26)
    at buildObjectString (http://localhost:8080/src/components/utils/events/stringifiedEventPayload.ts:56:3)
    at stringifyEventPayload (http://localhost:8080/src/components/utils/events/stringifiedEventPayload.ts:6:29)
    at copyRawEventData (http://localhost:8080/src/components/event/EventActionsMenu.vue:63:32)
    at Object.onActivate (http://localhost:8080/src/components/event/EventActionsMenu.vue:79:13)
    at _ctx.item.type._ctx.item.type.createElementBlock.onClick._cache.<computed>._cache.<computed> (http://localhost:8080/node_modules/.vite/deps/@codexteam_ui_vue.js?v=bd392687:1028:58)
    fileLine: 
  },
  {
    method: error
    timestamp: 2026-05-07T12:38:03.427Z
    type: UnhandledRejection
    message: Cannot convert undefined or null to object
    stack: TypeError: Cannot convert undefined or null to object
    at Object.entries (<anonymous>)
    at traverse (http://localhost:8080/src/components/utils/events/stringifiedEventPayload.ts:45:12)
    at http://localhost:8080/src/components/utils/events/stringifiedEventPayload.ts:49:9
    at Array.forEach (<anonymous>)
    at traverse (http://localhost:8080/src/components/utils/events/stringifiedEventPayload.ts:45:26)
    at buildObjectString (http://localhost:8080/src/components/utils/events/stringifiedEventPayload.ts:56:3)
    at stringifyEventPayload (http://localhost:8080/src/components/utils/events/stringifiedEventPayload.ts:6:29)
    at copyRawEventData (http://localhost:8080/src/components/event/EventActionsMenu.vue:63:32)
    at Object.onActivate (http://localhost:8080/src/components/event/EventActionsMenu.vue:79:13)
    at _ctx.item.type._ctx.item.type.createElementBlock.onClick._cache.<computed>._cache.<computed> (http://localhost:8080/node_modules/.vite/deps/@codexteam_ui_vue.js?v=bd392687:1028:58)
    fileLine: 
  }
]

@akulistus akulistus requested a review from neSpecc May 8, 2026 11:03
…atch markdown header, replace section title 'addons' with 'additional data'
Comment thread src/components/utils/events/stringifiedEventPayload.ts Outdated
Co-authored-by: Peter <specc.dev@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.copy translation strings (EN/RU).
  • Introduced stringifyEventPayload utility to format event payload sections (title/backtrace/context/addons).
  • Wired EventHeaderEventActionsMenu with eventPayload prop 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');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants