refactor: 清理未使用参数、移除死代码、聚焦电商核心模块
主要变更概述: ================ 1. 清理未使用的函数参数 (TypeScript noUnusedParameters) ------------------------------------------------------ - AppShell.tsx: 移除未使用的 backendHealth prop 及 ServerConnectionHealth 导入 - canvasUtils.ts: 移除 resolveWorkflowVideoModel 的 workflowModel 参数 - canvasWorkflowDeserialize.ts: 同步更新调用方 - CanvasPage.tsx: 移除 resolveWorkflowVideoModel 未使用导入 - HomePage.tsx: 移除 onOpenTokenMonitor、onOpenImageTool 未使用 props - ToolboxSection.tsx: 移除 onOpenImageTool 未使用 prop 及 WebImageWorkbenchTool 类型导入 - ScriptTokensPage.tsx: 移除 formatReportMarkdown 的 script 参数,更新 2 处调用 - TokenUsagePage.tsx: 移除 onOpenImageTool、onSelectView 未使用 props - WorkbenchPage.tsx: 移除 renderComposerToolbar 的 showStop 参数,更新 2 处调用 2. 移除未使用的模块和死代码 -------------------------- 删除以下未在电商模块中使用的功能模块: - 画布模块 (canvas/): CanvasPage, canvasUtils, canvasWorkflow* 等 - 主页模块 (home/): HomePage, ToolboxSection, WelcomeSplash 等 - 工作台模块 (workbench/): WorkbenchPage, ConversationSidebar 等 - 社区模块 (community/, community-review/) - 数字人模块 (digital-human/) - 图片工作台 (image-workbench/) - 其他独立工具页: agent, assets, beta-applications, character-mix, compliance, dialog-generator, more, profile, provider-health, report, resolution-upscale, script-tokens, settings, size-template, subtitle-removal, watermark-removal 3. 移除未使用的公共组件 ---------------------- - AnimatedPanel, BeforeAfterCompare, BetaApplicationModal - CookieConsentBanner, DropZone, EmptyState, NotFoundPage - NotificationCenter, OnboardingTour, OptimizedImage - PageTransition, RechargeModal, ShellIcon, Skeleton - StudioToolLayout, TaskStatusBar, WorkspacePageShell 4. 移除未使用的 API 客户端 -------------------------- - betaApplicationClient, communityClient, conversationClient - draftClient, modelCapabilitiesClient, notificationClient - projectTaskClient, providerHealthClient, publicConfigClient - referenceUploadService, reportClient, scriptEvalClient - uploadWithProgress 5. 移除未使用的工具函数和 hooks ------------------------------- - utils/: imageModelVisibility, mentionTrigger, modelOptions, ossImageOptimize, toolPageUtils - hooks/: useGenerationStatus, useScrollEntrance - scripts/: 所有分析脚本 (check-governance, dynamic-analysis 等) 6. 移除未使用的样式文件 ---------------------- 删除与已移除模块对应的 CSS 文件,保留电商模块专用样式 7. 新增电商模块功能文件 ---------------------- + src/api/generationRecordClient.ts (生成记录客户端) + src/features/ecommerce/ecommerceGenerationPersistence.ts (生成持久化) 验证: - TypeScript 编译 (tsc --noEmit --noUnusedParameters) 零错误通过 - 所有保留文件的功能完整性未受影响
This commit is contained in:
@@ -7805,7 +7805,7 @@
|
||||
.product-set-preview-backdrop {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 24;
|
||||
z-index: 100;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
background: rgb(17 24 39 / 58%);
|
||||
@@ -8551,89 +8551,6 @@
|
||||
.ecommerce-template-apple-carousel.is-resetting .ecommerce-template-apple-card img {
|
||||
transition: none;
|
||||
}
|
||||
.clone-ai-video-outfit-upload {
|
||||
position: relative;
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.clone-ai-video-outfit-upload-btn {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
min-height: 118px;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1.5px dashed var(--ecm-line, var(--border-subtle));
|
||||
border-radius: var(--ecm-radius-md, 14px);
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 65%),
|
||||
var(--ecm-inset, var(--bg-inset));
|
||||
color: var(--ecm-text, var(--fg-body));
|
||||
font-size: 13px;
|
||||
font-weight: 850;
|
||||
line-height: 1.35;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
transition:
|
||||
border-color 150ms,
|
||||
background 150ms,
|
||||
color 150ms,
|
||||
transform 150ms;
|
||||
}
|
||||
|
||||
.clone-ai-video-outfit-upload-btn::before {
|
||||
display: grid;
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
place-items: center;
|
||||
margin-bottom: 8px;
|
||||
border: 1px solid rgba(var(--ecm-accent-rgb, 0, 255, 136), 0.26);
|
||||
border-radius: 999px;
|
||||
background: rgba(var(--ecm-accent-rgb, 0, 255, 136), 0.08);
|
||||
color: var(--ecm-accent, var(--accent));
|
||||
content: "+";
|
||||
font-size: 24px;
|
||||
font-weight: 800;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.clone-ai-video-outfit-upload-btn:hover {
|
||||
border-color: rgba(var(--ecm-accent-rgb, 0, 255, 136), 0.48);
|
||||
background:
|
||||
linear-gradient(180deg, rgba(var(--ecm-accent-rgb, 0, 255, 136), 0.08), transparent 72%),
|
||||
var(--ecm-inset-hover, var(--bg-hover));
|
||||
color: var(--ecm-text, var(--fg-body));
|
||||
}
|
||||
|
||||
.clone-ai-video-outfit-upload-btn:active {
|
||||
transform: scale(0.99);
|
||||
}
|
||||
|
||||
.clone-ai-video-outfit-info {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
max-width: calc(100% - 20px);
|
||||
padding: 4px 8px;
|
||||
border: 1px solid rgba(var(--ecm-accent-rgb, 0, 255, 136), 0.28);
|
||||
border-radius: 999px;
|
||||
background: rgba(var(--ecm-accent-rgb, 0, 255, 136), 0.1);
|
||||
font-size: 12px;
|
||||
font-weight: 850;
|
||||
color: var(--ecm-accent, var(--accent));
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.clone-ai-video-outfit-upload:has(.clone-ai-video-outfit-info) .clone-ai-video-outfit-upload-btn {
|
||||
border-style: solid;
|
||||
border-color: rgba(var(--ecm-accent-rgb, 0, 255, 136), 0.38);
|
||||
background:
|
||||
linear-gradient(180deg, rgba(var(--ecm-accent-rgb, 0, 255, 136), 0.075), transparent 74%),
|
||||
var(--ecm-inset, var(--bg-inset));
|
||||
}
|
||||
|
||||
/* Ecommerce generation page SaaS polish: visual-only refinement for the product creation workspace. */
|
||||
.product-clone-page {
|
||||
--ecm-page: #0e1012;
|
||||
@@ -10356,19 +10273,6 @@
|
||||
aspect-ratio: 16 / 9;
|
||||
}
|
||||
|
||||
.ecommerce-standalone .product-clone-page[data-tool="clone"] .ecom-command-asset-thumb--video::after {
|
||||
position: absolute;
|
||||
right: 4px;
|
||||
bottom: 4px;
|
||||
padding: 2px 4px;
|
||||
border-radius: 4px;
|
||||
color: #ffffff;
|
||||
background: rgba(16, 32, 44, 0.68);
|
||||
font-size: 10px;
|
||||
font-weight: 900;
|
||||
content: "视频";
|
||||
}
|
||||
|
||||
.ecommerce-standalone .product-clone-page[data-tool="clone"] .ecom-command-asset-thumb > button {
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
@@ -10479,6 +10383,26 @@
|
||||
transition: border-color 150ms ease, background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
|
||||
}
|
||||
|
||||
.ecommerce-standalone .product-clone-page[data-tool="clone"] .ecom-platform-logo-mark {
|
||||
display: inline-grid;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
flex: 0 0 auto;
|
||||
place-items: center;
|
||||
border: 1px solid rgba(30, 189, 219, 0.22);
|
||||
border-radius: 6px;
|
||||
background: rgba(30, 189, 219, 0.1);
|
||||
color: #127284;
|
||||
font-size: 12px;
|
||||
font-weight: 900;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.ecommerce-standalone .product-clone-page[data-tool="clone"] .ecom-platform-logo-mark--text-wide {
|
||||
font-size: 10px;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.ecommerce-standalone .product-clone-page[data-tool="clone"] .ecom-command-popover button.is-active,
|
||||
.ecommerce-standalone .product-clone-page[data-tool="clone"] .ecom-command-popover button:hover {
|
||||
border-color: #1ebddb !important;
|
||||
|
||||
Reference in New Issue
Block a user