Skip to content

feat(docs): add per-page Agent setup button to docs title row - #6293

Open
bgrenon wants to merge 6 commits into
mainfrom
docs-agent-setup-button
Open

bgrenon wants to merge 6 commits into
mainfrom
docs-agent-setup-button

Conversation

@bgrenon

@bgrenon bgrenon commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

What this does

Adds a per-page Agent setup button to the docs article title row. One click copies a short prompt a reader can paste into their coding agent (Claude Code, Cursor, Codex) to set up Neon. It replaces the sidebar "Set up Neon with AI" action and its modal with a more visible title-row action.

The button

Sits in the title action row, to the left of the existing Copy page split button.

  • 34px tall, 1px #D7D8DB border, 6px radius, white background, 14px label.
  • Sparkle icon in #39A57D; border turns #39A57D on hover (120ms).
  • Copied state (1.4s, then reverts): label "Prompt copied", check icon, #157A55 text, #39A57D border.

It copies plain text (navigator.clipboard.writeText), so the prompt pastes as normal body text rather than styled/monospace.

Prompt text

Base text, identical on every page:

Set me up for Neon. Fetch https://neon.com/prompts/agent-setup.md and follow it.

If a page's frontmatter sets agentPrompt, it is appended with a single leading space, e.g. agentPrompt: 'Then connect this Node.js app.' produces ... and follow it. Then connect this Node.js app.

Prompt file

The prompt points at https://neon.com/prompts/agent-setup.md. That file is also introduced by #6241 (the docs home redesign). To keep this button working before #6241 merges, this PR bundles public/prompts/agent-setup.md with the same content as #6241's file. This overlap is intentional: when both land it is a trivial identical-content duplicate, and only one copy should be kept.

Other changes

  • Removed the sidebar "Set up Neon with AI" action and its now-unused modal.
  • Moved the "Updated {date}" stamp into the title row. Same source as before: the page's updatedOn frontmatter, which is auto-stamped per file at commit time, so each page shows its own real last-updated date.
  • Widened the docs title block to the full content width. The H1 and subtitle previously wrapped early at a narrow max-width that only existed to leave room for the side button; with the actions moved to their own row, that constraint is removed.

Verification

Lint, formatting, the full unit suite, and the production build all pass; the build generates all pages.

Add an "Agent setup" button to the docs article title action row that
copies an agent-setup prompt to the clipboard, replacing the sidebar
"Set up Neon with AI" action and its modal.

- New AgentSetupButton (title row, left of the Copy page split button):
  copies the base prompt and appends the page's agentPrompt frontmatter
  when present; shows a 1.4s "Prompt copied" state via use-copy-to-clipboard.
- Thread agentPrompt frontmatter through Post (flows via gray-matter data)
  and add it to PropTypes.
- Move the "Updated {date}" stamp into the title action row.
- Remove the sidebar SetUpNeonButton and the now-unused neon-init-modal.
- Bundle public/get-started.md so the prompt URL is not a 404, and register
  it in the static-md manifest.

Co-authored-by: Isaac <no-reply@databricks.com>
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
neon-next Ready Ready Preview Oct 28, 2026 9:10pm UTC

Request Review

- Update the base prompt to "Set me up for Neon. Fetch
  https://neon.com/prompts/agent-setup.md and follow it." (agentPrompt
  frontmatter still appends with one leading space).
- Copy the prompt as plain text via navigator.clipboard.writeText (no
  text/html, no styled DOM-node copy), so it pastes as normal body text.
- Point the button at /prompts/agent-setup.md: drop public/get-started.md
  and bundle public/prompts/agent-setup.md (verbatim copy of the file in
  PR #6241) so the URL resolves before that PR merges; manifest regenerated.
- Widen the docs title block to full content width so the H1 and subtitle
  no longer wrap early (the title no longer reserves room for a side button).

Co-authored-by: Isaac <no-reply@databricks.com>
Swap the default Agent setup button icon from a sparkle to the existing
docs AI-agent (robot head) icon. Everything else is unchanged: 15px size,
green icon in the default state, green check swap in the copied state,
placement, and title attribute.

Co-authored-by: Isaac <no-reply@databricks.com>
Docs pages without an `updatedOn` frontmatter field showed no date, leaving
the title action row unbalanced. Add a committed fallback map of each such
page's last git commit date and use it when the frontmatter field is absent.

- Add src/scripts/generate-docs-last-modified.js and the generated
  src/constants/docs-last-modified.js (slug -> last git commit date for the
  72 docs pages that lack updatedOn). Committed rather than computed at build
  because Vercel's shallow clone makes per-file git history unavailable there.
- Docs route prefers data.updatedOn, falling back to the map, so every
  servable docs article now shows its real last-updated date.
- Right-align the title-row actions with ml-auto instead of a lone spacer, so
  a date-less row no longer looks unbalanced.

Co-authored-by: Isaac <no-reply@databricks.com>
Replace the standalone Agent setup button and the Updated-date element
with a single left-aligned, text-only actions row below the title:
Copy page, View as Markdown, Set up agent.

- Add an inline variant to DropdownMenu: a plain "Copy page" text trigger
  with a chevron that opens the existing menu (Copy page as Markdown,
  Open in ChatGPT, Open in Claude) unchanged.
- Add a plain "View as Markdown" link to the page's raw markdown.
- Restyle "Set up agent" as a text action: robot icon in green, label
  turns green on hover, and swaps to a check with "Prompt copied" for
  1.4s on click. Still copies the prompt as plain text.
- Restructure the title block as a grid with a bottom rule; keep the
  full-width H1 and subtitle.
- Remove the Updated-date element and its last-modified fallback
  machinery (script, generated map, package.json script, route plumbing).

Co-authored-by: Isaac <no-reply@databricks.com>

@danieltprice danieltprice left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Let's merge!

Resolve conflicts after PR #6241 (docs IA redesign) merged to main:
- public/prompts/agent-setup.md: took main's canonical copy, dropped the
  bundled stopgap duplicate (identical content).
- src/components/pages/doc/post/post.jsx: kept the inline page actions row
  (Copy page menu, View as Markdown, Set up agent), the full-width title
  block, and the grid header rework; adopted main's removal of the
  isDocsIndex prop (the docs home is now its own route/component), so the
  actions row and header rule render unconditionally on article pages.

Co-authored-by: Isaac <no-reply@databricks.com>

This branch was successfully deployed

1 active deployment
Preview – neon-next — 761c3008 Deployed Oct 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants