generated from nhcarrigan/template
perf: virtual windowing, markdown memoisation, and search debounce
- Terminal: virtual windowing renders max 150 lines, loads 50 older on scroll-up with scroll position compensation; auto-advances window forward during auto-scroll so old DOM nodes are unloaded continuously - Markdown: two-stage derived rendering separates expensive parse step (marked + hljs + spoilers, runs on content change) from cheap search highlight step (runs on query change only) - Achievements: fix double Object.keys() call in derived store - Terminal: 150ms debounce on search query to reduce redundant updates - Tests: add Markdown.test.ts for processSpoilers and highlightSearchMatches; extend Terminal.test.ts with virtual windowing helper coverage
This commit is contained in:
@@ -1471,11 +1471,14 @@ export const achievementsByRarity = derived(achievementsStore, ($store) => {
|
||||
return byRarity;
|
||||
});
|
||||
|
||||
export const achievementProgress = derived(achievementsStore, ($store) => ({
|
||||
unlocked: $store.totalUnlocked,
|
||||
total: Object.keys($store.achievements).length,
|
||||
percentage: Math.round(($store.totalUnlocked / Object.keys($store.achievements).length) * 100),
|
||||
}));
|
||||
export const achievementProgress = derived(achievementsStore, ($store) => {
|
||||
const total = Object.keys($store.achievements).length;
|
||||
return {
|
||||
unlocked: $store.totalUnlocked,
|
||||
total,
|
||||
percentage: Math.round(($store.totalUnlocked / total) * 100),
|
||||
};
|
||||
});
|
||||
|
||||
// Initialize achievement listener
|
||||
export async function initAchievementsListener() {
|
||||
|
||||
Reference in New Issue
Block a user