Browse Source

fix: prevent 1 from showing when preparing write

Aiden Cline 2 months ago
parent
commit
a50ab4b5b5
1 changed files with 14 additions and 10 deletions
  1. 14 10
      packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

+ 14 - 10
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

@@ -1423,20 +1423,24 @@ ToolRegistry.register<typeof WriteTool>({
       return props.metadata.diagnostics?.[filePath] ?? []
     })
 
+    const done = !!props.input.filePath
+
     return (
       <>
-        <ToolTitle icon="←" fallback="Preparing write..." when={props.input.filePath}>
+        <ToolTitle icon="←" fallback="Preparing write..." when={done}>
           Wrote {props.input.filePath}
         </ToolTitle>
-        <line_number fg={theme.textMuted} minWidth={3} paddingRight={1}>
-          <code
-            conceal={false}
-            fg={theme.text}
-            filetype={filetype(props.input.filePath!)}
-            syntaxStyle={syntax()}
-            content={code()}
-          />
-        </line_number>
+        <Show when={done}>
+          <line_number fg={theme.textMuted} minWidth={3} paddingRight={1}>
+            <code
+              conceal={false}
+              fg={theme.text}
+              filetype={filetype(props.input.filePath!)}
+              syntaxStyle={syntax()}
+              content={code()}
+            />
+          </line_number>
+        </Show>
         <Show when={diagnostics().length}>
           <For each={diagnostics()}>
             {(diagnostic) => (