Sfoglia il codice sorgente

docs: comment out thinking blocks for share page

Jay V 6 mesi fa
parent
commit
0386898476

+ 2 - 2
packages/web/src/components/icons/custom.tsx

@@ -75,7 +75,7 @@ export function IconRobot(props: JSX.SvgSVGAttributes<SVGSVGElement>) {
 }
 
 // https://icones.js.org/collection/ri?s=brain&icon=ri:brain-2-line
-export function IconBrain(props: JSX.SvgSVGAttributes<SVGSVGElement>) {
+/* export function IconBrain(props: JSX.SvgSVGAttributes<SVGSVGElement>) {
   return (
     <svg {...props} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
       <path
@@ -84,4 +84,4 @@ export function IconBrain(props: JSX.SvgSVGAttributes<SVGSVGElement>) {
       />
     </svg>
   )
-}
+} */

+ 2 - 2
packages/web/src/components/share/part.module.css

@@ -128,7 +128,7 @@
     max-width: var(--md-tool-width);
   }
 
-  [data-component="assistant-reasoning"] {
+  /* [data-component="assistant-reasoning"] {
     min-width: 0;
     display: flex;
     flex-direction: column;
@@ -150,7 +150,7 @@
         right: calc(0.5rem - 1px);
       }
     }
-  }
+  } */
 
   [data-component="assistant-text"] {
     min-width: 0;

+ 43 - 35
packages/web/src/components/share/part.tsx

@@ -19,7 +19,7 @@ import {
   IconMagnifyingGlass,
   IconDocumentMagnifyingGlass,
 } from "../icons"
-import { IconMeta, IconRobot, IconOpenAI, IconGemini, IconAnthropic, IconBrain } from "../icons/custom"
+import { IconMeta, IconRobot, IconOpenAI, IconGemini, IconAnthropic /*, IconBrain */ } from "../icons/custom"
 import { ContentCode } from "./content-code"
 import { ContentDiff } from "./content-diff"
 import { ContentText } from "./content-text"
@@ -83,9 +83,9 @@ export function Part(props: PartProps) {
               >
                 {(model) => <ProviderIcon model={model()} size={18} />}
               </Match>
-              <Match when={props.part.type === "reasoning" && props.message.role === "assistant"}>
+              {/* <Match when={props.part.type === "reasoning" && props.message.role === "assistant"}>
                 <IconBrain width={18} height={18} />
-              </Match>
+              </Match> */}
               <Match when={props.part.type === "tool" && props.part.tool === "todowrite"}>
                 <IconQueueList width={18} height={18} />
               </Match>
@@ -158,7 +158,7 @@ export function Part(props: PartProps) {
             )}
           </div>
         )}
-        {props.message.role === "assistant" && props.part.type === "reasoning" && (
+        {/* {props.message.role === "assistant" && props.part.type === "reasoning" && (
           <div data-component="tool">
             <div data-component="tool-title">
               <span data-slot="name">Thinking</span>
@@ -169,36 +169,43 @@ export function Part(props: PartProps) {
                   <ContentMarkdown expand text={props.part.text || "Thinking..."} />
                 </div>
               </ResultsButton>
-            </div>
-          </div>
-        )}
-        {props.message.role === "user" && props.part.type === "file" && (
-          <div data-component="attachment">
-            <div data-slot="copy">Attachment</div>
-            <div data-slot="filename">{props.part.filename}</div>
+              </div>
           </div>
-        )}
-        {props.part.type === "step-start" && props.message.role === "assistant" && (
-          <div data-component="step-start">
-            <div data-slot="provider">{props.message.providerID}</div>
-            <div data-slot="model">
-              {DateTime.fromMillis(props.message.time.completed || props.message.time.created).toLocaleString(
-                DateTime.DATETIME_MED,
-              )}
-              {` | ${props.message.modelID}`}
-              {props.message.mode && (
-                <span style={{ color: "var(--sl-color-accent)" }}>{` | ${props.message.mode}`}</span>
-              )}
+        )} */}
+        {
+          props.message.role === "user" && props.part.type === "file" && (
+            <div data-component="attachment">
+              <div data-slot="copy">Attachment</div>
+              <div data-slot="filename">{props.part.filename}</div>
             </div>
-          </div>
-        )}
-        {props.part.type === "tool" && props.part.state.status === "error" && (
-          <div data-component="tool" data-tool="error">
-            <ContentError>{formatErrorString(props.part.state.error)}</ContentError>
-            <Spacer />
-          </div>
-        )}
-        {props.part.type === "tool" &&
+          )
+        }
+        {
+          props.part.type === "step-start" && props.message.role === "assistant" && (
+            <div data-component="step-start">
+              <div data-slot="provider">{props.message.providerID}</div>
+              <div data-slot="model">
+                {DateTime.fromMillis(props.message.time.completed || props.message.time.created).toLocaleString(
+                  DateTime.DATETIME_MED,
+                )}
+                {` | ${props.message.modelID}`}
+                {props.message.mode && (
+                  <span style={{ color: "var(--sl-color-accent)" }}>{` | ${props.message.mode}`}</span>
+                )}
+              </div>
+            </div>
+          )
+        }
+        {
+          props.part.type === "tool" && props.part.state.status === "error" && (
+            <div data-component="tool" data-tool="error">
+              <ContentError>{formatErrorString(props.part.state.error)}</ContentError>
+              <Spacer />
+            </div>
+          )
+        }
+        {
+          props.part.type === "tool" &&
           props.part.state.status === "completed" &&
           props.message.role === "assistant" && (
             <>
@@ -300,9 +307,10 @@ export function Part(props: PartProps) {
                   .toMillis()}
               />
             </>
-          )}
-      </div>
-    </div>
+          )
+        }
+      </div >
+    </div >
   )
 }