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:
2026-06-12 11:12:55 +08:00
parent 52e704375c
commit 6d93c2b9b8
184 changed files with 2146 additions and 89530 deletions
+29 -36
View File
@@ -8,43 +8,7 @@ function muban(path: string): string {
return oss(`muban/${path.replace(/^\/+/, "")}`);
}
function toolbox(path: string): string {
return oss(`static/toolbox/${path.replace(/^\/+/, "")}`);
}
export const ossAssets = {
brand: {
logo: oss("logo.png"),
},
auth: {
showcaseVideo: oss("test5.mp4"),
},
home: {
backgroundVideo: muban("hero-bg.mp4"),
heroSlides: [oss("static/banners/light2_轮播1.jpg"), oss("static/banners/light2_轮播2.jpg"), oss("static/banners/light2_轮播3.jpg")],
features: {
ecommerce: muban("feature-ecommerce.jpg"),
script: muban("feature-script.jpg"),
token: muban("feature-token.jpg"),
},
},
toolbox: {
imageBefore: toolbox("%E7%89%9B%E4%BB%94.webp"),
imageAfter: toolbox("%E8%A5%BF%E8%A3%85.webp"),
watermarkBefore: toolbox("%E5%8E%BB%E6%B0%B4%E5%8D%B0%E5%89%8D.webp"),
watermarkAfter: toolbox("%E5%8E%BB%E6%B0%B4%E5%8D%B0%E5%90%8E.webp"),
},
community: {
cardImages: [
muban("dianshang1.png"),
muban("dianshang2.png"),
muban("dianshang3.png"),
muban("wechat-7.png"),
muban("wechat-8.png"),
muban("wechat-9.png"),
],
carouselVideos: [oss("test3.mp4"), oss("test4.mp4"), oss("test6.mp4")],
},
workflows: {
caseImages: [
muban("community/workflow-rain-night.jpg"),
@@ -81,6 +45,35 @@ export const ossAssets = {
muban("ecommerce/templates/case-5.png"),
muban("ecommerce/templates/case-6.png"),
],
inspiration: {
asinListing: muban("ecommerce/inspiration/2026-06/asin-listing-optimization.png"),
tiktokPreference: muban("ecommerce/inspiration/2026-06/tiktok-us-consumer-preference.png"),
competitorListing: muban("ecommerce/inspiration/2026-06/competitor-listing-analysis.png"),
fathersDaySet: muban("ecommerce/inspiration/2026-06/fathers-day-product-set.png"),
perfumeSet: muban("ecommerce/inspiration/2026-06/perfume-product-set.png"),
sprayScene: muban("ecommerce/inspiration/2026-06/spray-product-scene.png"),
campingCart: muban("ecommerce/inspiration/2026-06/taobao-camping-cart.webp"),
cosmeticApplication: muban("ecommerce/inspiration/2026-06/cosmetic-application-set.png"),
officeStyleSet: muban("ecommerce/inspiration/2026-06/office-style-product-set.png"),
spokenReview: muban("ecommerce/inspiration/2026-06/spoken-product-review.mp4"),
perfumeTexture: muban("ecommerce/inspiration/2026-06/perfume-texture-video.mp4"),
toyInteraction: muban("ecommerce/inspiration/2026-06/toy-interaction-video.mp4"),
vesselDisplay: muban("ecommerce/inspiration/2026-06/vessel-product-display.mp4"),
jewelryModel: muban("ecommerce/inspiration/2026-06/jewelry-model-tryon.mp4"),
sofaLifestyle: muban("ecommerce/inspiration/2026-06/sofa-lifestyle-video.mp4"),
stationeryTaobaoSet: muban("ecommerce/inspiration/2026-06/stationery-taobao-set-2.png"),
stripedSingleSofaSet: muban("ecommerce/inspiration/2026-06/striped-single-sofa-set.png"),
brownLeatherJacketPhotoSet: muban("ecommerce/inspiration/2026-06/brown-leather-jacket-photo-set-2.png"),
modelSunHatTryon: muban("ecommerce/inspiration/2026-06/model-sun-hat-tryon.png"),
taobaoEarphoneProduct: muban("ecommerce/inspiration/2026-06/taobao-earphone-product.png"),
etsyScentedCandleSet: muban("ecommerce/inspiration/2026-06/etsy-scented-candle-set-2.png"),
worldCupFlashVideo: muban("ecommerce/inspiration/2026-06/world-cup-flash-video.mp4"),
lipstickUgcTiktokVideo: muban("ecommerce/inspiration/2026-06/lipstick-ugc-tiktok-video.mp4"),
nightLightUnboxingDouyin: muban("ecommerce/inspiration/2026-06/night-light-unboxing-douyin-2.mp4"),
cleanerPainpointDouyin: muban("ecommerce/inspiration/2026-06/cleaner-painpoint-douyin-video.mp4"),
dressOutfitVideo: muban("ecommerce/inspiration/2026-06/dress-outfit-video.mp4"),
sunscreenUgcTiktokVideo: muban("ecommerce/inspiration/2026-06/sunscreen-ugc-tiktok-2.mp4"),
},
productSet: {
main: muban("ecommerce/product-set/main.webp"),
scene: muban("ecommerce/product-set/scene.webp"),