fix: stabilize chat history prepend scroll preservation on mobile and desktop
- Mobile: defeat iOS momentum scroll when compensating history prepend (overflow toggle + short rAF watchdog); disable history virtualization and post-paint background prepends; preload Markdown renderer and use plain-text Suspense fallback to avoid first-frame geometry shifts - Desktop: stop double-compensating prepends on the virtualized list - virtua shift owns the adjustment; remove sticky-anchor heuristics that misfired as failed restores - Sync: skip no-op store writes when messages/parts are unchanged
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
let markdownRendererModulePromise: Promise<typeof import('./MarkdownRendererImpl')> | null = null;
|
||||
|
||||
export const loadMarkdownRendererModule = () => {
|
||||
markdownRendererModulePromise ??= import('./MarkdownRendererImpl').catch((error) => {
|
||||
markdownRendererModulePromise = null;
|
||||
throw error;
|
||||
});
|
||||
return markdownRendererModulePromise;
|
||||
};
|
||||
|
||||
export const preloadMarkdownRenderer = () => {
|
||||
void loadMarkdownRendererModule().catch(() => undefined);
|
||||
};
|
||||
Reference in New Issue
Block a user