mirror of
https://github.com/anomalyco/opencode.git
synced 2026-09-05 08:24:35 +00:00
fix(tui): tone down patch failure details
This commit is contained in:
parent
fac875dba0
commit
b7dfe1147a
1 changed files with 14 additions and 3 deletions
|
|
@ -3087,11 +3087,13 @@ function StatusBadge(props: { children: string }) {
|
|||
type BlockToolProps = {
|
||||
title?: string
|
||||
path?: { label: string; value: string }
|
||||
headerColor?: RGBA
|
||||
children?: JSX.Element
|
||||
onClick?: () => void
|
||||
part?: SessionMessageAssistantTool
|
||||
spinner?: boolean
|
||||
error?: string
|
||||
errorColor?: RGBA
|
||||
}
|
||||
|
||||
function BlockTool(props: BlockToolProps) {
|
||||
|
|
@ -3137,7 +3139,11 @@ function BlockToolContent(props: BlockToolProps & { borderColor: RGBA }) {
|
|||
<Show
|
||||
when={props.spinner}
|
||||
fallback={
|
||||
<text fg={permission() ? theme.text.feedback.warning.default : theme.text.subdued}>{title()}</text>
|
||||
<text
|
||||
fg={permission() ? theme.text.feedback.warning.default : (props.headerColor ?? theme.text.subdued)}
|
||||
>
|
||||
{title()}
|
||||
</text>
|
||||
}
|
||||
>
|
||||
<Spinner color={permission() ? theme.text.feedback.warning.default : theme.text.subdued}>
|
||||
|
|
@ -3153,7 +3159,10 @@ function BlockToolContent(props: BlockToolProps & { borderColor: RGBA }) {
|
|||
<Show
|
||||
when={props.spinner}
|
||||
fallback={
|
||||
<text flexShrink={0} fg={permission() ? theme.text.feedback.warning.default : theme.text.subdued}>
|
||||
<text
|
||||
flexShrink={0}
|
||||
fg={permission() ? theme.text.feedback.warning.default : (props.headerColor ?? theme.text.subdued)}
|
||||
>
|
||||
{path().label}
|
||||
</text>
|
||||
}
|
||||
|
|
@ -3172,7 +3181,7 @@ function BlockToolContent(props: BlockToolProps & { borderColor: RGBA }) {
|
|||
</Show>
|
||||
{props.children}
|
||||
<Show when={error()}>
|
||||
<text fg={theme.text.feedback.error.default}>{error()}</text>
|
||||
<text fg={props.errorColor ?? theme.text.feedback.error.default}>{error()}</text>
|
||||
</Show>
|
||||
</box>
|
||||
)
|
||||
|
|
@ -3777,6 +3786,8 @@ function ApplyPatch(props: ToolProps) {
|
|||
}
|
||||
part={props.part}
|
||||
spinner={props.part.state.status === "streaming" || props.part.state.status === "running"}
|
||||
headerColor={props.part.state.status === "error" ? theme.text.feedback.error.default : undefined}
|
||||
errorColor={props.part.state.status === "error" ? theme.text.subdued : undefined}
|
||||
/>
|
||||
</Match>
|
||||
</Switch>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue