Files
UHD_Media_Tool/docs/design
rootandClaude Opus 5.5 289e8b297a feat(files): wide file manager layout and basic previews (FM-2)
- Files page uses a wide layout (route handle layout:"wide"): no max width,
  full-height directory tree docked next to the sidebar, resizable
  (200-520px, remembered, double-click resets) and collapsible; mobile keeps
  the tree in a drawer.
- GET /files/preview (admin console session only, same path guards as
  download): text/NFO with encoding detection (BOM/UTF-16/UTF-8/GB18030/Big5),
  subtitles first 200 cues (SRT/VTT/ASS/SSA, PGS timings), .torrent file
  list/trackers (passkey masked)/infohash, image dimensions. Reads at most
  1 MiB of text; .torrent capped at 4 MiB.
- Download also allows text files, .torrent and avif/gif.
- Research notes in docs/design/file-preview-research.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-29 21:44:13 +08:00
..

设计系统

控制台(apps/web)沿用 /opt/uhd_web 的设计系统:token 定义在 app.css,shadcn 组件在 apps/web/app/components/ui/,控制台共享件在 apps/web/app/components/console/。

文档 内容
design-tokens.md 颜色 token 分层、命名与使用规则,字号/圆角/时长/缓动阶梯
interface-materials.md 材质:pg-chrome 贴边、pg-slab 内容卡、pg-float 悬浮层
ui-controls.md 按钮、选中态、状态反馈、动效与圆角角色

硬规则

  1. 新增语义先加 token 再用。 需要新的颜色、字号、圆角、时长或缓动时,先在 app.css 定义语义 token(日夜两套值都给),跑 deno task gen:tokens,再在组件里引用。
  2. 禁止原色与十六进制。 组件里不写 #xxxxxx、text-[#..]、bg-red-500 这类 Tailwind 调色板色、white/10 之类的黑白透明度,也不写 text-[13px]、duration-300、ease-[cubic..]、裸 rounded。状态只用 success / warning / destructive,并且配文字,不只靠颜色。
  3. 材质按层级只有三种,不在玻璃上叠玻璃:已在卡片里的空态用 <EmptyState plain>。
  4. 确需例外(第三方库的颜色参数等),在该行或上一行写 token-allow: 原因。

以上规则由 deno task check:tokens(apps/web/scripts/check-design-tokens.sh + 生成物校验)在 deno task ci 中守住。

控制台共享件

  • PageHeader:页面标题 + 一句说明 + 右侧操作区。
  • EmptyState:空态/建设中占位;plain 用于卡片内部。
  • StatusBadge:success | warning | destructive | neutral 四种语气,必须带文字。
  • nav.ts:12 个工作区的导航表,标题与说明同时供占位页使用。