@@ -12,6 +12,7 @@ import type { LogsAttachment, ReportDetailDTO } from "@reprojs/shared"
1212import AppErrorState from " ~/components/common/app-error-state.vue"
1313import AppLoadingSkeleton from " ~/components/common/app-loading-skeleton.vue"
1414import ActivityTab from " ~/components/report-drawer/activity-tab.vue"
15+ import AttachmentsTab from " ~/components/report-drawer/attachments-tab.vue"
1516import CommentsTab from " ~/components/report-drawer/comments-tab.vue"
1617import ConsoleTab from " ~/components/report-drawer/console-tab.vue"
1718import CookiesTab from " ~/components/report-drawer/cookies-tab.vue"
@@ -57,6 +58,7 @@ type TabId =
5758 | " activity"
5859 | " comments"
5960 | " cookies"
61+ | " attachments"
6062 | " system"
6163 | " raw"
6264const activeTab = ref <TabId >(" overview" )
@@ -84,6 +86,9 @@ const consoleHasData = computed(
8486)
8587const networkHasData = computed (() => logs .value !== null && logs .value .network .length > 0 )
8688const cookiesHasData = computed (() => (report .value ?.context ?.cookies ?.length ?? 0 ) > 0 )
89+ const userFileCount = computed (
90+ () => (report .value ?.attachments ?? []).filter ((a ) => a .kind === " user-file" ).length ,
91+ )
8792
8893const tabs = computed (() => {
8994 const base: { id: string ; label: string ; hasData? : boolean }[] = [
@@ -99,6 +104,9 @@ const tabs = computed(() => {
99104 if (report .value ?.source !== " expo" ) {
100105 base .push ({ id: " cookies" , label: " Cookies" , hasData: cookiesHasData .value })
101106 }
107+ if (userFileCount .value > 0 ) {
108+ base .push ({ id: " attachments" , label: " Attachments" , hasData: true })
109+ }
102110 base .push ({ id: " system" , label: " System" })
103111 base .push ({ id: " raw" , label: " Raw" })
104112 return base
@@ -256,6 +264,10 @@ onUnmounted(() => window.removeEventListener("keydown", onKey))
256264 :report-id =" report.id"
257265 />
258266 <CookiesTab v-else-if =" activeTab === 'cookies'" :project-id =" projectId" :report =" report" />
267+ <AttachmentsTab
268+ v-else-if =" activeTab === 'attachments'"
269+ :attachments =" report.attachments ?? []"
270+ />
259271 <div v-else-if =" activeTab === 'system'" class =" p-5" >
260272 <UCard :ui =" { body: 'p-4' }" >
261273 <pre class =" text-sm font-mono whitespace-pre-wrap break-all" >{{
0 commit comments