feat: refine generation workspace experience

This commit is contained in:
2026-06-08 13:44:03 +08:00
35 changed files with 5249 additions and 350 deletions
+50 -3
View File
@@ -106,6 +106,9 @@ import {
type WorkbenchKeepaliveTask,
MODE_META,
MODE_OPTIONS,
CHAT_MODEL_OPTIONS,
THINKING_SPEED_OPTIONS,
THINKING_DEPTH_OPTIONS,
IMAGE_MODEL_OPTIONS,
VIDEO_MODEL_OPTIONS,
RATIO_OPTIONS,
@@ -354,9 +357,13 @@ function WorkbenchPage({
const [videoModel, setVideoModel] = useState(VIDEO_MODEL_OPTIONS[0].value);
const [videoFrameMode, setVideoFrameMode] = useState("omni");
const [videoRatio, setVideoRatio] = useState("16:9");
const [videoDuration, setVideoDuration] = useState("4");
const [videoDuration, setVideoDuration] = useState("5");
const [videoQuality, setVideoQuality] = useState(() => getDefaultVideoQuality(VIDEO_MODEL_OPTIONS[0].value));
const [chatModel, setChatModel] = useState(CHAT_MODEL_OPTIONS[0].value);
const [thinkingSpeed, setThinkingSpeed] = useState(THINKING_SPEED_OPTIONS[0].value);
const [thinkingDepth, setThinkingDepth] = useState(THINKING_DEPTH_OPTIONS[0].value);
useEffect(() => {
let cancelled = false;
@@ -412,13 +419,13 @@ function WorkbenchPage({
const referenceCount = referenceItems.length;
const activeVideoModelValue = toHappyHorseDisplayModel(videoModel);
const activeModelValue =
activeMode === "image" ? imageModel : activeMode === "video" ? activeVideoModelValue : CHAT_MODEL;
activeMode === "image" ? imageModel : activeMode === "video" ? activeVideoModelValue : chatModel;
const activeModel =
activeMode === "image"
? imageModelOptions.find((item) => item.value === imageModel)?.label || imageModel
: activeMode === "video"
? videoModelOptions.find((item) => item.value === activeVideoModelValue)?.label || activeVideoModelValue
: "OmniChat";
: CHAT_MODEL_OPTIONS.find((item) => item.value === chatModel)?.label || chatModel;
const conversationRecords = useMemo<WebProjectSummary[]>(
() =>
conversations.map((conversation) => ({
@@ -2737,6 +2744,46 @@ function WorkbenchPage({
ariaLabel="工作台模式"
direction={dropdownDirection}
/>
{activeMode === "chat" && (
<>
<SelectChip
chipId="chat-model"
value={chatModel}
options={CHAT_MODEL_OPTIONS}
disabled={disabled}
isOpen={toolbarMenuId === "chat-model"}
onToggle={() => toggleToolbarMenu("chat-model")}
onClose={closeToolbarMenus}
onChange={setChatModel}
ariaLabel="对话模型"
direction={dropdownDirection}
/>
<SelectChip
chipId="chat-speed"
value={thinkingSpeed}
options={THINKING_SPEED_OPTIONS}
disabled={disabled}
isOpen={toolbarMenuId === "chat-speed"}
onToggle={() => toggleToolbarMenu("chat-speed")}
onClose={closeToolbarMenus}
onChange={setThinkingSpeed}
ariaLabel="思考速度"
direction={dropdownDirection}
/>
<SelectChip
chipId="chat-depth"
value={thinkingDepth}
options={THINKING_DEPTH_OPTIONS}
disabled={disabled}
isOpen={toolbarMenuId === "chat-depth"}
onToggle={() => toggleToolbarMenu("chat-depth")}
onClose={closeToolbarMenus}
onChange={setThinkingDepth}
ariaLabel="思考深度"
direction={dropdownDirection}
/>
</>
)}
{activeMode === "image" && (
<>
<SelectChip