This repository was archived by the owner on Dec 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
This repository was archived by the owner on Dec 19, 2025. It is now read-only.
Add keyboard shortcuts to toggle tool details and thinking blocks visibility #169
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem/Context
Currently, there is a single showDetails state (src/app/index.tsx:582) that controls visibility for both tool outputs and thinking/reasoning blocks. Users should be able to independently control:
- Tool details visibility - Show/hide tool execution results and outputs
- Thinking blocks visibility - Show/hide model reasoning/thinking content
This aligns with the opencode TUI which provides separate toggle keybinds:
<leader>d- Toggle tool details<leader>b- Toggle thinking blocks
Acceptance Criteria
- Add new state variables:
showToolDetailsandshowThinkingBlocks(both default totrue) - Register keyboard shortcuts:
<leader>dtogglesshowToolDetails<leader>btogglesshowThinkingBlocks
- Update
MessagePart.tsxto accept and pass through both props - Update
ToolPart.tsxto useshowToolDetailsprop - Update
ReasoningPart.tsxto useshowThinkingBlocksprop - Display toast feedback when toggling (e.g., "Tool details shown/hidden", "Thinking blocks shown/hidden")
- Persist preferences in localStorage for session continuity
Implementation Details
1. State Management (src/app/index.tsx)
Replace the existing single showDetails state:
// Current (line 582)
const [showDetails, setShowDetails] = useState(true);
// Proposed
const [showToolDetails, setShowToolDetails] = useState(true);
const [showThinkingBlocks, setShowThinkingBlocks] = useState(true);2. Register Keyboard Shortcuts (src/app/index.tsx)
Add shortcuts following the existing pattern around lines 896-1165:
// Toggle tool details (<leader>d)
unregisterFns.push(
registerShortcut({
key: "d",
handler: () => {
setShowToolDetails((prev) => !prev);
showToast(`Tool details ${!showToolDetails ? "shown" : "hidden"}`);
},
requiresLeader: true,
description: "Toggle Tool Details",
category: "action",
})
);
// Toggle thinking blocks (<leader>b)
unregisterFns.push(
registerShortcut({
key: "b",
handler: () => {
setShowThinkingBlocks((prev) => !prev);
showToast(`Thinking blocks ${!showThinkingBlocks ? "shown" : "hidden"}`);
},
requiresLeader: true,
description: "Toggle Thinking Blocks",
category: "action",
})
);3. Update Component Props
MessagePart.tsx (src/app/_components/message/MessagePart.tsx:14-36):
interface MessagePartProps {
part: Part;
showToolDetails?: boolean;
showThinkingBlocks?: boolean;
}ReasoningPart.tsx (src/app/_components/message/ReasoningPart.tsx):
- Rename
showDetailsprop toshowThinkingBlocksfor clarity
ToolPart.tsx (src/app/_components/message/ToolPart.tsx):
- Rename
showDetailsprop toshowToolDetailsfor clarity
Key Files to Modify
src/app/index.tsx- State management and shortcut registrationsrc/app/_components/message/MessagePart.tsx- Props interfacesrc/app/_components/message/ToolPart.tsx- Tool visibility logicsrc/app/_components/message/ReasoningPart.tsx- Thinking block visibility logicsrc/app/_components/message/StepPart.tsx- May need similar update
Reference Implementations
- AetherLink (settingsSlice.ts) - Uses separate
showToolDetailsand thinking display style settings - TriliumNext (llm_chat_panel.ts) - Implements
toggleThinkingDetails()for collapsible thinking panels
Tasks
- Create
showToolDetailsandshowThinkingBlocksstate - Add
<leader>dshortcut for tool details toggle - Add
<leader>bshortcut for thinking blocks toggle - Update
MessagePartcomponent props - Update
ToolPartto respectshowToolDetails - Update
ReasoningPartto respectshowThinkingBlocks - Update
StepPartif applicable - Add localStorage persistence
- Add toast notifications for toggle feedback
- Update help documentation/keyboard shortcuts list
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request