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
13 changes: 13 additions & 0 deletions docs/wiki/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ production deployment and real-provider acceptance require separate evidence.

## Unreleased

### 2026-11-01 - Foreground cloud operation loading

- Keep saves, publication generation, and Gist refresh in a visible foreground
loading dialog. Freeze background editing and navigation until the operation
settles, while keeping explicit confirmation dialogs usable.
- Retain drafts and pending/repair feedback when cloud confirmation is missing;
only confirmed remote commits finalize saves and publication links.
- Capture the publication profile, target, and filename before asynchronous
generation so the result stays attached to the original operation. Initialize
export drafts before checking for unsaved changes on first load.
- Wait for Gist refresh completion before exercising file actions in browser
tests, and keep navigation tests stable while the scroll button label changes.

### 2026-10-31 - Explicit device reset and fresh connection

- Added a confirmed Settings recovery action for devices whose original Gist was
Expand Down
9 changes: 9 additions & 0 deletions docs/wiki/Changelog.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@

## 未发布

### 2026-11-01 - 云端操作前台等待状态

- 保存、发布生成与 Gist 刷新统一显示前台 loading,等待期间禁止编辑背景内容或切换页面,
需要用户选择的确认弹窗仍可正常操作。
- 未获得云端确认时保留草稿与待处理/修复提示;只有远端提交确认后才完成保存并更新发布链接。
- 发布前固定配置、目标与文件名,避免生成期间的状态变化导致发布内容与操作对象混用。
- 客户端导出先初始化草稿再检查变更,避免首次加载时误判为未保存并锁住发布按钮。
- 浏览器测试等待 Gist 刷新完成后再操作文件按钮,并在导航翻页按钮文案变化时保持定位稳定。

### 2026-10-31 - 显式设备重置与重新连接

- 在设置中增加需确认的恢复入口,支持原 Gist 已删除或不可访问、退出登录和云端加载失败的场景。
Expand Down
61 changes: 50 additions & 11 deletions e2e/gists-readonly.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ for (const variant of [
test(`Gists stays read-only while viewing and refreshing all file kinds (${variant.name})`, async ({
page,
context,
}) => {
}, testInfo) => {
await page.setViewportSize(variant);
const errors: string[] = [];
const writes: string[] = [];
Expand Down Expand Up @@ -71,7 +71,11 @@ for (const variant of [
await expect(page).toHaveURL(/\/gists$/);
await expect(page).toHaveTitle("Gists - SubMan");
await expect(page.locator(".app-header-link-connected")).toBeVisible();
const main = page.getByRole("main");
const main = page.locator("main");
await expect(main.locator(".gh-box.shadow-sm")).toHaveAttribute(
"aria-busy",
"false",
);
await expect(main.getByRole("heading", { name: "Gists" })).toBeVisible();
await expect(
main.getByText(variant.locale === "en" ? "Read-only" : "只读", {
Expand Down Expand Up @@ -116,15 +120,50 @@ for (const variant of [
"data-copied-url",
rawUrl,
);
await Promise.all([
page.waitForResponse(gistUrl),
main
.getByRole("button", {
name: variant.locale === "en" ? "Refresh" : "刷新",
exact: true,
})
.click(),
]);
let release = () => {};
const held = new Promise<void>((resolve) => {
release = resolve;
});
let requests = 0;
await context.route(gistUrl, async (route) => {
requests += 1;
await held;
await route.fallback();
});
await main
.getByRole("button", {
name: variant.locale === "en" ? "Refresh" : "刷新",
exact: true,
})
.click();
const waiting = page.getByRole("dialog", {
name:
variant.locale === "en"
? "Loading workspace files..."
: "正在加载工作区文件...",
exact: true,
});
await expect(waiting).toBeVisible();
await expect(waiting).toHaveAttribute("aria-busy", "true");
await expect(main.locator(".gh-box.shadow-sm")).toHaveAttribute(
"aria-busy",
"true",
);
await page.keyboard.press("Escape");
await expect(waiting).toBeVisible();
await expect(waiting).toHaveCSS("opacity", "1");
await page.screenshot({
path: testInfo.outputPath("gists-refresh-loading.png"),
});
release();
await expect(waiting).toHaveCount(0);
await expect(
main.getByRole("button", {
name: variant.locale === "en" ? "Refresh" : "刷新",
exact: true,
}),
).toBeEnabled();
expect(requests).toBe(1);
await expect(main.locator(".gh-box-row")).toHaveCount(5);
await expect(main.getByRole("button")).toHaveCount(6);
expect(
Expand Down
7 changes: 4 additions & 3 deletions e2e/ui-interactions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ test("edit stays open and busy until the original cloud mutation is confirmed",
"true",
);
await expect(dialog.locator(".gh-action-button")).toBeDisabled();
await expect(
dialog.getByRole("textbox", { name: "Name", exact: true }),
).toHaveValue("Cloud-confirmed edit");
await expect(dialog.getByLabel("Name", { exact: true })).toHaveValue(
"Cloud-confirmed edit",
);
await expect(
page.getByRole("status").filter({ hasText: "Node updated" }),
).toHaveCount(0);
Expand Down Expand Up @@ -278,6 +278,7 @@ test("automatic theme follows the OS while explicit light mode stays fixed", asy
"rgb(13, 17, 23)",
);
await page.reload();
await expect(page.locator(".app-header-link-connected")).toBeVisible();
await expect(page.locator("body")).toHaveCSS(
"background-color",
"rgb(13, 17, 23)",
Expand Down
39 changes: 25 additions & 14 deletions e2e/ui-polish.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,28 @@ test("mobile navigation reveals settings and keeps the selected page visible", a
await seedUiWorkspace(page, context);
await page.goto("/");
await expect(page.locator(".app-header-link-connected")).toBeVisible();
const navigation = page.getByRole("navigation", { name: "Primary" });
const scroll = page.locator(".app-nav-scroll");
for (let attempt = 0; attempt < 4; attempt++) {
const more = page.getByRole("button", {
name: "More navigation items",
exact: true,
});
if (!(await more.count())) break;
const previous = await page
.locator("nav")
.evaluate((node) => node.scrollLeft);
await more.click();
const previous = await navigation.evaluate((node) => ({
left: node.scrollLeft,
remaining: node.scrollWidth - node.clientWidth - node.scrollLeft,
}));
if (previous.remaining <= 1) break;
await expect(scroll).toHaveAttribute("aria-label", "More navigation items");
await scroll.click();
await expect
.poll(() => page.locator("nav").evaluate((node) => node.scrollLeft))
.toBeGreaterThan(previous);
.poll(() => navigation.evaluate((node) => node.scrollLeft))
.toBeGreaterThan(previous.left);
const atEnd = await navigation.evaluate(
(node) => node.scrollWidth - node.clientWidth - node.scrollLeft <= 1,
);
await expect(scroll).toHaveAttribute(
"aria-label",
atEnd ? "Previous navigation items" : "More navigation items",
);
}
const settings = page
.getByRole("navigation", { name: "Primary" })
.getByRole("link", { name: "Settings" });
const settings = navigation.getByRole("link", { name: "Settings" });
await expect(settings).toBeInViewport({ ratio: 1 });
await settings.click();
await expect(page).toHaveURL(/\/auth$/);
Expand Down Expand Up @@ -219,6 +224,11 @@ test("Gist filenames expose real raw links and accessible icon labels", async ({
await seedUiWorkspace(page, context);
await page.goto("/gists");
await expect(page.locator(".app-header-link-connected")).toBeVisible();
await expect(page.locator(".gh-box.shadow-sm")).toHaveAttribute(
"aria-busy",
"false",
);
await expect(page.getByRole("dialog")).toHaveCount(0);
await expect(
page.getByRole("link", { name: "subman.json · Open Raw" }),
).toHaveAttribute(
Expand All @@ -227,6 +237,7 @@ test("Gist filenames expose real raw links and accessible icon labels", async ({
);
const copy = page.getByRole("button", { name: "Copy Raw URL", exact: true });
await copy.focus();
await expect(copy).toBeFocused();
await expect(page.getByRole("tooltip")).toHaveText("Copy Raw URL");
});

Expand Down
9 changes: 9 additions & 0 deletions e2e/workspace-reset.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,15 @@ test("reset remains reachable when browser persistence initialization fails", as
});
});
await page.goto("/auth");
await expect(
page
.getByRole("alert")
.filter({
hasText:
"Cloud data could not be loaded. Check your connection and retry.",
})
.first(),
).toBeVisible();
const action = page.getByTestId("device-reset-action");
await expect(action).toBeEnabled();
await action.click();
Expand Down
Loading
Loading