fix(app): keep timeline scroll when switching models (#50865)

This commit is contained in:
Luke Parker
2026-09-23 18:03:42 +10:00
committed by GitHub
parent a25d304201
commit fabf56781c
+10 -10
View File
@@ -83,21 +83,21 @@ function createGlobalModels() {
recent: [],
variant: {},
})
const [recent] = createResource(
async () => {
const value = store.recent
await ready.promise
return value
},
(value) => value,
{ initialValue: [] },
)
// Suspend readers only until persisted state loads. Refetching on every change would put the
// session route into its Suspense fallback, detaching the screen and resetting the timeline scroll.
const [loaded] = createResource(async () => {
await ready.promise
return true
})
return {
store,
set: setStore,
ready,
recent: () => recent()!,
recent: () => {
loaded()
return store.recent
},
// Marks models visible in the picker regardless of the "latest per family" default.
show(models: ReadonlyArray<{ providerID: string; modelID: string }>) {
const seen = new Map(store.user.map((item, index) => [`${item.providerID}:${item.modelID}`, index]))