fix: SettingsView TS errors + calendar month/year font
CI typecheck failed: JournalLocation interface requires `address: string`,
but Profile-tab Locations code created defaults like `{ label: 'Home' }`
without it. Symptoms were six TS2741 errors in SettingsView.vue.
Fix: include `address` in defaults and treat the user's place-name input
as the address field. Now homeQuery / workQuery sync to
locations.{home|work}.address — both at load time and on geocode.
loadJournalConfig now reads address (was reading label, which is fixed
to "Home"/"Work"); geocodeFor writes the typed query into address while
also setting lat/lon on success.
Calendar Month/Year title was actually rendering Fraunces, not Inter as
I'd claimed. FullCalendar renders .fc-toolbar-title as an <h2>, which
the global theme.css `h1, h2 { font-family: 'Fraunces' }` rule catches
before the parent .fc font-family inherit can do anything. At 1.1rem
it's below the doc's "Fraunces only at ≥18px" threshold, so explicit
Inter override on the deep selector.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -459,6 +459,10 @@ const upcomingGrouped = computed(() => {
|
|||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
}
|
}
|
||||||
:deep(.fc-toolbar-title) {
|
:deep(.fc-toolbar-title) {
|
||||||
|
/* FullCalendar renders this as <h2>, which would otherwise pick up the
|
||||||
|
theme.css h1/h2 → Fraunces rule. At 1.1rem it's below the doc's
|
||||||
|
"Fraunces only at ≥18px" threshold, so explicit Inter. */
|
||||||
|
font-family: 'Inter', system-ui, sans-serif;
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
@@ -600,7 +600,7 @@ const journalConfig = ref<JournalConfig>({
|
|||||||
prep_hour: 5,
|
prep_hour: 5,
|
||||||
prep_minute: 0,
|
prep_minute: 0,
|
||||||
day_rollover_hour: 4,
|
day_rollover_hour: 4,
|
||||||
locations: { home: { label: 'Home' }, work: { label: 'Work' } },
|
locations: { home: { label: 'Home', address: '' }, work: { label: 'Work', address: '' } },
|
||||||
temp_unit: 'C',
|
temp_unit: 'C',
|
||||||
})
|
})
|
||||||
const journalConfigSaving = ref(false)
|
const journalConfigSaving = ref(false)
|
||||||
@@ -623,13 +623,13 @@ async function loadJournalConfig() {
|
|||||||
morning_end_hour: cfg.morning_end_hour,
|
morning_end_hour: cfg.morning_end_hour,
|
||||||
midday_end_hour: cfg.midday_end_hour,
|
midday_end_hour: cfg.midday_end_hour,
|
||||||
locations: {
|
locations: {
|
||||||
home: cfg.locations?.home ?? { label: 'Home' },
|
home: cfg.locations?.home ?? { label: 'Home', address: '' },
|
||||||
work: cfg.locations?.work ?? { label: 'Work' },
|
work: cfg.locations?.work ?? { label: 'Work', address: '' },
|
||||||
},
|
},
|
||||||
temp_unit: cfg.temp_unit ?? 'C',
|
temp_unit: cfg.temp_unit ?? 'C',
|
||||||
}
|
}
|
||||||
homeQuery.value = cfg.locations?.home?.label && cfg.locations.home.lat ? cfg.locations.home.label : ''
|
homeQuery.value = cfg.locations?.home?.address ?? ''
|
||||||
workQuery.value = cfg.locations?.work?.label && cfg.locations.work.lat ? cfg.locations.work.label : ''
|
workQuery.value = cfg.locations?.work?.address ?? ''
|
||||||
} catch { /* non-critical */ }
|
} catch { /* non-critical */ }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -637,10 +637,11 @@ async function geocodeFor(which: 'home' | 'work') {
|
|||||||
const query = (which === 'home' ? homeQuery.value : workQuery.value).trim()
|
const query = (which === 'home' ? homeQuery.value : workQuery.value).trim()
|
||||||
const statusRef = which === 'home' ? homeGeoStatus : workGeoStatus
|
const statusRef = which === 'home' ? homeGeoStatus : workGeoStatus
|
||||||
const msgRef = which === 'home' ? homeGeoMsg : workGeoMsg
|
const msgRef = which === 'home' ? homeGeoMsg : workGeoMsg
|
||||||
|
const label = which === 'home' ? 'Home' : 'Work'
|
||||||
if (!query) {
|
if (!query) {
|
||||||
// Clear location
|
// Clear location
|
||||||
if (!journalConfig.value.locations) journalConfig.value.locations = {}
|
if (!journalConfig.value.locations) journalConfig.value.locations = {}
|
||||||
journalConfig.value.locations[which] = { label: which === 'home' ? 'Home' : 'Work' }
|
journalConfig.value.locations[which] = { label, address: '' }
|
||||||
statusRef.value = ''
|
statusRef.value = ''
|
||||||
msgRef.value = ''
|
msgRef.value = ''
|
||||||
return
|
return
|
||||||
@@ -656,7 +657,8 @@ async function geocodeFor(which: 'home' | 'work') {
|
|||||||
}
|
}
|
||||||
if (!journalConfig.value.locations) journalConfig.value.locations = {}
|
if (!journalConfig.value.locations) journalConfig.value.locations = {}
|
||||||
journalConfig.value.locations[which] = {
|
journalConfig.value.locations[which] = {
|
||||||
label: which === 'home' ? 'Home' : 'Work',
|
label,
|
||||||
|
address: query,
|
||||||
lat: result.lat,
|
lat: result.lat,
|
||||||
lon: result.lon,
|
lon: result.lon,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user