mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
tui: fix command autocomplete to show for all sessions and adjust message layout
This commit is contained in:
parent
7b2fb0d8ef
commit
34464c0db3
2 changed files with 11 additions and 11 deletions
|
|
@ -307,17 +307,17 @@ function Autocomplete(props: {
|
|||
const results: AutocompleteOption[] = []
|
||||
const s = session()
|
||||
const dialog = useDialog()
|
||||
for (const command of sync.data.command) {
|
||||
results.push({
|
||||
display: "/" + command.name,
|
||||
description: command.description,
|
||||
onSelect: () => {
|
||||
props.input().value = "/" + command.name + " "
|
||||
props.input().cursorPosition = props.input().value.length
|
||||
},
|
||||
})
|
||||
}
|
||||
if (s) {
|
||||
for (const command of sync.data.command) {
|
||||
results.push({
|
||||
display: "/" + command.name,
|
||||
description: command.description,
|
||||
onSelect: () => {
|
||||
props.input().value = "/" + command.name + " "
|
||||
props.input().cursorPosition = props.input().value.length
|
||||
},
|
||||
})
|
||||
}
|
||||
results.push(
|
||||
{
|
||||
display: "/undo",
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ function TextPart(props: { part: TextPart; message: AssistantMessage }) {
|
|||
const local = useLocal()
|
||||
|
||||
return (
|
||||
<box paddingLeft={3} marginTop={1}>
|
||||
<box paddingLeft={3} marginTop={1} flexShrink={0}>
|
||||
<text>{props.part.text.trim()}</text>
|
||||
<text>
|
||||
<span style={{ fg: local.agent.color(agent().name) }}>{Locale.titlecase(agent().name)}</span>{" "}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue