diff options
| author | adamdottv <[email protected]> | 2025-06-27 06:48:34 -0500 |
|---|---|---|
| committer | Jay V <[email protected]> | 2025-06-27 19:10:42 -0400 |
| commit | 49053b66a92e7d1095d7934ff86a6764ed765266 (patch) | |
| tree | f4c4015907cb5d5d22182a0abf8a0f1c8ad19de0 /packages/web/src | |
| parent | 47497aef0754792361c8d4a8e41a85cea63fa431 (diff) | |
| download | opencode-49053b66a92e7d1095d7934ff86a6764ed765266.tar.gz opencode-49053b66a92e7d1095d7934ff86a6764ed765266.zip | |
fix(web): remove system prompts from share page
Diffstat (limited to 'packages/web/src')
| -rw-r--r-- | packages/web/src/components/Share.tsx | 91 |
1 files changed, 10 insertions, 81 deletions
diff --git a/packages/web/src/components/Share.tsx b/packages/web/src/components/Share.tsx index 5510f5a69..9b953bd2d 100644 --- a/packages/web/src/components/Share.tsx +++ b/packages/web/src/components/Share.tsx @@ -23,7 +23,6 @@ import { } from "./icons/custom" import { IconFolder, - IconCpuChip, IconHashtag, IconSparkles, IconGlobeAlt, @@ -103,10 +102,7 @@ function stripWorkingDirectory(filePath: string, workingDir?: string) { } function getShikiLang(filename: string) { - const ext = filename - .split('.') - .pop() - ?.toLowerCase() ?? '' + const ext = filename.split(".").pop()?.toLowerCase() ?? "" // map.languages(ext) returns an array of matching Linguist language names (e.g. ['TypeScript']) const langs = map.languages(ext) @@ -114,12 +110,10 @@ function getShikiLang(filename: string) { // Overrride any specific language mappings const overrides: Record<string, string> = { - "conf": "shellscript" + conf: "shellscript", } - return type - ? overrides[type] ?? type - : 'plaintext' + return type ? (overrides[type] ?? type) : "plaintext" } function formatDuration(ms: number): string { @@ -1087,13 +1081,6 @@ export default function Share(props: { } > {(assistant) => { - const system = createMemo(() => { - const prompts = assistant().system || [] - return prompts.filter( - (p: string) => - !p.startsWith("You are Claude"), - ) - }) return ( <div id={anchor()} @@ -1119,67 +1106,13 @@ export default function Share(props: { <span data-part-model> {assistant().modelID} </span> - <Show when={system().length > 0}> - <div data-part-tool-result> - <ResultsButton - showCopy="Show system prompt" - hideCopy="Hide system prompt" - results={showResults()} - onClick={() => - setShowResults((e) => !e) - } - /> - <Show when={showResults()}> - <TextPart - expand - data-size="sm" - data-color="dimmed" - text={system().join("\n\n").trim()} - /> - </Show> - </div> - </Show> </div> </div> </div> ) }} </Match> - {/* System text */} - <Match - when={ - msg.role === "system" && - part.type === "text" && - part - } - > - {(part) => ( - <div - id={anchor()} - data-section="part" - data-part-type="system-text" - > - <div data-section="decoration"> - <AnchorIcon id={anchor()}> - <IconCpuChip width={18} height={18} /> - </AnchorIcon> - <div></div> - </div> - <div data-section="content"> - <div data-part-tool-body> - <div data-part-title> - <span data-element-label>System</span> - </div> - <TextPart - data-size="sm" - text={part().text} - data-color="dimmed" - /> - </div> - </div> - </div> - )} - </Match> + {/* Grep tool */} <Match when={ @@ -1374,9 +1307,9 @@ export default function Share(props: { const path = createMemo(() => toolData()?.args.path !== data().rootDir ? stripWorkingDirectory( - toolData()?.args.path, - data().rootDir, - ) + toolData()?.args.path, + data().rootDir, + ) : toolData()?.args.path, ) @@ -1737,8 +1670,7 @@ export default function Share(props: { when={ msg.role === "assistant" && part.type === "tool-invocation" && - part.toolInvocation.toolName === - "todowrite" && + part.toolInvocation.toolName === "todowrite" && part } > @@ -1803,8 +1735,7 @@ export default function Share(props: { when={ msg.role === "assistant" && part.type === "tool-invocation" && - part.toolInvocation.toolName === - "webfetch" && + part.toolInvocation.toolName === "webfetch" && part } > @@ -1978,9 +1909,7 @@ export default function Share(props: { > <IconSparkles width={18} height={18} /> </Match> - <Match when={msg.role === "system"}> - <IconCpuChip width={18} height={18} /> - </Match> + <Match when={msg.role === "user"}> <IconUserCircle width={18} height={18} /> </Match> |
