mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-03 07:03:18 +00:00
* feat(app): add first-run setup modal New users landed on an empty "Add a project" screen and never found providers, Paseo tools or phone pairing, which all live in Settings. A one-time setup modal now walks them through Appearance, Providers, Projects, Orchestration and Phone. Every step renders the same component Settings uses, so changing something in setup changes it in Settings too. The modal opens only when the setup host is connected, its workspaces have loaded and it has no projects. Existing users already have projects, so they never see it after upgrading and no migration is needed. Finishing or skipping writes `@paseo:onboarding` on this client. It uses its own key because it records feature state, and e2e specs replace app settings wholesale. Settings > General > "Show setup again" reopens the modal on step 1. Native phones skip the modal for now. Shared pieces moved out so setup and Settings render the same thing: - ThemePicker is a tile grid and replaces the Settings theme dropdown. - PaseoToolsCard is extracted from the host page. - The skeleton pulse moves to components/ui. Provider rows show it while the first snapshot loads instead of "Loading…". - The pair-device direct-connection hint links to the Tailscale docs. The e2e fixture marks setup completed by default so existing specs keep their starting state. The desktop smoke and lifecycle scripts, which start from a fresh daemon, mark it before they continue. * feat(onboarding): suggest projects from agent history The setup's Projects step lists the repos the user already ran agents in, with busy recent ones preselected, so a new user adds their projects in one click instead of browsing for folders. With rows checked, the footer's main button adds them and only moves on once every one was added; a checked row always means "this will be added". The daemon resolves each session folder to its project root (main checkout for worktrees, repo root for subfolders) because only it can read the git state; the app asks once per provider so a slow or broken provider never holds up the others and can be retried on its own. Hosts without the projectSuggestions feature show only the Add project button. Onboarding e2e hosts read an empty Claude history with other providers off, so suggestions never depend on the machine running the tests. * fix(onboarding): keep late project adds on their step and show Retry early - A finished add only advances setup while the Projects step is still open. - A failed provider shows its Retry as soon as any provider answers. - The desktop lifecycle check no longer reloads the window: setup never opens there because no host is connected. * fix(onboarding): bind late project adds to their step visit and freeze rows while adding - Each step visit has an id; a finished add only advances the visit that started it, so leaving and returning to Projects, or reopening setup, ignores it. - Suggestion rows are disabled while their batch is being added. * test(app): drive theme selection through the tile picker Settings → Appearance no longer has a theme dropdown. The Escape test opens the syntax theme dropdown instead, and the Android system-bars check taps theme tiles. * fix(server): return project suggestion roots in the form project.add stores Git reports Windows repo roots with forward slashes, so an added suggestion kept showing because its path never matched the new project's root. * feat(app): two control sizes, orchestration switches and mobile connect choices in setup Controls had four sizes picked per call site, so a button in a dialog, a settings row and a setup step came out at different heights. Controls now have two: md (default; 32px with a pointer, 44px in the compact layout so phone controls are full touch targets) and sm (28px, for tight chrome and nested settings rows). The breakpoint picks md's height, not the caller. Setup: - Orchestration is three switches (Paseo tools, agent skills, CLI), all on, applied on Continue. Turning one off undoes it; the desktop CLI uninstall removes only the file this app installed. - The Mobile step has store buttons and a "Choose how to connect" section: Relay opens the existing pairing modal, Tailscale opens the docs. Settings section docs links are one pattern, SettingsSection's `link` prop, and modals sit on surface0 like a screen. The vitest unistyles stub now resolves breakpoint values by window width, as Unistyles does at runtime; without it md controls had no height in browser tests. * fix(app): finish setup on its last step and confirm undoing orchestration In the compact layout Orchestration is the last step, and Finish closed setup without applying its switches. The last step's work now runs before Finish, the same as Continue. Turning off skills now asks first, as Settings does. Removing the CLI keeps a paseo command this app didn't install and says so. A failed Paseo tools update shows a toast. Adding suggested projects no longer advances when a row was checked while the add ran. Chat sender attribution and the message preview toggle go back to the sm button: md padding is a breakpoint value, and on web its media-query rule beat the zero right padding that aligns the sender with its bubble. * fix(app): ignore a late Finish once the user left the last setup step Finish called complete(), which ignored the step visit, so pressing Back while Orchestration applied its choices still closed setup and recorded it as done. next(visit) now finishes setup from the last step, so a late Finish is dropped the same way a late Continue already was. * fix(app): hold the skills switch while setup applies its choices The Paseo tools and CLI switches were disabled while Continue or Finish applied them, but the skills switch only locked while a skills operation ran. With skills needing no change, it stayed editable during a pending tools update and the new value was silently dropped. * fix(app): read setup's skills choice as off when no skill is picked Saving an empty selection in the skills picker left setup's skills switch on. Continue then asked the host to install nothing, the host reported skills as not installed, and the step stayed put with no error. Setup now reads skills as off with nothing picked, as Settings does.
185 lines
6.6 KiB
TypeScript
185 lines
6.6 KiB
TypeScript
import { pluginRequirements } from "../support/helpers/plugin-fixture";
|
|
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
import { tmpdir } from "node:os";
|
|
import path from "node:path";
|
|
import { expect, test } from "../support/fixtures";
|
|
import { connectNewWorkspaceDaemonClient } from "../support/helpers/new-workspace";
|
|
import { openSettingsSection } from "../support/helpers/settings";
|
|
|
|
const PLUGIN_ID = "plugin-theme-e2e";
|
|
|
|
// Catppuccin Mocha: base, text, surface0, surface1, mauve, subtext0, overlay0.
|
|
const PLUGIN_SOURCE = `export default function contribute(plugin) {
|
|
plugin.addTheme({
|
|
id: "mocha",
|
|
name: "Catppuccin Mocha",
|
|
appearance: "dark",
|
|
colors: {
|
|
background: "#1e1e2e",
|
|
foreground: "#cdd6f4",
|
|
raised: "#313244",
|
|
control: "#45475a",
|
|
border: "#45475a",
|
|
accent: "#cba6f7",
|
|
mutedForeground: "#a6adc8",
|
|
ring: "#6c7086",
|
|
},
|
|
});
|
|
plugin.addTheme({
|
|
id: "latte",
|
|
name: "Catppuccin Latte",
|
|
appearance: "light",
|
|
colors: {
|
|
background: "#eff1f5",
|
|
foreground: "#4c4f69",
|
|
raised: "#e6e9ef",
|
|
control: "#dce0e8",
|
|
border: "#ccd0da",
|
|
accent: "#8839ef",
|
|
mutedForeground: "#6c6f85",
|
|
ring: "#9ca0b0",
|
|
},
|
|
});
|
|
return () => {};
|
|
}`;
|
|
|
|
// settingsStyles.sectionHeaderTitle paints from foregroundMuted, so the section heading proves the
|
|
// contributed palette reached the semantic tokens rather than just the swatch.
|
|
const MOCHA_MUTED_FOREGROUND = "rgb(166, 173, 200)";
|
|
const LATTE_MUTED_FOREGROUND = "rgb(108, 111, 133)";
|
|
|
|
test("applies a contributed theme and falls back when its plugin is gone", async ({
|
|
page,
|
|
}, testInfo) => {
|
|
const directory = await mkdtemp(path.join(tmpdir(), "paseo-plugin-theme-e2e-"));
|
|
const client = await connectNewWorkspaceDaemonClient({ ownProjects: false });
|
|
const previousConfig = await client.getDaemonConfig();
|
|
await writeFile(
|
|
path.join(directory, "paseo-plugin.json"),
|
|
JSON.stringify({ id: PLUGIN_ID, requirements: pluginRequirements }),
|
|
);
|
|
await writeFile(path.join(directory, "index.client.ts"), PLUGIN_SOURCE);
|
|
|
|
try {
|
|
await client.patchDaemonConfig({ pluginsEnabled: true });
|
|
await client.installDirectoryPlugin(directory);
|
|
await page.goto("/settings");
|
|
await expect(page.getByTestId("settings-sidebar")).toBeVisible();
|
|
await openSettingsSection(page, "appearance");
|
|
|
|
const sectionTitle = page.getByText("Theme", { exact: true }).first();
|
|
const mochaItem = page.getByRole("radio", { name: "Catppuccin Mocha", exact: true });
|
|
await expect(mochaItem).toBeVisible({ timeout: 30_000 });
|
|
await page.screenshot({
|
|
path: testInfo.outputPath("plugin-theme-picker.png"),
|
|
animations: "disabled",
|
|
fullPage: true,
|
|
});
|
|
|
|
await test.step("a contributed light theme uses the light palette", async () => {
|
|
const latteItem = page.getByRole("radio", { name: "Catppuccin Latte", exact: true });
|
|
await latteItem.click();
|
|
await expect(latteItem).toBeChecked();
|
|
await expect(sectionTitle).toHaveCSS("color", LATTE_MUTED_FOREGROUND);
|
|
});
|
|
|
|
await mochaItem.click();
|
|
await expect(mochaItem).toBeChecked();
|
|
await expect(sectionTitle).toHaveCSS("color", MOCHA_MUTED_FOREGROUND);
|
|
await page.screenshot({
|
|
path: testInfo.outputPath("plugin-theme-applied.png"),
|
|
fullPage: true,
|
|
});
|
|
|
|
await test.step("the selection survives a reload", async () => {
|
|
await page.reload();
|
|
await expect(mochaItem).toBeChecked({ timeout: 30_000 });
|
|
await expect(sectionTitle).toHaveCSS("color", MOCHA_MUTED_FOREGROUND);
|
|
});
|
|
|
|
await test.step("removing the plugin falls back to the default theme", async () => {
|
|
await client.removePlugin(PLUGIN_ID);
|
|
await expect(page.getByRole("radio", { name: "System", exact: true })).toBeChecked({
|
|
timeout: 30_000,
|
|
});
|
|
await expect(sectionTitle).not.toHaveCSS("color", MOCHA_MUTED_FOREGROUND);
|
|
await page.screenshot({
|
|
path: testInfo.outputPath("plugin-theme-fallback.png"),
|
|
fullPage: true,
|
|
});
|
|
});
|
|
} finally {
|
|
await client.removePlugin(PLUGIN_ID).catch(() => undefined);
|
|
await client
|
|
.patchDaemonConfig({ pluginsEnabled: previousConfig.config.pluginsEnabled ?? false })
|
|
.catch(() => undefined);
|
|
await client.close().catch(() => undefined);
|
|
await rm(directory, { recursive: true, force: true });
|
|
}
|
|
});
|
|
|
|
const MANY_THEMES_PLUGIN_ID = "plugin-theme-many-e2e";
|
|
const MANY_THEMES_COUNT = 40;
|
|
const LAST_THEME_NAME = `Pack theme ${MANY_THEMES_COUNT}`;
|
|
|
|
const MANY_THEMES_SOURCE = `export default function contribute(plugin) {
|
|
for (let index = 1; index <= ${MANY_THEMES_COUNT}; index += 1) {
|
|
plugin.addTheme({
|
|
id: "pack-" + index,
|
|
name: "Pack theme " + index,
|
|
appearance: "dark",
|
|
colors: {
|
|
background: "#1e1e2e",
|
|
foreground: "#cdd6f4",
|
|
raised: "#313244",
|
|
control: "#45475a",
|
|
border: "#45475a",
|
|
accent: "#cba6f7",
|
|
mutedForeground: "#a6adc8",
|
|
ring: "#6c7086",
|
|
},
|
|
});
|
|
}
|
|
return () => {};
|
|
}`;
|
|
|
|
test("reaches the last theme when a plugin contributes more themes than fit", async ({
|
|
page,
|
|
}, testInfo) => {
|
|
const directory = await mkdtemp(path.join(tmpdir(), "paseo-plugin-theme-many-e2e-"));
|
|
const client = await connectNewWorkspaceDaemonClient({ ownProjects: false });
|
|
const previousConfig = await client.getDaemonConfig();
|
|
await writeFile(
|
|
path.join(directory, "paseo-plugin.json"),
|
|
JSON.stringify({ id: MANY_THEMES_PLUGIN_ID, requirements: pluginRequirements }),
|
|
);
|
|
await writeFile(path.join(directory, "index.client.ts"), MANY_THEMES_SOURCE);
|
|
|
|
try {
|
|
await client.patchDaemonConfig({ pluginsEnabled: true });
|
|
await client.installDirectoryPlugin(directory);
|
|
await page.setViewportSize({ width: 1280, height: 720 });
|
|
await page.goto("/settings");
|
|
await expect(page.getByTestId("settings-sidebar")).toBeVisible();
|
|
await openSettingsSection(page, "appearance");
|
|
|
|
const lastTheme = page.getByRole("radio", { name: LAST_THEME_NAME, exact: true });
|
|
await expect(lastTheme).toBeAttached({ timeout: 30_000 });
|
|
await lastTheme.scrollIntoViewIfNeeded();
|
|
await page.screenshot({
|
|
path: testInfo.outputPath("plugin-theme-picker-scrolled.png"),
|
|
animations: "disabled",
|
|
});
|
|
|
|
await lastTheme.click();
|
|
await expect(lastTheme).toBeChecked();
|
|
} finally {
|
|
await client.removePlugin(MANY_THEMES_PLUGIN_ID).catch(() => undefined);
|
|
await client
|
|
.patchDaemonConfig({ pluginsEnabled: previousConfig.config.pluginsEnabled ?? false })
|
|
.catch(() => undefined);
|
|
await client.close().catch(() => undefined);
|
|
await rm(directory, { recursive: true, force: true });
|
|
}
|
|
});
|