Repository navigation
feat(admin): 管理后台 UI/UX 重设计 v1——工具面路线、四组导航、五原语与三页吃满 - #126
Merged
Merged
Conversation
globals.css @theme 增量:--color-ink-900/800/700/500/300/200/100、 --color-admin-accent(指向品牌橙)、admin-danger/warn text+bg 对 (深底徽章 300 系文字+12% 透明底保证 4.5:1),外加骨架 shimmer 动画及 prefers-reduced-motion 静态降级。前台零波及。
components/admin/ 新增 AdminTable(columns 定义式/三态内建/粘性操作 列/可选批量)、AdminFilters(防抖+chips+清空全部)、AdminEmptyState、 AdminTableSkeleton/BlockSkeleton、Toast(sonner,生产依赖)。 Pagination 升级跳页输入与每页条数(向后兼容)。AdminPageHeader 按 18px/600 降档,AdminModal 加 isDirty 内联脏关闭确认。
导航按领域名词分四组(内容/评测/用户/系统,频率排序默认全展开), 侧边栏 ink-900+橙左边条激活,顶栏 56px 面包屑+返回前台+账号菜单 (退出收敛至顶栏)。概览快捷卡 amber 裸类清零改 ink/primary。登录 跳转移出渲染期进 useEffect(修 React 19 渲染期更新 Router 报错)。 锁死的导航字面值测试同步更新。
641 行纵向长滚动改三张分组卡(邮件服务/第三方登录/通知推送), 右侧 sticky 锚点导航(IntersectionObserver 于 Shell 滚动容器), 每组独立保存按钮+loading 防重;成功反馈就近 toast,系统级错误 保留 AdminNoticeBanner。业务逻辑与 API 调用不动。
列表换 AdminTable(八列/粘性操作列/同步+编辑直显+···菜单收其余), 删除/暂停/批量暂停统一 AdminModal 二次确认替代原生 confirm;筛选 换 AdminFilters+chips 单移除+清空全部;URL query 两段式同步(挂载后 恢复,防 hydration mismatch,didRestore 门防双请求);分页接每页条数。 添加/编辑弹窗接 isDirty 脏关闭。批量部分失败仍走横幅保留重试路径。
AdminTable 七列(操作列粘性)、AdminFilters+chips、空态区分有无 筛选两种文案、分页接 page_size(后端原生支持)。URL query 两段式 同步与信源页同口径。
/stats/jobs 本就是无用户侧入口的后台工具页(流水线健康信息), 整页迁至 /admin/jobs 换后台壳(AdminPageShell/Header/时间窗口切换), 侧边栏系统组加回「任务监控」(壳内真页面,15 项全壳内);旧路径留 服务端 redirect 桩防收藏失效;EXTRA_ADMIN_ONLY_PATHS 补显式冗余。
/stats/jobs 路由守卫从 get_current_user 换 get_current_admin_user (与 users.py 同模式)。消费端已全部归位管理后台。实测权限矩阵: 无 token 401/普通登录用户 403/admin 200(探针用户验证后即删)。
独立 Verifier 复审两处 blocking:text-amber-600 裸类换 text-amber (项目 token 同值),text-orange 无 token 无效类换 text-primary-text; 跳转桩注释 301 修正为 redirect() 实际的 307。补 /admin/jobs 进 navigation 测试与 check-navigation-access 断言(权限收紧留机器回归)。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #121(v1 范围完结;v2 待办见 #125)
变更摘要(9 个 commit,对应圆桌定稿切片 S1–S6 + 迁移/收紧/复审修正)
globals.css@theme 只加不改:ink 三档+admin-accent+danger/warn 语义对+骨架 shimmer(reduced-motion 降级),前台零波及components/admin/:AdminTable(columns 定义式/加载-错误-空三态内建/粘性操作列/可选批量)、AdminFilters(300ms 防抖+chips+清空全部)、AdminEmptyState、AdminSkeleton、Toast(sonner,新生产依赖);Pagination 升级跳页+每页条数(向后兼容);AdminModal 加 isDirty 内联脏关闭;AdminPageHeader 18px/600不变式:业务逻辑/API 端点与参数逐参不变(权限收紧除外);a11y 基线(focus-visible/skip-link/reduced-motion/键盘可达)无回退。
Verification(Worker 证据,本地实跑)
cd frontend && npx tsc --noEmit→ 零输出cd frontend && npm run test:coverage→ 14 文件 199/199 全绿(覆盖率门禁过:stmts 96%)node scripts/check-navigation-access.js→ passed(含新增 /admin/jobs 断言)<table>→ 0cd backend && uv run python -m py_compile app/api/v1/stats_jobs.py→ OK?view=list、?category=AI直达恢复无 console 错误;脏表单 ESC 出「继续编辑/放弃修改」确认条;/stats/jobs 跳转到 /admin/jobs;登录后 14 页抽查渲染正常Verifier verdict(独立复核,与实现过程分离)
首轮 REQUEST_CHANGES(2 blocking:jobs 页 amber 裸类 1 命中、text-orange 无效类)→ aac3efa 修复 → 复核 APPROVE,引用结论:
备注