Fix admin memory showing 0 facts; add pagination/search/sort
Bug fix:
- get_all_facts(user_id=None) was filtering for user_id IS NULL only,
  so admin panel showed 0 facts when facts had user_ids set.
- Added all_users parameter to get_all_facts and fact_count.
- Admin endpoint now passes all_users=True to return all facts.

Memory pagination:
- Extended get_all_facts with offset, search, sort_by, sort_order params.
- Extended fact_count with search and all_users params.
- /admin/memory endpoint now accepts limit, offset, search, sort_by,
  sort_order and returns {total, limit, offset, items}.

Admin panel frontend:
- Added server-side search with debounce for memory facts.
- Added sortable column headers (category, key, source, confidence, updated).
- Added pagination controls (prev/next, page size selector).
- Switched memory display from grouped tables to flat sortable table.

Tests:
- Added unit tests for get_all_facts(all_users=True) and
  fact_count(all_users=True).
- All 219 tests pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 193b7a5 commit cc7cb0ed1feafab44df8fa845aee66d3b6136f34
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored on 8 May
Showing 4 changed files
View
admin/index.html
View
navi/api/routes/admin.py
View
navi/memory/_facts.py
View
tests/unit/memory/test_store.py