From 944cd74550eb7a235377d2eaf5b103958fadfac8 Mon Sep 17 00:00:00 2001 From: Mohd Owais Date: Thu, 19 Nov 2026 18:57:14 +0530 Subject: [PATCH 1/4] feat: add editor targets to deploy card --- src/components/designV2/DeployView.tsx | 11 +++---- src/components/designV2/constants.ts | 30 +++++++++++-------- .../components/designV2/DeployView.test.tsx | 22 ++++++++++---- 3 files changed, 39 insertions(+), 24 deletions(-) diff --git a/src/components/designV2/DeployView.tsx b/src/components/designV2/DeployView.tsx index 0f99b834..6aeedd68 100644 --- a/src/components/designV2/DeployView.tsx +++ b/src/components/designV2/DeployView.tsx @@ -219,18 +219,19 @@ export const DeployView = () => { {card.button} )} - {card.secondary && ( + {card.editorTargets?.map((target) => ( - )} + ))} ); diff --git a/src/components/designV2/constants.ts b/src/components/designV2/constants.ts index b7261904..bd101909 100644 --- a/src/components/designV2/constants.ts +++ b/src/components/designV2/constants.ts @@ -22,6 +22,8 @@ export const URLS = { vscodeTutorial: "https://docs.accordproject.org/docs/tutorial-vscode/", apapDeploy: "https://docs.accordproject.org/docs/ref-apap/#deploy-a-template", vscodeDev: "https://vscode.dev/", + vscodeDownload: "https://code.visualstudio.com/download", + claudeCodeDocs: "https://code.claude.com/docs/en/quickstart", apapMcp: "https://docs.accordproject.org/docs/ref-apap/#mcp-support-experimental", templateLibrary: "https://templates.accordproject.org/", /** Where the "new design" banner sends people to report problems: the design v2 bug bash. */ @@ -502,7 +504,7 @@ export interface DeployCard { /** Which in-app action the button runs when there is no `href`. */ action?: "pdf" | "markdown" | "share" | "copy" | "archive" | "vscode"; /** A second, link-only button under the main one. */ - secondary?: { label: string; href: string }; + editorTargets?: readonly { label: string; href: string }[]; /** Toast shown when the action succeeds. */ done?: string; } @@ -579,18 +581,22 @@ export const DEPLOY = { done: "Template archive downloaded", }, { - title: "Open in vscode.dev", + title: "Open in an editor", icon: "vscode", description: - "Save the template as a folder on your computer and open it in VS Code for the Web to keep editing it there.", + "Save the template as a folder, then continue working with the editor or coding agent you prefer.", details: [ - "First save the folder, then open vscode.dev", - "There, choose File › Open Folder and pick the saved folder", - "Chrome or Edge — they can save folders", + "Save the folder, then choose one of the three editor options below", + "VS Code Web and desktop VS Code can open the saved folder", + "For Claude Code, install the CLI and run claude from the folder in a terminal", ], button: "1. Save as folder", action: "vscode", - secondary: { label: "2. Open vscode.dev", href: URLS.vscodeDev }, + editorTargets: [ + { label: "VS Code for the Web", href: URLS.vscodeDev }, + { label: "Desktop VS Code", href: URLS.vscodeDownload }, + { label: "Claude Code", href: URLS.claudeCodeDocs }, + ], }, { title: "Deploy to an APAP server", @@ -622,12 +628,10 @@ export const DEPLOY = { }, ] satisfies readonly DeployGroup[], failed: (title: string) => `${title} failed`, - /** Toasts for the vscode.dev card. */ - folderSaved: (folder: string) => - `Saved the template to “${folder}”. Now open vscode.dev, choose File › Open Folder and pick it.`, - noFolderSupport: - "This browser can’t save folders, so the template was downloaded as a .cta (a zip). Unzip it, then open the folder in vscode.dev from Chrome or Edge, or in desktop VS Code.", - renderError: "The agreement doesn’t render with the current text, model and data — fix the error and try again.", + /** Toasts for the editor card. */ + folderSaved: (folder: string) => `Saved the template to "${folder}". Choose an editor below to continue.`, + noFolderSupport: "This browser cannot save folders, so the template was downloaded as a .cta archive. Unzip it, then open the folder in VS Code Web or desktop VS Code, or open a terminal in it and run claude after installing Claude Code.", + renderError: "The agreement doesn't render with the current text, model and data — fix the error and try again.", } as const; /** Every Deploy card, in display order. */ diff --git a/src/tests/components/designV2/DeployView.test.tsx b/src/tests/components/designV2/DeployView.test.tsx index 806533e0..42fc72d7 100644 --- a/src/tests/components/designV2/DeployView.test.tsx +++ b/src/tests/components/designV2/DeployView.test.tsx @@ -290,7 +290,7 @@ describe('DeployView', () => { expect(writeText).not.toHaveBeenCalled(); }, 30_000); - describe('Open in vscode.dev', () => { + describe('Open in an editor', () => { const files: string[] = []; const dir = (name: string): DirectoryHandle => ({ name, @@ -331,13 +331,15 @@ describe('DeployView', () => { // Synchronously from the click, before the archive is built (user activation). expect(picker).toHaveBeenCalledTimes(1); await waitFor(() => expect(success).toHaveBeenCalled(), SLOW); - // vscode.dev is the card's own link, not a pop-up after the save. + // Editor targets are links, not pop-ups after the save. expect(open).not.toHaveBeenCalled(); success.mockRestore(); expect(files).toEqual(expect.arrayContaining([ 'Documents/my-template/package.json', 'Documents/my-template/text/grammar.tem.md', 'Documents/my-template/model/model.cto', + 'Documents/my-template/AGENTS.md', + 'Documents/my-template/.vscode/extensions.json', ])); }, 30_000); @@ -410,11 +412,19 @@ describe('DeployView', () => { error.mockRestore(); }, 30_000); - it('also links straight to vscode.dev', () => { + it('provides links to all three editor targets', () => { render(); - const link = within(screen.getByRole('article', { name: 'Open in vscode.dev' })).getByRole('link', { name: /^2\. Open vscode\.dev/ }); - expect(link).toHaveAttribute('href', URLS.vscodeDev); - expect(link).toHaveAttribute('target', '_blank'); + const card = within(screen.getByRole('article', { name: 'Open in an editor' })); + const targets = [ + { label: 'VS Code for the Web', href: URLS.vscodeDev }, + { label: 'Desktop VS Code', href: URLS.vscodeDownload }, + { label: 'Claude Code', href: URLS.claudeCodeDocs }, + ]; + for (const target of targets) { + const link = card.getByRole('link', { name: new RegExp(`^${target.label}`) }); + expect(link).toHaveAttribute('href', target.href); + expect(link).toHaveAttribute('target', '_blank'); + } }); }); From bd5abcb65cab52fae1e7c4d4a23df2b10cd719d7 Mon Sep 17 00:00:00 2001 From: Mohd Owais Date: Thu, 19 Nov 2026 19:57:00 +0530 Subject: [PATCH 2/4] test: cover design v2 editor targets --- e2e/design-v2-default.spec.ts | 9 ++-- e2e/design-v2-editor-targets.spec.ts | 67 ++++++++++++++++++++++++++++ e2e/rebuild-sandbox.spec.ts | 21 +++++++-- 3 files changed, 89 insertions(+), 8 deletions(-) create mode 100644 e2e/design-v2-editor-targets.spec.ts diff --git a/e2e/design-v2-default.spec.ts b/e2e/design-v2-default.spec.ts index 61358f98..41a1b401 100644 --- a/e2e/design-v2-default.spec.ts +++ b/e2e/design-v2-default.spec.ts @@ -14,12 +14,12 @@ test.describe('Design v2 as the default', () => { test('a first visit opens design v2 with the one-time banner', async ({ page }) => { await page.goto('/'); - await expect(page.locator('.nd-rail')).toBeVisible(); - await expect(banner(page)).toBeVisible(); + await expect(page.locator('.nd-rail')).toBeVisible({ timeout: 30000 }); + await expect(banner(page)).toBeVisible({ timeout: 30000 }); - // Shown once: a reload keeps design v2 without the banner, even though it was never clicked. + // Shown once: a reload keeps design v2 without the banner. await page.reload(); - await expect(page.locator('.nd-rail')).toBeVisible(); + await expect(page.locator('.nd-rail')).toBeVisible({ timeout: 30000 }); await expect(banner(page)).toHaveCount(0); }); @@ -36,3 +36,4 @@ test.describe('Design v2 as the default', () => { await expect(page.locator('.main-container')).toBeVisible(); }); }); + diff --git a/e2e/design-v2-editor-targets.spec.ts b/e2e/design-v2-editor-targets.spec.ts new file mode 100644 index 00000000..7704c5a4 --- /dev/null +++ b/e2e/design-v2-editor-targets.spec.ts @@ -0,0 +1,67 @@ +import { test, expect } from '@playwright/test'; + +test.use({ + storageState: { + cookies: [], + origins: [ + { + origin: 'http://localhost:5173', + localStorage: [ + { name: 'hasVisited', value: 'true' }, + { name: 'isDesignV2Enabled', value: 'true' }, + ], + }, + ], + }, +}); + +test.describe('Design v2 editor targets', () => { + test('Deploy card provides all three editor options', async ({ page }) => { + await page.goto('/'); + + await expect(page.locator('.nd-rail')).toBeVisible({ + timeout: 30000, + }); + + // Enter the Design V2 workflow. + await page.locator('.nd-hero-actions button').first().click(); + + // Navigate directly to Deploy using the stepper. + const stepper = page.locator('.nd-stepper-cards'); + await expect(stepper).toBeVisible(); + + await stepper.getByRole('button', { name: /Deploy/ }).click(); + + // Verify the editor card and its three external links. + const card = page.getByRole('article', { + name: 'Open in an editor', + }); + + await expect(card).toBeVisible(); + + const targets = [ + { + label: 'VS Code for the Web', + href: 'https://vscode.dev/', + }, + { + label: 'Desktop VS Code', + href: 'https://code.visualstudio.com/download', + }, + { + label: 'Claude Code', + href: 'https://code.claude.com/docs/en/quickstart', + }, + ]; + + for (const target of targets) { + const link = card.getByRole('link', { + name: new RegExp(`^${target.label}`), + }); + + await expect(link).toBeVisible(); + await expect(link).toHaveAttribute('href', target.href); + await expect(link).toHaveAttribute('target', '_blank'); + } + }); +}); diff --git a/e2e/rebuild-sandbox.spec.ts b/e2e/rebuild-sandbox.spec.ts index 02c979bc..aec7ea6a 100644 --- a/e2e/rebuild-sandbox.spec.ts +++ b/e2e/rebuild-sandbox.spec.ts @@ -127,10 +127,23 @@ test.describe('Template rendering sandbox', () => { const hello = page.getByRole('button', { name: /(^|\s)Hello World$/ }); const confirm = page.getByRole('button', { name: 'Continue' }); await expect(async () => { - if (!(await hello.isVisible())) await samples.click(); - await hello.click({ timeout: 5_000 }); - if (await confirm.isVisible({ timeout: 3_000 }).catch(() => false)) await confirm.click(); - await expect(samples).toContainText('Hello World', { timeout: 5_000 }); + // If a previous attempt already opened the confirmation dialog, + // resolve it before interacting with the sample menu again. + if (await confirm.isVisible()) { + await confirm.click(); + } else { + if (!(await hello.isVisible())) { + await samples.click(); + } + + await hello.click({ timeout: 5_000 }); + await expect(confirm).toBeVisible({ timeout: 5_000 }); + await confirm.click(); + } + + await expect(samples).toContainText('Hello World', { + timeout: 5_000, + }); }).toPass({ timeout: 60_000 }); await expect(preview).toContainText('Hello John Doe!', { timeout: RENDER_TIMEOUT }); From d5b2112ec5b7f76df52fb3030dab45d7db68e0b0 Mon Sep 17 00:00:00 2001 From: Mohd Owais Date: Thu, 19 Nov 2026 20:00:27 +0530 Subject: [PATCH 3/4] DCO Remediation Commit for Mohd Owais I, Mohd Owais , hereby add my Signed-off-by to this commit: 944cd74550eb7a235377d2eaf5b103958fadfac8 I, Mohd Owais , hereby add my Signed-off-by to this commit: bd5abcb65cab52fae1e7c4d4a23df2b10cd719d7 Signed-off-by: Mohd Owais From 9d720ae8df1797868a83fbd576aae982eaae357d Mon Sep 17 00:00:00 2001 From: Mohd Owais Date: Fri, 20 Nov 2026 09:02:32 +0530 Subject: [PATCH 4/4] fix: keep editor workflow PR scope focused Signed-off-by: Mohd Owais --- e2e/design-v2-default.spec.ts | 9 ++++----- e2e/rebuild-sandbox.spec.ts | 21 ++++----------------- src/components/designV2/constants.ts | 10 ++++++---- 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/e2e/design-v2-default.spec.ts b/e2e/design-v2-default.spec.ts index 41a1b401..61358f98 100644 --- a/e2e/design-v2-default.spec.ts +++ b/e2e/design-v2-default.spec.ts @@ -14,12 +14,12 @@ test.describe('Design v2 as the default', () => { test('a first visit opens design v2 with the one-time banner', async ({ page }) => { await page.goto('/'); - await expect(page.locator('.nd-rail')).toBeVisible({ timeout: 30000 }); - await expect(banner(page)).toBeVisible({ timeout: 30000 }); + await expect(page.locator('.nd-rail')).toBeVisible(); + await expect(banner(page)).toBeVisible(); - // Shown once: a reload keeps design v2 without the banner. + // Shown once: a reload keeps design v2 without the banner, even though it was never clicked. await page.reload(); - await expect(page.locator('.nd-rail')).toBeVisible({ timeout: 30000 }); + await expect(page.locator('.nd-rail')).toBeVisible(); await expect(banner(page)).toHaveCount(0); }); @@ -36,4 +36,3 @@ test.describe('Design v2 as the default', () => { await expect(page.locator('.main-container')).toBeVisible(); }); }); - diff --git a/e2e/rebuild-sandbox.spec.ts b/e2e/rebuild-sandbox.spec.ts index aec7ea6a..02c979bc 100644 --- a/e2e/rebuild-sandbox.spec.ts +++ b/e2e/rebuild-sandbox.spec.ts @@ -127,23 +127,10 @@ test.describe('Template rendering sandbox', () => { const hello = page.getByRole('button', { name: /(^|\s)Hello World$/ }); const confirm = page.getByRole('button', { name: 'Continue' }); await expect(async () => { - // If a previous attempt already opened the confirmation dialog, - // resolve it before interacting with the sample menu again. - if (await confirm.isVisible()) { - await confirm.click(); - } else { - if (!(await hello.isVisible())) { - await samples.click(); - } - - await hello.click({ timeout: 5_000 }); - await expect(confirm).toBeVisible({ timeout: 5_000 }); - await confirm.click(); - } - - await expect(samples).toContainText('Hello World', { - timeout: 5_000, - }); + if (!(await hello.isVisible())) await samples.click(); + await hello.click({ timeout: 5_000 }); + if (await confirm.isVisible({ timeout: 3_000 }).catch(() => false)) await confirm.click(); + await expect(samples).toContainText('Hello World', { timeout: 5_000 }); }).toPass({ timeout: 60_000 }); await expect(preview).toContainText('Hello John Doe!', { timeout: RENDER_TIMEOUT }); diff --git a/src/components/designV2/constants.ts b/src/components/designV2/constants.ts index bd101909..de6f3cfc 100644 --- a/src/components/designV2/constants.ts +++ b/src/components/designV2/constants.ts @@ -628,10 +628,12 @@ export const DEPLOY = { }, ] satisfies readonly DeployGroup[], failed: (title: string) => `${title} failed`, - /** Toasts for the editor card. */ - folderSaved: (folder: string) => `Saved the template to "${folder}". Choose an editor below to continue.`, - noFolderSupport: "This browser cannot save folders, so the template was downloaded as a .cta archive. Unzip it, then open the folder in VS Code Web or desktop VS Code, or open a terminal in it and run claude after installing Claude Code.", - renderError: "The agreement doesn't render with the current text, model and data — fix the error and try again.", + /** Toasts for the editor card. */ + folderSaved: (folder: string) => + `Saved the template to “${folder}”. Choose an editor below to continue.`, + noFolderSupport: + "This browser can’t save folders, so the template was downloaded as a .cta archive. Unzip it, then open the folder in VS Code Web or desktop VS Code, or open a terminal in it and run claude after installing Claude Code.", + renderError: "The agreement doesn’t render with the current text, model and data — fix the error and try again.", } as const; /** Every Deploy card, in display order. */