Skip to content

Commit 7119c0b

Browse files
authored
Merge pull request #1122 from murataslan1/fix/cli-missing-full-content-param
fix(cli): add missing full_content param to API URL
2 parents 41b3ef5 + 51ab7eb commit 7119c0b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/prompts.chat/src/cli/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
22
import { homedir } from 'os';
33
import { join } from 'path';
44

5-
const PROMPTS_URL = 'https://prompts.chat/prompts.json';
5+
const PROMPTS_URL = 'https://prompts.chat/prompts.json?full_content=true';
66
const CACHE_DIR = join(homedir(), '.prompts-chat');
77
const CACHE_FILE = join(CACHE_DIR, 'prompts.json');
88

packages/prompts.chat/src/cli/components/PromptDetail.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function PromptDetail({ prompt, onBack, onCopy }: PromptDetailProps) {
7777
const contentHeight = Math.max(terminalHeight - headerLines - footerLines, 5);
7878

7979
useEffect(() => {
80-
const vars = extractVariables(prompt.content);
80+
const vars = extractVariables(prompt.content ?? '');
8181
setVariables(vars);
8282

8383
const defaults: Record<string, string> = {};
@@ -90,7 +90,7 @@ export function PromptDetail({ prompt, onBack, onCopy }: PromptDetailProps) {
9090
const contentLines = useMemo(() => {
9191
if (!prompt) return [];
9292
// Parse escape sequences like \n
93-
const parsedContent = prompt.content.replace(/\\n/g, '\n');
93+
const parsedContent = (prompt.content ?? '').replace(/\\n/g, '\n');
9494
return wrapText(parsedContent, terminalWidth - 6);
9595
}, [prompt, terminalWidth]);
9696

@@ -200,12 +200,12 @@ export function PromptDetail({ prompt, onBack, onCopy }: PromptDetailProps) {
200200
setCurrentVarIndex(0);
201201
setCurrentInput(variableValues[variables[0].name] || '');
202202
} else {
203-
handleCopy(prompt.content);
203+
handleCopy(prompt.content ?? '');
204204
}
205205
}
206206

207207
if (input === 'C' && prompt) {
208-
handleCopy(prompt.content);
208+
handleCopy(prompt.content ?? '');
209209
}
210210

211211
if (input === 'o' && prompt) {

0 commit comments

Comments
 (0)