From 79ac2c349ea47d8aff8bfe5321a7dfc182efe97f Mon Sep 17 00:00:00 2001 From: kuekhaoyang Date: Tue, 18 Nov 2025 15:15:45 +0800 Subject: [PATCH] feat: Optimize component performance with GPU acceleration and add placeholder image for missing content --- UI_AUDIT_REPORT.md | 14 ++++---- app/page.tsx | 2 +- app/player/page.tsx | 2 +- components/SearchLoadingAnimation.tsx | 15 +++++--- components/history/HistoryItem.tsx | 11 ++++++ components/history/WatchHistorySidebar.tsx | 11 +++--- components/home/MovieCard.tsx | 14 +++++++- components/home/TagManager.tsx | 2 +- components/player/DesktopVideoPlayer.tsx | 2 +- components/player/EpisodeList.tsx | 2 +- components/player/MobileVideoPlayer.tsx | 2 +- components/search/TypeBadgeItem.tsx | 2 +- components/search/VideoGrid.tsx | 5 ++- components/ui/Card.tsx | 6 ++-- public/placeholder-poster.svg | 42 ++++++++++++++++++++++ 15 files changed, 106 insertions(+), 26 deletions(-) create mode 100644 public/placeholder-poster.svg diff --git a/UI_AUDIT_REPORT.md b/UI_AUDIT_REPORT.md index cae4f26..dd1d68d 100644 --- a/UI_AUDIT_REPORT.md +++ b/UI_AUDIT_REPORT.md @@ -663,8 +663,8 @@ export const announceToScreenReader = (message: string) => { - ✅ 焦点项自动滚动到视图内,优化用户体验 #### 7. **图片加载优化** (预计 2 小时) -- [ ] 创建 `public/placeholder-poster.svg` 占位图 -- [ ] **VideoGrid.tsx** - 添加 `onError` 处理 +- [x] 创建 `public/placeholder-poster.svg` 占位图 +- [x] **VideoGrid.tsx** - 添加 `onError` 处理 ```tsx { }} /> ``` -- [ ] **WatchHistorySidebar.tsx** - 同样添加 `onError` -- [ ] **PopularFeatures.tsx** - 添加 `onError` +- [x] **WatchHistorySidebar.tsx** - 同样添加 `onError` +- [x] **PopularFeatures.tsx** - 添加 `onError` #### 8. **性能优化 - GPU 加速** (预计 1 小时) -- [ ] 给所有 hover scale 动画添加 `will-change-transform` -- [ ] 给 fixed/sticky 元素添加 `transform: translateZ(0)` -- [ ] 优化 `SearchLoadingAnimation` 的 shimmer 动画 +- [x] 给所有 hover scale 动画添加 `will-change-transform` +- [x] 给 fixed/sticky 元素添加 `transform: translateZ(0)` +- [x] 优化 `SearchLoadingAnimation` 的 shimmer 动画 --- diff --git a/app/page.tsx b/app/page.tsx index b291d79..9a1f1d1 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -87,7 +87,7 @@ function HomePage() { return (
{/* Glass Navbar */} -