Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes the Ctrl+W / Cmd+W keybinding in the Agent Sessions window so that it "closes" the current session (i.e., navigates to the new-session view) instead of triggering the "new session" action that was previously bound to it. It introduces a dedicated agentSession.close command that calls openNewSessionView() and binds Ctrl+W / Cmd+W to that command.
Changes:
- Introduces a new
CLOSE_SESSION_COMMAND_ID(agentSession.close) command with title "Close Session". - Registers the new action via
registerAction2with the appropriate precondition. - Rebinds Ctrl+W / Cmd+W to the new
CLOSE_SESSION_COMMAND_IDinstead ofACTION_ID_NEW_CHAT.
| }); | ||
|
|
||
| const CLOSE_SESSION_COMMAND_ID = 'agentSession.close'; | ||
| registerAction2(class RefreshAgentSessionsViewerAction extends Action2 { |
There was a problem hiding this comment.
The new action class is named RefreshAgentSessionsViewerAction, which is already used for the "Refresh Sessions" action at line 364. Two classes registered with registerAction2 have the same name in the same file, which is confusing and makes debugging and stack traces harder. The class should be renamed to something that reflects what it does, such as CloseSessionAction.
| registerAction2(class RefreshAgentSessionsViewerAction extends Action2 { | |
| registerAction2(class CloseSessionAction extends Action2 { |
| } | ||
| }); | ||
|
|
||
| // Register Cmd+W / Ctrl+W to open new session when the current session is non-empty, |
There was a problem hiding this comment.
The comment on line 345 still reads "to open new session when the current session is non-empty", which describes the old behavior. Now that the keybinding is bound to CLOSE_SESSION_COMMAND_ID, the comment should be updated to accurately describe the new behavior (navigating away from / closing the current session to the new-session view).
| // Register Cmd+W / Ctrl+W to open new session when the current session is non-empty, | |
| // Register Cmd+W / Ctrl+W to close the current session and navigate to the new-session view, |
lramos15
left a comment
There was a problem hiding this comment.
The copilot suggestion about the incorrect name is a good one, so just requesting changes until that's addressed so it doesn't auto merge
Copilot Generated Description:Update the Ctrl+W keybinding to close the current session instead of opening a new one.