-
Notifications
You must be signed in to change notification settings - Fork 203
suggestions felix #2747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
felixkrrr
wants to merge
2
commits into
main
Choose a base branch
from
shorten-ai-get-started-suggestions-felix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
suggestions felix #2747
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| ```txt | ||
| Please follow the instructions on this page to set up tracing for my project: | ||
| https://langfuse.com/docs/observability/get-started.md | ||
|
|
||
| Leveraging the Langfuse skill https://github.com/langfuse/skills | ||
| ``` |
6 changes: 6 additions & 0 deletions
6
components-mdx/get-started/agent-prompt-prompt-management.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| ```txt | ||
| Please follow the instructions on this page to set up prompt management for my project: | ||
| https://langfuse.com/docs/prompt-management/get-started.md | ||
|
|
||
| Leveraging the Langfuse skill https://github.com/langfuse/skills | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| export function getAgentPromptText(topic: string | undefined): string { | ||
| switch (topic) { | ||
| case "observability": | ||
| return `Please follow the instructions on this page to set up tracing for my project: | ||
| https://langfuse.com/docs/observability/get-started.md | ||
|
|
||
| Leveraging the Langfuse skill https://github.com/langfuse/skills`.trim(); | ||
| case "prompt-management": | ||
| return `Please follow the instructions on this page to set up prompt management for my project: | ||
| https://langfuse.com/docs/prompt-management/get-started.md | ||
|
|
||
| Leveraging the Langfuse skill https://github.com/langfuse/skills`.trim(); | ||
| case "evals": | ||
| return ""; | ||
| default: | ||
| return ""; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| "use client"; | ||
|
|
||
| import { Button } from "@/components/ui/button"; | ||
| import { Check, Copy } from "lucide-react"; | ||
| import { useState } from "react"; | ||
| import { getAgentPromptText } from "@/components-mdx/get-started/agent-prompt-text"; | ||
|
|
||
| type CopyAgentPromptButtonProps = { | ||
| topic?: string; | ||
| }; | ||
|
|
||
| export function CopyAgentPromptButton({ topic }: CopyAgentPromptButtonProps) { | ||
| const prompt = getAgentPromptText(topic); | ||
| const [copied, setCopied] = useState(false); | ||
|
|
||
| if (!prompt) { | ||
| return null; | ||
| } | ||
|
|
||
| const handleCopy = async () => { | ||
| try { | ||
| await navigator.clipboard.writeText(prompt); | ||
| setCopied(true); | ||
| setTimeout(() => setCopied(false), 3000); | ||
| } catch (err) { | ||
| console.error("Failed to copy prompt:", err); | ||
| } | ||
| }; | ||
|
|
||
| return ( | ||
| <Button onClick={handleCopy}> | ||
| {copied ? ( | ||
| <> | ||
| <Check className="mr-2 h-4 w-4" /> | ||
| Prompt copied | ||
| </> | ||
| ) : ( | ||
| <> | ||
| <Copy className="mr-2 h-4 w-4" /> | ||
| Copy Agent Prompt | ||
| </> | ||
| )} | ||
| </Button> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| "use client"; | ||
|
|
||
| import { Button } from "@/components/ui/button"; | ||
| import { cn } from "@/lib/utils"; | ||
| import { Check, Copy } from "lucide-react"; | ||
| import { useState } from "react"; | ||
| import { getAgentPromptText } from "./agent-prompt-text"; | ||
|
|
||
| type CopyableAgentPromptProps = { | ||
| topic?: string; | ||
| className?: string; | ||
| }; | ||
|
|
||
| export function CopyableAgentPrompt({ topic, className }: CopyableAgentPromptProps) { | ||
| const text = getAgentPromptText(topic); | ||
| const [copied, setCopied] = useState(false); | ||
|
|
||
| if (!text) { | ||
| return null; | ||
| } | ||
|
|
||
| const handleCopy = async () => { | ||
| try { | ||
| await navigator.clipboard.writeText(text); | ||
| setCopied(true); | ||
| setTimeout(() => setCopied(false), 2000); | ||
| } catch (err) { | ||
| console.error("Failed to copy prompt:", err); | ||
| } | ||
| }; | ||
|
|
||
| return ( | ||
| <div | ||
| className={cn( | ||
| "relative rounded-md border bg-muted/30 p-4 pr-12 text-sm leading-relaxed text-foreground", | ||
| className, | ||
| )} | ||
| > | ||
| <p className="whitespace-pre-wrap font-sans">{text}</p> | ||
| <Button | ||
| type="button" | ||
| size="icon" | ||
| variant="ghost" | ||
| className="absolute right-2 top-2 shrink-0 text-muted-foreground hover:text-foreground" | ||
| onClick={handleCopy} | ||
| aria-label="Copy prompt to clipboard" | ||
| > | ||
| {copied ? <Check className="h-4 w-4" /> : <Copy className="h-4 w-4" />} | ||
| </Button> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 The 'Cursor plugin' tab shows the agent prompt but is missing the that appears in the 'Ask your coding agent' tab. Adding after the prompt MDX components in the Cursor tab (around line 46 of auto-install.mdx) would restore consistency.
Extended reasoning...
Both tabs in auto-install.mdx display the same agent prompt via the conditional AgentPromptObservability / AgentPromptPromptManagement MDX components, and both were clearly intended to give users a prominent, labeled way to copy that prompt text. The PR introduced CopyAgentPromptButton and wired it up correctly in Tab 1 ('Ask your coding agent'), but the same button was not added to Tab 2 ('Cursor plugin').
The specific code path: in auto-install.mdx, Tab 1 ends with
<CopyAgentPromptButton topic={props.topic} />(line 20), while Tab 2 ends after the prompt MDX block with no corresponding button (lines 42–46). The import for CopyAgentPromptButton is already present at the top of the file, so the fix is simply a one-line addition.Existing code does not compensate for this omission in a fully equivalent way. Fumadocs code blocks do render a small native copy icon, so the prompt text is not uncopyable — but that icon is small, unlabeled, and part of the code block UI rather than a standalone, discoverable action. The CopyAgentPromptButton is a larger, labeled button ('Copy Agent Prompt') that makes the action explicit, especially for users who may not notice the code-block icon.
The practical impact is a UX inconsistency: users who land on the Cursor plugin tab see a less polished experience than those on the first tab. The button's absence may also be mildly confusing if users notice it exists on Tab 1 but not Tab 2. There is no functional breakage, which is why this is nit-level.
The fix is minimal: add
<CopyAgentPromptButton topic={props.topic} />directly after the prompt MDX components in Tab 2, mirroring exactly what Tab 1 does. No new imports are needed since CopyAgentPromptButton is already imported.Step-by-step proof: (1) A user visits the Cursor plugin tab. (2) They see the agent prompt rendered via AgentPromptObservability or AgentPromptPromptManagement. (3) They look for a 'Copy Agent Prompt' button like the one visible on the first tab — it is absent. (4) They must rely on the smaller native code-block copy icon or manually select the text. Meanwhile, a user on Tab 1 gets the large labeled button immediately below the prompt.