v1.7.16
Feature
Offline mode improvements
- 1. Set lastVisited on offline item creation - new offline notes/threads
- now appear at top instead of sorting below old items
- 2. Include lastVisited in incremental sync change detection - visiting
- an item on one device now syncs to other devices
- 3. Implement offline-first data loading - IndexedDB data loads instantly
- while server refresh happens in parallel, improving UX on slow networks
- 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fix
Remove client-side lastVisited preservation logic
- Server is now the sole source of truth for lastVisited ordering.
- This removes the complex logic that tried to preserve "recent" client-side
- lastVisited values when server data arrived, which was causing inconsistent
- ordering across devices and refreshes.
- The optimistic update for immediate UI feedback when clicking items is kept,
- but server data always wins on refresh - ensuring consistent ordering.
- 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fix
Set lastVisited on newly created notes and threads
- New items created after the backfill-last-visited migration didn't have
- lastVisited set, causing them to sort below old items that had lastVisited
- from the migration. This fix ensures newly created items appear at the top
- of the list by setting lastVisited to the creation time.
- 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fix
Ensure cache-busting for dashboard refresh requests
- Always use cache: 'no-store' and add a timestamp parameter to refresh
- requests to prevent browsers from returning stale cached responses.
- This helps ensure the dashboard always shows fresh data from the server
- and prevents lastVisited order inconsistencies between initial SSR load
- and subsequent client-side refreshes.
- 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fix
Only preserve very recent optimistic lastVisited updates
- The previous logic was preserving client-side lastVisited values even when
- the server correctly indicated an item hadn't been visited (null). This caused
- items to incorrectly appear as visited when they weren't.
- Now the preservation logic only keeps client-side lastVisited if:
- 1. The value is very recent (within last 10 seconds) - indicating a true optimistic update
- 2. The server either has no lastVisited or an older value
- This ensures the server remains the source of truth while still allowing
- smooth optimistic updates for the brief window before the server catches up.
- 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fix
Prioritize visited items over unvisited in lastVisited sorting
- sorting.ts: Added primary sort tier in sortByLastVisited and
- dashboard-data.ts: Removed fallback that was masking the distinction
