chore: batch commit remaining changes
Includes search engine improvements, Alembic migrations, new services (pubmed_daily_update, query_expansion), frontend updates, and documentation sync.
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import { reactive, watch } from 'vue'
|
||||
import type { DisplaySettings } from '../types'
|
||||
|
||||
const STORAGE_KEY = 'search:displaySettings'
|
||||
|
||||
const defaults: DisplaySettings = {
|
||||
showAuthors: true,
|
||||
showAffiliation: true,
|
||||
showJournal: true,
|
||||
showPmid: true,
|
||||
showDoi: true,
|
||||
showAbstract: true,
|
||||
showStudyTypes: true,
|
||||
showTags: true,
|
||||
showCitedBy: true,
|
||||
showAiSummary: true,
|
||||
showActions: true,
|
||||
showBadges: true,
|
||||
showSummary: true,
|
||||
showPubmed: true,
|
||||
}
|
||||
|
||||
function loadSettings(): DisplaySettings {
|
||||
try {
|
||||
const raw = localStorage.getItem(STORAGE_KEY)
|
||||
if (raw) {
|
||||
const parsed = JSON.parse(raw)
|
||||
return { ...defaults, ...parsed }
|
||||
}
|
||||
} catch { /* ignore */ }
|
||||
return { ...defaults }
|
||||
}
|
||||
|
||||
const settings = reactive<DisplaySettings>(loadSettings())
|
||||
|
||||
watch(
|
||||
() => ({ ...settings }),
|
||||
(val) => {
|
||||
localStorage.setItem(STORAGE_KEY, JSON.stringify(val))
|
||||
},
|
||||
{ deep: true },
|
||||
)
|
||||
|
||||
export function useDisplaySettings() {
|
||||
return settings
|
||||
}
|
||||
Reference in New Issue
Block a user