fix(desktop): render steer note as a codicon, not an emoji
The inline steer note used a ⏩ emoji. Emit a structured `steer:<text>`
system note and render it in SystemMessage as a codicon (compass) row —
same style as slash-status output. No emoji in the transcript.
This commit is contained in:
parent
efa53fb3be
commit
7cceead273
@ -768,8 +768,9 @@ export function usePromptActions({
|
|||||||
if (result?.status === 'queued') {
|
if (result?.status === 'queued') {
|
||||||
triggerHaptic('submit')
|
triggerHaptic('submit')
|
||||||
// Inline note (not a toast) so the nudge lives in the transcript next
|
// Inline note (not a toast) so the nudge lives in the transcript next
|
||||||
// to the turn it steered — same centered system-note style as slash output.
|
// to the turn it steered. The `steer:` prefix is rendered as a codicon
|
||||||
appendSessionTextMessage(sessionId, 'system', `⏩ steered · ${text}`)
|
// row by SystemMessage (see STEER_NOTE_RE), same style as slash output.
|
||||||
|
appendSessionTextMessage(sessionId, 'system', `steer:${text}`)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
@ -820,6 +820,7 @@ const UserMessage: FC<{
|
|||||||
}
|
}
|
||||||
|
|
||||||
const SLASH_STATUS_RE = /^slash:(?<command>\/[^\n]+)\n(?<output>[\s\S]*)$/
|
const SLASH_STATUS_RE = /^slash:(?<command>\/[^\n]+)\n(?<output>[\s\S]*)$/
|
||||||
|
const STEER_NOTE_RE = /^steer:(?<text>[\s\S]+)$/
|
||||||
|
|
||||||
const SystemMessage: FC = () => {
|
const SystemMessage: FC = () => {
|
||||||
const text = useAuiState(s => messageContentText(s.message.content))
|
const text = useAuiState(s => messageContentText(s.message.content))
|
||||||
@ -828,6 +829,23 @@ const SystemMessage: FC = () => {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const steerNote = text.match(STEER_NOTE_RE)
|
||||||
|
|
||||||
|
if (steerNote?.groups) {
|
||||||
|
return (
|
||||||
|
<MessagePrimitive.Root
|
||||||
|
className="flex max-w-[min(86%,44rem)] items-center gap-1.5 self-center px-2 py-0.5 text-[0.6875rem] leading-5 text-muted-foreground/60"
|
||||||
|
data-role="system"
|
||||||
|
data-slot="aui_system-message-root"
|
||||||
|
>
|
||||||
|
<Codicon className="text-muted-foreground/55" name="compass" size="0.75rem" />
|
||||||
|
<span className="text-muted-foreground/55">steered</span>
|
||||||
|
<span className="text-muted-foreground/35">·</span>
|
||||||
|
<span className="whitespace-pre-wrap">{steerNote.groups.text.trim()}</span>
|
||||||
|
</MessagePrimitive.Root>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
const slashStatus = text.match(SLASH_STATUS_RE)
|
const slashStatus = text.match(SLASH_STATUS_RE)
|
||||||
|
|
||||||
if (slashStatus?.groups) {
|
if (slashStatus?.groups) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user