App: chat colours, Ctrl+1-9 opens the Nth list item, starred chats alphabetical
A chat's colour is picked from its row menu (Colour...), a long-press or the chat information sheet. The list shows it as a leading bar, a faint row tint and a coloured avatar; the open chat shows a faint wash under its top bar. Shades are Cupertino's dynamic system colours and Material swatches tuned per brightness. Changes from other devices apply live. Ctrl+1...Ctrl+9 open the Nth item of the open tab's list (chats, runs, pipelines) in on-screen order, also while typing. Starred chats are sorted by name, case-insensitively, as one alphabetical group.
This commit is contained in:
@@ -12,6 +12,7 @@ import '../../attention/runtime/attention_store.dart';
|
||||
import '../../attention/ui/needs_you_runs_heading.dart';
|
||||
import '../domain/run_models.dart';
|
||||
import '../../../shell/shell_bar.dart';
|
||||
import '../../../shell/shell_list_shortcuts.dart';
|
||||
import 'run_list_row.dart';
|
||||
import 'runs_controller.dart';
|
||||
import 'runs_filter_options.dart';
|
||||
@@ -79,7 +80,7 @@ class RunsList extends StatelessWidget {
|
||||
title: bar.title,
|
||||
subtitle: bar.subtitle,
|
||||
actions: bar.actions,
|
||||
child: _list(context),
|
||||
child: _shortcutList(context),
|
||||
);
|
||||
}
|
||||
final actions = [
|
||||
@@ -110,11 +111,26 @@ class RunsList extends StatelessWidget {
|
||||
child: ShellBadge(
|
||||
kind: ShellBadgeKind.running,
|
||||
count: controller.runs.where((run) => run['executing'] == true).length,
|
||||
child: _list(context),
|
||||
child: _shortcutList(context),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// The list under the shell's Ctrl+1…Ctrl+9, which open the Nth run shown
|
||||
/// (filtered and sorted as on screen). Select mode keeps keys for itself.
|
||||
Widget _shortcutList(BuildContext context) => ShellListShortcut(
|
||||
onOpenIndex: (index) {
|
||||
if (controller.selection.active) return false;
|
||||
final runs = controller.visibleRuns;
|
||||
if (index >= runs.length) return false;
|
||||
final id = runs[index]['id'];
|
||||
if (id is! num) return false;
|
||||
onSelected(id);
|
||||
return true;
|
||||
},
|
||||
child: _list(context),
|
||||
);
|
||||
|
||||
Widget _ownBar(BuildContext context, List<Widget> bar) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user