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,63 @@
|
||||
/// The output-dock builtin (T-54 / D-87): contributes the Output tab + the
|
||||
/// merged health/toggle status-bar widget, and the `dock.toggle` command.
|
||||
library;
|
||||
|
||||
import 'package:clide/builtin/output/src/dock_status_item.dart';
|
||||
import 'package:clide/builtin/output/src/output_view.dart';
|
||||
import 'package:clide/clide.dart';
|
||||
import 'package:clide/extension/extension.dart';
|
||||
import 'package:clide/kernel/kernel.dart';
|
||||
|
||||
class OutputExtension extends ClideExtension {
|
||||
ClideExtensionContext? _ctx;
|
||||
|
||||
@override
|
||||
String get id => 'builtin.output';
|
||||
@override
|
||||
String get title => 'Output';
|
||||
@override
|
||||
String get version => '0.1.0';
|
||||
|
||||
/// The dock slot is registered by the default-layout preset; depend on it so
|
||||
/// the slot exists before this tab contributes.
|
||||
@override
|
||||
List<String> get dependsOn => const ['builtin.default-layout'];
|
||||
|
||||
@override
|
||||
Future<void> activate(ClideExtensionContext ctx) async {
|
||||
_ctx = ctx;
|
||||
}
|
||||
|
||||
@override
|
||||
List<ContributionPoint> get contributions => [
|
||||
TabContribution(
|
||||
id: 'output.panel',
|
||||
slot: Slots.dock,
|
||||
title: 'Output',
|
||||
priority: -100, // sort before Problems in the dock tab bar
|
||||
build: (ctx) => OutputView(ring: ClideKernel.of(ctx).logRing),
|
||||
),
|
||||
StatusItemContribution(
|
||||
id: 'output.dock-toggle',
|
||||
priority: 100, // right group, replacing the old app-status item
|
||||
build: (_) => const DockStatusItem(),
|
||||
),
|
||||
CommandContribution(
|
||||
id: 'dock.toggle',
|
||||
command: 'dock.toggle',
|
||||
title: 'Toggle output dock',
|
||||
defaultBinding: 'ctrl+j',
|
||||
run: (_) async {
|
||||
final ctx = _ctx;
|
||||
if (ctx == null) return IpcResponse.ok(id: '', data: const {});
|
||||
final a = ctx.arrangement;
|
||||
final opening = !a.isVisible(Slots.dock);
|
||||
a.setVisible(Slots.dock, opening);
|
||||
if (opening && ctx.panels.activeTabIn(Slots.dock) == null) {
|
||||
ctx.panels.activateTab(Slots.dock, 'output.panel');
|
||||
}
|
||||
return IpcResponse.ok(id: '', data: {'dock': opening});
|
||||
},
|
||||
),
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user