Skip to content

Commit d45d948

Browse files
formatting fixes and better adherance to CONTRIBUTING.md (my bad... thanks for patience)
1 parent 66b7f56 commit d45d948

5 files changed

Lines changed: 59 additions & 53 deletions

File tree

packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -813,33 +813,33 @@ export function Prompt(props: PromptProps) {
813813
</box>
814814
</box>
815815
<Show when={layout.current.showInputBorder}>
816-
<box
817-
height={1}
818-
border={["left"]}
819-
borderColor={highlight()}
820-
customBorderChars={{
821-
...EmptyBorder,
822-
// when the background is transparent, don't draw the vertical line
823-
vertical: theme.background.a != 0 ? "╹" : " ",
824-
}}
825-
>
826816
<box
827817
height={1}
828-
border={["bottom"]}
829-
borderColor={theme.backgroundElement}
830-
customBorderChars={
831-
theme.background.a != 0
832-
? {
833-
...EmptyBorder,
834-
horizontal: "▀",
835-
}
836-
: {
837-
...EmptyBorder,
838-
horizontal: " ",
839-
}
840-
}
841-
/>
842-
</box>
818+
border={["left"]}
819+
borderColor={highlight()}
820+
customBorderChars={{
821+
...EmptyBorder,
822+
// when the background is transparent, don't draw the vertical line
823+
vertical: theme.background.a != 0 ? "╹" : " ",
824+
}}
825+
>
826+
<box
827+
height={1}
828+
border={["bottom"]}
829+
borderColor={theme.backgroundElement}
830+
customBorderChars={
831+
theme.background.a != 0
832+
? {
833+
...EmptyBorder,
834+
horizontal: "▀",
835+
}
836+
: {
837+
...EmptyBorder,
838+
horizontal: " ",
839+
}
840+
}
841+
/>
842+
</box>
843843
</Show>
844844
<box flexDirection="row" justifyContent="space-between">
845845
<Show

packages/opencode/src/cli/cmd/tui/context/layout/default.jsonc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@
3333
"agentInfoMarginTop": 1,
3434

3535
// Horizontal indentation for message text and tool output
36-
"textIndent": 3, // Main message text indent
37-
"toolIndent": 2, // Tool call/output indent
36+
"textIndent": 3, // Main message text indent
37+
"toolIndent": 2, // Tool call/output indent
3838

3939
// UI visibility toggles
40-
"showHeader": true, // Show session header
41-
"showFooter": true, // Show status footer
40+
"showHeader": true, // Show session header
41+
"showFooter": true, // Show status footer
4242
"forceSidebarHidden": false, // Force sidebar off (useful for narrow terminals)
4343

4444
// Input box styling
45-
"showInputAgentInfo": true, // Show agent/model info below input box
46-
"showInputBorder": true, // Show decorative border below input
45+
"showInputAgentInfo": true, // Show agent/model info below input box
46+
"showInputBorder": true, // Show decorative border below input
4747
"inputAgentInfoPaddingTop": 1, // Padding above agent info line
48-
"inputBoxPaddingTop": 1, // Blank lines above cursor in input box
49-
"inputBoxPaddingBottom": 0 // Blank lines below cursor in input box
50-
}
48+
"inputBoxPaddingTop": 1, // Blank lines above cursor in input box
49+
"inputBoxPaddingBottom": 0, // Blank lines below cursor in input box
50+
},
5151
}

packages/opencode/src/cli/cmd/tui/context/layout/dense.jsonc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@
3333
"agentInfoMarginTop": 0,
3434

3535
// Reduced indentation to save horizontal space
36-
"textIndent": 2, // Minimal text indent
37-
"toolIndent": 1, // Minimal tool indent
36+
"textIndent": 2, // Minimal text indent
37+
"toolIndent": 1, // Minimal tool indent
3838

3939
// Hide UI chrome to maximize content area
40-
"showHeader": false, // No header
41-
"showFooter": false, // No footer
40+
"showHeader": false, // No header
41+
"showFooter": false, // No footer
4242
"forceSidebarHidden": true, // Always hide sidebar
4343

4444
// Compact input box
45-
"showInputAgentInfo": false, // Move agent/model to status line
46-
"showInputBorder": false, // No decorative border
45+
"showInputAgentInfo": false, // Move agent/model to status line
46+
"showInputBorder": false, // No decorative border
4747
"inputAgentInfoPaddingTop": 0, // No padding (not shown anyway)
48-
"inputBoxPaddingTop": 1, // One blank line above cursor
49-
"inputBoxPaddingBottom": 1 // One blank line below cursor
50-
}
48+
"inputBoxPaddingTop": 1, // One blank line above cursor
49+
"inputBoxPaddingBottom": 1, // One blank line below cursor
50+
},
5151
}

packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,16 +1073,18 @@ function AssistantMessage(props: { message: AssistantMessage; parts: Part[]; las
10731073
<Match when={props.last || final()}>
10741074
{(function () {
10751075
const ctx = use()
1076-
return <box paddingLeft={ctx.layout().textIndent}>
1077-
<text marginTop={ctx.layout().agentInfoMarginTop}>
1078-
<span style={{ fg: local.agent.color(props.message.mode) }}></span>{" "}
1079-
<span style={{ fg: theme.text }}>{Locale.titlecase(props.message.mode)}</span>
1080-
<span style={{ fg: theme.textMuted }}> · {props.message.modelID}</span>
1081-
<Show when={duration()}>
1082-
<span style={{ fg: theme.textMuted }}> · {Locale.duration(duration())}</span>
1083-
</Show>
1084-
</text>
1085-
</box>
1076+
return (
1077+
<box paddingLeft={ctx.layout().textIndent}>
1078+
<text marginTop={ctx.layout().agentInfoMarginTop}>
1079+
<span style={{ fg: local.agent.color(props.message.mode) }}></span>{" "}
1080+
<span style={{ fg: theme.text }}>{Locale.titlecase(props.message.mode)}</span>
1081+
<span style={{ fg: theme.textMuted }}> · {props.message.modelID}</span>
1082+
<Show when={duration()}>
1083+
<span style={{ fg: theme.textMuted }}> · {Locale.duration(duration())}</span>
1084+
</Show>
1085+
</text>
1086+
</box>
1087+
)
10861088
})()}
10871089
</Match>
10881090
</Switch>

packages/sdk/js/src/gen/types.gen.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,10 @@ export type Config = {
10161016
* Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column
10171017
*/
10181018
diff_style?: "auto" | "stacked"
1019+
/**
1020+
* Layout mode (built-in: default, dense; or custom layouts from ~/.config/opencode/layout/)
1021+
*/
1022+
layout?: string
10191023
}
10201024
/**
10211025
* Command configuration, see https://opencode.ai/docs/commands

0 commit comments

Comments
 (0)