Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/lib/components/events/event-trace-tree.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,30 @@
}
</script>

<div class="flex min-h-0 flex-col">
<div class="flex shrink-0 items-center gap-3 border-b border-border px-4 py-2.5 text-xs sm:px-5">
<div class="flex min-h-0 min-w-0 flex-col overflow-hidden">
<div class="flex shrink-0 items-center gap-3 whitespace-nowrap border-b border-border px-4 py-2.5 text-xs sm:px-5">
<button
type="button"
onclick={onCollapse}
title={t('收起事件列表')}
aria-label={t('收起事件列表')}
class="-ml-1 hidden text-faint transition-colors hover:text-foreground lg:block"
class="-ml-1 hidden shrink-0 text-faint transition-colors hover:text-foreground lg:block"
><PanelLeftClose class="size-4" /></button
>
<span class={failedCount ? 'text-destructive' : 'text-muted-foreground'}>{failedCount} {t('失败')}</span>
<span class="text-faint">·</span>
<span class="text-muted-foreground">{succeededCount} {t('成功')}</span>
<label class="ml-auto flex cursor-pointer items-center gap-1.5 text-muted-foreground">
<label
class="ml-auto flex min-w-0 cursor-pointer items-center gap-1.5 text-muted-foreground"
title={t('折叠成功的执行')}
>
<input
type="checkbox"
checked={folded}
onchange={(event) => onToggleFold(event.currentTarget.checked)}
class="accent-foreground"
class="shrink-0 accent-foreground"
/>
{t('折叠成功的执行')}
<span class="truncate">{t('折叠成功的执行')}</span>
</label>
</div>
<div data-scroll-surface class="min-h-0 flex-1 overflow-y-auto pb-4">
Expand Down
20 changes: 3 additions & 17 deletions src/lib/components/run-log-viewer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
loadingEarlier = false,
downloading = false,
preserveLine = 0,
horizontalScroll = true,
onQuery,
onDownload,
onLoadEarlier,
Expand All @@ -32,8 +31,6 @@
* Callers must not count rows inserted below that anchor.
*/
preserveLine?: number;
/** Keep long lines scrollable in the full-page viewer; embedded event logs fit their pane. */
horizontalScroll?: boolean;
onQuery: (value: string) => void;
onDownload: () => void;
onLoadEarlier?: () => void;
Expand Down Expand Up @@ -177,17 +174,10 @@
data-scroll-surface
data-log-viewport
onscroll={trackScroll}
class="min-h-0 min-w-0 flex-1 overflow-y-auto rounded-lg border border-border bg-muted font-mono text-xs leading-5 text-foreground"
style:overflow-x={horizontalScroll ? 'auto' : 'hidden'}
class="min-h-0 min-w-0 flex-1 overflow-auto rounded-lg border border-border bg-muted font-mono text-xs leading-5 text-foreground"
>
{#if lines.length}
<div
class:min-w-full={!horizontalScroll}
class:w-max={horizontalScroll}
class:max-w-full={!horizontalScroll}
class:overflow-hidden={!horizontalScroll}
style:height="{totalHeight}px"
>
<div class="w-max min-w-full" style:height="{totalHeight}px">
<div style:transform="translateY({startIndex * LINE_HEIGHT}px)">
{#each visibleLines as line, offset (startIndex + offset)}
{@const index = startIndex + offset}
Expand All @@ -198,11 +188,7 @@
? 'active'
: 'true'
: undefined}
class:min-w-full={!horizontalScroll}
class:w-max={horizontalScroll}
class:max-w-full={!horizontalScroll}
class:overflow-hidden={!horizontalScroll}
class="h-5 px-4 whitespace-pre data-[log-match=true]:bg-amber-300/25 data-[log-match=active]:bg-orange-500/40"
class="h-5 w-max min-w-full px-4 whitespace-pre data-[log-match=true]:bg-amber-300/25 data-[log-match=active]:bg-orange-500/40"
style:height="{LINE_HEIGHT}px"
style:line-height="{LINE_HEIGHT}px"
>
Expand Down
3 changes: 0 additions & 3 deletions src/lib/components/sandbox-log-runs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@
events,
activeStream,
legacyCells = [],
horizontalScroll = true,
onError,
}: {
sandboxId: string;
runs: RunSummary[];
events: RunEvent[];
activeStream?: AgentStreamState;
legacyCells?: SandboxHistoryCell[];
horizontalScroll?: boolean;
onError?: (message: string) => void;
} = $props();

Expand Down Expand Up @@ -293,7 +291,6 @@
{loadingEarlier}
{downloading}
{preserveLine}
{horizontalScroll}
onViewportLine={(line) => (anchorBeforeLine = line)}
onQuery={(value) => (query = value)}
onDownload={() => void download()}
Expand Down
2 changes: 0 additions & 2 deletions src/lib/components/sandbox-workbench.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -556,15 +556,13 @@
{runs}
{events}
{activeStream}
horizontalScroll={!embedded}
legacyCells={historyCells.filter((cell) => !cell.runId && !cell.id.endsWith('-legacy-log'))}
onError={(message) => (error = message)}
/>
{:else}<RunLogViewer
query={contextLogQuery}
lines={fallbackLogLines}
loadedLineCount={fallbackLogLines.length}
horizontalScroll={!embedded}
onQuery={(value) => (contextLogQuery = value)}
onDownload={downloadContextLog}
/>{/if}
Expand Down
9 changes: 6 additions & 3 deletions src/routes/EventDetail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
/** 左侧事件栏收起后,右侧的日志占满宽度。 */
let traceCollapsed = $state(false);
// 左栏宽度占整行的百分比,拖动分隔线调整,记在浏览器里。
const TRACE_WIDTH_KEY = 'agent-compose:event-trace-width';
const TRACE_WIDTH_DEFAULT = 42;
// 改默认宽度时换一个 key,让旧的记忆值失效。
const TRACE_WIDTH_KEY = 'agent-compose:event-trace-width:v3';
const TRACE_WIDTH_DEFAULT = 28;
const TRACE_WIDTH_MIN = 20;
const TRACE_WIDTH_MAX = 70;
let traceWidth = $state(clampTraceWidth(Number(localStorage.getItem(TRACE_WIDTH_KEY)) || TRACE_WIDTH_DEFAULT));
Expand Down Expand Up @@ -248,7 +249,9 @@
>
</div>
{/if}
<div class="relative min-h-0 flex-col border-border lg:border-r {traceCollapsed ? 'flex lg:hidden' : 'flex'}">
<div
class="relative min-h-0 min-w-0 flex-col border-border lg:border-r {traceCollapsed ? 'flex lg:hidden' : 'flex'}"
>
<!-- svelte-ignore a11y_no_noninteractive_tabindex, a11y_no_noninteractive_element_interactions -->
<div
data-trace-resizer
Expand Down
Loading