-
Notifications
You must be signed in to change notification settings - Fork 8
Add Wizard canvas designer setup dialog and advisory E2E checks #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nicolehaugen
merged 5 commits into
main
from
nicolehaugen-wizard-canvas-generation-dialog
Sep 30, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
57dca31
Add Wizard canvas designer setup dialog and advisory browser checks
nicolehaugen d1fb159
Ignore bundle steps when mirroring designer selections
nicolehaugen 938b8a8
Limit designer bundle matches to the bundle catalog source
nicolehaugen 315c24f
Include Default bundles in canvas designer selection
nicolehaugen 71a468b
Make designer tabs keyboard accessible and isolate confirmation
nicolehaugen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| name: Wizard E2E | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
|
|
||
| jobs: | ||
| changes: | ||
| name: Detect Wizard changes | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| wizard: ${{ steps.detect.outputs.wizard }} | ||
| steps: | ||
| - name: Detect changed Wizard files | ||
| id: detect | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| GH_REPO: ${{ github.repository }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| run: | | ||
| files=$(gh api "repos/$GH_REPO/pulls/$PR_NUMBER/files" --paginate --jq '.[] | .filename, (.previous_filename // empty)') | ||
| if grep -q '^plugins/spec-kit-copilot-wizard/' <<< "$files"; then | ||
| echo "wizard=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "wizard=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| browser: | ||
| name: Wizard browser tests | ||
| needs: changes | ||
| if: needs.changes.outputs.wizard == 'true' | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: plugins/spec-kit-copilot-wizard/extensions/speckit-wizard-canvas | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
| cache: npm | ||
| cache-dependency-path: plugins/spec-kit-copilot-wizard/extensions/speckit-wizard-canvas/package-lock.json | ||
| - run: npm ci | ||
| - run: npx playwright install --with-deps chromium | ||
| - run: npm run test:e2e | ||
| - uses: actions/upload-artifact@v4 | ||
| if: failure() | ||
| with: | ||
| name: wizard-e2e-results | ||
| path: plugins/spec-kit-copilot-wizard/extensions/speckit-wizard-canvas/test-results/ | ||
| retention-days: 7 | ||
|
|
||
| gate: | ||
| name: Wizard E2E gate | ||
| needs: [changes, browser] | ||
| if: always() | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check browser result for Wizard changes | ||
| env: | ||
| DETECTION: ${{ needs.changes.result }} | ||
| WIZARD: ${{ needs.changes.outputs.wizard }} | ||
| BROWSER: ${{ needs.browser.result }} | ||
| run: | | ||
| if [[ "$DETECTION" != "success" ]]; then | ||
| echo "::error::Could not determine whether Wizard files changed" | ||
| exit 1 | ||
| fi | ||
| if [[ "$WIZARD" == "true" && "$BROWSER" != "success" ]]; then | ||
| echo "::error::Wizard browser tests did not pass ($BROWSER)" | ||
| exit 1 | ||
| fi | ||
| echo "Wizard E2E check complete (changed: $WIZARD)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
...ins/spec-kit-copilot-wizard/extensions/speckit-wizard-canvas/e2e/canvas-designer.spec.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| import { test, expect } from "@playwright/test"; | ||
|
|
||
| test.beforeEach(async ({ page }) => { | ||
| await page.goto("/?token=e2e-token"); | ||
| await page.getByRole("tab", { name: "Phases" }).click(); | ||
| await page.getByRole("button", { name: "Generate canvas" }).click(); | ||
| }); | ||
|
|
||
| test("opens a design-only dialog without enabling launch", async ({ page }) => { | ||
| const dialog = page.getByRole("dialog", { name: "Canvas designer setup" }); | ||
| await expect(dialog).toBeVisible(); | ||
| await expect(dialog.getByRole("checkbox", { name: /Design preset/ })).toBeVisible(); | ||
| await expect(dialog.getByText("Other preset")).toHaveCount(0); | ||
| await expect(dialog.getByRole("button", { name: /Launch designer/ })).toBeDisabled(); | ||
| const presetsTab = dialog.getByRole("tab", { name: "Presets" }); | ||
| const extensionsTab = dialog.getByRole("tab", { name: "Extensions" }); | ||
| const bundlesTab = dialog.getByRole("tab", { name: "Bundles" }); | ||
| await expect(presetsTab).toHaveAttribute("tabindex", "0"); | ||
| await expect(extensionsTab).toHaveAttribute("tabindex", "-1"); | ||
| await page.keyboard.press("Tab"); | ||
| await expect(presetsTab).toBeFocused(); | ||
| await page.keyboard.press("ArrowRight"); | ||
| await expect(extensionsTab).toBeFocused(); | ||
| await expect(dialog.getByRole("tabpanel", { name: "Extensions" })).toBeVisible(); | ||
| await page.keyboard.press("End"); | ||
| await expect(bundlesTab).toBeFocused(); | ||
| await page.keyboard.press("ArrowRight"); | ||
| await expect(presetsTab).toBeFocused(); | ||
| await page.keyboard.press("ArrowLeft"); | ||
| await expect(bundlesTab).toBeFocused(); | ||
| await page.keyboard.press("Home"); | ||
| await expect(presetsTab).toBeFocused(); | ||
| await bundlesTab.click(); | ||
| await expect(bundlesTab).toHaveAttribute("tabindex", "0"); | ||
| await expect(presetsTab).toHaveAttribute("tabindex", "-1"); | ||
| await expect(dialog.getByRole("checkbox", { name: /Design bundle/ })).toBeVisible(); | ||
| await dialog.getByRole("checkbox", { name: /Default bundle/ }).check(); | ||
| await expect(dialog.getByRole("checkbox", { name: /Default bundle/ })).toBeChecked(); | ||
| await expect(dialog.getByText("Other bundle")).toHaveCount(0); | ||
| await dialog.getByRole("button", { name: "Cancel" }).click(); | ||
| await expect(dialog).toHaveCount(0); | ||
| await page.getByRole("button", { name: "Generate canvas" }).click(); | ||
| await expect(page.getByRole("dialog", { name: "Canvas designer setup" }) | ||
| .getByRole("checkbox", { name: /Design preset/ })).not.toBeChecked(); | ||
| }); | ||
|
|
||
| test("confirms community selection and checks only listed design bundle members", async ({ page }) => { | ||
| const writes = []; | ||
| page.on("request", (request) => { | ||
| if (request.method() !== "GET") writes.push(request.url()); | ||
| }); | ||
| const dialog = page.getByRole("dialog", { name: "Canvas designer setup" }); | ||
| await dialog.getByRole("tab", { name: "Bundles" }).click(); | ||
| const community = dialog.getByRole("checkbox", { name: /Community bundle/ }); | ||
| await community.check(); | ||
| const warning = page.getByRole("dialog", { name: "Select community bundle?" }); | ||
| await expect(warning.getByText(/not reviewed, audited, or endorsed/)).toBeVisible(); | ||
| await expect(page.locator(".designer-backdrop")).toHaveJSProperty("inert", true); | ||
| await expect(page.locator(".designer-backdrop")).toHaveAttribute("aria-hidden", "true"); | ||
| await expect(dialog).toHaveCount(0); | ||
| await warning.getByRole("button", { name: "Cancel" }).click(); | ||
| await expect(page.locator(".designer-backdrop")).toHaveJSProperty("inert", false); | ||
| await expect(page.locator(".designer-backdrop")).not.toHaveAttribute("aria-hidden", "true"); | ||
| await expect(dialog).toBeVisible(); | ||
| await expect(community).toBeFocused(); | ||
| await expect(community).not.toBeChecked(); | ||
| await community.check(); | ||
| await warning.getByRole("button", { name: "Select anyway" }).click(); | ||
| await expect(page.locator(".designer-backdrop")).toHaveJSProperty("inert", false); | ||
| await expect(page.locator(".designer-backdrop")).not.toHaveAttribute("aria-hidden", "true"); | ||
| await expect(community).toBeFocused(); | ||
| await expect(community).toBeChecked(); | ||
|
|
||
| await dialog.getByRole("checkbox", { name: /Design bundle/ }).check(); | ||
| await warning.getByRole("button", { name: "Select anyway" }).click(); | ||
| await dialog.getByRole("tab", { name: "Presets" }).click(); | ||
| const presets = dialog.getByRole("tabpanel", { name: "Presets" }); | ||
| const preset = presets.getByRole("checkbox", { name: /Design preset/ }); | ||
| await expect(preset).toBeChecked(); | ||
| await expect(presets.getByText("Included by bundle: Design bundle")).toBeVisible(); | ||
| await expect(presets.getByText("Unlisted preset")).toHaveCount(0); | ||
| await expect(presets.getByRole("checkbox", { name: /Copilot preset/ })).not.toBeChecked(); | ||
| await preset.uncheck(); | ||
| await expect(preset).not.toBeChecked(); | ||
| await dialog.getByRole("tab", { name: "Extensions" }).click(); | ||
| await expect(dialog.getByRole("checkbox", { name: /Design extension/ })).toBeChecked(); | ||
| await expect(dialog.getByText("Unlisted extension")).toHaveCount(0); | ||
| await expect(dialog.getByRole("button", { name: /Launch designer/ })).toBeDisabled(); | ||
| expect(writes).toEqual([]); | ||
| }); |
61 changes: 61 additions & 0 deletions
61
plugins/spec-kit-copilot-wizard/extensions/speckit-wizard-canvas/e2e/server.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import { createServer } from "node:http"; | ||
| import { createHandler } from "../server.mjs"; | ||
|
|
||
| const snapshot = { | ||
| workspacePath: process.cwd(), | ||
| currentPhase: "constitution", | ||
| setup: { | ||
| pluginInstalled: true, | ||
| cliInstalled: true, | ||
| projectInitialized: true, | ||
| skillsReloaded: true, | ||
| }, | ||
| boot: { phase: "ready", steps: [] }, | ||
| phases: {}, | ||
| commands: [], | ||
| catalog: { | ||
| presets: [ | ||
| { id: "design-preset", name: "Design preset", source: "community", tags: ["canvas-design"] }, | ||
| { id: "foreign-preset", name: "Copilot preset", source: "copilot", tags: ["canvas-design"] }, | ||
| { id: "other-preset", name: "Other preset", source: "copilot", tags: ["other"] }, | ||
| { id: "unlisted-preset", name: "Unlisted preset", source: "copilot" }, | ||
| ], | ||
| extensions: [ | ||
| { id: "design-extension", name: "Design extension", source: "community", tags: ["canvas-design"] }, | ||
| { id: "unlisted-extension", name: "Unlisted extension", source: "copilot", tags: ["other"] }, | ||
| ], | ||
| bundles: [ | ||
| { id: "design-bundle", name: "Design bundle", source: "community", tags: ["canvas-design"] }, | ||
| { id: "default-bundle", name: "Default bundle", source: "default", tags: ["canvas-design"] }, | ||
| { id: "community-bundle", name: "Community bundle", source: "community", tags: ["canvas-design"] }, | ||
| { id: "other-bundle", name: "Other bundle", source: "default", tags: ["design"] }, | ||
| ], | ||
| }, | ||
| }; | ||
|
|
||
| const members = { | ||
| "design-bundle": [ | ||
| { kind: "presets", id: "design-preset" }, | ||
| { kind: "presets", id: "foreign-preset" }, | ||
| { kind: "presets", id: "unlisted-preset" }, | ||
| { kind: "extensions", id: "design-extension" }, | ||
| ], | ||
| "default-bundle": [], | ||
| "community-bundle": [], | ||
| }; | ||
|
|
||
| const handler = createHandler({ | ||
| token: "e2e-token", | ||
| session: { send: async () => { throw new Error("E2E fixture must not dispatch a session"); } }, | ||
| log: async (message) => { console.error(message); }, | ||
| getState: async () => snapshot, | ||
| getInstance: () => ({ workspacePath: process.cwd() }), | ||
| broadcast: () => {}, | ||
| registerSse: (_req, res) => { res.on("close", () => {}); }, | ||
| inspectBundle: async (id) => ({ | ||
| source: id === "default-bundle" ? "default" : "community", | ||
| members: members[id] ?? [], | ||
| }), | ||
| }); | ||
|
|
||
| createServer((req, res) => { void handler(req, res); }).listen(4177, "127.0.0.1"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.