fix(ui/chat): wrap TokenInput children in flex row and fix placeholder
This commit is contained in:
3 files changed
+81
-52
No files matched your search
@@ -250,32 +250,52 @@ function menuHeading(trigger: string | null): string {
|
||||
</li>
|
||||
</ul>
|
||||
<ChatSuggestions v-if="!flat && messages.length" />
|
||||
<TokenInput
|
||||
:controller="prompt"
|
||||
submit-shortcut="enter"
|
||||
:class="
|
||||
cn(
|
||||
'relative flex gap-2 rounded-xl border transition-colors duration-200',
|
||||
flat ? 'items-center border-transparent px-2 py-1.5' : 'items-end border-border-strong bg-muted px-3 py-2.5',
|
||||
)
|
||||
"
|
||||
@value-change="onValueChange"
|
||||
@submit="onSubmit"
|
||||
>
|
||||
<div v-if="$slots.start" :class="cn('flex flex-none items-center', !flat && 'mb-1.5')">
|
||||
<slot name="start" />
|
||||
</div>
|
||||
|
||||
<TokenInputEditor
|
||||
aria-label="Message Archie"
|
||||
:placeholder="placeholderHint || 'Message Archie (@ workflow, # task, / command)'"
|
||||
<TokenInput :controller="prompt" submit-shortcut="enter" @value-change="onValueChange" @submit="onSubmit">
|
||||
<div
|
||||
:class="
|
||||
cn(
|
||||
'max-h-40 min-w-0 flex-1 overflow-y-auto bg-transparent text-label pointer-coarse:text-base outline-none',
|
||||
flat ? 'min-h-10 py-2.5 text-base leading-5' : 'min-h-11 py-1 leading-6',
|
||||
'relative flex gap-2 rounded-xl border transition-colors duration-200',
|
||||
flat ? 'items-center border-transparent px-2 py-1.5' : 'items-end border-border-strong bg-muted px-3 py-2.5',
|
||||
)
|
||||
"
|
||||
/>
|
||||
>
|
||||
<div v-if="$slots.start" :class="cn('flex flex-none items-center', !flat && 'mb-1.5')">
|
||||
<slot name="start" />
|
||||
</div>
|
||||
|
||||
<TokenInputEditor
|
||||
aria-label="Message Archie"
|
||||
:placeholder="placeholderHint || 'Message Archie (@ workflow, # task, / command)'"
|
||||
:class="
|
||||
cn(
|
||||
'max-h-40 min-w-0 flex-1 overflow-y-auto bg-transparent text-label pointer-coarse:text-base outline-none',
|
||||
flat ? 'min-h-10 py-2.5 text-base leading-5' : 'min-h-11 py-1 leading-6',
|
||||
)
|
||||
"
|
||||
/>
|
||||
|
||||
<div :class="cn('flex flex-none items-center gap-2', !flat && 'mb-1.5')">
|
||||
<slot name="actions" />
|
||||
<Button v-if="isSending" variant="outline" size="sm" @click="stopTurn">Stop</Button>
|
||||
<Button
|
||||
v-if="canRecord && !composerText.trim()"
|
||||
size="sm"
|
||||
:variant="recording ? 'destructive' : 'outline'"
|
||||
:disabled="isSending && !recording"
|
||||
:aria-label="recording ? 'Stop recording and send' : 'Record a voice message'"
|
||||
@click="toggleRecording"
|
||||
><Mic data-icon="inline-start" />{{ recording ? "Send" : "" }}</Button
|
||||
>
|
||||
<p v-if="recordError" class="px-1 text-caption text-danger" role="alert">{{ recordError }}</p>
|
||||
<Button
|
||||
size="sm"
|
||||
:variant="composerText.trim() ? 'default' : 'secondary'"
|
||||
:disabled="!composerText.trim()"
|
||||
@click="sendMessage()"
|
||||
>{{ isSending ? "Queue" : "Send" }}</Button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<TriggerMenu :triggers="triggers">
|
||||
<TriggerMenuContent
|
||||
@@ -315,28 +335,6 @@ function menuHeading(trigger: string | null): string {
|
||||
</TokenInputTokenRemove>
|
||||
</TokenInputToken>
|
||||
</template>
|
||||
|
||||
<div :class="cn('flex flex-none items-center gap-2', !flat && 'mb-1.5')">
|
||||
<slot name="actions" />
|
||||
<Button v-if="isSending" variant="outline" size="sm" @click="stopTurn">Stop</Button>
|
||||
<Button
|
||||
v-if="canRecord && !composerText.trim()"
|
||||
size="sm"
|
||||
:variant="recording ? 'destructive' : 'outline'"
|
||||
:disabled="isSending && !recording"
|
||||
:aria-label="recording ? 'Stop recording and send' : 'Record a voice message'"
|
||||
@click="toggleRecording"
|
||||
><Mic data-icon="inline-start" />{{ recording ? "Send" : "" }}</Button
|
||||
>
|
||||
<p v-if="recordError" class="px-1 text-caption text-danger" role="alert">{{ recordError }}</p>
|
||||
<Button
|
||||
size="sm"
|
||||
:variant="composerText.trim() ? 'default' : 'secondary'"
|
||||
:disabled="!composerText.trim()"
|
||||
@click="sendMessage()"
|
||||
>{{ isSending ? "Queue" : "Send" }}</Button
|
||||
>
|
||||
</div>
|
||||
</TokenInput>
|
||||
</div>
|
||||
</template>
|
||||
+1
-1
@@ -354,7 +354,7 @@
|
||||
}
|
||||
|
||||
[data-slot="token-input-editor"][data-empty]::before {
|
||||
content: attr(data-placeholder);
|
||||
content: attr(aria-placeholder);
|
||||
color: var(--muted-foreground);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user