From 47c2def656812c3b35ee83193d589afcb1d5a318 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Thu, 23 Apr 2026 21:25:36 +0200 Subject: [PATCH] add files.read IPC, fix pane chrome layout, raise context panel max Register files.read command for reading file content by relative path. Remove top padding on context panel container and mainAxisSize.min from ClidePaneChrome so the header sits flush and the pane fills available height. Context panel max raised from 420px to 1000px. Co-Authored-By: Claude --- lib/app.dart | 2 +- lib/kernel/src/panels/layout_preset.dart | 2 +- lib/src/daemon/files_commands.dart | 14 ++++++++++++++ lib/widgets/src/clide_pane_chrome.dart | 1 - 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/app.dart b/lib/app.dart index c96ef92a..e9d82b2f 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -892,7 +892,7 @@ class _ContextSlot extends StatelessWidget { return Container( color: tokens.panelBackground, alignment: Alignment.topLeft, - padding: const EdgeInsets.fromLTRB(0, 2, 2, 0), + padding: const EdgeInsets.only(right: 2), child: active.build(context), ); } diff --git a/lib/kernel/src/panels/layout_preset.dart b/lib/kernel/src/panels/layout_preset.dart index 3da75f6a..b217c3e7 100644 --- a/lib/kernel/src/panels/layout_preset.dart +++ b/lib/kernel/src/panels/layout_preset.dart @@ -30,7 +30,7 @@ LayoutPresetContribution classicPreset() => const LayoutPresetContribution( position: SlotPosition.right, defaultSize: 420, minSize: 220, - maxSize: 420, + maxSize: 1000, ), LayoutSlot( slot: Slots.statusbar, diff --git a/lib/src/daemon/files_commands.dart b/lib/src/daemon/files_commands.dart index abcb7bf6..ec2fb7e3 100644 --- a/lib/src/daemon/files_commands.dart +++ b/lib/src/daemon/files_commands.dart @@ -8,6 +8,7 @@ import '../files/ignore.dart'; import '../files/listing.dart'; import '../files/watcher.dart'; import '../ipc/envelope.dart'; +import '../ipc/schema_v1.dart'; import '../panes/event_sink.dart'; import 'dispatcher.dart'; @@ -63,6 +64,19 @@ void registerFilesCommands(DaemonDispatcher d, FilesService files) { }, )); + d.register('files.read', (req) async { + final path = req.args['path'] as String?; + if (path == null || path.isEmpty) { + return IpcResponse.err(id: req.id, error: IpcError(code: IpcExitCode.toolError, kind: IpcErrorKind.toolError, message: 'files.read requires a path')); + } + final file = File('${files.root.absolute.path}/$path'); + if (!file.existsSync()) { + return IpcResponse.err(id: req.id, error: IpcError(code: IpcExitCode.toolError, kind: IpcErrorKind.toolError, message: 'file not found: $path')); + } + final content = file.readAsStringSync(); + return IpcResponse.ok(id: req.id, data: {'path': path, 'content': content}); + }); + d.register('files.ls', (req) async { final dir = (req.args['path'] as String?) ?? ''; final entries = await listDir( diff --git a/lib/widgets/src/clide_pane_chrome.dart b/lib/widgets/src/clide_pane_chrome.dart index b442ef81..dec40382 100644 --- a/lib/widgets/src/clide_pane_chrome.dart +++ b/lib/widgets/src/clide_pane_chrome.dart @@ -51,7 +51,6 @@ class ClidePaneChrome extends StatelessWidget { return ColoredBox( color: tokens.panelBackground, child: Column( - mainAxisSize: MainAxisSize.min, children: [ _Header( title: title,