restructure pql sidebar: Search default, Markdown tab with viewer

Search (PQL DSL query) is now the default left tab; Markdown (filtered
to .md files) on the right.  Clicking a markdown file publishes on
the message bus; the markdown extension activates the context panel
viewer and re-publishes on a load channel after the frame so the
viewer is guaranteed to be mounted.  Viewer subscribes to load channel
and editor buffer events, publishes focus for sidebar highlighting.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-04-23 21:25:52 +02:00
co-authored by Claude
parent 47c2def656
commit bfd304a3f9
4 changed files with 128 additions and 146 deletions
+6 -6
View File
@@ -9,14 +9,14 @@ import 'dart:async';
import 'package:clide/kernel/kernel.dart';
import 'package:flutter/foundation.dart';
enum PqlView { files, query }
enum PqlView { query, markdown }
class PqlController extends ChangeNotifier {
PqlController({required this.ipc});
final DaemonClient ipc;
PqlView _view = PqlView.files;
PqlView _view = PqlView.query;
PqlView get view => _view;
String? _error;
@@ -38,19 +38,19 @@ class PqlController extends ChangeNotifier {
_error = null;
notifyListeners();
switch (v) {
case PqlView.files:
unawaited(loadFiles());
case PqlView.markdown:
unawaited(loadMarkdownFiles());
case PqlView.query:
break;
}
}
Future<void> loadFiles({String? glob}) async {
Future<void> loadMarkdownFiles({String? glob}) async {
_loading = true;
notifyListeners();
final r = await ipc.request('pql.files', args: {
if (glob != null) 'glob': glob,
'glob': glob ?? '**/*.md',
'limit': 200,
});