From 4a53bbd1fb1fc1851778c9d5de59f97f99141bdb Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 1 Sep 2026 20:10:16 +0000 Subject: [PATCH 1/9] fix(ui): surface failure evidence first on the execution page The Diagnosis tab opened with the screenshot folded away while console and network were always expanded. The test source and failure evidence cards now start expanded, and console/network become foldable cards with a peek line (entry count plus the first entry). Fold choices still persist per user through the existing cookie. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_0122WucKkRwT2weCog4xDZ3w --- .../test-case/TestCaseConsoleCard.vue | 45 ++++++++++++++++--- .../test-case/TestCaseEvidenceCard.vue | 3 ++ .../test-case/TestCaseNetworkRequests.vue | 36 +++++++++++++-- .../components/test-case/TestSourceCard.vue | 3 ++ .../app/pages/test-run-cases/[id].vue | 42 +++++++++-------- apps/docs/evidence.md | 6 +-- 6 files changed, 105 insertions(+), 30 deletions(-) diff --git a/apps/application/app/components/test-case/TestCaseConsoleCard.vue b/apps/application/app/components/test-case/TestCaseConsoleCard.vue index dbdfd317..3e9d6d2f 100644 --- a/apps/application/app/components/test-case/TestCaseConsoleCard.vue +++ b/apps/application/app/components/test-case/TestCaseConsoleCard.vue @@ -1,15 +1,46 @@ diff --git a/apps/application/app/components/test-case/TestCaseEvidenceCard.vue b/apps/application/app/components/test-case/TestCaseEvidenceCard.vue index 7a8181c2..cceac4e9 100644 --- a/apps/application/app/components/test-case/TestCaseEvidenceCard.vue +++ b/apps/application/app/components/test-case/TestCaseEvidenceCard.vue @@ -12,6 +12,8 @@ const props = defineProps<{ attachments: AttachmentInfo[]; traces: TraceInfo[]; storageKey: string; + /** Whether the card starts folded on first visit (no stored cookie). */ + defaultFolded?: boolean; }>(); const config = useRuntimeConfig(); @@ -60,6 +62,7 @@ defineExpose({ reveal: () => card.value?.reveal?.() }); import type { NetworkRequest, ServerLogEntry, ServerSpanEntry } from '~~/types/api'; +import SectionCard from '../shared/SectionCard.vue'; +import CollapsibleSectionCard from '../shared/CollapsibleSectionCard.vue'; const props = defineProps<{ requests: NetworkRequest[]; @@ -7,8 +9,17 @@ const props = defineProps<{ runId?: number | null; testRunsCaseId?: number | null; hasTrace?: boolean; + /** When set, the card folds to a header with a peek (persisted per user). */ + storageKey?: string; + /** Whether the card starts folded on first visit (no stored cookie). */ + defaultFolded?: boolean; }>(); +const cardComponent = computed(() => (props.storageKey ? CollapsibleSectionCard : SectionCard)); +const cardBind = computed(() => + props.storageKey ? { storageKey: props.storageKey, defaultFolded: props.defaultFolded } : {}, +); + type Filter = 'all' | 'failed' | 'logs'; const filter = ref('all'); @@ -55,7 +66,22 @@ const viewItems = computed(() => [ function showTraceMode() { if (props.hasTrace) manualView.value = 'trace'; } -defineExpose({ showTraceMode }); + +// Forward reveal so a jump chip or diagnosis citation can unfold + scroll to this card. +const card = ref<{ reveal?: () => void; $el?: HTMLElement } | null>(null); +function reveal() { + if (card.value?.reveal) card.value.reveal(); + else card.value?.$el?.scrollIntoView?.({ behavior: 'smooth', block: 'start' }); +} +defineExpose({ showTraceMode, reveal }); + +/** Folded peek: the captured request count and the first request, or the trace-only hint. */ +const peek = computed(() => { + const n = props.requests.length; + if (n === 0) return 'Full network activity from the trace'; + const first = props.requests[0]!; + return `${n} request${n === 1 ? '' : 's'} · ${first.method} ${toPath(first.url)} → ${first.status}`; +}); /** Per-request expansion state (keyed by stable index). */ const expanded = ref>(new Set()); @@ -246,12 +272,16 @@ function rowAccent(r: DecoratedRequest): string {