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:
@@ -49,38 +49,34 @@ class _ToolStatusItemState extends State<ToolStatusItem> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final tokens = ClideTheme.of(context).surface;
|
final tokens = ClideTheme.of(context).surface;
|
||||||
if (!_checked) return const SizedBox.shrink();
|
if (!_checked) return const SizedBox.shrink();
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
|
if (_ptycOk && _pqlOk) {
|
||||||
child: Row(
|
return _chip('ok', tokens.statusSuccess, tokens);
|
||||||
mainAxisSize: MainAxisSize.min,
|
}
|
||||||
children: [
|
|
||||||
_Indicator(label: 'ptyc', ok: _ptycOk, tokens: tokens),
|
return Row(
|
||||||
const SizedBox(width: 10),
|
mainAxisSize: MainAxisSize.min,
|
||||||
_Indicator(label: 'pql', ok: _pqlOk, tokens: tokens),
|
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 {
|
Widget _chip(String label, Color color, SurfaceTokens tokens) {
|
||||||
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;
|
|
||||||
return Semantics(
|
return Semantics(
|
||||||
label: '$label ${ok ? "available" : "not found"}',
|
label: label,
|
||||||
child: Row(
|
child: Padding(
|
||||||
mainAxisSize: MainAxisSize.min,
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
|
||||||
children: [
|
child: Row(
|
||||||
ClideIcon(PhosphorIcons.circlesFour, size: 10, color: color),
|
mainAxisSize: MainAxisSize.min,
|
||||||
const SizedBox(width: 4),
|
children: [
|
||||||
ClideText(label, fontSize: clideFontCaption, color: color, fontFamily: clideMonoFamily),
|
Container(width: 7, height: 7, decoration: BoxDecoration(color: color, shape: BoxShape.circle)),
|
||||||
],
|
const SizedBox(width: 6),
|
||||||
|
ClideText(label, fontSize: clideFontCaption, color: color),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user