diff --git a/AGENTS.md b/AGENTS.md index 0b1998ec50..8e7ff342b5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,6 +4,14 @@ - Local `main` ref may not exist; use `dev` or `origin/dev` for diffs. - Prefer automation: execute requested actions without confirmation unless blocked by missing info or safety/irreversibility. +## Commits and PR Titles + +Use conventional commit-style messages and PR titles: `type(scope): summary`. + +Valid types are `feat`, `fix`, `docs`, `chore`, `refactor`, and `test`. Scopes are optional; use the affected package or area when helpful, e.g. `core`, `opencode`, `tui`, `app`, `desktop`, `sdk`, or `plugin`. + +Examples: `fix(tui): simplify thinking toggle styling`, `docs: update contributing guide`, `chore(sdk): regenerate types`. + ## Style Guide ### General Principles diff --git a/packages/opencode/src/cli/cmd/tui/feature-plugins/system/session-v2.tsx b/packages/opencode/src/cli/cmd/tui/feature-plugins/system/session-v2.tsx index f9217ec403..e08e15aaa6 100644 --- a/packages/opencode/src/cli/cmd/tui/feature-plugins/system/session-v2.tsx +++ b/packages/opencode/src/cli/cmd/tui/feature-plugins/system/session-v2.tsx @@ -411,12 +411,9 @@ function AssistantReasoning(props: { @@ -425,17 +422,20 @@ function AssistantReasoning(props: { drawUnstyledText={false} streaming={true} syntaxStyle={props.subtleSyntax} - content={(inMinimal() ? "▼ " : "") + "_Thinking:_ " + content()} + content={(inMinimal() ? "- " : "") + "_Thinking:_ " + content()} conceal={true} fg={theme.textMuted} /> - - - {title() ? "▶ Thought: " + title() : "▶ Thought"} - + + @@ -448,6 +448,16 @@ function AssistantReasoning(props: { ) } +function CollapsedReasoningText(props: { title: string | null }) { + const { theme } = useTheme() + + return ( + + {props.title ? "+ Thought · " + props.title : "+ Thought"} + + ) +} + function AssistantTool(props: { part: SessionMessageAssistantTool; sessionID: string }) { const input = createMemo(() => toolInputRecord(props.part.state.input)) const toolprops = { 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 3f2e902bdf..154bc5c004 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -1533,12 +1533,9 @@ function ReasoningPart(props: { last: boolean; part: ReasoningPart; message: Ass {/* Full markdown block: `show` mode, or `hide` after the user opens it. */} - {/* Settled: ▶ at the start as the click-to-expand cue. */} - - - {"▶ " + - (title() - ? "Thought: " + title() + " · " + Locale.duration(duration()) - : "Thought for " + Locale.duration(duration()))} - + + - {/* Streaming: leading animated spinner, no disclosure arrow yet — it - snaps in once reasoning settles, signalling "done, click to expand". */} {title() ? "Thinking: " + title() : "Thinking"} @@ -1575,6 +1570,19 @@ function ReasoningPart(props: { last: boolean; part: ReasoningPart; message: Ass ) } +function CollapsedReasoningText(props: { title: string | null; duration: number }) { + const { theme } = useTheme() + const duration = () => Locale.duration(props.duration) + + return ( + + + {props.title ? "+ Thought · " + props.title + " · " + duration() : "+ Thought · " + duration()} + + + ) +} + function TextPart(props: { last: boolean; part: TextPart; message: AssistantMessage }) { const ctx = use() const { theme, syntax } = useTheme()