Chat: Ctrl+K / Alt+K on Chat opens a quick switcher for the open chats
On Chat the chord now toggles a centred dialog (bottom sheet on a phone) with an autofocused filter over the open chats in list order; Ctrl+N/Down and Ctrl+P/Up move the wrapping selection, Enter opens the chat as Ctrl+Tab does (pane reused, composer focused), Esc or the chord closes it. From other destinations the chord still jumps to Chat. Ctrl+N/Ctrl+P are handled so the web page prevents their defaults (Ctrl+P no longer prints); a browser tab keeps Ctrl+N reserved, documented in the help and notes/chat-quick-switch.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -32,6 +32,7 @@ class AdaptiveShell extends StatefulWidget {
|
||||
this.onDestinationReselected,
|
||||
this.onSearch,
|
||||
this.onOpenChat,
|
||||
this.onChatQuickSwitch,
|
||||
this.attentionCount = 0,
|
||||
this.runningRunCount,
|
||||
this.listPaneWidthStore = const SharedPreferencesListPaneWidthStore(),
|
||||
@@ -71,6 +72,11 @@ class AdaptiveShell extends StatefulWidget {
|
||||
/// was already shown), so the open chat's composer can take the keyboard.
|
||||
final VoidCallback? onOpenChat;
|
||||
|
||||
/// Runs instead of [onOpenChat] when Ctrl+K or Alt+K is pressed while Chat
|
||||
/// is already shown: the host toggles its chat quick switcher. Null keeps
|
||||
/// the composer focus of [onOpenChat] there too.
|
||||
final VoidCallback? onChatQuickSwitch;
|
||||
|
||||
/// Runs needing the operator today, retained in the tab's accessible label.
|
||||
final int attentionCount;
|
||||
|
||||
@@ -459,8 +465,14 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
||||
}
|
||||
|
||||
/// Shows Chat (the tab's own selection, so its open chat returns) and then
|
||||
/// lets the app focus that chat's composer.
|
||||
/// lets the app focus that chat's composer. On Chat already, the chord
|
||||
/// toggles the host's chat quick switcher instead.
|
||||
void _openChat() {
|
||||
final quickSwitch = widget.onChatQuickSwitch;
|
||||
if (_selected == AppDestination.chat && quickSwitch != null) {
|
||||
quickSwitch();
|
||||
return;
|
||||
}
|
||||
if (_selected != AppDestination.chat) _select(AppDestination.chat);
|
||||
widget.onOpenChat?.call();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user