feat(app): quick switcher also finds pages by block content

BlockHit carries the page id so a hit opens its page (journals included).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dasemuandClaude Opus 5.5 committed 2026-10-26 04:02:21 +01:00
1 parent a6d566ff6f
commit b44cbee038
9 files changed
+204 -30

No files matched your search

+15 -2
View File
@@ -291,8 +291,21 @@ class MemoryBackend implements GraphBackend {
}
@override
Future<List<BlockHit>> searchBlocks(String query, {int limit = 20}) async =>
[];
Future<List<BlockHit>> searchBlocks(String query, {int limit = 20}) async {
final q = query.trim().toLowerCase();
if (q.isEmpty) return [];
return [
for (final e in outlines.entries)
for (final n in e.value)
if (n.content.toLowerCase().contains(q))
BlockHit(
id: n.id,
content: n.content,
pageId: e.key,
pageTitle: pages[e.key]?.title ?? '',
),
].take(limit).toList();
}
@override
String? assetPath(String hash) => null;