wire the output dock into the layout — toggle, tabs, persistence (T-54)
The D-87 bottom dock, end to end. New Slots.dock in the classic preset (hidden by default); RootLayout renders it full-width above the status bar when open, capped at half the window so Claude stays largest (the D-47 amendment). LogRing now lives on KernelServices (boot tees the kernel logger into it; main.dart also tees the IPC/MCP logger), so the dock shows logs from every subsystem. OutputExtension contributes the Output tab, the merged health/toggle status-bar widget (green check when clean, warn/error counts otherwise) that replaces the old ipc-status item, and the dock.toggle command (Ctrl+J). Problems moves out of the sidebar into the dock. open/height persist per workspace via the default-layout extension. Drag-resize of the dock height is deferred (DragResizeHandle needs a dock sign case); height is the persisted default for now. Boot verified via testmode; full suite green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
/// T-54: the merged health + dock-toggle status-bar widget (D-87).
|
||||
library;
|
||||
|
||||
import 'package:clide/builtin/default_layout/default_layout.dart';
|
||||
import 'package:clide/builtin/output/output.dart';
|
||||
import 'package:clide/kernel/kernel.dart';
|
||||
import 'package:clide/widgets/widgets.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import '../../helpers/kernel_fixture.dart';
|
||||
import '../../helpers/widget_harness.dart';
|
||||
|
||||
bool _textIs(Object? w, String s) => w is ClideText && w.data == s;
|
||||
|
||||
void main() {
|
||||
late KernelFixture f;
|
||||
|
||||
setUp(() async {
|
||||
f = await KernelFixture.create();
|
||||
f.services.extensions.register(DefaultLayoutExtension());
|
||||
await f.services.extensions.activate('builtin.default-layout');
|
||||
});
|
||||
tearDown(() => f.dispose());
|
||||
|
||||
testWidgets('reads clean (green ✓), then shows the error count', (tester) async {
|
||||
await tester.pumpWidget(harness(f, const DockStatusItem()));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byWidgetPredicate((w) => _textIs(w, '✓')), findsOneWidget);
|
||||
|
||||
f.services.logRing.add(LogRecord(level: LogLevel.error, source: 'x', message: 'boom', timestamp: DateTime.utc(2026)));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byWidgetPredicate((w) => _textIs(w, '✕ 1')), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('shows a warn count when there are warnings but no errors', (tester) async {
|
||||
f.services.logRing.add(LogRecord(level: LogLevel.warn, source: 'x', message: 'w', timestamp: DateTime.utc(2026)));
|
||||
await tester.pumpWidget(harness(f, const DockStatusItem()));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byWidgetPredicate((w) => _textIs(w, '⚠ 1')), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('tapping toggles the dock open', (tester) async {
|
||||
await tester.pumpWidget(harness(f, const DockStatusItem()));
|
||||
await tester.pumpAndSettle();
|
||||
expect(f.services.arrangement.isVisible(Slots.dock), isFalse);
|
||||
await tester.tap(find.byType(DockStatusItem));
|
||||
await tester.pumpAndSettle();
|
||||
expect(f.services.arrangement.isVisible(Slots.dock), isTrue);
|
||||
expect(find.byWidgetPredicate((w) => _textIs(w, '▼ Output ')), findsOneWidget);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/// T-54: OutputExtension wires the dock tab, the status toggle, and the
|
||||
/// dock.toggle command (D-87).
|
||||
library;
|
||||
|
||||
import 'package:clide/builtin/default_layout/default_layout.dart';
|
||||
import 'package:clide/builtin/output/output.dart';
|
||||
import 'package:clide/extension/extension.dart';
|
||||
import 'package:clide/kernel/kernel.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import '../../helpers/kernel_fixture.dart';
|
||||
|
||||
void main() {
|
||||
late KernelFixture f;
|
||||
|
||||
setUp(() async {
|
||||
f = await KernelFixture.create();
|
||||
f.services.extensions
|
||||
..register(DefaultLayoutExtension())
|
||||
..register(OutputExtension());
|
||||
await f.services.extensions.activate('builtin.default-layout');
|
||||
await f.services.extensions.activate('builtin.output');
|
||||
});
|
||||
tearDown(() => f.dispose());
|
||||
|
||||
test('contributes the Output dock tab, a status item, and dock.toggle', () {
|
||||
final ext = OutputExtension();
|
||||
final tabs = ext.contributions.whereType<TabContribution>();
|
||||
expect(tabs.any((t) => t.id == 'output.panel' && t.slot == Slots.dock), isTrue);
|
||||
expect(ext.contributions.whereType<StatusItemContribution>(), isNotEmpty);
|
||||
expect(f.services.commands.get('dock.toggle'), isNotNull);
|
||||
});
|
||||
|
||||
test('dock.toggle opens the dock + activates Output, then closes it', () async {
|
||||
expect(f.services.arrangement.isVisible(Slots.dock), isFalse);
|
||||
await f.services.commands.execute('dock.toggle');
|
||||
expect(f.services.arrangement.isVisible(Slots.dock), isTrue);
|
||||
expect(f.services.panels.activeTabIn(Slots.dock), 'output.panel');
|
||||
await f.services.commands.execute('dock.toggle');
|
||||
expect(f.services.arrangement.isVisible(Slots.dock), isFalse);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user