Files
clide/lib/builtin/claude/src/meta_sidebar/icon_button.dart
T
jpmschweitzerandClaude Fable 5 31df537770 split claude_meta_sidebar.dart into meta_sidebar/ (T-395)
The 1192-LOC sidebar monolith now keeps only its lifecycle — stats
polling, team membership streams, primary-session binding, broker
subscription, inject + accordion state — and switches between
stateless, props-driven tab views under meta_sidebar/:

- models.dart — SidebarTab/ConfigSection/ConfigPermKind enums, the
  MetaSection/MetaRow models, and the shared table geometry both
  Activity and Config render on
- activity_tab.dart / team_tab.dart / config_tab.dart — the three
  bodies; accordion expansion stays in the parent (survives tab
  switches) and arrives as prop + callback
- roster_row.dart, permission_badge.dart, task_row.dart,
  tab_strip.dart, icon_button.dart, inject_field.dart — the widgets

Public API unchanged: ClaudeMetaSidebar stays put and SidebarTab is
re-exported from the root file, so all 44 sidebar tests (and
extension.dart) pass without a single edit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 02:38:57 +02:00

38 lines
1.2 KiB
Dart

/// A single icon-button used by the roster row controls + task rows.
/// Split out of claude_meta_sidebar.dart (T-395). Promote to
/// lib/widgets/ only when a second consumer appears.
library;
import 'package:clide/kernel/kernel.dart';
import 'package:clide/widgets/widgets.dart';
import 'package:flutter/widgets.dart';
class MetaIconButton extends StatelessWidget {
const MetaIconButton({super.key, required this.painter, required this.tooltip, required this.color, required this.onTap});
final ClideIconPainter painter;
final String tooltip;
final Color color;
final VoidCallback onTap;
@override
Widget build(BuildContext context) {
// Icon-only button: expose the tooltip text as the Semantics button label
// so AT (and widget tests) can find and activate it by name.
return Semantics(
button: true,
label: tooltip,
excludeSemantics: true,
onTap: onTap,
child: ClideTappable(
tooltip: tooltip,
onTap: onTap,
builder: (ctx, hovered, _) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 3, vertical: 2),
child: ClideIcon(painter, size: 12, color: hovered ? ClideTheme.of(ctx).surface.globalForeground : color),
),
),
);
}
}