feat(app): show the type emoji before page names

Page header, All pages, quick switcher, recents, tabs, hub members, tag view,
linked references, related pages, type pill and the tree view; not the network
graph.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dasemuandClaude Opus 5.5 committed 2026-10-26 06:44:35 +01:00
1 parent a5bee50190
commit 00a64401e0
10 files changed
+430 -46

No files matched your search

+18 -5
View File
@@ -4,6 +4,7 @@ import 'package:flutter/services.dart';
import '../backend/graph_backend.dart';
import '../state/app_state.dart';
import '../theme/theme.dart';
import '../widgets/type_icon.dart';
/// Ctrl+K: jump to a page by title or alias, to a page whose blocks contain the text, or
/// create it.
@@ -168,6 +169,7 @@ class _QuickSwitcherState extends State<QuickSwitcher> {
onMiddle: () => _open(i, newTab: true),
icon: Icons.description_outlined,
title: _hits[i].title,
pageType: _hits[i].pageType,
detail: _hits[i].isAlias ? 'alias' : null,
),
if (_blocks.isNotEmpty)
@@ -217,6 +219,7 @@ class _Item extends StatelessWidget {
required this.onMiddle,
this.detail,
this.snippet,
this.pageType,
});
final bool selected;
final VoidCallback onTap;
@@ -225,6 +228,9 @@ class _Item extends StatelessWidget {
final String title;
final String? detail;
/// Type of the page hit (its emoji goes before the title).
final String? pageType;
/// Matching text shown under the title (content results).
final Widget? snippet;
@@ -254,11 +260,18 @@ class _Item extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 14, color: colors.ink),
Row(
children: [
TypeIcon(pageType),
Expanded(
child: Text(
title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 14, color: colors.ink),
),
),
],
),
if (snippet != null) ...[
const SizedBox(height: 2),