0791a4702d
The Artifacts badge counted every recorded turn document (input, memory, output, session.html) while the tab lists only deliverables, so a run whose visits recorded only debugging files (the Caplens ticket runs) badged dozens of artifacts and opened to an empty tab. The badge and the header now count deliverables only; the tab stays reachable when only debugging files exist and ends with a collapsed 'Show debugging files' entry naming their count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
1.3 KiB
Dart
44 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../../ui/text/plural.dart';
|
|
|
|
/// The gallery's secondary, collapsed entry for a run's debugging files.
|
|
///
|
|
/// It follows the deliverables (or stands alone when there are none), so a
|
|
/// run that recorded only runner-internal files says how many there are and
|
|
/// opens them in place instead of leaving the page apparently empty.
|
|
class ArtifactDebugReveal extends StatelessWidget {
|
|
const ArtifactDebugReveal({
|
|
super.key,
|
|
required this.count,
|
|
required this.showing,
|
|
required this.onToggle,
|
|
});
|
|
|
|
/// The recorded debugging files the section holds.
|
|
final int count;
|
|
|
|
/// Whether the debugging files are currently listed.
|
|
final bool showing;
|
|
|
|
final VoidCallback onToggle;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Material(
|
|
type: MaterialType.transparency,
|
|
child: ListTile(
|
|
key: const Key('artifact-debug-reveal'),
|
|
leading: Icon(showing ? Icons.bug_report : Icons.bug_report_outlined),
|
|
title: Text(showing ? 'Hide debugging files' : 'Show debugging files'),
|
|
subtitle: Text(
|
|
'${countLabel(count, 'file')}: turn documents, history and '
|
|
'private scratch',
|
|
),
|
|
trailing: Icon(showing ? Icons.expand_less : Icons.expand_more),
|
|
onTap: onToggle,
|
|
),
|
|
);
|
|
}
|
|
}
|