fix: expose stable trace row attributes (#2084)

This commit is contained in:
Lyon
2026-06-25 05:49:18 +08:00
committed by GitHub
parent fe2ed4e308
commit 67282299c2
@@ -127,7 +127,7 @@ function firstNonEmptyString(...values: unknown[]): string | null {
</script>
<template>
<section v-if="trace" class="trace-timeline" :data-status="trace.status" :data-projection-health="trace.projection?.projectionHealth || trace.projectionHealth || undefined" :data-following="following ? 'true' : 'false'">
<section v-if="trace" class="trace-timeline" :data-trace-id="trace.traceId || undefined" :data-status="trace.status" :data-projection-health="trace.projection?.projectionHealth || trace.projectionHealth || undefined" :data-following="following ? 'true' : 'false'">
<details class="trace-disclosure" :open="expanded" @toggle="onDisclosureToggle">
<summary class="trace-disclosure-summary" aria-label="折叠运行记录">
<span class="trace-disclosure-caret" aria-hidden="true" />
@@ -135,7 +135,7 @@ function firstNonEmptyString(...values: unknown[]): string | null {
</summary>
<div class="trace-disclosure-body">
<ol ref="listRef" @scroll="onScroll">
<li v-for="(row, index) in readableRows" :key="rowKey(row, index)" class="trace-render-row" :data-event-status="row.tone" :data-terminal="row.terminal ? 'true' : 'false'" :data-row-kind="rowIsTool(row) ? 'tool' : 'message'" :data-row-id="row.rowId">
<li v-for="(row, index) in readableRows" :key="rowKey(row, index)" class="trace-render-row" data-testid="trace-render-row" :data-trace-id="trace.traceId || undefined" :data-projected-seq="row.seq ?? undefined" :data-event-kind="row.rowId" :data-event-status="row.tone" :data-terminal="row.terminal ? 'true' : 'false'" :data-row-kind="rowIsTool(row) ? 'tool' : 'message'" :data-row-id="row.rowId" :aria-posinset="row.seq ?? index + 1">
<details v-if="rowIsTool(row)" class="trace-tool-details">
<summary>
<code>{{ row.header }}</code>