feat(web): nav regroup, site RSS tab and site types (IA-2)

- sidebar: 概览 / 获取 / 整理 / 系统. Tasks moves to 系统; sites,
  subscriptions and rules form the 获取 group (ACQUIRE_GROUP_TITLE in
  nav.ts, the single place to rename it); standalone RSS nav item removed
- site detail gets an RSS tab with everything the RSS page had (create,
  edit, enable, fetch now, fetch state) plus recent items; tabs and
  header actions follow the site's capabilities
- old /console/sources links redirect to the site's RSS tab (?feed= looks
  up the owning site) or the site list; task links to RSS point at sites
- site list shows and filters by type; add-site wizard starts with a type
  step (PT still picks from the definition library; public BT / custom
  RSS source only need name, URL and RSS URL)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-30 00:29:56 +08:00
1 parent ec65435328
commit 614262378e
20 files changed
+772 -304

No files matched your search

+19 -10
View File
@@ -1,7 +1,15 @@
import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
import { LEGACY_REDIRECTS, legacyRedirect } from "../../routes/console/redirects.ts";
import { consolePath, findNavItem, NAV_GROUPS, NAV_ITEMS, pageTitle, settingsPath } from "./nav.ts";
import {
ACQUIRE_GROUP_TITLE,
consolePath,
findNavItem,
NAV_GROUPS,
NAV_ITEMS,
pageTitle,
settingsPath,
} from "./nav.ts";
/** routes.ts 里登记的控制台路由(相对 /console) */
const ROUTE_PATTERNS = [
@@ -16,17 +24,17 @@ const matchesRoute = (pathname: string) => {
};
describe("控制台导航", () => {
it("IA-3:5 组,按定稿清单逐项列出,路径唯一且都在 /console 下", () => {
expect(NAV_GROUPS.map((g) => g.title)).toEqual(["概览", "资源", "订阅", "整理", "系统"]);
it("IA-2:4 组,任务归系统,站点 / 订阅 / 规则合为「获取」,没有独立 RSS 项", () => {
expect(NAV_GROUPS.map((g) => g.title)).toEqual(["概览", ACQUIRE_GROUP_TITLE, "整理", "系统"]);
expect(ACQUIRE_GROUP_TITLE).toBe("获取");
expect(NAV_GROUPS.map((g) => g.items.map((i) => i.label))).toEqual([
["首页", "任务", "计划", "智能体会话"],
["站点", "RSS"],
["订阅", "规则"],
["首页", "计划", "智能体会话"],
["站点", "订阅", "规则"],
["下载面板", "整理记录", "文件管理", "媒体库"],
["设置", "审计", "运行状态"],
["任务", "设置", "审计", "运行状态"],
]);
// IA-3 逐项清单 14 项 + FE-6 计划页
expect(NAV_ITEMS).toHaveLength(15);
expect(NAV_ITEMS).toHaveLength(14);
expect(NAV_ITEMS.map((i) => i.to)).not.toContain("/console/sources");
expect(new Set(NAV_ITEMS.map((i) => i.to)).size).toBe(NAV_ITEMS.length);
expect(NAV_ITEMS.every((i) => i.to.startsWith("/console"))).toBe(true);
});
@@ -87,6 +95,7 @@ describe("旧链接重定向", () => {
expect(legacyRedirect("/console/tasks", "?tab=failed")).toBeNull();
expect(legacyRedirect("/console/library", "?filter=unidentified")).toBeNull();
expect(legacyRedirect("/console/subscriptions", "")).toBeNull();
expect(legacyRedirect("/console/sources", "?health=failing")).toBeNull();
// 旧 RSS 页的 ?feed= 由 sources.tsx 查所属站点后跳转
expect(legacyRedirect("/console/sources", "?feed=f1")).toBeNull();
});
});