Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: move Read aloud and Edit response into the More menu (#11920)

Michael Han2d219b0e5b71
diff --git a/studio/frontend/src/components/assistant-ui/thread.tsx b/studio/frontend/src/components/assistant-ui/thread.tsx
index b7cfd2cbc23..61d6d8727af 100644
--- a/studio/frontend/src/components/assistant-ui/thread.tsx
+++ b/studio/frontend/src/components/assistant-ui/thread.tsx
@@ -327,8 +327,10 @@ import {
PencilRulerIcon,
Scroll01Icon,
Telescope02Icon,
+ VolumeMute02Icon,
} from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
+import { Volume02Icon } from "@/lib/volume-icons";
import { useNavigate } from "@tanstack/react-router";
import {
ArrowDownIcon,
@@ -347,8 +349,6 @@ import {
RefreshCwIcon,
SquareIcon,
TerminalIcon,
- Volume2Icon,
- VolumeXIcon,
XIcon,
} from "lucide-react";
import {
@@ -7870,22 +7870,25 @@ const AssistantMessage: FC = () => {
)}
{isEditing ? (
<div className="flex flex-col gap-2 w-full">
- <textarea
- ref={textareaRef}
- defaultValue={extractTaggedText(messageContent)}
- className="w-full p-3 rounded-xl bg-muted border border-border text-foreground focus:ring-1 focus:ring-ring outline-none overflow-y-auto resize-none font-mono text-sm max-h-[70dvh]"
- autoFocus
- onInput={adjustHeight}
- onKeyDown={(e) => {
- e.stopPropagation();
- if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) {
- handleSave();
- }
- if (e.key === 'Escape') {
- setEditingId(null); // UX: Close editor on Escape
- }
- }}
- />
+ {/* Borderless textarea, so auto-grow fits with no scrollbar; the wrapper keeps corners round. */}
+ <div className="overflow-hidden rounded-xl border-[0.5px] border-border bg-muted focus-within:border-ring">
+ <textarea
+ ref={textareaRef}
+ defaultValue={extractTaggedText(messageContent)}
+ className="block w-full p-3 bg-transparent text-foreground outline-none overflow-y-auto resize-none font-mono text-sm max-h-[70dvh]"
+ autoFocus
+ onInput={adjustHeight}
+ onKeyDown={(e) => {
+ e.stopPropagation();
+ if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) {
+ handleSave();
+ }
+ if (e.key === 'Escape') {
+ setEditingId(null); // UX: Close editor on Escape
+ }
+ }}
+ />
+ </div>
<div className="flex justify-end gap-2">
<Button size="sm" variant="ghost" onClick={() => setEditingId(null)} className="h-8 text-xs">Cancel</Button>
<Button size="sm" onClick={handleSave} className="h-8 text-xs">Save</Button>
@@ -8310,6 +8313,28 @@ const EditAssistantMessageButton: FC = () => {
);
};
+// The More menu's Edit response, shown when the button is not pinned to the bar.
+const EditAssistantMessageMenuItem: FC = () => {
+ const messageId = useAuiState(({ message }) => message.id);
+ const researchRunId = useResearchMessageRunId();
+ const isRunning = useAuiState(({ thread }) => thread.isRunning);
+ const researchActive = useThreadResearchActive();
+ const setEditingId = useChatRuntimeStore((s) => s.setEditingMessageId);
+
+ if (researchRunId) return null;
+
+ return (
+ <ActionBarMorePrimitive.Item
+ disabled={isRunning || researchActive}
+ onSelect={() => setEditingId(messageId)}
+ className="aui-action-bar-more-item flex cursor-pointer select-none items-center gap-2 rounded-[12px] px-3 py-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
+ >
+ <HugeiconsIcon icon={Edit03Icon} strokeWidth={1.75} className="size-icon" />
+ Edit response
+ </ActionBarMorePrimitive.Item>
+ );
+};
+
async function exportMessageMarkdown(content: string): Promise<void> {
try {
await downloadFile(
@@ -8336,6 +8361,9 @@ const AssistantActionBar: FC = () => {
const activeProjectId = useChatRuntimeStore((s) => s.activeProjectId);
const [detailsOpen, setDetailsOpen] = useState(false);
const ttsEnabled = useVoiceSettingsStore((s) => s.ttsEnabled);
+ // Off by default: Read aloud and Edit response live in the More menu.
+ const inlineReadAloud = useChatPreferencesStore((s) => s.showInlineReadAloud);
+ const inlineEdit = useChatPreferencesStore((s) => s.showInlineEditResponse);
// hideWhenRunning is thread-level, so a new run would hide this bar and its
// only Stop reading control while read-aloud keeps playing; keep it shown.
const speaking = useAuiState(({ message }) => message.speech != null);
@@ -8362,7 +8390,7 @@ const AssistantActionBar: FC = () => {
className="aui-assistant-action-bar-root col-start-3 row-start-2 flex items-center gap-1 text-chat-icon-fg [&_button:not([data-slot=message-timing-trigger])]:size-8 [&_button]:!rounded-full [&_button:hover]:bg-chat-icon-bg-hover [&_button:hover]:text-chat-icon-fg-hover"
>
<CopyButton />
- <EditAssistantMessageButton />
+ {inlineEdit && <EditAssistantMessageButton />}
{!researchRunId && !researchActive && (
<ActionBarPrimitive.Reload asChild={true}>
<TooltipIconButton tooltip="Refresh">
@@ -8372,11 +8400,11 @@ const AssistantActionBar: FC = () => {
)}
<ForkCountBadge />
<DeleteMessageButton />
- {ttsEnabled && (
+ {inlineReadAloud && ttsEnabled && (
<MessagePrimitive.If speaking={false}>
<ActionBarPrimitive.Speak asChild={true}>
<TooltipIconButton tooltip="Read aloud" aria-label="Read aloud">
- <Volume2Icon strokeWidth={1.75} className="size-icon" />
+ <HugeiconsIcon icon={Volume02Icon} strokeWidth={1.75} className="size-icon" />
</TooltipIconButton>
</ActionBarPrimitive.Speak>
</MessagePrimitive.If>
@@ -8390,7 +8418,7 @@ const AssistantActionBar: FC = () => {
aria-label="Stop reading"
className="text-destructive"
>
- <VolumeXIcon strokeWidth={1.75} className="size-icon" />
+ <HugeiconsIcon icon={VolumeMute02Icon} strokeWidth={1.75} className="size-icon" />
</TooltipIconButton>
</ActionBarPrimitive.StopSpeaking>
</MessagePrimitive.If>
@@ -8411,10 +8439,25 @@ const AssistantActionBar: FC = () => {
side="bottom"
align="start"
onCloseAutoFocus={(e) => e.preventDefault()}
- className="aui-action-bar-more-content z-50 min-w-32 overflow-hidden rounded-[21px] bg-popover px-[calc(9px*var(--ui-space-scale,1))] py-2 text-popover-foreground shadow-[0_2px_8px_-2px_rgba(0,0,0,0.16)] dark:shadow-none"
+ className="aui-action-bar-more-content z-50 min-w-32 overflow-hidden rounded-[21px] bg-popover px-[calc(9px*var(--ui-space-scale,1))] py-2 text-popover-foreground shadow-[0_2px_8px_-2px_rgba(0,0,0,0.16)] dark:shadow-[0_8px_28px_-6px_var(--background)]"
>
{/* Prevent an outside dismissal from triggering Delete. */}
<MenuDismissGuard triggerRef={moreMenuTriggerRef} />
+ {!inlineReadAloud && ttsEnabled && (
+ <MessagePrimitive.If speaking={false}>
+ <ActionBarPrimitive.Speak asChild={true}>
+ <ActionBarMorePrimitive.Item className="aui-action-bar-more-item flex cursor-pointer select-none items-center gap-2 rounded-[12px] px-3 py-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50">
+ <HugeiconsIcon
+ icon={Volume02Icon}
+ strokeWidth={1.75}
+ className="size-icon"
+ />
+ Read aloud
+ </ActionBarMorePrimitive.Item>
+ </ActionBarPrimitive.Speak>
+ </MessagePrimitive.If>
+ )}
+ {!inlineEdit && <EditAssistantMessageMenuItem />}
<ActionBarMorePrimitive.Item
disabled={forkDisabled}
onSelect={() => void forkMessage()}
diff --git a/studio/frontend/src/features/chat/stores/chat-preferences-store.ts b/studio/frontend/src/features/chat/stores/chat-preferences-store.ts
index 47d1ffa23c4..b1f2c7af07a 100644
--- a/studio/frontend/src/features/chat/stores/chat-preferences-store.ts
+++ b/studio/frontend/src/features/chat/stores/chat-preferences-store.ts
@@ -26,6 +26,8 @@ import {
// expanded, see display-visibility.ts. foldToolActivityIntoThinking: on hides a round's tool calls
// until its thinking block is opened, and has no effect while toolVisibility is "expanded".
// pastedTextMinChars: paste length that becomes a .txt attachment; 0 is off.
+// showInlineReadAloud / showInlineEditResponse: on keeps that action in each response's action bar
+// instead of its More menu.
export interface ChatPreferencesState {
plainTextComposer: boolean;
setPlainTextComposer: (value: boolean) => void;
@@ -43,6 +45,10 @@ export interface ChatPreferencesState {
setShowModelDisclaimer: (value: boolean) => void;
showResponseModel: boolean;
setShowResponseModel: (value: boolean) => void;
+ showInlineReadAloud: boolean;
+ setShowInlineReadAloud: (value: boolean) => void;
+ showInlineEditResponse: boolean;
+ setShowInlineEditResponse: (value: boolean) => void;
thinkingVisibility: DisplayVisibility;
setThinkingVisibility: (value: DisplayVisibility) => void;
toolVisibility: DisplayVisibility;
@@ -83,6 +89,12 @@ export const useChatPreferencesStore = create<ChatPreferencesState>()(
set({ showModelDisclaimer }),
showResponseModel: false,
setShowResponseModel: (showResponseModel) => set({ showResponseModel }),
+ showInlineReadAloud: false,
+ setShowInlineReadAloud: (showInlineReadAloud) =>
+ set({ showInlineReadAloud }),
+ showInlineEditResponse: false,
+ setShowInlineEditResponse: (showInlineEditResponse) =>
+ set({ showInlineEditResponse }),
thinkingVisibility: DEFAULT_THINKING_VISIBILITY,
setThinkingVisibility: (thinkingVisibility) =>
set({ thinkingVisibility }),
@@ -114,6 +126,8 @@ export const useChatPreferencesStore = create<ChatPreferencesState>()(
alwaysDeleteChatFiles: saved?.alwaysDeleteChatFiles ?? false,
showModelDisclaimer: saved?.showModelDisclaimer ?? false,
showResponseModel: saved?.showResponseModel ?? false,
+ showInlineReadAloud: saved?.showInlineReadAloud ?? false,
+ showInlineEditResponse: saved?.showInlineEditResponse ?? false,
thinkingVisibility: migrateVisibility(
saved?.thinkingVisibility,
legacy?.collapseThinkingByDefault,
diff --git a/studio/frontend/src/features/loaded-models/loaded-models-indicator.tsx b/studio/frontend/src/features/loaded-models/loaded-models-indicator.tsx
index 4d48e4985e6..ef37c3bef0e 100644
--- a/studio/frontend/src/features/loaded-models/loaded-models-indicator.tsx
+++ b/studio/frontend/src/features/loaded-models/loaded-models-indicator.tsx
@@ -28,8 +28,8 @@ import {
Mic01Icon,
RemoveCircleIcon,
Video01Icon,
- VolumeHighIcon,
} from "@hugeicons/core-free-icons";
+import { Volume02Icon } from "@/lib/volume-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import { useNavigate, useRouterState } from "@tanstack/react-router";
import { useCallback, useEffect, useRef } from "react";
@@ -55,7 +55,7 @@ const COLLAPSED_KEY = LOADED_MODELS_PREFERENCE_KEYS.collapsed;
const KIND_ICONS: Record<LoadedModelKind, typeof SparkleIcon> = {
text: Message01Icon,
- tts: VolumeHighIcon,
+ tts: Volume02Icon,
image: Image01Icon,
video: Video01Icon,
stt: Mic01Icon,
diff --git a/studio/frontend/src/features/settings/settings-search.ts b/studio/frontend/src/features/settings/settings-search.ts
index 9046132e6ca..62baed9a124 100644
--- a/studio/frontend/src/features/settings/settings-search.ts
+++ b/studio/frontend/src/features/settings/settings-search.ts
@@ -123,6 +123,8 @@ export const SETTINGS_SEARCH_INDEX: Record<SettingsTab, TranslationKey[]> = {
"settings.chat.artifacts.allowNetworkAccess",
"settings.chat.webSearch.images",
"settings.chat.modelDisclaimer",
+ "settings.chat.inlineReadAloud",
+ "settings.chat.inlineEditResponse",
"settings.chat.projectsSection",
"settings.chat.groups.menu.title",
],
diff --git a/studio/frontend/src/features/settings/tabs/chat-tab.tsx b/studio/frontend/src/features/settings/tabs/chat-tab.tsx
index 531f7ce8c23..6f64fbecfae 100644
--- a/studio/frontend/src/features/settings/tabs/chat-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/chat-tab.tsx
@@ -233,6 +233,18 @@ export function ChatTab() {
const showResponseModel = useChatPreferencesStore(
(state) => state.showResponseModel,
);
+ const showInlineReadAloud = useChatPreferencesStore(
+ (state) => state.showInlineReadAloud,
+ );
+ const setShowInlineReadAloud = useChatPreferencesStore(
+ (state) => state.setShowInlineReadAloud,
+ );
+ const showInlineEditResponse = useChatPreferencesStore(
+ (state) => state.showInlineEditResponse,
+ );
+ const setShowInlineEditResponse = useChatPreferencesStore(
+ (state) => state.setShowInlineEditResponse,
+ );
const setShowResponseModel = useChatPreferencesStore(
(state) => state.setShowResponseModel,
);
@@ -535,6 +547,26 @@ export function ChatTab() {
onCheckedChange={setShowResponseModel}
/>
</SettingsRow>
+ <SettingsRow
+ label={t("settings.chat.inlineReadAloud")}
+ description={t("settings.chat.inlineReadAloudDescription")}
+ >
+ <Switch
+ aria-label={t("settings.chat.inlineReadAloud")}
+ checked={showInlineReadAloud}
+ onCheckedChange={setShowInlineReadAloud}
+ />
+ </SettingsRow>
+ <SettingsRow
+ label={t("settings.chat.inlineEditResponse")}
+ description={t("settings.chat.inlineEditResponseDescription")}
+ >
+ <Switch
+ aria-label={t("settings.chat.inlineEditResponse")}
+ checked={showInlineEditResponse}
+ onCheckedChange={setShowInlineEditResponse}
+ />
+ </SettingsRow>
<SettingsRow
label={t("settings.chat.projectsSection")}
description={t("settings.chat.projectsSectionDescription")}
diff --git a/studio/frontend/src/features/settings/tabs/voice-tab.tsx b/studio/frontend/src/features/settings/tabs/voice-tab.tsx
index 5e11540c9eb..2dacb7e5ade 100644
--- a/studio/frontend/src/features/settings/tabs/voice-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/voice-tab.tsx
@@ -49,8 +49,8 @@ import { toast } from "@/lib/toast";
import {
AudioWave01Icon,
Search01Icon,
- VolumeHighIcon,
} from "@hugeicons/core-free-icons";
+import { Volume02Icon } from "@/lib/volume-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import { useNavigate } from "@tanstack/react-router";
import { SquareIcon } from "lucide-react";
@@ -1520,7 +1520,7 @@ export function VoiceTab() {
) : (
<>
<HugeiconsIcon
- icon={VolumeHighIcon}
+ icon={Volume02Icon}
className="mr-1.5 size-3.5"
/>
{t("settings.voice.readAloud.previewAction")}
diff --git a/studio/frontend/src/features/video/video-page.tsx b/studio/frontend/src/features/video/video-page.tsx
index b60e6bdae2d..748983e85cf 100644
--- a/studio/frontend/src/features/video/video-page.tsx
+++ b/studio/frontend/src/features/video/video-page.tsx
@@ -10,8 +10,8 @@ import {
ImageCropIcon,
Image03Icon,
InformationCircleIcon,
- VolumeHighIcon,
} from "@hugeicons/core-free-icons";
+import { Volume02Icon } from "@/lib/volume-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import { AdvancedDisclosure } from "@/components/advanced-disclosure";
@@ -4228,7 +4228,7 @@ function VideoGenerator({
/>
{selected.has_audio && (
<div className="absolute left-4 top-4 flex items-center gap-1 rounded-lg bg-background/80 px-2 py-1 text-ui-11 font-medium shadow-lg ring-1 ring-border backdrop-blur">
- <HugeiconsIcon icon={VolumeHighIcon} className="size-3.5" />
+ <HugeiconsIcon icon={Volume02Icon} className="size-3.5" />
Audio
</div>
)}
diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.ts
index 32a2cd3015b..7cafa908919 100644
--- a/studio/frontend/src/i18n/locales/en.ts
+++ b/studio/frontend/src/i18n/locales/en.ts
@@ -1625,6 +1625,12 @@ export const en = {
showResponseModel: "Response model",
showResponseModelDescription:
"Show model details in assistant responses.",
+ inlineReadAloud: "Read aloud on responses",
+ inlineReadAloudDescription:
+ "Keep Read aloud on every response, instead of in the More menu.",
+ inlineEditResponse: "Edit response on responses",
+ inlineEditResponseDescription:
+ "Keep Edit response on every response, instead of in the More menu.",
modelDisclaimer: "Model disclaimer",
modelDisclaimerDescription:
'Show "LLMs can make mistakes" under the chat box.',
diff --git a/studio/frontend/src/lib/volume-icons.ts b/studio/frontend/src/lib/volume-icons.ts
new file mode 100644
index 00000000000..d7e618cf4f1
--- /dev/null
+++ b/studio/frontend/src/lib/volume-icons.ts
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import type { IconSvgElement } from "@hugeicons/react";
+
+// Hugeicons volume-02 (MIT), missing from the pinned @hugeicons/core-free-icons. Pairs with its
+// VolumeMute02Icon, which the package has.
+export const Volume02Icon: IconSvgElement = [
+ [
+ "path",
+ {
+ d: "M14 14.8135V9.18646C14 6.04126 14 4.46866 13.0747 4.0773C12.1494 3.68593 11.0603 4.79793 8.88232 7.02192C7.75439 8.17365 7.11085 8.42869 5.50604 8.42869C4.10257 8.42869 3.40084 8.42869 2.89675 8.77262C1.85035 9.48655 2.00852 10.882 2.00852 12C2.00852 13.118 1.85035 14.5134 2.89675 15.2274C3.40084 15.5713 4.10257 15.5713 5.50604 15.5713C7.11085 15.5713 7.75439 15.8264 8.88232 16.9781C11.0603 19.2021 12.1494 20.3141 13.0747 19.9227C14 19.5313 14 17.9587 14 14.8135Z",
+ stroke: "currentColor",
+ strokeLinecap: "round",
+ strokeLinejoin: "round",
+ strokeWidth: "1.5",
+ key: "0",
+ },
+ ],
+ [
+ "path",
+ {
+ d: "M17 9C17.6254 9.81968 18 10.8634 18 12C18 13.1366 17.6254 14.1803 17 15",
+ stroke: "currentColor",
+ strokeLinecap: "round",
+ strokeLinejoin: "round",
+ strokeWidth: "1.5",
+ key: "1",
+ },
+ ],
+ [
+ "path",
+ {
+ d: "M20 7C21.2508 8.36613 22 10.1057 22 12C22 13.8943 21.2508 15.6339 20 17",
+ stroke: "currentColor",
+ strokeLinecap: "round",
+ strokeLinejoin: "round",
+ strokeWidth: "1.5",
+ key: "2",
+ },
+ ],
+];