From 6410de86691850fc072c695f86d25484fb06cf74 Mon Sep 17 00:00:00 2001 From: Amp Date: Thu, 19 Nov 2026 15:42:10 +0000 Subject: [PATCH] Say exactly how to see the widget after setup Setup's closing note read "Refresh your app's preview to see the Patchstack widget", which did not say what to do or where to look. It now reads "Reload your app's preview page. The Patchstack widget appears in a bottom corner of the page." The widget is a fixed button at the bottom right or bottom left of the page, so "a bottom corner" is accurate for both. The `widget` command's closing line gets the same wording. The summary layout in AGENT-INSTALL.md and the tests are updated to match. Amp-Thread-ID: https://ampcode.com/threads/T-2e659ca3-7bd0-4d70-b3d3-09638251060b Co-authored-by: Danilo Radovic --- AGENT-INSTALL.md | 4 ++-- src/cli.ts | 2 +- src/report.ts | 2 +- tests/bin-invocation.test.ts | 2 +- tests/install-prompt.test.ts | 2 +- tests/report.test.ts | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/AGENT-INSTALL.md b/AGENT-INSTALL.md index ffb0f4cf..730e2702 100644 --- a/AGENT-INSTALL.md +++ b/AGENT-INSTALL.md @@ -166,7 +166,7 @@ When you've connected, say **done**. #### What Patchstack found 🔴 High **1** · 🟠 Medium **3** · 🔵 Low **1** · 12 packages outdated · 12 protection rules available -**Refresh your app's preview** to see the Patchstack widget. +**Reload your app's preview page.** The Patchstack widget appears in a bottom corner of the page. _Patchstack is now part of your install and build. Your API key is in `.patchstackrc.local.json`: git ignores it, so never share it._ ```` @@ -177,7 +177,7 @@ The parts always come in that order. Fill each from the output, and leave out a 2. **Headline.** What was checked and found, as the heading. When the output gives no counts, write "Patchstack is now watching your app." Never estimate a count the output did not print. 3. **What to do now.** The next step from the `Next:` line, as the heading, with its link or command written out in full on its own line. Only that step: the items under `To do` are yours to finish, not the person's. Then: "When you've connected, say **done**." (or "When that's done, say **done**." for any other step). 4. **What Patchstack found.** The severity counts, outdated packages and protection rules exactly as the output lists them. Leave it out when nothing was found: the headline already says so. -5. **Notes.** "**Refresh your app's preview** to see the Patchstack widget." when setup added the widget; any line the output marks `ℹ`, except the one about no server. +5. **Notes.** "**Reload your app's preview page.** The Patchstack widget appears in a bottom corner of the page." when setup added the widget; any line the output marks `ℹ`, except the one about no server. 6. **What changed.** One line in italics: that Patchstack is now part of the install and build, and where the API key is (git ignores it; never share it). ### Commands for later diff --git a/src/cli.ts b/src/cli.ts index 5626c0e4..22c0175c 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1949,7 +1949,7 @@ async function runWidget(args: ParsedArgs): Promise { console.log(` ${buildWidgetTag(state.siteUuid)}`); break; } - console.log(` ${paint('dim', 'Refresh your preview to see it. Your live site gets it with your next deploy.')}`); + console.log(` ${paint('dim', 'Reload your app\'s preview page to see it in a bottom corner of the page. Your live site gets it with your next deploy.')}`); return 0; } diff --git a/src/report.ts b/src/report.ts index c14fb0c4..362764d2 100644 --- a/src/report.ts +++ b/src/report.ts @@ -378,7 +378,7 @@ export function renderSummary(report: StatusReport, progress: Progress, context: lines.push('#### What Patchstack found', parts.join(' · '), ''); } - if (options.widgetOnPage) lines.push("**Refresh your app's preview** to see the Patchstack widget.", ''); + if (options.widgetOnPage) lines.push("**Reload your app's preview page.** The Patchstack widget appears in a bottom corner of the page.", ''); // A fact about the app, not a step: the ones that matter here are what protection does not cover. for (const item of report.missing.filter((entry) => entry.note === true && entry.key !== 'runtime-protection')) { lines.push(item.plain?.text ?? item.text, ''); diff --git a/tests/bin-invocation.test.ts b/tests/bin-invocation.test.ts index 4bbfa6c0..ff6b97a9 100644 --- a/tests/bin-invocation.test.ts +++ b/tests/bin-invocation.test.ts @@ -843,7 +843,7 @@ describe.skipIf(!built)('the packaged bin, invoked as npm invokes it', () => { // The summary is what sits between its heading and the closing line for the assistant. const summary = setup.slice(setup.indexOf('──── Summary ────'), setup.lastIndexOf('\n\nYour reply to the person')); - expect(summary).toContain("**Refresh your app's preview** to see the Patchstack widget."); + expect(summary).toContain("**Reload your app's preview page.** The Patchstack widget appears in a bottom corner of the page."); expect(summary).toContain('Your API key is in `.patchstackrc.local.json`: git ignores it, so never share it.'); expect(summary).toContain(`When you've connected, say **done**.`); // Every file setup changed is still listed for the person, in the report above the summary. diff --git a/tests/install-prompt.test.ts b/tests/install-prompt.test.ts index a11351ea..102e2651 100644 --- a/tests/install-prompt.test.ts +++ b/tests/install-prompt.test.ts @@ -54,7 +54,7 @@ describe('the install prompt', () => { { installCommand: 'npm install --save @patchstack/connect', siteUuid: 's', claimUrl: 'https://example.com/claim', environment: 'sandbox' }, { widgetOnPage: true, dashboardUrl: null }, ).join('\n'); - expect(summary).toMatch(/Refresh your app's preview\*\* to see the Patchstack widget/); + expect(summary).toContain("**Reload your app's preview page.** The Patchstack widget appears in a bottom corner of the page."); }); it('makes the widget part of the install rather than a question for the user', () => { diff --git a/tests/report.test.ts b/tests/report.test.ts index 4127c849..c194f9bf 100644 --- a/tests/report.test.ts +++ b/tests/report.test.ts @@ -201,7 +201,7 @@ describe('renderSummary', () => { '#### What Patchstack found', '🔴 High **1** · 🟠 Medium **3** · 🔵 Low **1** · 12 packages outdated · 12 protection rules available', '', - "**Refresh your app's preview** to see the Patchstack widget.", + "**Reload your app's preview page.** The Patchstack widget appears in a bottom corner of the page.", ]); }); @@ -225,7 +225,7 @@ describe('renderSummary', () => { '', `When you've connected, say **done**.`, '', - "**Refresh your app's preview** to see the Patchstack widget.", + "**Reload your app's preview page.** The Patchstack widget appears in a bottom corner of the page.", '', `_Patchstack is now part of your install and build. Your API key is in \`${SECRET_CONFIG_FILENAME}\`: git ignores it, so never share it._`, ]);