collapse tool status to single "ok" when both tools found

Shows "● ok" in green when both ptyc and pql are available.
When either is missing, shows each broken tool by name in amber
("● ptyc not found", "● pql not found"). Font matches the git
branch widget — uses inherited UI face at clideFontCaption size,
no mono override. Dot indicator replaces the Phosphor icon.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-23 07:43:10 +02:00
co-authored by Claude Opus 4.6
parent 80daa76623
commit 76029a02a0
+24 -28
View File
@@ -49,38 +49,34 @@ class _ToolStatusItemState extends State<ToolStatusItem> {
Widget build(BuildContext context) {
final tokens = ClideTheme.of(context).surface;
if (!_checked) return const SizedBox.shrink();
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
_Indicator(label: 'ptyc', ok: _ptycOk, tokens: tokens),
const SizedBox(width: 10),
_Indicator(label: 'pql', ok: _pqlOk, tokens: tokens),
],
),
if (_ptycOk && _pqlOk) {
return _chip('ok', tokens.statusSuccess, tokens);
}
return Row(
mainAxisSize: MainAxisSize.min,
children: [
if (!_ptycOk) _chip('ptyc not found', tokens.statusWarning, tokens),
if (!_ptycOk && !_pqlOk) const SizedBox(width: 10),
if (!_pqlOk) _chip('pql not found', tokens.statusWarning, tokens),
],
);
}
}
class _Indicator extends StatelessWidget {
const _Indicator({required this.label, required this.ok, required this.tokens});
final String label;
final bool ok;
final SurfaceTokens tokens;
@override
Widget build(BuildContext context) {
final color = ok ? tokens.statusSuccess : tokens.statusWarning;
Widget _chip(String label, Color color, SurfaceTokens tokens) {
return Semantics(
label: '$label ${ok ? "available" : "not found"}',
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
ClideIcon(PhosphorIcons.circlesFour, size: 10, color: color),
const SizedBox(width: 4),
ClideText(label, fontSize: clideFontCaption, color: color, fontFamily: clideMonoFamily),
],
label: label,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(width: 7, height: 7, decoration: BoxDecoration(color: color, shape: BoxShape.circle)),
const SizedBox(width: 6),
ClideText(label, fontSize: clideFontCaption, color: color),
],
),
),
);
}