feat(core): a page's direct hub is an implicit tag

Members of a hub are indexed under the hub's title in page_tags, tag_catalog and the
graph tag nodes, merged with a same-name type or tag. Hub rename, delete and
membership changes re-index the derived index (no ops). Schema v7 rebuilds it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dasemuandClaude Opus 5.5 committed 2026-10-26 03:52:04 +01:00
1 parent 3585ce67af
commit 6f483ce763
10 files changed
+273 -77

No files matched your search

+3
View File
@@ -140,6 +140,9 @@ Both are plain names with no page, shown as one row of pills under the title.
several can be added in a row; hovering a chip shows its ×. A chip opens the tag view: pages
with that tag or type, "Rename" (also renames types, merging duplicates) and "Remove from all
pages". An inline `#tema` in the text still links to a page of that name.
- **Hub as tag**: a note's direct hub also counts as a tag of the same name (not shown as a
chip, not stored in the tags). It lists in that tag's view and graph node and merges with a
same-name type or tag; "Rename" there never renames the hub itself.
- In the graph every tag is a virtual node drawn as a hollow accent ring and linked to its
pages with a separate edge kind (TAGGED); tapping one opens its tag view.
+6
View File
@@ -37,6 +37,12 @@ crates may add their own tables to the same database (prefix them: `search_*`, `
- **A page has at most one type** (`Page.types`, 0 or 1 entries; `Page::page_type()`), a name
saying what the page is. It implies a tag of the same name. API: `set_page_type(page,
Option<&str>)`, `type_catalog` (types in use by count, then the seeded `SUGGESTED_TYPES`).
- **A page's direct hub is an implicit tag**, like its type: members of hub "Anime" are filed
under "Anime" (`page_tags`, `pages_with_tag`, `tag_catalog`, the graph's tag node). It is
not stored in `Page.tags` and merges with a same-name type or tag. Only the direct hub
counts (not ancestors); hubs, templates and journals get none. The index is derived, so
renaming or deleting a hub, or moving a member, just re-indexes `page_tags` (no ops).
`rename_tag` never renames a hub: it only changes explicit tags and types.
- Schema v6 turned former tag pages (kind `tag`) into plain notes and trimmed multiple types to
the first; `PageKind` has no `Tag` any more and "tag" parses as a note.
- In the graph (`synapse-ffi`) every tag in use is a virtual node (`GraphNode.is_tag`, id