12c7642e35
Ctrl+K lists open chats most recently used first (tracked on open and pane focus, persisted per server) and preselects the previous chat, so Ctrl+K, Enter returns to it. Rows mark needs you / working / unread; a query also lists matching closed chats under Closed, and choosing one reopens it. Alt+N (Option+N) starts a new chat and Alt+J (Option+J) opens the next chat waiting for you, unread or failed, cycling; the terminal keeps both. In run detail, bare 1-4 switch tabs when not typing. Cheatsheet entries added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
55 lines
1.7 KiB
Dart
55 lines
1.7 KiB
Dart
part of 'screen.dart';
|
|
|
|
/// The Chat destination's app-wide chat shortcuts, run through
|
|
/// [ChatRuntime.newChat] and [ChatRuntime.nextAttention] (the shell shows
|
|
/// Chat first): Alt+N starts a new chat with the list's own create dialog,
|
|
/// and Alt+J opens the next chat needing the operator (waiting for an answer,
|
|
/// unread, or a failed action), cycling in list order. Neither acts while a
|
|
/// popup or dialog over the chat keeps the keyboard.
|
|
mixin _ChatScreenAttention on State<ChatScreen>, _ChatScreenWorkspace {
|
|
ChatRuntime get _runtime;
|
|
|
|
void _bindAttention() {
|
|
_runtime.newChat.attach(_startNewChat);
|
|
_runtime.nextAttention.attach(_openNextAttention);
|
|
}
|
|
|
|
void _unbindAttention() {
|
|
_runtime.newChat.detach(_startNewChat);
|
|
_runtime.nextAttention.detach(_openNextAttention);
|
|
}
|
|
|
|
void _startNewChat() {
|
|
if (!mounted || !_chatOwnsKeyboard()) return;
|
|
final state = _sessionsKey.currentState;
|
|
if (state != null) unawaited(state.newChat());
|
|
}
|
|
|
|
void _openNextAttention() {
|
|
if (!mounted || !_chatOwnsKeyboard()) return;
|
|
final sessions = _runtime.sessions;
|
|
final current = _workspaceVisible ? _workspace.activePane?.sessionId : null;
|
|
final next = chatNextNeedingAttention(
|
|
sessions.sessions,
|
|
current,
|
|
(row) => chatNeedsAttention(
|
|
row,
|
|
unread: sessions.isUnseen(row),
|
|
failed: sessions.errorFor('${row['id'] ?? ''}') != null,
|
|
),
|
|
);
|
|
if (next != null) {
|
|
_openByShortcut(next);
|
|
return;
|
|
}
|
|
ScaffoldMessenger.maybeOf(context)
|
|
?..hideCurrentSnackBar()
|
|
..showSnackBar(
|
|
const SnackBar(
|
|
key: Key('chat-no-attention'),
|
|
content: Text('No other chat needs you.'),
|
|
),
|
|
);
|
|
}
|
|
}
|