Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions docs/archive/plans/2026-10-27-ui-hierarchy-polish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# UI hierarchy and interaction polish

## Scope and isolation

- Worktree: `/root/Clouds/SubMan-ui-polish`
- Branch: `feat/ui-hierarchy-polish`
- Base: `e015b6f650abfe8c3aa89cbf9c741495f783e465`
- Preserve the existing Primer palette, Svelte architecture, single cloud binding,
persistence boundary, and cloud-confirmed operation semantics.
- Local implementation and commit are authorized. Remote publication, merging,
Wiki publication, and production deployment require separate authorization.

## Implementation

1. Separate the brand toolbar and navigation with distinct surfaces and borders.
Align both with the content, enlarge the home-linked brand, surface connection
and pending states as text, and make overflowing navigation discoverable.
2. Provide shared, viewport-aware tooltips for icon actions with hover, keyboard
focus, Escape dismissal, and cleanup. Complete theme-menu keyboard behavior.
3. Restore dark primary-button emphasis, readable metadata, useful row hover and
focus states, search-icon spacing, larger touch controls, distinct filtered
empty states, and honest file-link affordances. Remove duplicate list actions
and status metadata without hiding the cloud confirmation state.
4. Adapt the overview to existing data with recent resources and publication
targets. Derive published URLs and dates from the confirmed binding baseline;
retain onboarding for empty workspaces and avoid a new activity storage path.
5. Group aggregation inputs into sources and optional advanced configuration.
Keep existing non-default configuration discoverable, preserve drafts and
protocol behavior, and explain saved rules, targets, and publication prerequisites.
6. Update both Wiki changelogs and verify the final patch before an atomic
Conventional Commit.

## Validation

- Bun 1.3.14; independent dependencies, generated output, Worker state, browser
contexts, and development ports in this worktree.
- Run docs checks, unit tests, Svelte/Worker type checks, lint, production build,
and affected Worker/browser checks. Use local mock Gists only.
- Browser plugin is unavailable; use Playwright Chromium. Verify all six routes,
light/dark themes, English/Chinese, desktop/mobile, tooltip hover/focus/Escape,
navigation overflow, theme keyboard interaction, search reset, file links,
overview states, and advanced configuration visibility.
- Inspect screenshots and console output. Record outcomes and limitations in the
handoff; retain the task worktree for review and any later authorized PR.

## Execution record

- Implemented all six steps with the existing design tokens and Octicons. Added
no dependency, business storage, public API, or cloud mutation behavior.
- Passed 679 unit tests, documentation validation (37 bilingual pages), Svelte and
Worker type checks (zero errors/warnings), lint, production builds, eight local
Cloudflare integration tests, the sing-box 1.14 check (15 generated outbounds),
and the local deployment-bundle dry run.
- Passed the full 56-case Playwright suite with one worker, matching CI. After
the final tooltip-listener cleanup, the eight UI cases and two settings cases
passed again. The five migration variants passed after fixing a test-only race
between checking readiness and interacting with a disappearing migration panel.
- Exploratory parallel runs exposed timing-sensitive existing delivery cases;
isolated checks passed on both the original baseline and the task branch.
Production delivery and migration behavior was preserved.
- Inspected all six routes at 1440px and narrow layouts at 390px and 320px, in
light/dark themes and English/Chinese. Browser console checks found no app
errors or warnings; no page overflow or framework error overlay was observed.
- Temporary browser artifacts and logs are outside the source worktree in
`/tmp/subman-ui-polish-qa`. Real GitHub Gists and production were not accessed.
- Delivery remains a local task commit and retained worktree. Push, PR review,
merge, main sync, and merged-branch cleanup have not been authorized.
15 changes: 15 additions & 0 deletions docs/wiki/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ production deployment and real-provider acceptance require separate evidence.

## Unreleased

### 2026-10-27 - UI hierarchy and interaction polish

- Separated the linked brand toolbar from navigation, aligned the header with the
page, and added visible cloud status, accessible tooltips, keyboard theme controls,
and a navigation overflow control on narrow screens.
- Restored primary-button emphasis in dark mode and readable list metadata;
removed duplicate node actions/status, fixed search spacing and filtered empty
states, enlarged touch actions, and made available Gist filenames real links.
- Adapted the overview to recent resources and confirmed publication metadata;
retained empty-workspace onboarding. Grouped advanced rule options and explained
save, preview, target, and publication prerequisites without changing cloud writes.
- Completed Chinese labels on these surfaces and localized resource timestamps;
kept browser test fixtures reusable and screenshots isolated per test.


### 2026-10-26 - Simplified application chrome

- Replaced header status badges, Gist ID, and setup button with a compact status
Expand Down
11 changes: 11 additions & 0 deletions docs/wiki/Changelog.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@

## 未发布

### 2026-10-27 - 页面层级与交互优化

- 区分可返回首页的品牌工具栏与业务导航,统一页头和正文对齐;增加可见的云端状态、
支持悬停和键盘聚焦的图标提示、主题菜单键盘操作及小屏导航翻页入口。
- 恢复暗色主按钮的强调色,提高列表辅助信息可读性;删除重复的新建入口和状态信息,
修复搜索图标间距、区分空数据和筛选无结果,增大触摸按钮并让可用文件名成为真实链接。
- 首页根据已有数据展示最近资源和已确认的发布信息,空工作区保留入门指引;
聚合页收纳高级配置并说明保存、预览、目标与发布的关系,云端写入协议保持不变。
- 补齐相关界面的中文标签并本地化资源更新时间;复用浏览器测试数据,按用例隔离截图。


### 2026-10-26 - 精简页面与顶部工具栏

- 将顶部状态标签、Gist ID 和设置按钮收为状态、主题、GitHub 三个图标,
Expand Down
10 changes: 10 additions & 0 deletions docs/wiki/User-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ if data is missing or a document is rejected.

## Manage resources

The brand links to the overview. The header shows connection and pending cloud
states; icon labels appear on hover or keyboard focus. On narrow screens, use the
navigation arrow to reach additional pages. The overview shows onboarding for an
empty Workspace, then recent resources and confirmed publication metadata.

| Page | Purpose |
| --- | --- |
| `/auth` | Connection, token, delivery status, cloud reload, migration, and diagnostics |
Expand All @@ -34,6 +39,11 @@ resolve duplicates before adding. Aggregates select nodes and subscriptions,
exclude tags, filter protocols, apply regex renaming, add region flags, and sort
by names, protocols, regions, priority keywords, or manual ordering.

Open **Advanced rule options** for protocol filtering, sorting, renaming, and
region flags. Existing non-default options open automatically when loading a rule.
Saving a rule or target stores configuration; publishing generates the output file.
For client exports, save profile changes and generate a current preview before publishing.

Subscription URLs must permit browser access. Fetches have a 15-second timeout
and 4 MiB response limit; network/CORS, HTTP, size, encoding, and empty responses
have separate errors. See the [export guide](../sing-box-export.md) for supported
Expand Down
8 changes: 8 additions & 0 deletions docs/wiki/User-Guide.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ SubMan 查找描述为 `SubMan-Data`、包含权威文档 `subman.json` 的私

## 管理资源

点击品牌可返回概览。页头直接显示连接与待云端确认状态,图标支持悬停和键盘聚焦提示。
小屏幕可通过导航箭头查看后面的页面入口。空工作区显示入门指引,已有数据后展示最近资源
和已确认的发布信息。

| 页面 | 用途 |
| --- | --- |
| `/auth` | 连接、Token、发送状态、云端重载、迁移和诊断 |
Expand All @@ -28,6 +32,10 @@ SubMan 查找描述为 `SubMan-Data`、包含权威文档 `subman.json` 的私
聚合规则可选择节点和订阅、排除标签、过滤协议、正则重命名、添加地区旗帜,
并按名称、协议、地区、优先关键词或手动拖拽排序。

展开“高级规则选项”可设置协议过滤、排序、重命名和地区旗帜;加载已有非默认配置的规则时
会自动展开。保存规则或目标只保存配置,发布才会生成输出文件。客户端导出需要先保存配置
修改并生成最新预览,再发布。

订阅地址需要允许浏览器访问。请求超时为 15 秒,响应上限为 4 MiB;网络/CORS、HTTP、
大小、编码和空内容分别提示错误。[导出指南](../sing-box-export.zh-CN.md)说明支持的协议、
警告和 sing-box 1.14 兼容范围。
Expand Down
140 changes: 3 additions & 137 deletions e2e/accessibility.spec.ts
Original file line number Diff line number Diff line change
@@ -1,145 +1,10 @@
import { expect, test } from "@playwright/test";
import { seedUiWorkspace } from "./ui-workspace-fixture";

const routes = ["/", "/auth", "/nodes", "/aggregate", "/exports", "/gists"];

test.beforeEach(async ({ page, context }) => {
const now = "2026-10-23T10:00:00.000Z";
const gistId = "accessibility-cloud";
const data = {
nodes: [
{
id: "accessibility-node",
name: "Accessibility Node",
type: "vless",
raw: "vless://00000000-0000-4000-8000-000000000001@example.com:443#A11y",
tags: [],
enabled: true,
updatedAt: now,
source: "single",
},
],
subscriptions: [],
aggregates: [],
publishTargets: [],
clientExports: [],
};
const document = {
version: 2,
schemaVersion: 2,
workspaceId: `gist:${gistId}`,
revision: 0,
updatedAt: now,
lastMutationId: null,
data,
tombstones: {
nodes: [],
subscriptions: [],
aggregates: [],
publishTargets: [],
clientExports: [],
},
};
await context.route("https://api.github.com/**", async (route) => {
if (
route.request().method() !== "GET" ||
new URL(route.request().url()).pathname !== `/gists/${gistId}`
) {
await route.abort("blockedbyclient");
return;
}
await route.fulfill({
json: {
id: gistId,
owner: { login: "e2e" },
description: "SubMan-Data",
updated_at: now,
html_url: `https://gist.github.com/e2e/${gistId}`,
files: {
"subman.json": {
filename: "subman.json",
content: JSON.stringify(document),
truncated: false,
},
},
},
});
});
await context.route("**/__e2e_seed__", (route) =>
route.fulfill({
status: 200,
contentType: "text/html",
body: "<!doctype html><title>SubMan E2E seed</title>",
}),
);
await page.goto("/__e2e_seed__");
await page.evaluate(
async ({ gistId, now, data, document }) => {
const database = await new Promise<IDBDatabase>((resolve, reject) => {
const request = indexedDB.open("subman-workspace", 1);
request.onupgradeneeded = () =>
request.result.createObjectStore("workspace-state");
request.onsuccess = () => resolve(request.result);
request.onerror = () => reject(request.error);
});
await new Promise<void>((resolve, reject) => {
const transaction = database.transaction(
"workspace-state",
"readwrite",
);
transaction.objectStore("workspace-state").put(
{
version: 1,
snapshot: {
...data,
gists: [],
activeGistId: gistId,
activeGistFile: "subman.json",
lastUpdated: now,
},
binding: {
version: 2,
gistId,
workspaceId: `gist:${gistId}`,
fileName: "subman.json",
revision: 0,
syncMode: "automatic",
baseline: document,
conflictBaseline: null,
},
workspaces: {},
leases: {},
quarantines: [],
quarantinePayloads: {},
nextFencingToken: 1,
migration: {
version: 1,
phase: "confirmed",
startedAt: now,
copiedAt: now,
validatedAt: now,
updatedAt: now,
confirmedAt: now,
cleanupCompletedAt: now,
},
},
"root",
);
transaction.oncomplete = () => resolve();
transaction.onerror = () => reject(transaction.error);
transaction.onabort = () => reject(transaction.error);
});
database.close();
sessionStorage.setItem(
"subman:auth:session:v2",
JSON.stringify({
version: 2,
token: "fixture-accessibility-token",
lastLoginAt: now,
}),
);
},
{ gistId, now, data, document },
);
await seedUiWorkspace(page, context);
});

test.describe("basic route accessibility", () => {
Expand Down Expand Up @@ -245,6 +110,7 @@ test("aggregate region dialog exposes focus and Escape behavior", async ({
page,
}) => {
await page.goto("/aggregate");
await page.locator("details.gh-advanced-options > summary").click();
const openButton = page.getByRole("button", { name: "Browse Icons" });
await openButton.click();

Expand Down
Loading
Loading