feat: add shift-enter hint below chat composer
This commit is contained in:
parent
42ece2aceb
commit
890f4d6bcb
6 changed files with 129 additions and 109 deletions
|
|
@ -70,6 +70,7 @@ export function ChatComposer({
|
|||
const { t } = useTranslation()
|
||||
const canInput = inputDisabledReason === null
|
||||
const composingRef = useRef(false)
|
||||
const hasInput = input.trim().length > 0
|
||||
const disabledMessage =
|
||||
inputDisabledReason === null
|
||||
? null
|
||||
|
|
@ -96,9 +97,10 @@ export function ChatComposer({
|
|||
|
||||
return (
|
||||
<div className="before:bg-background pointer-events-none relative z-10 -mt-[24px] shrink-0 [scrollbar-gutter:stable] overflow-y-auto px-4 pb-[calc(1rem+env(safe-area-inset-bottom))] before:pointer-events-none before:absolute before:inset-x-0 before:top-[24px] before:bottom-0 before:content-[''] md:px-8 md:pb-8 lg:px-24 xl:px-48">
|
||||
<div className="pointer-events-auto mx-auto flex max-w-[1000px] flex-col items-end">
|
||||
<div
|
||||
className={cn(
|
||||
"bg-card border-border/60 pointer-events-auto relative mx-auto flex max-w-[1000px] flex-col rounded-2xl border p-3 shadow-sm transition-colors",
|
||||
"bg-card border-border/60 relative flex w-full flex-col rounded-2xl border p-3 shadow-sm transition-colors",
|
||||
isDragActive && "border-violet-400/70 bg-violet-500/5",
|
||||
)}
|
||||
onDragEnter={onDragEnter}
|
||||
|
|
@ -212,6 +214,19 @@ export function ChatComposer({
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
aria-hidden={!hasInput}
|
||||
className={cn(
|
||||
"border-border/70 bg-muted text-foreground mt-2 inline-flex items-center rounded-md border px-3 py-1.5 text-xs shadow-lg shadow-black/10 transition-all duration-200 dark:shadow-black/30",
|
||||
hasInput
|
||||
? "translate-y-0 opacity-100"
|
||||
: "pointer-events-none -translate-y-1 opacity-0",
|
||||
)}
|
||||
>
|
||||
{t("chat.composeHint")}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@
|
|||
},
|
||||
"sendMessage": "বার্তা পাঠান",
|
||||
"sendHint": "পাঠাতে Enter চাপুন\nনতুন লাইনের জন্য Shift + Enter",
|
||||
"composeHint": "পাঠাতে Enter চাপুন, নতুন লাইনের জন্য Shift + Enter",
|
||||
"contextTitle": "প্রসঙ্গ",
|
||||
"contextDetail": "বিস্তারিত দেখুন",
|
||||
"contextCompressAt": "Compress at",
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@
|
|||
},
|
||||
"sendMessage": "Odeslat zprávu",
|
||||
"sendHint": "Enter pro odeslání\nShift + Enter pro nový řádek",
|
||||
"composeHint": "Enter pro odeslání, Shift + Enter pro nový řádek",
|
||||
"contextTitle": "Kontext",
|
||||
"contextDetail": "Zobrazit detail",
|
||||
"contextCompressAt": "Komprimovat při",
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@
|
|||
},
|
||||
"sendMessage": "Send message",
|
||||
"sendHint": "Press Enter to send\nShift + Enter for a new line",
|
||||
"composeHint": "Press Enter to send, Shift + Enter for a new line",
|
||||
"contextTitle": "Context",
|
||||
"contextDetail": "View Details",
|
||||
"contextCompressAt": "Compress at",
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@
|
|||
},
|
||||
"sendMessage": "Enviar mensagem",
|
||||
"sendHint": "Pressione Enter para enviar\nShift + Enter para nova linha",
|
||||
"composeHint": "Pressione Enter para enviar, Shift + Enter para nova linha",
|
||||
"contextTitle": "Contexto",
|
||||
"contextDetail": "Ver Detalhes",
|
||||
"contextCompressAt": "Comprimir em",
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@
|
|||
},
|
||||
"sendMessage": "发送消息",
|
||||
"sendHint": "按 Enter 发送\nShift + Enter 换行",
|
||||
"composeHint": "按 Enter 发送,Shift + Enter 换行",
|
||||
"contextTitle": "上下文",
|
||||
"contextDetail": "查看详情",
|
||||
"contextCompressAt": "压缩阈值",
|
||||
|
|
|
|||
Loading…
Reference in a new issue