open markdown files in the reader, not the editor

The files panel and the Claude Config tab called ipc.request('editor.open')
for every file, which targets the editor — so a .md click never reached the
right-side markdown reader (it opens only when something publishes
('builtin.markdown','selection')). Route .md clicks from the files panel
(tree + filtered rows), the Config tab's file-backed rows, and .md wiki links
in the viewer to that channel; non-.md files still open in the editor. Also
remove the dead DaemonEvent fallback that listened for 'editor.buffer_activated'
(the registry emits 'editor.active-changed').

T-187.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-05-31 16:16:34 +02:00
co-authored by Claude
parent 4340dc38d0
commit c56b60622b
7 changed files with 369 additions and 49 deletions
@@ -535,7 +535,8 @@ class _ClaudeMetaSidebarState extends State<ClaudeMetaSidebar> {
}
/// A tappable row for file-backed items (skills, agents, commands).
/// Fires `editor.open` with the path when tapped (D-6, T-183).
/// All config items are .md files — opens in the markdown reader panel
/// via the kernel MessageBus (D-6, T-183).
Widget _configFileRow(SurfaceTokens tokens, String name, String? path) {
final row = Padding(
padding: const EdgeInsets.only(left: 16, top: 2, bottom: 2),
@@ -546,14 +547,15 @@ class _ClaudeMetaSidebarState extends State<ClaudeMetaSidebar> {
),
);
if (path == null) return row;
void openMarkdown() => ClideKernel.of(context).messages.publish('builtin.markdown', 'selection', {'path': path});
return Semantics(
button: true,
label: name,
excludeSemantics: true,
onTap: () => unawaited(ClideKernel.of(context).ipc.request('editor.open', args: {'path': path})),
onTap: openMarkdown,
child: ClideTappable(
tooltip: path,
onTap: () => unawaited(ClideKernel.of(context).ipc.request('editor.open', args: {'path': path})),
onTap: openMarkdown,
builder: (ctx, hovered, _) => Padding(
padding: const EdgeInsets.only(left: 16, top: 2, bottom: 2),
child: ClideText(