instant: build fix-card Copy AI prompt dynamically from title + link#94637
instant: build fix-card Copy AI prompt dynamically from title + link#94637aurorascharff wants to merge 1 commit into
Conversation
The dev-overlay fix cards used to ship a multi-paragraph `prompt` string
per card that the user copied to their agent verbatim. Same for the
public docs pages, where each `<FixOption>` carried a matching `prompt={...}`
attribute (36 prompts across 14 pages).
Two problems with the verbatim approach:
1. The prompt repeats what the docs page already says — the agent receives
either a long instruction OR a link to the docs that explains the same
fix, but not both stitched together.
2. The agent has no obvious instruction to read the actual error in the
dev overlay before applying the fix, so it can patch the wrong file.
This change collapses every prompt into a single template that the copy
button constructs at click time from `title + link`. The template:
- tells the agent to read the dev overlay (or browser/terminal console)
to identify the failing file/line/component
- points at the rule docs URL AND the specific fix anchor URL
- names the fix to apply
No per-card prompt text anywhere. The runtime card type loses its
`prompt` field in favor of `copyable: boolean`. The `<FixOption>`
MDX component loses its `prompt` prop entirely (docs site PR ships the
matching component change).
Result: 71 prompt strings deleted from source (36 docs + 35 runtime),
one template lives in two render sites (dev overlay + docs page), both
emit identical output for the same fix.
Failing test suitesCommit: 0fb10a0 | About building and testing Next.js
Expand output● app dir - metadata static routes cache › should generate different content after replace the static metadata file |
Stats cancelledCommit: 0fb10a0 |
There was a problem hiding this comment.
Pull request overview
This PR removes hard-coded multi-paragraph “Copy AI prompt” strings from fix cards and replaces them with a single standardized prompt template that is generated from the fix card title + docs link. This keeps the agent workflow consistently anchored to the canonical docs page while also explicitly instructing the agent to first inspect the real dev overlay error context.
Changes:
- Replaced
FixCard.prompt?: stringwithFixCard.copyable?: boolean, and updated the dev overlay to generate the copy prompt fromtitle+link. - Updated
instant-guidance-data.tsto mark relevant cards ascopyable: true(removing the duplicated prompt strings). - Removed
prompt={...}props from the affectederrors/*.mdxpages and updated the authoring skill doc accordingly.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/next/src/next-devtools/dev-overlay/components/instant/instant-guidance.tsx | Generates the copied AI prompt from title + link and gates the copy button via copyable. |
| packages/next/src/next-devtools/dev-overlay/components/instant/instant-guidance-data.ts | Updates the FixCard type and replaces embedded prompt strings with copyable: true. |
| errors/instant-unrendered-segment.mdx | Removes prompt props from <FixOption> entries. |
| errors/blocking-prerender-viewport-runtime.mdx | Removes prompt props from <FixOption> entries. |
| errors/blocking-prerender-viewport-dynamic.mdx | Removes prompt props from <FixOption> entries. |
| errors/blocking-prerender-runtime.mdx | Removes prompt props from <FixOption> entries. |
| errors/blocking-prerender-random.mdx | Removes prompt props from <FixOption> entries. |
| errors/blocking-prerender-random-client.mdx | Removes prompt props from <FixOption> entries. |
| errors/blocking-prerender-metadata-runtime.mdx | Removes prompt props from <FixOption> entries. |
| errors/blocking-prerender-metadata-dynamic.mdx | Removes prompt props from <FixOption> entries (and collapses one <FixOption> tag to a single line). |
| errors/blocking-prerender-dynamic.mdx | Removes prompt props from <FixOption> entries. |
| errors/blocking-prerender-current-time.mdx | Removes prompt props from <FixOption> entries. |
| errors/blocking-prerender-current-time-client.mdx | Removes prompt props from <FixOption> entries. |
| errors/blocking-prerender-crypto.mdx | Removes prompt props from <FixOption> entries. |
| errors/blocking-prerender-crypto-client.mdx | Removes prompt props from <FixOption> entries. |
| errors/blocking-prerender-client-hook.mdx | Removes prompt props from <FixOption> entries. |
| .agents/skills/insight-error-page/SKILL.md | Updates authoring guidance to reflect that prompts are generated dynamically and the page is the source of truth. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What
Every fix card (dev overlay + docs pages) used to ship a multi-paragraph
promptstring copied verbatim to the agent. This PR builds the prompt at click time fromtitle + linkso 71 prompt strings (36 docs MDX + 35 runtime) are deleted from source.The template:
Why
Old prompts repeated what the docs already say and never told the agent to read the dev overlay first. The new template always points at the docs (rule + fix anchor) and grounds the fix in the real error.
Changes
FixCardtype:prompt?: string→copyable?: booleanCopyPromptButton: takestitle + link, builds the promptprompt={...}removed (36 strings)instant-guidance-data.ts: everyprompt: '...'→copyable: true(35 strings).agents/skills/insight-error-page/SKILL.md): updatedPairs with
vercel/front#73087 — same template in the docs-site
<FixOption>.