The open source coding agent.
TypeScript
fix(web): remove system prompts from share page
adamdottv49053b66a92e
diff --git a/packages/web/src/components/Share.tsx b/packages/web/src/components/Share.tsxindex 5510f5a6950..9b953bd2de3 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 mappingsconst 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 (<divid={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 */}<Matchwhen={@@ -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>