-
Notifications
You must be signed in to change notification settings - Fork 8.9k
feat: Allow expanding MCP call arguments #11207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -44,6 +44,7 @@ export const ToolConfirmationMessage: React.FC< | |||||||||||||
|
|
||||||||||||||
| const [ideClient, setIdeClient] = useState<IdeClient | null>(null); | ||||||||||||||
| const [isDiffingEnabled, setIsDiffingEnabled] = useState(false); | ||||||||||||||
| const [isExpanded, setIsExpanded] = useState(false); | ||||||||||||||
|
|
||||||||||||||
| useEffect(() => { | ||||||||||||||
| let isMounted = true; | ||||||||||||||
|
|
@@ -83,6 +84,8 @@ export const ToolConfirmationMessage: React.FC< | |||||||||||||
| if (!isFocused) return; | ||||||||||||||
| if (key.name === 'escape' || (key.ctrl && key.name === 'c')) { | ||||||||||||||
| handleConfirm(ToolConfirmationOutcome.Cancel); | ||||||||||||||
| } else if (key.ctrl && key.name === 's') { | ||||||||||||||
| setIsExpanded((prev) => !prev); | ||||||||||||||
| } | ||||||||||||||
|
Comment on lines
+87
to
89
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The keypress for toggling argument expansion is hardcoded as You will need to import
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is in line with the |
||||||||||||||
| }, | ||||||||||||||
| { isActive: isFocused }, | ||||||||||||||
|
|
@@ -273,6 +276,14 @@ export const ToolConfirmationMessage: React.FC< | |||||||||||||
| <Box flexDirection="column" paddingX={1} marginLeft={1}> | ||||||||||||||
| <Text color={theme.text.link}>MCP Server: {mcpProps.serverName}</Text> | ||||||||||||||
| <Text color={theme.text.link}>Tool: {mcpProps.toolName}</Text> | ||||||||||||||
| {isExpanded && ( | ||||||||||||||
| <Text color={theme.text.link}> | ||||||||||||||
| Arguments: {JSON.stringify(mcpProps.args, null, 2)} | ||||||||||||||
| </Text> | ||||||||||||||
| )} | ||||||||||||||
| <Text color={theme.text.secondary}> | ||||||||||||||
| (Press CTRL+s to {isExpanded ? 'collapse' : 'expand'} arguments) | ||||||||||||||
| </Text> | ||||||||||||||
| </Box> | ||||||||||||||
| ); | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To improve consistency and maintainability, it's better to use the centralized
keyMatchersfor keybinding checks instead of hardcoding the key combination. This ensures that if the keybinding forTOGGLE_TOOL_CALL_ARGUMENTS_EXPANSIONis ever changed inkeyBindings.ts, it will be automatically reflected here. This also makes the purpose of defining the newCommandand its keybinding clearer.You'll also need to add
import { keyMatchers, Command } from '../../keyMatchers.js';at the top of the file.