From 2c7f77901d030b47e95d264b0381fcc76678ea97 Mon Sep 17 00:00:00 2001 From: KnowSky404 Date: Mon, 26 Oct 2026 16:32:00 +0800 Subject: [PATCH] feat(ui): simplify header controls and remove redundant panels --- docs/wiki/Changelog.md | 10 + docs/wiki/Changelog.zh-CN.md | 8 + e2e/workspace-v2.spec.ts | 15 +- src/app.css | 165 ++++----------- src/routes/+layout.svelte | 60 +++--- src/routes/+page.svelte | 277 ++++++------------------- src/routes/aggregate/+page.svelte | 10 - src/routes/auth/+page.svelte | 1 - src/routes/exports/+page.svelte | 40 ---- src/routes/exports/page-source.test.ts | 6 +- src/routes/gists/+page.svelte | 232 ++++++++------------- src/routes/gists/page-source.test.ts | 8 +- src/routes/layout-source.test.ts | 6 +- src/routes/nodes/+page.svelte | 8 - 14 files changed, 253 insertions(+), 593 deletions(-) diff --git a/docs/wiki/Changelog.md b/docs/wiki/Changelog.md index 5e24d1c..d77742e 100644 --- a/docs/wiki/Changelog.md +++ b/docs/wiki/Changelog.md @@ -8,6 +8,16 @@ production deployment and real-provider acceptance require separate evidence. ## Unreleased +### 2026-10-26 - Simplified application chrome + +- Replaced header status badges, Gist ID, and setup button with a compact status + icon, theme control, and GitHub link; retained accessible labels, hover text, + pending/error indicators, and the repair shortcut. +- Removed repeated page descriptions and summary badges, overview status panels, + the Gist information sidebar, and the export summary card. Kept actionable + warnings, publication links, and counts beside the relevant lists. +- Made overview counts navigable and kept the header on one row on small screens. + ### 2026-10-26 - Worktree and PR development workflow - Adopted FlareMail's task isolation, current-head Codex review, rebase merge, diff --git a/docs/wiki/Changelog.zh-CN.md b/docs/wiki/Changelog.zh-CN.md index 487cd6d..d9f6197 100644 --- a/docs/wiki/Changelog.zh-CN.md +++ b/docs/wiki/Changelog.zh-CN.md @@ -7,6 +7,14 @@ ## 未发布 +### 2026-10-26 - 精简页面与顶部工具栏 + +- 将顶部状态标签、Gist ID 和设置按钮收为状态、主题、GitHub 三个图标, + 保留无障碍名称、悬停提示、待处理/异常提示与修复入口。 +- 删除各页重复说明和统计胶囊、首页状态面板、Gist 信息侧栏、导出统计卡片; + 保留实际告警、发布链接及列表旁的必要计数。 +- 首页计数可直接进入对应页面,小屏幕顶部工具栏保持单行。 + ### 2026-10-26 - Worktree 与 PR 开发工作流 - 参考 FlareMail,统一任务隔离、当前 head 的 Codex review、rebase 合并、 diff --git a/e2e/workspace-v2.spec.ts b/e2e/workspace-v2.spec.ts index 5e28331..b40c786 100644 --- a/e2e/workspace-v2.spec.ts +++ b/e2e/workspace-v2.spec.ts @@ -1300,7 +1300,9 @@ test("rolls back the visible node when the IndexedDB transaction fails", async ( await expect(page.getByText("Must Roll Back", { exact: true })).toHaveCount( 0, ); - await expect(page.getByText("0 nodes", { exact: true })).toBeVisible(); + await expect( + page.getByRole("button", { name: "Nodes 0", exact: true }), + ).toBeVisible(); const stored = await readIndexedDb(page); expect((stored.snapshot as JsonRecord).nodes).toEqual([]); }); @@ -2040,7 +2042,10 @@ test("Save and Publish reports peer ownership until another tab commits once", a }) .toBe(0); await expect( - page.getByText("Saved to Workspace", { exact: true }).first(), + page.getByRole("link", { + name: "Manage Workspace: Saved to Workspace", + exact: true, + }), ).toBeVisible(); await expect(page.getByText("Live Link", { exact: true })).toHaveCount(0); expect(submissions).toHaveLength(1); @@ -2556,7 +2561,7 @@ test("shows a domain conflict without full-state merge and clears Repair after c "Domain Conflict Node", "vless://domain-conflict.example", ); - const repairLink = page.getByRole("link", { name: "Repair", exact: true }); + const repairLink = page.getByRole("link", { name: /^Repair:/ }); await expect(repairLink).toBeVisible(); await repairLink.click(); await page.getByTestId("queue-inspector").locator("summary").first().click(); @@ -2575,9 +2580,7 @@ test("shows a domain conflict without full-state merge and clears Repair after c .getByRole("dialog") .getByRole("button", { name: "Reload from Cloud", exact: true }) .click(); - await expect( - page.getByRole("link", { name: "Repair", exact: true }), - ).toHaveCount(0); + await expect(page.getByRole("link", { name: /^Repair:/ })).toHaveCount(0); await expect(page.getByTestId("active-queue-count")).toHaveText("0"); }); diff --git a/src/app.css b/src/app.css index 1fd45c2..b6152f0 100644 --- a/src/app.css +++ b/src/app.css @@ -428,7 +428,7 @@ input[type="checkbox"]:indeterminate { } .gh-page-header { - @apply flex flex-col gap-3 border-b border-border-default pb-4 lg:flex-row lg:items-end lg:justify-between; + @apply flex flex-wrap items-center justify-between gap-3 border-b border-border-default pb-4; } .gh-page-heading { @@ -439,26 +439,10 @@ input[type="checkbox"]:indeterminate { @apply text-2xl font-semibold leading-tight text-fg-default; } -.gh-page-subtitle { - @apply max-w-3xl text-sm text-fg-muted; -} - .gh-page-actions { @apply flex flex-wrap items-center gap-2; } -.gh-page-meta { - @apply flex flex-wrap items-center gap-2 text-xs text-fg-muted; -} - -.gh-page-meta-item { - @apply inline-flex min-h-7 max-w-full items-center gap-1.5 truncate rounded-md border border-border-default bg-canvas-default px-2.5 py-1; -} - -.gh-page-meta-item-code { - @apply max-w-full truncate font-mono text-[11px]; -} - .gh-list-header { @apply flex items-center justify-between gap-3 border-b border-border-default bg-canvas-subtle px-4 py-2 text-[11px] font-semibold uppercase tracking-wide text-fg-muted; } @@ -624,38 +608,38 @@ input[type="checkbox"]:indeterminate { @apply z-[130]; } -.theme-menu-button { - @apply inline-flex h-8 w-8 items-center justify-center rounded-md border transition-colors; - border-color: var(--border-default); - background-color: var(--canvas-default); +.theme-menu-button, +.app-header-link { + @apply inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md transition-colors; color: var(--fg-muted); } -.theme-menu-button:hover { - background-color: var(--canvas-subtle); +.theme-menu-button:hover, +.app-header-link:hover { + background-color: var(--canvas-inset); color: var(--fg-default); } -.theme-menu-button:focus, -.theme-menu-button:focus-visible { - outline: none; - border-color: var(--accent-emphasis); - box-shadow: 0 0 0 3px var(--accent-muted); +.theme-menu-button:focus-visible, +.app-header-link:focus-visible { + outline: 2px solid var(--accent-fg); + outline-offset: 2px; } .theme-menu-dropdown { @apply z-[150]; } -.app-header-link { - @apply inline-flex h-8 w-8 items-center justify-center rounded-md border transition-colors; - border-color: var(--border-default); - color: var(--fg-muted); +.app-header-link-connected { + color: var(--success-emphasis); } -.app-header-link:hover { - background: var(--canvas-subtle); - color: var(--fg-default); +.app-header-link-pending { + color: var(--attention-emphasis); +} + +.app-header-link-danger { + color: var(--danger-emphasis); } .app-repo-shell { @@ -667,7 +651,7 @@ input[type="checkbox"]:indeterminate { } .app-repo-meta { - @apply mx-auto flex w-full flex-col gap-3 px-4 py-3 sm:px-6 lg:flex-row lg:items-center lg:justify-between lg:px-8; + @apply mx-auto flex w-full items-center justify-between gap-3 px-4 py-3 sm:px-6 lg:px-8; } .app-repo-main { @@ -687,7 +671,7 @@ input[type="checkbox"]:indeterminate { } .app-repo-title { - @apply flex min-w-0 flex-wrap items-center gap-1.5 text-xl leading-7; + @apply flex min-w-0 items-center gap-2 text-lg font-semibold leading-7; color: var(--fg-default); } @@ -695,69 +679,8 @@ input[type="checkbox"]:indeterminate { @apply flex min-w-0 items-center; } -.app-repo-status-line { - @apply flex min-w-0 items-center gap-2; - color: var(--fg-muted); -} - -.app-repo-title-owner { - color: var(--accent-fg); - font-weight: 400; -} - -.app-repo-title-owner:hover { - text-decoration: underline; -} - -.app-repo-title-separator { - color: var(--fg-muted); -} - -.app-repo-visibility { - @apply ml-1 inline-flex items-center rounded-full border px-1.5 py-0 text-xs font-medium leading-5; - border-color: var(--border-default); - color: var(--fg-muted); -} - .app-repo-actions { - @apply flex min-w-0 flex-wrap items-center gap-2 lg:justify-end; -} - -.app-repo-status { - @apply inline-flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-xs font-medium; - border-color: var(--border-default); - background: var(--canvas-default); - color: var(--fg-muted); -} - -.app-repo-status-connected { - color: var(--success-emphasis); -} - -.app-repo-workspace-id { - @apply hidden max-w-[16rem] truncate font-mono text-xs sm:inline; - color: var(--fg-muted); -} - -.app-repo-action-button { - @apply inline-flex h-8 items-center justify-center rounded-md border px-3 text-xs font-medium transition-colors; - border-color: var(--border-default); - background: var(--canvas-default); - color: var(--fg-default); -} - -.app-repo-action-button:hover { - background: var(--canvas-subtle); -} - -.app-repo-action-button-primary { - border-color: color-mix(in srgb, var(--success-emphasis) 70%, black); - background: var(--success-emphasis); - color: #ffffff; -} - -.app-repo-action-button-primary:hover { - background: color-mix(in srgb, var(--success-emphasis) 88%, black); + @apply flex shrink-0 items-center gap-1; } .app-main-container { @@ -786,11 +709,31 @@ input[type="checkbox"]:indeterminate { } .repo-metric-grid { - @apply grid grid-cols-1 divide-y divide-border-default md:grid-cols-4 md:divide-x md:divide-y-0; + @apply grid grid-cols-2 md:grid-cols-4; } .repo-metric { - @apply flex min-w-0 flex-col gap-2 p-4; + @apply flex min-w-0 flex-col gap-3 p-4 transition-colors hover:bg-canvas-subtle; + outline-offset: -2px; + border-right: 1px solid var(--border-default); +} + +.repo-metric:nth-child(2n) { + border-right: 0; +} + +.repo-metric:nth-child(n + 3) { + border-top: 1px solid var(--border-default); +} + +@media (min-width: 768px) { + .repo-metric:nth-child(2) { + border-right: 1px solid var(--border-default); + } + + .repo-metric:nth-child(n + 3) { + border-top: 0; + } } .repo-metric-label { @@ -801,10 +744,6 @@ input[type="checkbox"]:indeterminate { @apply text-2xl font-semibold leading-none text-fg-default; } -.repo-metric-caption { - @apply text-xs text-fg-muted; -} - .repo-workflow-row { @apply flex flex-col gap-2 px-4 py-3 sm:flex-row sm:items-center sm:justify-between; } @@ -817,22 +756,6 @@ input[type="checkbox"]:indeterminate { @apply mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-border-default bg-canvas-subtle text-[11px] font-medium text-fg-muted; } -.repo-sidebar-section { - @apply border-b border-border-default px-4 py-4 last:border-b-0; -} - -.repo-sidebar-title { - @apply mb-2 text-sm font-semibold; -} - -.repo-sidebar-row { - @apply flex items-center justify-between gap-3 py-1 text-sm; -} - -.repo-sidebar-row-label { - @apply min-w-0 text-fg-muted; -} - .blankslate { @apply flex flex-col items-center justify-center rounded-md border border-dashed border-border-default bg-canvas-default px-8 py-12 text-center; } diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 09ae88a..acdd37a 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -15,8 +15,8 @@ import { fileCode, gear, home, + markGithub, moon, - packageIcon, server, shieldCheck, sun, @@ -40,7 +40,6 @@ import { startWorkspaceMutationSync } from "$lib/workspace-mutation-sync-browser import { workspaceSyncStatus } from "$lib/workspace-sync-status"; const PROJECT_GITHUB_URL = "https://github.com/KnowSky404/SubMan"; -const PROJECT_OWNER = "KnowSky404"; const PROJECT_NAME = "SubMan"; const navItems = [ @@ -71,9 +70,15 @@ $: isWorkspaceConnected = Boolean( $workspaceCloudStatus.phase === "ready" && $workspaceSyncStatus.mode !== "disconnected", ); -$: workspaceMetaText = isWorkspaceConnected - ? $appState.activeGistId - : $t("Connect GitHub to load your cloud data."); +$: workspaceNeedsAttention = + $workspaceCloudStatus.phase === "error" || + $workspaceSyncStatus.repairRequired; +$: workspaceBusy = + $workspaceCloudStatus.phase === "loading" || + $workspaceSyncStatus.lifecycle === "syncing"; +$: workspacePending = + $workspaceSyncStatus.queueCount > 0 || + $workspaceSyncStatus.lifecycle === "retrying"; $: syncStatusLabel = $workspaceCloudStatus.phase === "loading" ? "Loading cloud data..." @@ -94,6 +99,7 @@ $: syncStatusLabel = disconnected: "Not connected", } as const )[$workspaceSyncStatus.lifecycle]; +$: workspaceControlLabel = `${$t(workspaceNeedsAttention ? "Repair" : isWorkspaceConnected ? "Manage Workspace" : "Setup GitHub")}: ${$t(syncStatusLabel)}${$workspaceSyncStatus.queueCount > 0 ? `, ${$t("{count} queued", { count: $workspaceSyncStatus.queueCount })}` : ""}`; let themeMenuOpen = false; let confirmDialogElement: HTMLDivElement | null = null; let confirmButton: HTMLButtonElement | null = null; @@ -206,43 +212,24 @@ onMount(() => {
- - {PROJECT_OWNER} - - / {PROJECT_NAME} - Public
-
- - {#if isWorkspaceConnected} - - {$t("Workspace")} - {:else} - - {$t("Not connected")} - {/if} - - {workspaceMetaText} - {$t(syncStatusLabel)} - {#if $workspaceSyncStatus.queueCount > 0} - {$t("{count} queued", { count: $workspaceSyncStatus.queueCount })} - {/if} - {#if $workspaceSyncStatus.repairRequired} - {$t("Repair")} - {/if} -
- - - {isWorkspaceConnected ? $t("Manage Workspace") : $t("Setup GitHub")} + + + {workspaceControlLabel}
- @@ -251,11 +238,11 @@ onMount(() => {
{#each themeOptions as option (option.value)} - {/each} @@ -270,8 +257,9 @@ onMount(() => { rel="noreferrer" class="app-header-link" aria-label={$t("Open project on GitHub")} + title={$t("Open project on GitHub")} > - +
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 8dccbf3..039d155 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,76 +1,41 @@

{$t("Overview")}

-

- {$t("Manage proxy sources, aggregate rules, client exports, and workspace publishing from one gist-backed workbench.")} -

-
- - {isConnected ? $t("Workspace connected") : $t("Not connected")} - - {$t("{count} live links", { count: publishTargetCount })} -
-
- -
-
-
- - {$t("Publish status")} -
- {publishTargetCount} -
-
-
-
- -
-
-

{$t("Published links")}

-

- {$t("{count} publish target(s) already have a live raw URL.", { count: publishTargetCount })} +

+
+
+ 1 +
+

{$t("Collect sources")}

+

+ {$t("Add single URIs or upstream subscription URLs.")}

+ + {$t("Nodes")} + + +
-
-
- -
-
-

{$t("Last cloud update")}

-

- {cloudUpdatedAt ? new Date(cloudUpdatedAt).toLocaleString() : $t("None")} +

+
+ 2 +
+

{$t("Compose rules")}

+

+ {$t("Filter, rename, and preview the output set.")}

-
-
-
- - +
+
diff --git a/src/routes/aggregate/+page.svelte b/src/routes/aggregate/+page.svelte index 788ce52..766c47d 100644 --- a/src/routes/aggregate/+page.svelte +++ b/src/routes/aggregate/+page.svelte @@ -943,16 +943,6 @@ function handleExcludeTagsInput() {

{$t("Aggregate")}

-

- {$t("Build source selection, filtering, rename, sorting, preview, and publish rules.")} -

-
- {$t("{count} rules", { count: $appState.aggregates.length })} - {$t("{count} targets", { count: $appState.publishTargets.length })} - - {isWorkspaceConnected ? $t("Workspace connected") : $t("Not connected")} - -