feat: add contextual help and stabilize repository layout
This commit is contained in:
@@ -83,7 +83,7 @@ async function assertScrollableWhenOverflowing(page, selector) {
|
||||
}
|
||||
test("shell, overview, repositories and settings remain responsive and accessible", async ({ page }, testInfo) => {
|
||||
await assertSurface(page);
|
||||
for (const view of ["overview", "deployments", "settings"]) {
|
||||
for (const view of ["overview", "deployments", "settings", "help"]) {
|
||||
await page.locator(`.nav-button[data-action="navigate"][data-view="${view}"]`).click();
|
||||
await expect(page.locator("main")).toBeVisible();
|
||||
await assertSurface(page);
|
||||
@@ -116,8 +116,40 @@ test("repository changes, Git tools and Git Validator complete their primary flo
|
||||
await expect(page.locator(":focus")).toBeVisible();
|
||||
});
|
||||
|
||||
test("repository context, tabs and content never overlap in a compact workspace", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1024, height: 768 });
|
||||
await page.locator('[data-action="select-repo"][data-deployment-count]:not([data-deployment-count="0"])').first().click();
|
||||
await page.locator('[data-action="repo-tab"][data-tab="gittools"]').click();
|
||||
const layout = await page.evaluate(() => {
|
||||
const context = document.querySelector(".repo-context")?.getBoundingClientRect();
|
||||
const tabs = document.querySelector(".tabs")?.getBoundingClientRect();
|
||||
const content = document.querySelector(".repo-content")?.getBoundingClientRect();
|
||||
return {
|
||||
contextEndsBeforeTabs: Boolean(context && tabs && context.bottom <= tabs.top + 0.5),
|
||||
tabsEndBeforeContent: Boolean(tabs && content && tabs.bottom <= content.top + 0.5),
|
||||
horizontalTabFallback: Boolean(tabs && document.querySelector(".tabs").scrollWidth >= document.querySelector(".tabs").clientWidth),
|
||||
};
|
||||
});
|
||||
expect(layout).toEqual({ contextEndsBeforeTabs: true, tabsEndBeforeContent: true, horizontalTabFallback: true });
|
||||
});
|
||||
|
||||
test("Help center is searchable and contextual guidance opens the requested topic", async ({ page }) => {
|
||||
await page.locator('.nav-button[data-view="help"]').click();
|
||||
await expect(page.getByRole("heading", { name: "How can we help?" })).toBeVisible();
|
||||
await expect(page.locator(".help-topic")).toHaveCount(8);
|
||||
await page.locator("#help-search").fill("deploy key");
|
||||
await expect(page.locator(".help-topic")).toHaveCount(1);
|
||||
await expect(page.locator(".help-topic")).toContainText("Repair repository deploy keys");
|
||||
await page.locator('[data-action="select-repo"]').first().click();
|
||||
await page.locator('[data-action="repo-tab"][data-tab="gittools"]').click();
|
||||
await page.locator('[data-action="open-context-help"][data-topic="workspace-sync"]').click();
|
||||
await expect(page.locator('[data-help-topic="workspace-sync"]')).toHaveAttribute("open", "");
|
||||
await expect(page.locator('[data-help-topic="workspace-sync"]')).toContainText("Make a local project match Gitea");
|
||||
await assertSurface(page);
|
||||
});
|
||||
|
||||
test("every long application surface retains a working vertical scroll owner", async ({ page }) => {
|
||||
for (const view of ["overview", "deployments", "diagnostics", "settings"]) {
|
||||
for (const view of ["overview", "deployments", "diagnostics", "settings", "help"]) {
|
||||
await test.step(`${view} view scrolls`, async () => {
|
||||
const navigation = page.locator(`.nav-button[data-view="${view}"]`);
|
||||
await navigation.click();
|
||||
|
||||
@@ -218,19 +218,35 @@ test("one-click troubleshooting excludes destructive or publishing Git actions",
|
||||
);
|
||||
});
|
||||
|
||||
test("premium repository workspace reserves separate rows for actions and release status", async () => {
|
||||
test("premium repository workspace groups variable context above a stable tab row", async () => {
|
||||
const renderer = await rendererSource();
|
||||
const styles = await readFile(
|
||||
new URL("../src/renderer/styles.css", import.meta.url),
|
||||
"utf8",
|
||||
);
|
||||
assert.match(
|
||||
styles,
|
||||
/\.repo-workspace\s*\{[^}]*grid-template-rows:\s*auto auto auto 39px minmax\(0, 1fr\)/s,
|
||||
/\.repo-workspace\s*\{[^}]*grid-template-rows:\s*auto auto 39px minmax\(0, 1fr\)/s,
|
||||
);
|
||||
assert.match(renderer, /<div class="repo-context">/);
|
||||
assert.match(styles, /\.tabs\s*\{[^}]*overflow-x:\s*auto/s);
|
||||
assert.match(styles, /\.tab\s*\{[^}]*white-space:\s*nowrap/s);
|
||||
assert.match(styles, /prefers-reduced-motion/);
|
||||
assert.match(styles, /ForgeFlow 0\.8 premium visual system/);
|
||||
});
|
||||
|
||||
test("help center explains core workflows and supports contextual searchable guidance", async () => {
|
||||
const renderer = await rendererSource();
|
||||
assert.match(renderer, /function renderHelp\(\)/);
|
||||
assert.match(renderer, /id: "workspace-sync"/);
|
||||
assert.match(renderer, /id: "deployment-linking"/);
|
||||
assert.match(renderer, /id: "deploy-keys"/);
|
||||
assert.match(renderer, /id: "git-validator"/);
|
||||
assert.match(renderer, /id="help-search"/);
|
||||
assert.match(renderer, /data-action="open-context-help" data-topic="workspace-sync"/);
|
||||
assert.match(renderer, /ui\.currentView === "help"/);
|
||||
});
|
||||
|
||||
test("interactive project illustrations are semantic, responsive and motion-safe", async () => {
|
||||
const renderer = await rendererSource();
|
||||
const styles = await readFile(
|
||||
|
||||
Reference in New Issue
Block a user