|
@@ -81,6 +81,7 @@ const context = createContext<{
|
|
|
conceal: () => boolean
|
|
conceal: () => boolean
|
|
|
showThinking: () => boolean
|
|
showThinking: () => boolean
|
|
|
showTimestamps: () => boolean
|
|
showTimestamps: () => boolean
|
|
|
|
|
+ showDetails: () => boolean
|
|
|
diffWrapMode: () => "word" | "none"
|
|
diffWrapMode: () => "word" | "none"
|
|
|
sync: ReturnType<typeof useSync>
|
|
sync: ReturnType<typeof useSync>
|
|
|
}>()
|
|
}>()
|
|
@@ -114,6 +115,7 @@ export function Session() {
|
|
|
const [conceal, setConceal] = createSignal(true)
|
|
const [conceal, setConceal] = createSignal(true)
|
|
|
const [showThinking, setShowThinking] = createSignal(kv.get("thinking_visibility", true))
|
|
const [showThinking, setShowThinking] = createSignal(kv.get("thinking_visibility", true))
|
|
|
const [showTimestamps, setShowTimestamps] = createSignal(kv.get("timestamps", "hide") === "show")
|
|
const [showTimestamps, setShowTimestamps] = createSignal(kv.get("timestamps", "hide") === "show")
|
|
|
|
|
+ const [showDetails, setShowDetails] = createSignal(kv.get("tool_details_visibility", true))
|
|
|
const [diffWrapMode, setDiffWrapMode] = createSignal<"word" | "none">("word")
|
|
const [diffWrapMode, setDiffWrapMode] = createSignal<"word" | "none">("word")
|
|
|
|
|
|
|
|
const wide = createMemo(() => dimensions().width > 120)
|
|
const wide = createMemo(() => dimensions().width > 120)
|
|
@@ -462,6 +464,17 @@ export function Session() {
|
|
|
dialog.clear()
|
|
dialog.clear()
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ title: showDetails() ? "Hide tool details" : "Show tool details",
|
|
|
|
|
+ value: "session.toggle.actions",
|
|
|
|
|
+ category: "Session",
|
|
|
|
|
+ onSelect: (dialog) => {
|
|
|
|
|
+ const newValue = !showDetails()
|
|
|
|
|
+ setShowDetails(newValue)
|
|
|
|
|
+ kv.set("tool_details_visibility", newValue)
|
|
|
|
|
+ dialog.clear()
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
title: "Page up",
|
|
title: "Page up",
|
|
|
value: "session.page.up",
|
|
value: "session.page.up",
|
|
@@ -763,6 +776,7 @@ export function Session() {
|
|
|
conceal,
|
|
conceal,
|
|
|
showThinking,
|
|
showThinking,
|
|
|
showTimestamps,
|
|
showTimestamps,
|
|
|
|
|
+ showDetails,
|
|
|
diffWrapMode,
|
|
diffWrapMode,
|
|
|
sync,
|
|
sync,
|
|
|
}}
|
|
}}
|
|
@@ -1137,9 +1151,21 @@ function TextPart(props: { last: boolean; part: TextPart; message: AssistantMess
|
|
|
|
|
|
|
|
function ToolPart(props: { last: boolean; part: ToolPart; message: AssistantMessage }) {
|
|
function ToolPart(props: { last: boolean; part: ToolPart; message: AssistantMessage }) {
|
|
|
const { theme } = useTheme()
|
|
const { theme } = useTheme()
|
|
|
|
|
+ const { showDetails } = use()
|
|
|
const sync = useSync()
|
|
const sync = useSync()
|
|
|
const [margin, setMargin] = createSignal(0)
|
|
const [margin, setMargin] = createSignal(0)
|
|
|
const component = createMemo(() => {
|
|
const component = createMemo(() => {
|
|
|
|
|
+ // Hide tool if showDetails is false and tool completed successfully
|
|
|
|
|
+ // But always show if there's an error or permission is required
|
|
|
|
|
+ const shouldHide =
|
|
|
|
|
+ !showDetails() &&
|
|
|
|
|
+ props.part.state.status === "completed" &&
|
|
|
|
|
+ !sync.data.permission[props.message.sessionID]?.some((x) => x.callID === props.part.callID)
|
|
|
|
|
+
|
|
|
|
|
+ if (shouldHide) {
|
|
|
|
|
+ return undefined
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const render = ToolRegistry.render(props.part.tool) ?? GenericTool
|
|
const render = ToolRegistry.render(props.part.tool) ?? GenericTool
|
|
|
|
|
|
|
|
const metadata = props.part.state.status === "pending" ? {} : (props.part.state.metadata ?? {})
|
|
const metadata = props.part.state.status === "pending" ? {} : (props.part.state.metadata ?? {})
|