Chat quick switcher MRU, Closed section and markers; Alt+N, Alt+J and run tab keys
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>
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
// them, and keeps colours picked with chat_color;
|
||||
// `?activity=1` (with `?chats=N`) lists a running chat, one with
|
||||
// background tasks and idle ones;
|
||||
// `?closed=N` (with `?chats=N`) closes the last N chats (chat_reopen
|
||||
// reopens one);
|
||||
// `?automations=N` reports N native automations for the selected chat;
|
||||
// `?msgs=`, `?rich=1`, `?older=1`, `?live=N` vary the chat transcripts for
|
||||
// scroll captures (tool/perf/chat_scroll_fixture.dart).
|
||||
@@ -91,8 +93,22 @@ const _colorNames = ['teal', 'purple', null, 'amber', 'red', null, 'blue'];
|
||||
final Map<String, String?> _pickedColors = {};
|
||||
final _chatCatalog = ChatCatalogFixture();
|
||||
|
||||
/// `?closed=N` (with `?chats=N`): the last N chats are closed until
|
||||
/// chat_reopen reopens one.
|
||||
int get _closedCount => int.tryParse(_params['closed'] ?? '') ?? 0;
|
||||
final Set<String> _reopened = {};
|
||||
|
||||
JsonMap _chatRow(int i) {
|
||||
final id = perfChatId(i);
|
||||
final closed = i >= _chats - _closedCount && !_reopened.contains(id);
|
||||
return {
|
||||
..._openChatRow(i, id),
|
||||
if (closed)
|
||||
'closed_at': DateTime.now().millisecondsSinceEpoch - (i + 1) * 60000,
|
||||
};
|
||||
}
|
||||
|
||||
JsonMap _openChatRow(int i, String id) {
|
||||
if (!_colors) {
|
||||
return {
|
||||
'id': id,
|
||||
@@ -305,6 +321,10 @@ JsonMap? perfChatReply(JsonMap request) {
|
||||
'type': 'chat_sessions',
|
||||
'chat_sessions': [for (var i = 0; i < _chats; i++) _chatRow(i)],
|
||||
};
|
||||
case 'chat_reopen':
|
||||
final query = request['chat_query'];
|
||||
_reopened.add(query is Map ? '${query['session_id'] ?? ''}' : '');
|
||||
return {'id': id, 'type': 'chat_reopen'};
|
||||
case 'chat_color':
|
||||
final query = request['chat_query'];
|
||||
final session = query is Map ? '${query['session_id'] ?? ''}' : '';
|
||||
|
||||
Reference in New Issue
Block a user