ui: one row height and one trailing line in the sidebar, and a dsh-Go activity cap

- The project header is a ListTile now, like a session row: both are 72 high
  (title + subtitle). A Material 3 list tile ends at 24, so the band's 8px
  inset gets 16 more, putting the project + and the session ⋮ on one line
  (a widget test asserts both the heights and the x centres).
- The running status is a full-width stadium like dsh-Go's activity strip:
  title and current-step summary on the left, a tabular m:ss clock on the
  right, translucent surface, 36 minimum height. The spinner inside is gone;
  the cap's top edge is where the future input-box pet will perch.
- 0.3.20 (320).
This commit is contained in:
blumia committed 2026-11-22 12:32:59 +08:00
1 parent 6ced914757
commit 73af9d851b
6 files changed
+200 -132

No files matched your search

+55 -40
View File
@@ -1380,57 +1380,72 @@ class _ChatScreenState extends State<ChatScreen> {
if (start <= 0) return '';
final secs =
((DateTime.now().millisecondsSinceEpoch - start) / 1000).round();
if (secs <= 0) return '';
if (secs < 60) return '$secs 秒';
if (secs <= 0) return '0:00';
return '${secs ~/ 60}:${(secs % 60).toString().padLeft(2, '0')}';
}
/// dsh-Go's activity strip: the current step and its clock, above the input.
/// dsh-Go's activity cap: a stadium above the input with the current step
/// on the left and its clock on the right. Its top edge is where the
/// input-box pet will later perch.
Widget _activityStrip() {
final theme = Theme.of(context);
final scheme = theme.colorScheme;
final act = _activity();
final elapsed = _elapsedSince(_runningStart());
return Padding(
padding: const EdgeInsets.fromLTRB(14, 2, 14, 2),
child: Row(
children: [
SizedBox(
width: 13,
height: 13,
child: CircularProgressIndicator(
strokeWidth: 1.7,
color: scheme.primary,
),
),
const SizedBox(width: 8),
Expanded(
child: Text.rich(
TextSpan(children: [
TextSpan(
text: act.title,
style: TextStyle(
fontSize: 12.5,
fontWeight: FontWeight.w600,
color: scheme.onSurface,
// The same 8px side margin as the composer, so the two capsules agree.
padding: const EdgeInsets.fromLTRB(8, 4, 8, 4),
child: Container(
constraints: const BoxConstraints(minHeight: 36),
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 6),
decoration: ShapeDecoration(
color: scheme.surfaceContainerHighest.withValues(alpha: 0.7),
shape: const StadiumBorder(),
),
child: Row(
children: [
Expanded(
child: Row(
children: [
Text(
act.title,
style: theme.textTheme.labelMedium?.copyWith(
fontSize: 13,
fontWeight: FontWeight.w600,
color: scheme.onSurface,
),
),
if (act.detail.isNotEmpty) ...[
const SizedBox(width: 6),
Flexible(
child: Text(
act.detail,
maxLines: 1,
softWrap: false,
overflow: TextOverflow.ellipsis,
style: theme.textTheme.bodySmall?.copyWith(
fontSize: 12,
color: scheme.onSurfaceVariant,
),
),
),
],
],
),
),
if (elapsed.isNotEmpty) ...[
const SizedBox(width: 8),
Text(
elapsed,
style: TextStyle(
fontSize: 12,
color: theme.hintColor,
fontFeatures: const [FontFeature.tabularFigures()],
),
if (act.detail.isNotEmpty)
TextSpan(
text: ' · ${act.detail}',
style: TextStyle(fontSize: 12, color: theme.hintColor),
),
if (elapsed.isNotEmpty)
TextSpan(
text: ' · $elapsed',
style: TextStyle(fontSize: 12, color: theme.hintColor),
),
]),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
],
),
],
],
),
),
);
}