Skip to content

Commit f3ec99e

Browse files
bitsandfoxesandrewshie-sentry
authored andcommitted
feat: Prettify Unity active_scene_name context (#103065)
1 parent 3afbb02 commit f3ec99e

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

static/app/components/events/contexts/platformContext/unity.spec.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {getUnityContextData} from 'sentry/components/events/contexts/platformCon
77

88
const MOCK_UNITY_CONTEXT = {
99
type: 'unity' as const,
10+
active_scene_name: '2_NativeSupport',
1011
copy_texture_support: 'Basic, Copy3D, DifferentTypes, TextureToRT, RTToTexture',
1112
editor_version: '2022.1.23f1',
1213
install_mode: 'Store',
@@ -28,6 +29,11 @@ const MOCK_REDACTION = {
2829
describe('UnityContext', () => {
2930
it('returns values and according to the parameters', () => {
3031
expect(getUnityContextData({data: MOCK_UNITY_CONTEXT})).toEqual([
32+
{
33+
key: 'active_scene_name',
34+
subject: 'Active Scene Name',
35+
value: '2_NativeSupport',
36+
},
3137
{
3238
key: 'copy_texture_support',
3339
subject: 'Copy Texture Support',

static/app/components/events/contexts/platformContext/unity.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ import type {KeyValueListData} from 'sentry/types/group';
66
export function getUnityContextData({data}: {data: UnityContext}): KeyValueListData {
77
return getContextKeys({data}).map(ctxKey => {
88
switch (ctxKey) {
9+
case UnityContextKey.ACTIVE_SCENE_NAME:
10+
return {
11+
key: ctxKey,
12+
subject: t('Active Scene Name'),
13+
value: data.active_scene_name,
14+
};
915
case UnityContextKey.COPY_TEXTURE_SUPPORT:
1016
return {
1117
key: ctxKey,

static/app/types/event.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ interface OtelContext extends Partial<Record<OtelContextKey, unknown>>, BaseCont
520520
}
521521

522522
export enum UnityContextKey {
523+
ACTIVE_SCENE_NAME = 'active_scene_name',
523524
COPY_TEXTURE_SUPPORT = 'copy_texture_support',
524525
EDITOR_VERSION = 'editor_version',
525526
INSTALL_MODE = 'install_mode',
@@ -528,6 +529,7 @@ export enum UnityContextKey {
528529
}
529530

530531
export interface UnityContext {
532+
[UnityContextKey.ACTIVE_SCENE_NAME]: string;
531533
[UnityContextKey.COPY_TEXTURE_SUPPORT]: string;
532534
[UnityContextKey.EDITOR_VERSION]: string;
533535
[UnityContextKey.INSTALL_MODE]: string;

0 commit comments

Comments
 (0)