From 4104e138c10e5ece6e5054f6f5b3f75f090a133c Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Tue, 30 Jun 2026 00:41:54 +0200 Subject: [PATCH] refactor(notes): rename title font to heading font These fonts apply to markdown headings (h1-h6), so "heading" is more accurate than "title". Renames the chosen*Font field, store action, and the --heading-font-family CSS variable. Keeps backward compatibility: .remanso.json still honors the legacy `t` key (alongside the new `h`), and a saved `chosenTitleFont` in localStorage is migrated on load so existing preferences survive. --- src/components/FontChange.vue | 12 ++-- src/modules/repo/interfaces/UserSettings.ts | 2 +- src/modules/repo/services/repo.spec.ts | 56 +++++++++++++++++++ src/modules/repo/services/repo.ts | 6 +- src/modules/repo/store/userRepo.store.spec.ts | 25 ++++++++- src/modules/repo/store/userRepo.store.ts | 30 ++++++---- .../user/hooks/useUserSettings.hook.ts | 6 +- src/styles/app.css | 2 +- tailwind.config.js | 6 +- 9 files changed, 116 insertions(+), 29 deletions(-) diff --git a/src/components/FontChange.vue b/src/components/FontChange.vue index 5640283..93741bc 100644 --- a/src/components/FontChange.vue +++ b/src/components/FontChange.vue @@ -25,16 +25,16 @@ const fontFamilies = computed( const sortedFontFamilies = computed(() => { const base = fontFamilies.value const extras = [ - store.userSettings?.chosenTitleFont, + store.userSettings?.chosenHeadingFont, store.userSettings?.chosenBodyFont ].filter((f): f is string => !!f && !base.includes(f)) return [...base, ...extras].sort((a, b) => a.localeCompare(b)) }) const fontSizes = Array.from({ length: 7 }, (_, i) => `${9 + i * 2}pt`) -const titleFont = computed({ - get: () => store.userSettings?.chosenTitleFont, - set: (value) => store.setTitleFont(value!) +const headingFont = computed({ + get: () => store.userSettings?.chosenHeadingFont, + set: (value) => store.setHeadingFont(value!) }) const bodyFont = computed({ get: () => store.userSettings?.chosenBodyFont, @@ -49,8 +49,8 @@ const fontSize = computed({