fix: centre the context ring, show a live status while running, and settle project rows

- The folded composer aligns to its bottom edge, so the 16px usage ring sat
  below the 36px keys; a 10px bottom padding puts it on their centre line (the
  two-row layout was already centred).
- A running turn no longer shows the finished turn's footer (model · mode ·
  time, with its copy/fork menu). Above the input there is now an activity
  strip like dsh-Go's: "思考中 / 正在回复 / 正在读取 · …" with the current
  step's summary and a clock that ticks each second.
- Project headers in the sidebar are tinted bands at least a session row tall,
  with a folder icon, a bolder name and the path beneath, so the project and
  its sessions read as different levels.
- Project names take the last path segment with either separator, and path
  comparisons unify `\`/`/` (case-insensitively for drive-letter paths); the
  grouping key does too, so a Windows server no longer shows a full path or
  splits one project in two.
- 0.3.19 (319).
This commit is contained in:
blumia committed 2026-11-22 11:59:33 +08:00
1 parent d9d5424318
commit 6ced914757
9 files changed
+272 -56

No files matched your search

+69 -42
View File
@@ -257,17 +257,20 @@ class _SessionListPaneState extends State<SessionListPane> {
List<_SessionGroup> _groups(List<Session> sessions) {
final map = <String, List<Session>>{};
for (final session in sessions) {
// Group on a separator-normalised key so a Windows server's mix of
// `\` and `/` does not split one project into two.
final key = _isChatDirectory(session.directory)
? '\u0000chats'
: session.directory;
: slashPath(session.directory);
map.putIfAbsent(key, () => []).add(session);
}
final groups = [
for (final entry in map.entries)
_SessionGroup(
key: entry.key,
label: _groupLabel(entry.key),
path: entry.key == '\u0000chats' ? '' : entry.key,
label: _groupLabel(entry.value.first.directory),
// The first session's own path: the server knows that spelling.
path: entry.key == '\u0000chats' ? '' : entry.value.first.directory,
sessions: entry.value
..sort((a, b) => b.updated.compareTo(a.updated)),
),
@@ -294,50 +297,74 @@ class _SessionListPaneState extends State<SessionListPane> {
Widget _groupHeader(_SessionGroup group, {required bool collapsed}) {
final theme = Theme.of(context);
return InkWell(
onTap: () => setState(() {
if (collapsed) {
_collapsed.remove(group.key);
} else {
_collapsed.add(group.key);
}
}),
child: Padding(
padding: const EdgeInsets.fromLTRB(14, 10, 4, 4),
child: Row(
children: [
Icon(collapsed ? Icons.chevron_right : Icons.expand_more,
size: 16, color: theme.hintColor),
const SizedBox(width: 2),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
final scheme = theme.colorScheme;
final radius = BorderRadius.circular(10);
// A tinted band, at least a session row's height: a project reads as a
// section, not as another row.
return Padding(
padding: const EdgeInsets.fromLTRB(8, 10, 8, 2),
child: Material(
color: scheme.surfaceContainerHighest.withValues(alpha: 0.5),
borderRadius: radius,
clipBehavior: Clip.antiAlias,
child: InkWell(
onTap: () => setState(() {
if (collapsed) {
_collapsed.remove(group.key);
} else {
_collapsed.add(group.key);
}
}),
child: ConstrainedBox(
constraints: const BoxConstraints(minHeight: 56),
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 10, 4, 10),
child: Row(
children: [
Text(
group.label.isEmpty ? '未命名项目' : group.label,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 12.5, fontWeight: FontWeight.w700),
),
if (group.path.isNotEmpty)
Text(
group.path,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style:
TextStyle(fontSize: 10.5, color: theme.hintColor),
Icon(collapsed ? Icons.chevron_right : Icons.expand_more,
size: 18, color: scheme.onSurfaceVariant),
const SizedBox(width: 6),
Icon(Icons.folder_outlined,
size: 16, color: scheme.primary),
const SizedBox(width: 6),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
group.label.isEmpty ? '未命名项目' : group.label,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 13.5,
fontWeight: FontWeight.w700,
color: scheme.onSurface),
),
if (group.path.isNotEmpty)
Padding(
padding: const EdgeInsets.only(top: 2),
child: Text(
group.path,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 11, color: theme.hintColor),
),
),
],
),
),
IconButton(
icon: const Icon(Icons.add, size: 18),
tooltip: '在此项目新会话',
visualDensity: VisualDensity.compact,
onPressed: () => _newSession(directory: group.path),
),
],
),
),
IconButton(
icon: const Icon(Icons.add, size: 18),
tooltip: '在此项目新会话',
visualDensity: VisualDensity.compact,
onPressed: () => _newSession(directory: group.path),
),
],
),
),
),
);