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
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ export function LarkSettingsPage({
<p>{t("lark.goalConnections", { count: connections.filter((connection) => connection.app_ref === app.app_ref).length })}{app.ready && !app.reply_ready ? ` · ${t("lark.autoReplyUnavailable")}` : ""}</p>
</article>
))}
{appsLoading ? <p role="status">{t("lark.loading")}</p> : apps.length === 0 && !appsError ? <ContextHelp label={locale === "zh-CN" ? "暂无飞书应用档案" : "No Lark app profiles"} icon={CircleHelp}><p className="personal-lark-empty">{t("lark.noProfiles")}</p></ContextHelp> : null}
{appsLoading ? <p role="status">{t("lark.loading")}</p> : apps.length === 0 && !appsError ? <ContextHelp label={locale === "zh-CN" ? "暂无飞书应用档案" : "No Lark app profiles"} icon={CircleHelp}><p>{t("lark.noProfiles")}</p></ContextHelp> : null}
</div>
</div>
) : null}
Expand Down Expand Up @@ -609,7 +609,7 @@ export function LarkSettingsPage({
</span>
</div>;
})}
{filteredConnections.length === 0 ? <ContextHelp label={locale === "zh-CN" ? "暂无 Goal 连接" : "No Goal connections"} icon={CircleHelp}><p className="personal-lark-empty">{t("lark.noConnections")}</p></ContextHelp> : null}
{filteredConnections.length === 0 ? <ContextHelp label={locale === "zh-CN" ? "暂无 Goal 连接" : "No Goal connections"} icon={CircleHelp}><p>{t("lark.noConnections")}</p></ContextHelp> : null}
</div>
</div>
) : null}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 36 additions & 4 deletions examples/personal-workspace-browser/progressive-loading.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ async function verifyLarkLoading(browser, url, collectCoverage) {
});
}});
const {page} = context;
const emptyHelp = page.getByRole("button", {name: "暂无飞书应用档案", exact: true});
const emptyExplanation = page.getByRole("tooltip").filter({hasText: "暂无飞书应用档案"});
async function verifyCompactHelp(explanation) {
const layout = await explanation.locator("p").evaluate(node => {
const style = getComputedStyle(node);
return {minHeight: parseFloat(style.minHeight) || 0, leading: parseFloat(style.lineHeight)};
});
if (!Number.isFinite(layout.leading) || layout.minHeight > layout.leading) throw new Error("Optional help inherited full empty-state spacing");
}
async function openSettings() {
const menu = page.locator(".personal-mobile-menu");
if (await menu.isVisible()) await menu.click();
Expand All @@ -51,7 +60,7 @@ async function verifyLarkLoading(browser, url, collectCoverage) {
// as an empty directory, regardless of the component's state variable names.
await appTab.getByText("…", {exact: true}).waitFor();
await page.screenshot({path: resolve(outputDir, "lark-catalog-pending-desktop.png"), animations: "disabled"});
if (await appTab.getByText("0", {exact: true}).count() || await page.locator(".personal-lark-empty").count()) throw new Error("Pending catalog displayed a false empty directory");
if (await appTab.getByText("0", {exact: true}).count() || await emptyHelp.count()) throw new Error("Pending catalog displayed a false empty directory");
if ((await page.locator(".personal-lark-app-toolbar > span").innerText()) !== "… 个可复用 App") throw new Error("Pending catalog toolbar displayed a false App count");
await page.setViewportSize({width: 390, height: 844});
if (await page.evaluate(() => document.documentElement.scrollWidth > innerWidth)) throw new Error("Pending Lark catalog overflows at 390px");
Expand All @@ -78,19 +87,42 @@ async function verifyLarkLoading(browser, url, collectCoverage) {
revision = 3;
await page.getByRole("button", {name: "刷新配置并重试核验", exact: true}).click();
await appTab.getByText("0", {exact: true}).waitFor();
await page.locator(".personal-lark-empty").waitFor();
await emptyHelp.waitFor();
if (await emptyExplanation.isVisible()) throw new Error("Empty catalog explanation was expanded by default");
await page.screenshot({path: resolve(outputDir, "lark-catalog-empty-desktop.png"), animations: "disabled"});
// Empty is a confirmed source state. Its optional explanation remains
// reachable through the same keyboard/tap help as the rest of Settings.
await emptyHelp.focus();
await emptyExplanation.waitFor();
if (await page.locator(".personal-lark-app-card").count() || catalogs !== 3 || probes.length !== 6) throw new Error("Empty catalog retained stale profiles or started verification");
await page.keyboard.press("Escape");
await page.setViewportSize({width: 390, height: 844});
await emptyHelp.click();
await emptyExplanation.waitFor();
if (await page.evaluate(() => document.documentElement.scrollWidth > innerWidth)) throw new Error("Empty catalog help overflows at 390px");
await page.screenshot({path: resolve(outputDir, "lark-catalog-empty-narrow.png"), animations: "disabled"});
await verifyCompactHelp(emptyExplanation);
await page.keyboard.press("Escape");
await page.locator(".personal-lark-tabs").getByRole("button", {name: /^连接/u}).click();
await page.getByRole("button", {name: "暂无 Goal 连接", exact: true}).click();
const connectionExplanation = page.getByRole("tooltip").filter({hasText: "暂无 Goal 连接"});
await connectionExplanation.waitFor();
await verifyCompactHelp(connectionExplanation);
await page.screenshot({path: resolve(outputDir, "lark-connections-empty-narrow.png"), animations: "disabled"});
await page.keyboard.press("Escape");
await appTab.click();
await page.setViewportSize({width: 1512, height: 982});
// A failed read is unknown, never a confirmed zero; its visible error and
// retry stay available without retaining the previous directory's cards.
revision = 4;
await page.getByRole("button", {name: "刷新配置并重试核验", exact: true}).click();
await page.locator(".personal-notification-error").waitFor();
await page.screenshot({path: resolve(outputDir, "lark-catalog-failed.png"), animations: "disabled"});
if (await appTab.getByText("…", {exact: true}).count() !== 1 || (await page.locator(".personal-lark-app-toolbar > span").innerText()) !== "… 个可复用 App" || await page.locator(".personal-lark-empty, .personal-lark-app-card").count() || catalogs !== 4 || probes.length !== 6) throw new Error("Failed catalog masqueraded as an empty or stale directory");
if (await appTab.getByText("…", {exact: true}).count() !== 1 || (await page.locator(".personal-lark-app-toolbar > span").innerText()) !== "… 个可复用 App" || await page.locator(".personal-lark-app-card").count() || await emptyHelp.count() || catalogs !== 4 || probes.length !== 6) throw new Error("Failed catalog masqueraded as an empty or stale directory");
revision = 5;
await page.getByRole("button", {name: "刷新配置并重试核验", exact: true}).click();
await page.locator(".personal-lark-app-card").filter({hasText: "slow 5"}).getByText("自动回复可用", {exact: true}).waitFor();
if (catalogs !== 5 || probes.length !== 9 || await page.locator(".personal-lark-empty, .personal-notification-error").count()) throw new Error("Failed catalog did not recover without duplicate reads");
if (catalogs !== 5 || probes.length !== 9 || await emptyHelp.count() || await page.locator(".personal-notification-error").count()) throw new Error("Failed catalog did not recover without duplicate reads");
await page.setViewportSize({width: 390, height: 844});
if (await page.evaluate(() => document.documentElement.scrollWidth > innerWidth)) throw new Error("Lark configuration overflows at 390px");
await page.screenshot({path: resolve(outputDir, "lark-progressive-narrow.png"), animations: "disabled"});
Expand Down
Loading