Schema bump V9 adds an updatedAt secondary index to the six tables
that the cross-app dashboard widgets use for "recent N" lookups:
conversations, images, presiDecks, documents, songs, mukkePlaylists.
Dexie builds the index lazily on first open — no migration code,
no data touched.
Recent-query refactor:
useRecentConversations
useRecentImages
useRecentDecks
useRecentDocuments
All four switched from `toArray() + JS sort + slice` to
`orderBy('updatedAt').reverse().filter().limit()`. Dexie walks the
BTree backwards and short-circuits as soon as `limit` matches
accumulate, so the cost is O(limit + filtered) instead of O(table).
For a dashboard with thousands of stored conversations or images,
the dashboard widget previously read every record on every render
(liveQuery re-runs on any write). Now it stops after 5–6 hits.
Verified: 20/20 sync.test.ts still passing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>