diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx index f5a7f6f6c..365eb3314 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -1762,11 +1762,6 @@ function Write(props: ToolProps) { return props.input.content }) - const diagnostics = createMemo(() => { - const filePath = Filesystem.normalizePath(props.input.filePath ?? "") - return props.metadata.diagnostics?.[filePath] ?? [] - }) - return ( @@ -1780,15 +1775,7 @@ function Write(props: ToolProps) { content={code()} /> - - - {(diagnostic) => ( - - Error [{diagnostic.range.start.line}:{diagnostic.range.start.character}]: {diagnostic.message} - - )} - - + @@ -1972,12 +1959,6 @@ function Edit(props: ToolProps) { const diffContent = createMemo(() => props.metadata.diff) - const diagnostics = createMemo(() => { - const filePath = Filesystem.normalizePath(props.input.filePath ?? "") - const arr = props.metadata.diagnostics?.[filePath] ?? [] - return arr.filter((x) => x.severity === 1).slice(0, 3) - }) - return ( @@ -2003,18 +1984,7 @@ function Edit(props: ToolProps) { removedLineNumberBg={theme.diffRemovedLineNumberBg} /> - - - - {(diagnostic) => ( - - Error [{diagnostic.range.start.line + 1}:{diagnostic.range.start.character + 1}]{" "} - {diagnostic.message} - - )} - - - + @@ -2086,6 +2056,7 @@ function ApplyPatch(props: ToolProps) { } > + )} @@ -2163,6 +2134,29 @@ function Skill(props: ToolProps) { ) } +function Diagnostics(props: { diagnostics?: Record[]>; filePath: string }) { + const { theme } = useTheme() + const errors = createMemo(() => { + const normalized = Filesystem.normalizePath(props.filePath) + const arr = props.diagnostics?.[normalized] ?? [] + return arr.filter((x) => x.severity === 1).slice(0, 3) + }) + + return ( + + + + {(diagnostic) => ( + + Error [{diagnostic.range.start.line + 1}:{diagnostic.range.start.character + 1}] {diagnostic.message} + + )} + + + + ) +} + function normalizePath(input?: string) { if (!input) return "" if (path.isAbsolute(input)) {