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 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -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),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ LayoutPresetContribution classicPreset() => const LayoutPresetContribution(
|
||||
position: SlotPosition.right,
|
||||
defaultSize: 420,
|
||||
minSize: 220,
|
||||
maxSize: 420,
|
||||
maxSize: 1000,
|
||||
),
|
||||
LayoutSlot(
|
||||
slot: Slots.statusbar,
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -51,7 +51,6 @@ class ClidePaneChrome extends StatelessWidget {
|
||||
return ColoredBox(
|
||||
color: tokens.panelBackground,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_Header(
|
||||
title: title,
|
||||
|
||||
Reference in New Issue
Block a user