From 0754c2840150b1925f90598c8f58c2d7fcc116fe Mon Sep 17 00:00:00 2001 From: dprevoznik <58714078+dprevoznik@users.noreply.github.com> Date: Fri, 21 Aug 2026 19:07:55 +0000 Subject: [PATCH] Make CopyPromptButton default prompt self-contained again #510 hoisted the homepage's default prompt text into a module-level DEFAULT_PROMPT const so the Foreman page could override it via props. That constant doesn't resolve in Mintlify's per-page render (Reference Error: DEFAULT_PROMPT is not defined), breaking the homepage button. #513 patched the destructuring but never touched DEFAULT_PROMPT's scope, so the underlying failure was still live. Move the default prompt text back inside the function body, matching how it worked before #510, while keeping the prompt/label override for the Foreman page. --- snippets/copy-prompt-button.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/snippets/copy-prompt-button.jsx b/snippets/copy-prompt-button.jsx index 5092c4b..bb59480 100644 --- a/snippets/copy-prompt-button.jsx +++ b/snippets/copy-prompt-button.jsx @@ -1,6 +1,10 @@ const { useState, useCallback } = React; -const DEFAULT_PROMPT = `# Setup Kernel +export const CopyPromptButton = (props) => { + const { label = 'copy prompt' } = props || {}; + const [copied, setCopied] = useState(false); + + const prompt = (props && props.prompt) || `# Setup Kernel ## Prerequisites - Read the kernel-cli skill at https://github.com/kernel/skills/blob/main/plugins/kernel-cli/skills/kernel-cli/SKILL.md for reference on commands and capabilities. @@ -27,10 +31,6 @@ const DEFAULT_PROMPT = `# Setup Kernel - Tell the user they can use the live view immediately. - If browser creation fails, stop and ask the user for help.`; -export const CopyPromptButton = (props) => { - const { prompt = DEFAULT_PROMPT, label = 'copy prompt' } = props || {}; - const [copied, setCopied] = useState(false); - const handleCopy = useCallback(async () => { try { await navigator.clipboard.writeText(prompt);