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:
2026-11-03 11:05:38 +00:00
parent a4c191a416
commit f7b5958d64
28 changed files with 1319 additions and 42 deletions
+34 -3
View File
@@ -16,6 +16,11 @@ const double _avatarGap = 12;
/// Keys on a row's highlight surface and inset divider, for tests.
const appListRowSurfaceKey = ValueKey<String>('app-list-row-surface');
const appListRowDividerKey = ValueKey<String>('app-list-row-divider');
const appListRowAccentKey = ValueKey<String>('app-list-row-accent');
bool _darkSurface(BuildContext context, bool cupertino) => cupertino
? CupertinoTheme.brightnessOf(context) == Brightness.dark
: Theme.of(context).brightness == Brightness.dark;
/// The app's one list row (runs, pipelines, chats, search results,
/// schedules), on both hosts.
@@ -55,8 +60,14 @@ class AppListRow extends StatelessWidget {
this.keepMenuWhenCompact = false,
this.compactWidth = kAppListRowCompactWidth,
this.cupertino,
this.accent,
});
/// The item's own colour (a chat's highlight): a bar on the row's leading
/// edge and a faint tint under an unselected row. The selected fill still
/// marks the open row, so the two never read as one another.
final Color? accent;
final Widget title;
final Widget? leading;
final String? time;
@@ -143,19 +154,23 @@ class AppListRow extends StatelessWidget {
],
),
);
final surface = cupertino
final tint = accent?.withValues(
alpha: _darkSurface(context, cupertino) ? 0.12 : 0.07,
);
Widget surface = cupertino
? _CupertinoRowSurface(
tapKey: tapKey,
onTap: onTap,
onLongPress: onLongPress,
selected: selected,
tint: tint,
child: content,
)
: Material(
key: appListRowSurfaceKey,
color: selected
? selectedColor(context, cupertino: false)
: Colors.transparent,
: tint ?? Colors.transparent,
child: InkWell(
key: tapKey,
onTap: onTap,
@@ -163,6 +178,18 @@ class AppListRow extends StatelessWidget {
child: content,
),
);
if (accent case final accent?) {
surface = DecoratedBox(
key: appListRowAccentKey,
position: DecorationPosition.foreground,
decoration: BoxDecoration(
border: BorderDirectional(
start: BorderSide(color: accent, width: 4),
),
),
child: surface,
);
}
if (!divider) return surface;
// The divider stays under the text column; a checkbox's width is
// not known here, so a selectable row's divider starts at the inset.
@@ -324,9 +351,13 @@ class _CupertinoRowSurface extends StatefulWidget {
required this.onTap,
required this.selected,
this.onLongPress,
this.tint,
required this.child,
});
/// The unselected row's tint, transparent when null.
final Color? tint;
final Key? tapKey;
final VoidCallback? onTap;
final VoidCallback? onLongPress;
@@ -350,7 +381,7 @@ class _CupertinoRowSurfaceState extends State<_CupertinoRowSurface> {
? CupertinoColors.systemGrey4.resolveFrom(context)
: widget.selected
? AppListRow.selectedColor(context, cupertino: true)
: const Color(0x00000000);
: widget.tint ?? const Color(0x00000000);
final enabled = widget.onTap != null;
return GestureDetector(
key: widget.tapKey,
@@ -22,11 +22,15 @@ class SliverCollapsibleListSection extends StatefulWidget {
this.itemKey,
this.count,
this.initiallyOpen = true,
this.onOpenChanged,
});
final String title;
final int? count;
final bool initiallyOpen;
/// Reports the operator opening or folding the section.
final ValueChanged<bool>? onOpenChanged;
final int itemCount;
final IndexedWidgetBuilder itemBuilder;
@@ -131,5 +135,8 @@ class _SliverCollapsibleListSectionState
);
}
void _toggle() => setState(() => _open = !_open);
void _toggle() {
setState(() => _open = !_open);
widget.onOpenChanged?.call(_open);
}
}