fix(web): unify mic/send button and restore scroll-down
Some checks failed
CI / test (push) Failing after 20s
Some checks failed
CI / test (push) Failing after 20s
- show one action button in composer: mic when empty, send when text exists - add floating scroll-to-bottom button in message list - exclude non-text/media messages from Chat Info links list to avoid duplicates
This commit is contained in:
@@ -48,6 +48,7 @@ export function MessageComposer() {
|
||||
const [recordingState, setRecordingState] = useState<RecordingState>("idle");
|
||||
const [recordSeconds, setRecordSeconds] = useState(0);
|
||||
const [dragHint, setDragHint] = useState<"idle" | "lock" | "cancel">("idle");
|
||||
const hasTextToSend = text.trim().length > 0;
|
||||
|
||||
useEffect(() => {
|
||||
recordingStateRef.current = recordingState;
|
||||
@@ -560,23 +561,27 @@ export function MessageComposer() {
|
||||
}}
|
||||
/>
|
||||
|
||||
<button
|
||||
className="h-[42px] w-[72px] rounded-full bg-sky-500 px-4 text-sm font-semibold text-slate-950 hover:bg-sky-400 disabled:opacity-60"
|
||||
disabled={recordingState !== "idle"}
|
||||
onClick={handleSend}
|
||||
type="button"
|
||||
>
|
||||
Send
|
||||
</button>
|
||||
|
||||
<button
|
||||
className={`h-[42px] w-[56px] rounded-full px-3 text-sm font-semibold ${recordingState === "idle" ? "bg-emerald-500 text-slate-950 hover:bg-emerald-400" : "bg-slate-700 text-slate-300"}`}
|
||||
disabled={isUploading}
|
||||
onPointerDown={onMicPointerDown}
|
||||
type="button"
|
||||
>
|
||||
Mic
|
||||
</button>
|
||||
{hasTextToSend ? (
|
||||
<button
|
||||
className="h-[42px] w-[56px] rounded-full bg-sky-500 px-3 text-sm font-semibold text-slate-950 hover:bg-sky-400 disabled:opacity-60"
|
||||
disabled={recordingState !== "idle" || !activeChatId}
|
||||
onClick={handleSend}
|
||||
type="button"
|
||||
>
|
||||
➤
|
||||
</button>
|
||||
) : (
|
||||
<button
|
||||
className={`h-[42px] w-[56px] rounded-full px-3 text-sm font-semibold ${
|
||||
recordingState === "idle" ? "bg-emerald-500 text-slate-950 hover:bg-emerald-400" : "bg-slate-700 text-slate-300"
|
||||
}`}
|
||||
disabled={isUploading || !activeChatId}
|
||||
onPointerDown={onMicPointerDown}
|
||||
type="button"
|
||||
>
|
||||
🎤
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{selectedFile ? (
|
||||
|
||||
Reference in New Issue
Block a user