feat: note subtitle — show metadata (date + word count) (#94)

* feat: show metadata subtitle (date + word count) instead of snippet

Replace the note list subtitle with a compact metadata summary showing
relative date and word count (e.g. "2d ago · 342 words") instead of
the first paragraph of note content. Adds word_count to VaultEntry on
the Rust backend, computed during vault scan.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: cargo fmt formatting

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Luca Rossi
2026-02-26 20:50:29 +01:00
committed by GitHub
parent 1c2f0ee193
commit 4664f3360e
30 changed files with 279 additions and 21 deletions

View File

@@ -25,6 +25,18 @@ export function getDisplayDate(entry: VaultEntry): number | null {
return entry.modifiedAt ?? entry.createdAt
}
export function formatSubtitle(entry: VaultEntry): string {
const parts: string[] = []
const date = getDisplayDate(entry)
if (date) parts.push(relativeDate(date))
if (entry.wordCount > 0) {
parts.push(`${entry.wordCount} words`)
} else {
parts.push('Empty')
}
return parts.join(' \u00b7 ')
}
function refsMatch(refs: string[], entry: VaultEntry): boolean {
const stem = entry.path.replace(/^.*\/Laputa\//, '').replace(/\.md$/, '')
const fileStem = entry.filename.replace(/\.md$/, '')