mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-25 10:42:45 +00:00
* Upgrade to Expo 57 and unify Explorer across layouts * feat(app): retain Explorer across layout and appearance changes Keep one workspace Explorer host and destination-aware navigation so folding, theme updates and compact sheets preserve the current panel. Scope pull request discovery and timeline demand to active surfaces. * fix(app): keep Explorer resize handles stretched through the dock The shared frame moved the divider into an absolute column, leaving its horizontal handle without height. Restore the row so pointer drags reach it, preserving the existing resize and performance contract. * fix(app): keep Explorer drag widths out of the shared stylesheet Carry the existing inline sizing policy into the shared frame so pointer previews do not accumulate CSS rules. * fix(test): align isolated test runtimes with Expo 57 Hoisted React consumers need the matching DOM renderer at the repository root. Automated Metro processes must not install native DevTools into disposable homes, and development toast overlays must not cover compact actions. Keep Explorer journeys on the shared host and synchronize setup fixtures on daemon output rather than a one-second file-marker window. A delayed real child start reproduces the readiness failure on every platform. * fix(test): await retained shell layout after composer resize The gesture host now stays mounted across breakpoints, so its presence no longer identifies compact layout. Report the current layout on the retained host and synchronize composer journeys with that state. * fix(app): preserve browser interactions in retained workspace hosts Initially disabled gesture hosts still registered pointer and wheel listeners, while hover cards used window positions inside a workspace-local sheet portal. Respect initial gesture enablement and position cards relative to their measured floating host. Keep developer-toast dismissal independent of pointer input and replacement toast visibility so modal, hover, and focus checks retain their input state. * fix(test): share developer toast handling with Electron browser runs The standalone Electron browser runner bypassed the browser fixture, allowing developer errors to cover Settings. Use the same non-pointer dismissal in both runners while retaining their console logs.
116 lines
5.0 KiB
TypeScript
116 lines
5.0 KiB
TypeScript
import { execFileSync } from "node:child_process";
|
|
import { mkdtemp, writeFile } from "node:fs/promises";
|
|
import path from "node:path";
|
|
import { test, expect, type Page } from "../support/fixtures";
|
|
import { getServerId } from "../support/helpers/server-id";
|
|
import { connectSeedClient } from "../support/helpers/seed-client";
|
|
import { createTempGitRepo, resolveTempRoot } from "../support/helpers/workspace";
|
|
import { buildHostWorkspaceRoute } from "../../src/utils/host-routes";
|
|
|
|
// The compact toolbar flattens every git action into one menu, and the policy keeps the actions
|
|
// it can promote to `primary` in `secondary` as well. A promoted action must still show once.
|
|
const cleanupTasks: Array<() => Promise<void>> = [];
|
|
|
|
test.afterEach(async () => {
|
|
for (const task of cleanupTasks.splice(0)) {
|
|
await task();
|
|
}
|
|
});
|
|
|
|
async function createRemoteRepo(prefix: string): Promise<string> {
|
|
const repo = await createTempGitRepo(prefix, {
|
|
withRemote: true,
|
|
files: [{ path: "src/app.ts", content: "export const app = 1;\n" }],
|
|
});
|
|
cleanupTasks.push(repo.cleanup);
|
|
// The helper puts the bare remote inside the checkout; keep it out of the status.
|
|
await writeFile(path.join(repo.path, ".git/info/exclude"), "remote.git/\n");
|
|
return repo.path;
|
|
}
|
|
|
|
async function registerWorkspace(repoPath: string): Promise<string> {
|
|
const client = await connectSeedClient();
|
|
cleanupTasks.push(async () => {
|
|
await client.close().catch(() => undefined);
|
|
});
|
|
const created = await client.createWorkspace({ source: { kind: "directory", path: repoPath } });
|
|
if (!created.workspace) {
|
|
throw new Error(created.error ?? `Failed to create workspace ${repoPath}`);
|
|
}
|
|
return created.workspace.id;
|
|
}
|
|
|
|
async function openCompactActionsMenu(page: Page, workspaceId: string) {
|
|
await page.setViewportSize({ width: 390, height: 844 });
|
|
await page.goto(buildHostWorkspaceRoute(getServerId(), workspaceId));
|
|
await page.reload();
|
|
await page.getByTestId("workspace-explorer-toggle").first().click();
|
|
const changesTab = page.getByTestId("workspace-tab-changes_tree").filter({ visible: true });
|
|
await expect(changesTab).toBeVisible({ timeout: 30_000 });
|
|
await changesTab.click();
|
|
const explorer = page.getByTestId("workspace-explorer-sidebar").filter({ visible: true });
|
|
await expect(explorer.getByTestId("changes-header")).toBeVisible({ timeout: 30_000 });
|
|
|
|
const trigger = explorer.getByTestId("changes-actions-menu-trigger");
|
|
await expect(trigger).toBeVisible({ timeout: 30_000 });
|
|
await trigger.click();
|
|
const menu = page.getByTestId("changes-primary-cta-menu");
|
|
await expect(menu).toBeVisible();
|
|
return menu;
|
|
}
|
|
|
|
test("compact git actions menu lists a promoted Pull once", async ({ page }) => {
|
|
const repoPath = await createRemoteRepo("compact-menu-pull-");
|
|
cleanupTasks.push(async () => {
|
|
execFileSync("rm", ["-rf", repoPath]);
|
|
});
|
|
|
|
// Advance origin so the clean checkout is behind it and Pull is the promoted action.
|
|
const other = await mkdtemp(path.join(await resolveTempRoot(), "compact-menu-other-"));
|
|
cleanupTasks.push(async () => {
|
|
execFileSync("rm", ["-rf", other]);
|
|
});
|
|
execFileSync("git", ["clone", path.join(repoPath, "remote.git"), other], { stdio: "ignore" });
|
|
execFileSync("git", ["config", "user.email", "e2e@paseo.test"], { cwd: other, stdio: "ignore" });
|
|
execFileSync("git", ["config", "user.name", "Paseo E2E"], { cwd: other, stdio: "ignore" });
|
|
await writeFile(path.join(other, "src/incoming.ts"), "export const incoming = 1;\n");
|
|
execFileSync("git", ["add", "--all"], { cwd: other, stdio: "ignore" });
|
|
execFileSync("git", ["commit", "-m", "Incoming commit"], { cwd: other, stdio: "ignore" });
|
|
execFileSync("git", ["push", "origin", "main"], { cwd: other, stdio: "ignore" });
|
|
execFileSync("git", ["fetch", "origin"], { cwd: repoPath, stdio: "ignore" });
|
|
|
|
const workspaceId = await registerWorkspace(repoPath);
|
|
const menu = await openCompactActionsMenu(page, workspaceId);
|
|
|
|
await expect(menu.getByTestId("changes-menu-pull")).toHaveCount(1);
|
|
await expect(menu.getByRole("menuitem")).toHaveText([
|
|
"Pull",
|
|
"Push",
|
|
"Pull and push",
|
|
"Archive workspace",
|
|
]);
|
|
});
|
|
|
|
test("compact git actions menu lists a promoted Push once", async ({ page }) => {
|
|
const repoPath = await createRemoteRepo("compact-menu-push-");
|
|
cleanupTasks.push(async () => {
|
|
execFileSync("rm", ["-rf", repoPath]);
|
|
});
|
|
const workspaceId = await registerWorkspace(repoPath);
|
|
|
|
// Commit so the clean checkout is ahead of origin and Push is the promoted action.
|
|
await writeFile(path.join(repoPath, "src/mine.ts"), "export const mine = 1;\n");
|
|
execFileSync("git", ["add", "--all"], { cwd: repoPath, stdio: "ignore" });
|
|
execFileSync("git", ["commit", "-m", "Local commit"], { cwd: repoPath, stdio: "ignore" });
|
|
|
|
const menu = await openCompactActionsMenu(page, workspaceId);
|
|
|
|
await expect(menu.getByTestId("changes-menu-push")).toHaveCount(1);
|
|
await expect(menu.getByRole("menuitem")).toHaveText([
|
|
"Push",
|
|
"Pull",
|
|
"Pull and push",
|
|
"Archive workspace",
|
|
]);
|
|
});
|