Codex/web quality gates #32
@@ -12,15 +12,11 @@
|
|||||||
FileImageOutlined,
|
FileImageOutlined,
|
||||||
FileTextOutlined,
|
FileTextOutlined,
|
||||||
FolderOpenOutlined,
|
FolderOpenOutlined,
|
||||||
MutedOutlined,
|
|
||||||
PauseCircleOutlined,
|
|
||||||
PictureOutlined,
|
PictureOutlined,
|
||||||
PlayCircleOutlined,
|
|
||||||
ReloadOutlined,
|
ReloadOutlined,
|
||||||
SaveOutlined,
|
SaveOutlined,
|
||||||
SearchOutlined,
|
SearchOutlined,
|
||||||
SendOutlined,
|
SendOutlined,
|
||||||
SoundOutlined,
|
|
||||||
ThunderboltOutlined,
|
ThunderboltOutlined,
|
||||||
UploadOutlined,
|
UploadOutlined,
|
||||||
VideoCameraOutlined,
|
VideoCameraOutlined,
|
||||||
@@ -37,10 +33,7 @@ import { communityClient } from "../../api/communityClient";
|
|||||||
import { modelCapabilitiesClient } from "../../api/modelCapabilitiesClient";
|
import { modelCapabilitiesClient } from "../../api/modelCapabilitiesClient";
|
||||||
import type { CreatePreviewTaskInput } from "../../api/webGenerationGateway";
|
import type { CreatePreviewTaskInput } from "../../api/webGenerationGateway";
|
||||||
import WorkspacePageShell from "../../components/WorkspacePageShell";
|
import WorkspacePageShell from "../../components/WorkspacePageShell";
|
||||||
import type {
|
import type { WebCanvasWorkflow } from "../../types";
|
||||||
WebCanvasWorkflow,
|
|
||||||
WebCanvasWorkflowNodePackage,
|
|
||||||
} from "../../types";
|
|
||||||
import type { AssetLibraryCategory } from "../assets/localAssetStore";
|
import type { AssetLibraryCategory } from "../assets/localAssetStore";
|
||||||
import {
|
import {
|
||||||
buildCanvasCommunityCaseInput,
|
buildCanvasCommunityCaseInput,
|
||||||
@@ -64,7 +57,6 @@ import { ENTERPRISE_VIDEO_MODEL_OPTIONS } from "../../utils/enterpriseVideoPolic
|
|||||||
import { filterImageModelOptionsForSession } from "../../utils/imageModelVisibility";
|
import { filterImageModelOptionsForSession } from "../../utils/imageModelVisibility";
|
||||||
import { translateTaskError } from "../../utils/translateTaskError";
|
import { translateTaskError } from "../../utils/translateTaskError";
|
||||||
import type {
|
import type {
|
||||||
CanvasAlignGuide,
|
|
||||||
CanvasAssetSaveSource,
|
CanvasAssetSaveSource,
|
||||||
CanvasCopiedNode,
|
CanvasCopiedNode,
|
||||||
CanvasConnectorDrag,
|
CanvasConnectorDrag,
|
||||||
@@ -72,37 +64,25 @@ import type {
|
|||||||
CanvasFloatingMenuPosition,
|
CanvasFloatingMenuPosition,
|
||||||
CanvasImageFocusDrag,
|
CanvasImageFocusDrag,
|
||||||
CanvasImageFocusSelection,
|
CanvasImageFocusSelection,
|
||||||
CanvasImageGenerationState,
|
|
||||||
CanvasImageNode,
|
CanvasImageNode,
|
||||||
CanvasImageNodeDrag,
|
|
||||||
CanvasImageReferenceItem,
|
CanvasImageReferenceItem,
|
||||||
CanvasManualLink,
|
CanvasManualLink,
|
||||||
CanvasNodeBounds,
|
CanvasNodeBounds,
|
||||||
CanvasNodeKind,
|
CanvasNodeKind,
|
||||||
CanvasNodePackage,
|
CanvasNodePackage,
|
||||||
CanvasNodePackageDrag,
|
|
||||||
CanvasNodePort,
|
CanvasNodePort,
|
||||||
CanvasNodeResizeDrag,
|
|
||||||
CanvasNodeSize,
|
CanvasNodeSize,
|
||||||
CanvasOption,
|
CanvasOption,
|
||||||
CanvasPageProps,
|
CanvasPageProps,
|
||||||
CanvasPanDrag,
|
|
||||||
CanvasPoint,
|
CanvasPoint,
|
||||||
CanvasProjectSaveState,
|
CanvasProjectSaveState,
|
||||||
CanvasSelectedNode,
|
CanvasSelectedNode,
|
||||||
CanvasSelectionDrag,
|
|
||||||
CanvasStyleCase,
|
CanvasStyleCase,
|
||||||
CanvasStylePickerTab,
|
CanvasStylePickerTab,
|
||||||
CanvasStyleReference,
|
|
||||||
CanvasTextGenerationState,
|
|
||||||
CanvasPromptMentionOption,
|
CanvasPromptMentionOption,
|
||||||
CanvasPromptMentionState,
|
CanvasPromptMentionState,
|
||||||
CanvasTextNode,
|
CanvasTextNode,
|
||||||
CanvasTextNodeDrag,
|
|
||||||
CanvasVideoGenerationState,
|
|
||||||
CanvasVideoMode,
|
|
||||||
CanvasVideoNode,
|
CanvasVideoNode,
|
||||||
CanvasVideoNodeDrag,
|
|
||||||
CanvasViewport,
|
CanvasViewport,
|
||||||
} from "./canvasTypes";
|
} from "./canvasTypes";
|
||||||
import {
|
import {
|
||||||
@@ -110,7 +90,6 @@ import {
|
|||||||
canvasAutoSaveDebounceMs,
|
canvasAutoSaveDebounceMs,
|
||||||
canvasAutoSaveIdleTimeoutMs,
|
canvasAutoSaveIdleTimeoutMs,
|
||||||
canvasNodeClickMoveThreshold,
|
canvasNodeClickMoveThreshold,
|
||||||
canvasNodeDefaultSizes,
|
|
||||||
canvasStylePickerCategories,
|
canvasStylePickerCategories,
|
||||||
canvasStylePickerTabs,
|
canvasStylePickerTabs,
|
||||||
connectorAnchorOutset,
|
connectorAnchorOutset,
|
||||||
@@ -120,22 +99,17 @@ import {
|
|||||||
defaultImageModel,
|
defaultImageModel,
|
||||||
defaultTextModelId,
|
defaultTextModelId,
|
||||||
defaultVideoModel,
|
defaultVideoModel,
|
||||||
image4kCapableModels,
|
|
||||||
imageFocusRatioOptions,
|
imageFocusRatioOptions,
|
||||||
imageModelOptions as fallbackCanvasImageModelOptions,
|
imageModelOptions as fallbackCanvasImageModelOptions,
|
||||||
imageRatioOptions,
|
imageRatioOptions,
|
||||||
textModelOptions,
|
|
||||||
videoDurationOptions,
|
videoDurationOptions,
|
||||||
videoRatioOptions,
|
videoRatioOptions,
|
||||||
} from "./canvasConstants";
|
} from "./canvasConstants";
|
||||||
import {
|
import {
|
||||||
applyImageFocusRatioFromTopLeft,
|
applyImageFocusRatioFromTopLeft,
|
||||||
blobToDataUrl,
|
blobToDataUrl,
|
||||||
buildCanvasStyleKeywords,
|
|
||||||
buildCopyTitle,
|
buildCopyTitle,
|
||||||
clampCanvasPercent,
|
clampCanvasPercent,
|
||||||
buildReversePromptFromAsset,
|
|
||||||
canvasGenerationProgressStyle,
|
|
||||||
clampCanvasNodeSize,
|
clampCanvasNodeSize,
|
||||||
clampCanvasViewportZoom,
|
clampCanvasViewportZoom,
|
||||||
communityCaseToCanvasStyleCase,
|
communityCaseToCanvasStyleCase,
|
||||||
@@ -150,15 +124,8 @@ import {
|
|||||||
getDefaultImageQuality,
|
getDefaultImageQuality,
|
||||||
getDefaultVideoQuality,
|
getDefaultVideoQuality,
|
||||||
getImageQualityOptions,
|
getImageQualityOptions,
|
||||||
getOptionLabel,
|
|
||||||
getVideoQualityOptions,
|
getVideoQualityOptions,
|
||||||
getWorkflowImageNodeFileName,
|
|
||||||
getWorkflowImageNodePrompt,
|
|
||||||
getWorkflowNodeFocusSelection,
|
|
||||||
getWorkflowNodeMetadataString,
|
|
||||||
getWorkflowNodeStyleReference,
|
|
||||||
hasCanvasOptionValue,
|
hasCanvasOptionValue,
|
||||||
moveCanvasNodesForPackageDrag,
|
|
||||||
normalizeCanvasGenerationProgress,
|
normalizeCanvasGenerationProgress,
|
||||||
normalizeCanvasLinkPorts,
|
normalizeCanvasLinkPorts,
|
||||||
normalizeCanvasSelectionRect,
|
normalizeCanvasSelectionRect,
|
||||||
@@ -166,10 +133,6 @@ import {
|
|||||||
positionFloatingMenu,
|
positionFloatingMenu,
|
||||||
resolveImageQuality,
|
resolveImageQuality,
|
||||||
resolveVideoQuality,
|
resolveVideoQuality,
|
||||||
resolveWorkflowImageModel,
|
|
||||||
resolveWorkflowRatio,
|
|
||||||
resolveWorkflowVideoMode,
|
|
||||||
resolveWorkflowVideoModel,
|
|
||||||
waitForImageTaskResult,
|
waitForImageTaskResult,
|
||||||
waitForVideoTaskResult,
|
waitForVideoTaskResult,
|
||||||
} from "./canvasUtils";
|
} from "./canvasUtils";
|
||||||
@@ -181,11 +144,9 @@ import {
|
|||||||
createVideoNodesFromWorkflow,
|
createVideoNodesFromWorkflow,
|
||||||
createWorkflowPackagesFromCanvasPackages,
|
createWorkflowPackagesFromCanvasPackages,
|
||||||
formatCanvasProjectUpdatedAt,
|
formatCanvasProjectUpdatedAt,
|
||||||
formatCanvasVideoTime,
|
|
||||||
resolveAssetCategory,
|
resolveAssetCategory,
|
||||||
} from "./canvasWorkflowDeserialize";
|
} from "./canvasWorkflowDeserialize";
|
||||||
import { CanvasNodeToolbar, CanvasNodeVideoPlayer, CanvasSelectChip } from "./canvasComponents";
|
import { CanvasNodeToolbar, CanvasNodeVideoPlayer, CanvasSelectChip } from "./canvasComponents";
|
||||||
import type { CanvasNodeToolbarAction } from "./canvasComponents";
|
|
||||||
import { CanvasMarkingPopover } from "./CanvasMarkingPopover";
|
import { CanvasMarkingPopover } from "./CanvasMarkingPopover";
|
||||||
import { CanvasPromptMentionTextarea, CanvasTextPromptComposer } from "./CanvasTextPromptComposer";
|
import { CanvasPromptMentionTextarea, CanvasTextPromptComposer } from "./CanvasTextPromptComposer";
|
||||||
import { CanvasMultiGridPanel, CanvasUpscalePanel, CanvasInpaintPanel } from "./canvasToolPanels";
|
import { CanvasMultiGridPanel, CanvasUpscalePanel, CanvasInpaintPanel } from "./canvasToolPanels";
|
||||||
@@ -396,7 +357,6 @@ function CanvasPage({
|
|||||||
const canvasUploadInputRef = useRef<HTMLInputElement>(null);
|
const canvasUploadInputRef = useRef<HTMLInputElement>(null);
|
||||||
const imageNodeInputRef = useRef<HTMLInputElement>(null);
|
const imageNodeInputRef = useRef<HTMLInputElement>(null);
|
||||||
const canvasRef = useRef<HTMLElement>(null);
|
const canvasRef = useRef<HTMLElement>(null);
|
||||||
const canvasReferenceUploadPromisesRef = useRef(new Map<string, Promise<string | null>>());
|
|
||||||
const canvasDragCounterRef = useRef(0);
|
const canvasDragCounterRef = useRef(0);
|
||||||
const [isCanvasDragging, setIsCanvasDragging] = useState(false);
|
const [isCanvasDragging, setIsCanvasDragging] = useState(false);
|
||||||
const suppressNextPaneClickRef = useRef(false);
|
const suppressNextPaneClickRef = useRef(false);
|
||||||
@@ -412,7 +372,7 @@ function CanvasPage({
|
|||||||
const imageNodeIdRef = useRef(1);
|
const imageNodeIdRef = useRef(1);
|
||||||
const videoNodeIdRef = useRef(1);
|
const videoNodeIdRef = useRef(1);
|
||||||
|
|
||||||
const { pushSnapshot, undo, redo, canUndo, canRedo } = useCanvasHistory();
|
const { pushSnapshot, undo, redo } = useCanvasHistory();
|
||||||
const {
|
const {
|
||||||
textGenerationState, imageGenerationState, videoGenerationState,
|
textGenerationState, imageGenerationState, videoGenerationState,
|
||||||
generationToast, setGenerationToast,
|
generationToast, setGenerationToast,
|
||||||
@@ -1892,7 +1852,7 @@ function CanvasPage({
|
|||||||
if (videoNode.videoMode === "img2video" && referenceUrls.length === 0) {
|
if (videoNode.videoMode === "img2video" && referenceUrls.length === 0) {
|
||||||
throw new Error("图生视频需要先连接至少一个可用的图片节点");
|
throw new Error("图生视频需要先连接至少一个可用的图片节点");
|
||||||
}
|
}
|
||||||
let requestModel = resolveVideoRequestModel({ model, referenceUrls });
|
const requestModel = resolveVideoRequestModel({ model, referenceUrls });
|
||||||
task = await onCreateTask({
|
task = await onCreateTask({
|
||||||
title: videoNode.title || "视频节点生成",
|
title: videoNode.title || "视频节点生成",
|
||||||
type: "video",
|
type: "video",
|
||||||
|
|||||||
@@ -2,24 +2,18 @@ import {
|
|||||||
AppstoreOutlined,
|
AppstoreOutlined,
|
||||||
ArrowDownOutlined,
|
ArrowDownOutlined,
|
||||||
ArrowUpOutlined,
|
ArrowUpOutlined,
|
||||||
CaretRightOutlined,
|
|
||||||
ClockCircleOutlined,
|
ClockCircleOutlined,
|
||||||
CloseOutlined,
|
CloseOutlined,
|
||||||
CopyOutlined,
|
CopyOutlined,
|
||||||
DeleteOutlined,
|
DeleteOutlined,
|
||||||
DownloadOutlined,
|
|
||||||
FullscreenOutlined,
|
|
||||||
LoadingOutlined,
|
LoadingOutlined,
|
||||||
MessageOutlined,
|
MessageOutlined,
|
||||||
MutedOutlined,
|
|
||||||
PictureOutlined,
|
PictureOutlined,
|
||||||
PauseOutlined,
|
|
||||||
PlusOutlined,
|
PlusOutlined,
|
||||||
ReloadOutlined,
|
ReloadOutlined,
|
||||||
SendOutlined,
|
SendOutlined,
|
||||||
SettingOutlined,
|
SettingOutlined,
|
||||||
StopOutlined,
|
StopOutlined,
|
||||||
ThunderboltOutlined,
|
|
||||||
VideoCameraOutlined,
|
VideoCameraOutlined,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import {
|
import {
|
||||||
@@ -35,10 +29,10 @@ import {
|
|||||||
type SyntheticEvent,
|
type SyntheticEvent,
|
||||||
} from "react";
|
} from "react";
|
||||||
import "../../styles/pages/workbench.css";
|
import "../../styles/pages/workbench.css";
|
||||||
import type { WebGenerationPreviewTask, WebUserSession } from "../../types";
|
import type { WebUserSession } from "../../types";
|
||||||
import { aiGenerationClient } from "../../api/aiGenerationClient";
|
import { aiGenerationClient } from "../../api/aiGenerationClient";
|
||||||
import { claimGenerationSlot, getActiveGenerationTaskCount, getEffectiveGenerationLimit, getGenerationUserKey, releaseGenerationSlot } from "../../api/generationConcurrency";
|
import { claimGenerationSlot, getActiveGenerationTaskCount, getEffectiveGenerationLimit, getGenerationUserKey, releaseGenerationSlot } from "../../api/generationConcurrency";
|
||||||
import { preUploadReference, resolvePreUploadedUrl } from "../../api/referenceUploadService";
|
import { preUploadReference } from "../../api/referenceUploadService";
|
||||||
import { assetClient } from "../../api/assetClient";
|
import { assetClient } from "../../api/assetClient";
|
||||||
import { communityClient } from "../../api/communityClient";
|
import { communityClient } from "../../api/communityClient";
|
||||||
import { loadRechargeModal, type RechargeModalComponent } from "../../components/RechargeModal/loadRechargeModal";
|
import { loadRechargeModal, type RechargeModalComponent } from "../../components/RechargeModal/loadRechargeModal";
|
||||||
@@ -46,7 +40,6 @@ import { useGenerationTasks } from "../../hooks/useGenerationTasks";
|
|||||||
|
|
||||||
import { conversationClient, type ConversationSummary } from "../../api/conversationClient";
|
import { conversationClient, type ConversationSummary } from "../../api/conversationClient";
|
||||||
import { modelCapabilitiesClient } from "../../api/modelCapabilitiesClient";
|
import { modelCapabilitiesClient } from "../../api/modelCapabilitiesClient";
|
||||||
import { buildApiUrl, buildAuthHeaders } from "../../api/serverConnection";
|
|
||||||
import type { CreatePreviewTaskInput } from "../../api/webGenerationGateway";
|
import type { CreatePreviewTaskInput } from "../../api/webGenerationGateway";
|
||||||
import type { WebProjectSummary } from "../../types";
|
import type { WebProjectSummary } from "../../types";
|
||||||
import {
|
import {
|
||||||
@@ -62,8 +55,6 @@ import {
|
|||||||
MarkdownMessage,
|
MarkdownMessage,
|
||||||
ResultCard,
|
ResultCard,
|
||||||
} from "./components/WorkbenchChatCards";
|
} from "./components/WorkbenchChatCards";
|
||||||
import { renderMarkdownBlocks } from "./markdownRenderer";
|
|
||||||
import { downloadResultAsset } from "./workbenchDownload";
|
|
||||||
import { translateTaskError } from "../../utils/translateTaskError";
|
import { translateTaskError } from "../../utils/translateTaskError";
|
||||||
import {
|
import {
|
||||||
buildLocalTimeoutMessage,
|
buildLocalTimeoutMessage,
|
||||||
@@ -80,7 +71,6 @@ import { isPixverseModel } from "../../utils/pixverseRouting";
|
|||||||
import { resolveVideoRequestModel } from "../../utils/resolveVideoModel";
|
import { resolveVideoRequestModel } from "../../utils/resolveVideoModel";
|
||||||
import { calculateEnterpriseVideoCredits, ENTERPRISE_DEFAULT_VIDEO_MODEL } from "../../utils/enterpriseVideoPolicy";
|
import { calculateEnterpriseVideoCredits, ENTERPRISE_DEFAULT_VIDEO_MODEL } from "../../utils/enterpriseVideoPolicy";
|
||||||
import {
|
import {
|
||||||
getImageQualityOptions,
|
|
||||||
getImageQualityOptionsForContext,
|
getImageQualityOptionsForContext,
|
||||||
getDefaultImageQuality,
|
getDefaultImageQuality,
|
||||||
getDefaultImageQualityForContext,
|
getDefaultImageQualityForContext,
|
||||||
@@ -90,8 +80,6 @@ import {
|
|||||||
} from "../../utils/modelOptions";
|
} from "../../utils/modelOptions";
|
||||||
import { filterImageModelOptionsForSession } from "../../utils/imageModelVisibility";
|
import { filterImageModelOptionsForSession } from "../../utils/imageModelVisibility";
|
||||||
import { persistWorkbenchResultAsset, type PersistedWorkbenchResultAsset } from "./workbenchResultPersistence";
|
import { persistWorkbenchResultAsset, type PersistedWorkbenchResultAsset } from "./workbenchResultPersistence";
|
||||||
import { SmoothedProgressBar } from "./SmoothedProgressBar";
|
|
||||||
import { useSmoothedProgress } from "../../hooks/useSmoothedProgress";
|
|
||||||
import {
|
import {
|
||||||
type WorkbenchMode,
|
type WorkbenchMode,
|
||||||
type ToolbarMenuId,
|
type ToolbarMenuId,
|
||||||
@@ -99,8 +87,6 @@ import {
|
|||||||
type WorkbenchOption,
|
type WorkbenchOption,
|
||||||
type WorkbenchFieldGroup,
|
type WorkbenchFieldGroup,
|
||||||
type ReferenceItem,
|
type ReferenceItem,
|
||||||
type PromptMentionItem,
|
|
||||||
type PromptMentionTokenRange,
|
|
||||||
type ChatAttachment,
|
type ChatAttachment,
|
||||||
type ChatMessage,
|
type ChatMessage,
|
||||||
type DeleteDialogState,
|
type DeleteDialogState,
|
||||||
@@ -117,33 +103,18 @@ import {
|
|||||||
GRID_SUPPORTED_MODELS,
|
GRID_SUPPORTED_MODELS,
|
||||||
VIDEO_FRAME_OPTIONS,
|
VIDEO_FRAME_OPTIONS,
|
||||||
VIDEO_DURATION_OPTIONS,
|
VIDEO_DURATION_OPTIONS,
|
||||||
MESSAGE_STORAGE_KEY,
|
|
||||||
ACTIVE_CONVERSATION_STORAGE_KEY,
|
|
||||||
PROMPT_HISTORY_STORAGE_KEY,
|
|
||||||
TASK_KEEPALIVE_STORAGE_KEY,
|
|
||||||
WORKBENCH_TASK_STALE_MS,
|
|
||||||
WORKBENCH_TASK_MAX_POLL_FAILURES,
|
WORKBENCH_TASK_MAX_POLL_FAILURES,
|
||||||
REFERENCE_IMAGE_COMPRESS_THRESHOLD,
|
|
||||||
REFERENCE_IMAGE_MAX_DIMENSION,
|
|
||||||
REFERENCE_IMAGE_INITIAL_QUALITY,
|
|
||||||
REFERENCE_IMAGE_MIN_QUALITY,
|
|
||||||
CHAT_MODEL,
|
|
||||||
CHAT_NATURAL_SYSTEM_PROMPT,
|
CHAT_NATURAL_SYSTEM_PROMPT,
|
||||||
CHAT_TURN_STYLE_REMINDER,
|
CHAT_TURN_STYLE_REMINDER,
|
||||||
NON_CONVERSATIONAL_ASSISTANT_TEXT,
|
|
||||||
getCachedRole,
|
getCachedRole,
|
||||||
getSessionUserId,
|
|
||||||
userKey,
|
|
||||||
createId,
|
createId,
|
||||||
formatWorkbenchTimestamp,
|
formatWorkbenchTimestamp,
|
||||||
parseWorkbenchTimestampValue,
|
|
||||||
buildChatAttachments,
|
buildChatAttachments,
|
||||||
buildNaturalChatHistoryMessages,
|
buildNaturalChatHistoryMessages,
|
||||||
getErrorText,
|
getErrorText,
|
||||||
isAuthFailure,
|
isAuthFailure,
|
||||||
isInsufficientBalance,
|
isInsufficientBalance,
|
||||||
isInsufficientBalanceMessage,
|
isInsufficientBalanceMessage,
|
||||||
isTransientMessage,
|
|
||||||
getPersistableMessages,
|
getPersistableMessages,
|
||||||
shouldPersistPatch,
|
shouldPersistPatch,
|
||||||
buildAssistantResult,
|
buildAssistantResult,
|
||||||
@@ -156,25 +127,18 @@ import {
|
|||||||
persistMessages,
|
persistMessages,
|
||||||
clearWorkbenchLocalState,
|
clearWorkbenchLocalState,
|
||||||
persistPromptHistory,
|
persistPromptHistory,
|
||||||
buildRecoverableTaskFromMessage,
|
|
||||||
readStoredKeepaliveTasks,
|
readStoredKeepaliveTasks,
|
||||||
persistKeepaliveTasks,
|
persistKeepaliveTasks,
|
||||||
} from "./workbenchStorage";
|
} from "./workbenchStorage";
|
||||||
import {
|
import {
|
||||||
getRatioOptionClassName,
|
|
||||||
getSettingsGridColumnsClassName,
|
|
||||||
getReferenceAccept,
|
getReferenceAccept,
|
||||||
getReferenceUploadLabel,
|
getReferenceUploadLabel,
|
||||||
getReferenceLimit,
|
getReferenceLimit,
|
||||||
getReferenceKindLabel,
|
getReferenceKindLabel,
|
||||||
getReferenceEmptyCopy,
|
|
||||||
hexToRgbTriplet,
|
hexToRgbTriplet,
|
||||||
inferReferenceKind,
|
inferReferenceKind,
|
||||||
disposeReferencePreview,
|
disposeReferencePreview,
|
||||||
fileToDataUrl,
|
|
||||||
bytesToHex,
|
|
||||||
buildReferenceFingerprint,
|
buildReferenceFingerprint,
|
||||||
canCompressReferenceImage,
|
|
||||||
compressReferenceImageIfNeeded,
|
compressReferenceImageIfNeeded,
|
||||||
buildReferenceToken,
|
buildReferenceToken,
|
||||||
resolveReferenceUrls,
|
resolveReferenceUrls,
|
||||||
@@ -188,7 +152,6 @@ import {
|
|||||||
import {
|
import {
|
||||||
findPromptMentionRangeInside,
|
findPromptMentionRangeInside,
|
||||||
findPromptMentionRangeOverlap,
|
findPromptMentionRangeOverlap,
|
||||||
ReferenceInlinePreview,
|
|
||||||
ReferencePreview,
|
ReferencePreview,
|
||||||
PromptPreviewLayer,
|
PromptPreviewLayer,
|
||||||
} from "./WorkbenchPromptPreview";
|
} from "./WorkbenchPromptPreview";
|
||||||
@@ -495,7 +458,6 @@ function WorkbenchPage({
|
|||||||
const workbenchAccent = "#00ff88";
|
const workbenchAccent = "#00ff88";
|
||||||
const hasConversationRecords = activeConversationId !== null || messages.length > 0;
|
const hasConversationRecords = activeConversationId !== null || messages.length > 0;
|
||||||
const hasActivatedWorkspace = !effectiveOnboarding && (workspaceStarted || isGenerating || hasConversationRecords);
|
const hasActivatedWorkspace = !effectiveOnboarding && (workspaceStarted || isGenerating || hasConversationRecords);
|
||||||
const referenceCount = referenceItems.length;
|
|
||||||
const activeVideoModelValue = toHappyHorseDisplayModel(videoModel);
|
const activeVideoModelValue = toHappyHorseDisplayModel(videoModel);
|
||||||
const activeModelValue =
|
const activeModelValue =
|
||||||
activeMode === "image" ? imageModel : activeMode === "video" ? activeVideoModelValue : chatModel;
|
activeMode === "image" ? imageModel : activeMode === "video" ? activeVideoModelValue : chatModel;
|
||||||
@@ -1007,7 +969,7 @@ function WorkbenchPage({
|
|||||||
|
|
||||||
const patchConversationMessage = useCallback(
|
const patchConversationMessage = useCallback(
|
||||||
async (conversationId: number, messageId: string, patch: Partial<ChatMessage>) => {
|
async (conversationId: number, messageId: string, patch: Partial<ChatMessage>) => {
|
||||||
let sourceMessages =
|
const sourceMessages =
|
||||||
activeConversationIdRef.current === conversationId
|
activeConversationIdRef.current === conversationId
|
||||||
? messagesRef.current
|
? messagesRef.current
|
||||||
: conversationMessagesCacheRef.current.get(conversationId);
|
: conversationMessagesCacheRef.current.get(conversationId);
|
||||||
@@ -2236,7 +2198,7 @@ function WorkbenchPage({
|
|||||||
taskId = result.taskId;
|
taskId = result.taskId;
|
||||||
genTracker.submitTask({ title: trimmedPrompt.slice(0, 60), type: "image", status: "running", progress: 5, prompt: trimmedPrompt, sourceView: "workbench", taskId });
|
genTracker.submitTask({ title: trimmedPrompt.slice(0, 60), type: "image", status: "running", progress: 5, prompt: trimmedPrompt, sourceView: "workbench", taskId });
|
||||||
} else {
|
} else {
|
||||||
let requestModel = resolveVideoRequestModel({
|
const requestModel = resolveVideoRequestModel({
|
||||||
model: taskInput.params?.model || ENTERPRISE_DEFAULT_VIDEO_MODEL,
|
model: taskInput.params?.model || ENTERPRISE_DEFAULT_VIDEO_MODEL,
|
||||||
referenceUrls: refUrls,
|
referenceUrls: refUrls,
|
||||||
});
|
});
|
||||||
@@ -3031,7 +2993,7 @@ function WorkbenchPage({
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
const renderComposerToolbar = (disabled = false, showStop = false) => (
|
const renderComposerToolbar = (disabled = false, _showStop = false) => (
|
||||||
<div className="wb-composer__toolbar">
|
<div className="wb-composer__toolbar">
|
||||||
<div className="wb-composer__toolbar-left">
|
<div className="wb-composer__toolbar-left">
|
||||||
<span data-onboarding={obTarget({ chat: "onboarding-mode-selector", image: "onboarding-mode-selector" })}>
|
<span data-onboarding={obTarget({ chat: "onboarding-mode-selector", image: "onboarding-mode-selector" })}>
|
||||||
|
|||||||
Reference in New Issue
Block a user