mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-09 13:21:42 +00:00
opentui(v2): fix streaming caret alignment during model response (item 10)
A just-started assistant turn (message.start, no deltas yet) rendered an EMPTY fallback <text> on the glyph's line plus the `▍` caret on a SEPARATE line below — so `⚕` sat alone with the caret dangling beneath it, indented. Folded the caret into the no-parts fallback so it renders inline with the glyph (` ⚕ ▍`); a settled row still shows its flat text, a turn with parts renders the parts. 71 pass. Live-smoked: streaming start now shows `⚕ ▍` on one line; the reply text then aligns with the glyph.
This commit is contained in:
parent
37b74f4df3
commit
f423aebb80
1 changed files with 15 additions and 8 deletions
|
|
@ -36,9 +36,21 @@ export function MessageLine(props: { message: Message }) {
|
|||
<Show
|
||||
when={m().role === 'assistant' && hasParts()}
|
||||
fallback={
|
||||
<text>
|
||||
<span style={{ fg: theme().color.text }}>{m().text}</span>
|
||||
</text>
|
||||
// No parts yet: the just-started streaming turn shows ONLY the caret,
|
||||
// inline with the glyph (not an empty line + a dangling caret below —
|
||||
// item 10 cursor misalignment); a settled row shows its flat text.
|
||||
<Show
|
||||
when={m().streaming && !hasParts()}
|
||||
fallback={
|
||||
<text>
|
||||
<span style={{ fg: theme().color.text }}>{m().text}</span>
|
||||
</text>
|
||||
}
|
||||
>
|
||||
<text>
|
||||
<span style={{ fg: theme().color.muted }}>▍</span>
|
||||
</text>
|
||||
</Show>
|
||||
}
|
||||
>
|
||||
<For each={m().parts ?? []}>
|
||||
|
|
@ -59,11 +71,6 @@ export function MessageLine(props: { message: Message }) {
|
|||
)}
|
||||
</For>
|
||||
</Show>
|
||||
<Show when={m().streaming && !hasParts()}>
|
||||
<text>
|
||||
<span style={{ fg: theme().color.muted }}>▍</span>
|
||||
</text>
|
||||
</Show>
|
||||
</box>
|
||||
</box>
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue