feat: H1-as-title — title resolution, TitleField hiding, breadcrumb filename

- Rust: extract_title now prioritizes H1 > frontmatter > filename
- Rust: add has_h1 field to VaultEntry for frontend TitleField control
- Frontend: hide TitleField + icon picker when note has H1 in body
- Frontend: breadcrumb shows filename stem instead of display title
- Frontend: new notes use untitled-{type}-{timestamp}.md, no title in frontmatter
- CSS: only hide first H1 in BlockNote when TitleField is visible
- Updated all tests for new title resolution and note creation behavior

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
lucaronin
2026-04-06 13:08:17 +02:00
parent 0b58fd6061
commit d50f3479dc
18 changed files with 195 additions and 71 deletions

View File

@@ -361,12 +361,13 @@
margin-top: 2px;
}
/* Hide the first H1 heading in BlockNote — title is shown in TitleField above */
.editor__blocknote-container [data-node-type="blockContainer"]:first-child [data-content-type="heading"][data-level="1"] {
/* When TitleField is shown (no H1 in body), hide the first H1 heading in
BlockNote to avoid duplicate title display. When hasH1 is set, the
TitleField is hidden and the H1 in the editor serves as the title. */
.title-section:not([data-has-h1]) ~ .editor__blocknote-container [data-node-type="blockContainer"]:first-child [data-content-type="heading"][data-level="1"] {
display: none;
}
/* Also hide the BlockContainer wrapper if its heading is hidden */
.editor__blocknote-container [data-node-type="blockContainer"]:first-child:has([data-content-type="heading"][data-level="1"]) {
.title-section:not([data-has-h1]) ~ .editor__blocknote-container [data-node-type="blockContainer"]:first-child:has([data-content-type="heading"][data-level="1"]) {
display: none;
}