Skip to content

一分钟搭建影视站,支持Docker等部署方式

fix(watch): 剧集排列开关移到剧集列表标题行,图标并入统一图标集,版本 2.12.1

bestZweib2a388c1d196
diff --git a/package.json b/package.json
index 6b44940..16457fe 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "libretv",
- "version": "2.12.0",
+ "version": "2.12.1",
"private": true,
"description": "免费在线视频搜索与观看平台(Next.js 重构版)",
"license": "AGPL-3.0-or-later",
diff --git a/src/app/watch/page.tsx b/src/app/watch/page.tsx
index 78e8452..f49e264 100644
--- a/src/app/watch/page.tsx
+++ b/src/app/watch/page.tsx
@@ -8,6 +8,7 @@ import { api } from '@/lib/client-api';
import { PlayerShell } from '@/components/player-shell';
import { EmptyState, LoadingState, Spinner } from '@/components/states';
import { SwitchSourceModal } from '@/components/switch-source';
+import { Icon } from '@/components/icon';
import { useAuth } from '@/components/auth';
import { resolveSource, useAppStore } from '@/lib/store';
import {
@@ -250,9 +251,6 @@ function WatchContent() {
>
下一集
</button>
- <button className="btn-ghost btn-sm" onClick={() => setReversed((v) => !v)}>
- {reversed ? '正序排列' : '倒序排列'}
- </button>
<label className="flex items-center gap-1.5 text-xs text-muted ml-auto cursor-pointer">
<input
type="checkbox"
@@ -267,10 +265,25 @@ function WatchContent() {
{/* 剧集侧栏 */}
<aside className="bg-surface-raised rounded-lg p-3 h-fit">
- <div className="flex items-center justify-between mb-2.5">
+ <div className="flex items-center justify-between gap-2 mb-2.5">
<h2 className="text-sm font-semibold text-content">
剧集列表{episodes.length > 0 && `(${episodes.length})`}
</h2>
+ {/* 排列开关紧贴它所作用的列表:放在这里才看得出它管的是这一栏的顺序 */}
+ {episodes.length > 1 && (
+ <button
+ className="btn-ghost btn-sm shrink-0"
+ onClick={() => setReversed((v) => !v)}
+ aria-label={reversed ? '切换为正序排列' : '切换为倒序排列'}
+ title="调整剧集列表的排列顺序"
+ >
+ <Icon
+ name="arrowDown"
+ className={cn('w-3.5 h-3.5 transition-transform', reversed && 'rotate-180')}
+ />
+ {reversed ? '正序排列' : '倒序排列'}
+ </button>
+ )}
</div>
{episodes.length === 0 ? (
detailQuery.isLoading ? (
diff --git a/src/components/detail-modal.tsx b/src/components/detail-modal.tsx
index 6eb19b7..0f5975a 100644
--- a/src/components/detail-modal.tsx
+++ b/src/components/detail-modal.tsx
@@ -11,6 +11,7 @@ import { cn } from '@/lib/utils';
import { addSearchHistory } from '@/lib/db';
import { EmptyState, ErrorState, LoadingState } from './states';
import { useFocusTrap } from './use-focus-trap';
+import { Icon } from './icon';
/**
* 详情弹窗:剧集列表 + 排序 + 复制链接。
@@ -195,11 +196,13 @@ export function DetailModal({ item, onClose }: { item: SearchResultItem | null;
<button
className="btn-ghost btn-sm"
onClick={() => setReversed((v) => !v)}
- aria-label={reversed ? '切换为正序' : '切换为倒序'}
+ aria-label={reversed ? '切换为正序排列' : '切换为倒序排列'}
+ title="调整剧集列表的排列顺序"
>
- <svg className={cn('w-3.5 h-3.5 transition-transform', reversed && 'rotate-180')} fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 14l-7 7m0 0l-7-7m7 7V3" />
- </svg>
+ <Icon
+ name="arrowDown"
+ className={cn('w-3.5 h-3.5 transition-transform', reversed && 'rotate-180')}
+ />
{reversed ? '正序排列' : '倒序排列'}
</button>
<span className="text-sm text-faint">共 {episodes.length} 集</span>
diff --git a/src/components/icon.tsx b/src/components/icon.tsx
index 3e2e4fe..a814002 100644
--- a/src/components/icon.tsx
+++ b/src/components/icon.tsx
@@ -17,6 +17,7 @@ export type IconName =
| 'search'
| 'clock'
| 'check'
+ | 'arrowDown'
| 'undo'
| 'trash'
| 'filter'
@@ -77,6 +78,9 @@ const PATHS: Record<IconName, ReactNode> = {
/>
),
check: <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="m4.5 12.75 6 6 9-13.5" />,
+ arrowDown: (
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 14l-7 7m0 0l-7-7m7 7V3" />
+ ),
undo: (
<path
strokeLinecap="round"