From c333fcec32b1f90bf0da6bb14d2609c20e38a74f Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Fri, 26 Jun 2026 22:21:55 +0900 Subject: style: switch from tabs to 2-space indentation (incl. svelte) --- src/features/chat/ui/ChatView.svelte | 611 +++++++++++++++++++---------------- 1 file changed, 332 insertions(+), 279 deletions(-) (limited to 'src/features/chat/ui/ChatView.svelte') diff --git a/src/features/chat/ui/ChatView.svelte b/src/features/chat/ui/ChatView.svelte index f2899c7..e72f639 100644 --- a/src/features/chat/ui/ChatView.svelte +++ b/src/features/chat/ui/ChatView.svelte @@ -1,294 +1,347 @@ {#snippet chunkRow(rendered: RenderedChunk)} - {#if rendered.role === "user"} - -
-
- {#if rendered.chunk.type === "text"} -

{rendered.chunk.text}

- {/if} -
-
- {:else if rendered.chunk.type === "thinking"} - -
-
-
- -
- {rendered.streaming ? "Thinking" : "Thoughts"} - {#if rendered.streaming} - - {/if} -
-
-

{rendered.chunk.text}

-
-
-
-
- {:else if rendered.chunk.type === "tool-call" || rendered.chunk.type === "tool-result"} - -
-
- {#if rendered.chunk.type === "tool-call"} -
- -
- - {rendered.chunk.toolName} -
-
-
{JSON.stringify(rendered.chunk.input, null, 2)}
-
-
- {:else} -
- -
- - {rendered.chunk.toolName} - {#if rendered.chunk.isError} - error - {/if} -
-
-
{rendered.chunk.content}
-
-
- {/if} -
-
- {:else} - -
-
- {#if rendered.chunk.type === "text"} - - {:else if rendered.chunk.type === "error"} - - {:else if rendered.chunk.type === "system"} -
{rendered.chunk.text}
- {/if} -
-
- {/if} + {#if rendered.role === "user"} + +
+
+ {#if rendered.chunk.type === "text"} +

{rendered.chunk.text}

+ {/if} +
+
+ {:else if rendered.chunk.type === "thinking"} + +
+
+
+ +
+ {rendered.streaming ? "Thinking" : "Thoughts"} + {#if rendered.streaming} + + {/if} +
+
+

{rendered.chunk.text}

+
+
+
+
+ {:else if rendered.chunk.type === "tool-call" || rendered.chunk.type === "tool-result"} + +
+
+ {#if rendered.chunk.type === "tool-call"} +
+ +
+ + {rendered.chunk.toolName} +
+
+
{JSON.stringify(
+                  rendered.chunk.input,
+                  null,
+                  2,
+                )}
+
+
+ {:else} +
+ +
+ + {rendered.chunk.toolName} + {#if rendered.chunk.isError} + error + {/if} +
+
+
{rendered.chunk.content}
+
+
+ {/if} +
+
+ {:else} + +
+
+ {#if rendered.chunk.type === "text"} + + {:else if rendered.chunk.type === "error"} + + {:else if rendered.chunk.type === "system"} +
{rendered.chunk.text}
+ {/if} +
+
+ {/if} {/snippet}
- {#if hasEarlier && onShowEarlier} - -
- -
- {/if} - {#each keyedRows as { row, key } (key)} - {#if row.kind === "step-metrics"} - {@const sv = viewStepMetrics(row.step, row.index)} -
-
-
- {sv.label} · {sv.tokensLabel} - {#if sv.tps} · {sv.tps}{/if} - {#if sv.genTotal} · {sv.genTotal}{/if} -
-
-
- {:else if row.kind === "turn-metrics"} - {@const turnView = viewTurnMetrics(row.turn, row.turnNumber)} - {@const lastCache = viewCacheRate(row.turn.usage)} - {@const chatCache = viewCacheRate(row.cumulativeUsage)} - {@const retention = viewExpectedCache(row.turn.usage, row.prevTurnUsage)} -
-
-
-
- {turnView.label} · {turnView.tokensLabel} ({turnView.breakdown}) - {#if turnView.tps} · {turnView.tps}{/if} - {#if turnView.duration} · {turnView.duration}{/if} -
-
- - Last turn: - {lastCache.pct}% - - - Chat Total: - {chatCache.pct}% - - {#if retention} - - Retention: - {retention.pct}% - - {/if} -
-
-
-
- {:else if row.group.kind === "single"} - {@render chunkRow(row.group.chunk)} - {:else} - -
-
-
- {#each row.group.entries as entry (entry.call.toolCallId)} -
- -
- - {entry.call.toolName} - {#if entry.result?.isError} - error - {:else if entry.result === null} - - {/if} -
-
-
{JSON.stringify(entry.call.input, null, 2)}
- {#if entry.result} -
{entry.result.content}
- {/if} -
-
- {/each} -
-
-
- {/if} - {/each} - {#if providerRetry} - {@const rv = viewProviderRetry(providerRetry)} - -
-
-
-
- - {rv.attemptLabel} — retrying in {rv.delayLabel}… - {#if rv.code} - {rv.code} - {/if} -
-
{rv.message}
-
-
-
- {/if} + {#if hasEarlier && onShowEarlier} + +
+ +
+ {/if} + {#each keyedRows as { row, key } (key)} + {#if row.kind === "step-metrics"} + {@const sv = viewStepMetrics(row.step, row.index)} +
+
+
+ {sv.label} · {sv.tokensLabel} + {#if sv.tps} + · {sv.tps}{/if} + {#if sv.genTotal} + · {sv.genTotal}{/if} +
+
+
+ {:else if row.kind === "turn-metrics"} + {@const turnView = viewTurnMetrics(row.turn, row.turnNumber)} + {@const lastCache = viewCacheRate(row.turn.usage)} + {@const chatCache = viewCacheRate(row.cumulativeUsage)} + {@const retention = viewExpectedCache(row.turn.usage, row.prevTurnUsage)} +
+
+
+
+ {turnView.label} · {turnView.tokensLabel} ({turnView.breakdown}) + {#if turnView.tps} + · {turnView.tps}{/if} + {#if turnView.duration} + · {turnView.duration}{/if} +
+
+ + Last turn: + {lastCache.pct}% + + + Chat Total: + {chatCache.pct}% + + {#if retention} + + Retention: + {retention.pct}% + + {/if} +
+
+
+
+ {:else if row.group.kind === "single"} + {@render chunkRow(row.group.chunk)} + {:else} + +
+
+
+ {#each row.group.entries as entry (entry.call.toolCallId)} +
+ +
+ + {entry.call.toolName} + {#if entry.result?.isError} + error + {:else if entry.result === null} + + {/if} +
+
+
{JSON.stringify(
+                      entry.call.input,
+                      null,
+                      2,
+                    )}
+ {#if entry.result} +
{entry.result.content}
+ {/if} +
+
+ {/each} +
+
+
+ {/if} + {/each} + {#if providerRetry} + {@const rv = viewProviderRetry(providerRetry)} + +
+
+
+
+ + {rv.attemptLabel} — retrying in {rv.delayLabel}… + {#if rv.code} + {rv.code} + {/if} +
+
{rv.message}
+
+
+
+ {/if}
-- cgit v1.2.3