open-notebook/api/routers
Matt Van Horn cc8bfb11ad
feat: Recently Viewed section for notebooks and sources (#979)
* feat: Recently Viewed section for notebooks and sources

Fixes #850

* fix: export RecentlyViewedResponse type from api types

The RecentlyViewed component and notebooks API client import
RecentlyViewedResponse from @/lib/types/api but the interface was missing,
failing the type-check build. Add it to match the backend api/models.py model.

* fix: harden recently-viewed read path and index the recency query

Three robustness fixes on the recently-viewed feature:

- Make the last_viewed_at write-on-read stamping best-effort. _stamp_source_view
  and _stamp_notebook_view now swallow and log their own errors, so a failed
  stamp update can no longer turn a successful GET /sources/{id} or
  GET /notebooks/{id} into a 500.
- Stop leaking internal details from GET /recently-viewed: log the full
  exception server-side and return a generic error message to the client.
- Add indexes on last_viewed_at for the notebook and source tables in
  migration 16 so the ORDER BY last_viewed_at DESC LIMIT recently-viewed
  query does not degrade into a full table scan as data grows. The down
  migration removes the indexes before dropping the field.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat: register migration 18, add recently-viewed i18n keys and CHANGELOG entry

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Luis Novo <lfnovo@gmail.com>
2026-07-03 12:39:14 -03:00
..
__init__.py Api podcast migration (#93) 2025-07-17 08:36:11 -03:00
auth.py feat: credential-based API key management (#477) (#540) 2026-02-10 08:30:22 -03:00
chat.py fix: run chat graph invoke off the event loop (#971) 2026-06-25 07:26:46 -03:00
commands.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
config.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
context.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
credentials.py fix(api): return 404 instead of 500 for missing resources in CRUD endpoints (#862) (#924) 2026-06-18 08:23:28 -03:00
embedding.py fix(api): return 404 instead of 500 for missing resources in CRUD endpoints (#862) (#924) 2026-06-18 08:23:28 -03:00
embedding_rebuild.py Fix re-embedding issues and improve retry strategy (#515) 2026-01-31 18:55:01 -03:00
episode_profiles.py fix: pass max_tokens through to podcast_creator for outline/transcript generation (#982) 2026-07-03 12:23:19 -03:00
insights.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
languages.py feat(podcasts): model registry integration, credential passthrough & new features (#632) 2026-02-27 11:06:47 -03:00
models.py fix(api): return 404 instead of 500 for missing resources in CRUD endpoints (#862) (#924) 2026-06-18 08:23:28 -03:00
notebooks.py feat: Recently Viewed section for notebooks and sources (#979) 2026-07-03 12:39:14 -03:00
notes.py fix(api): return 404 instead of 500 for missing resources in CRUD endpoints (#862) (#924) 2026-06-18 08:23:28 -03:00
podcasts.py fix: podcast failure recovery and retry (1.7.3) (#595) 2026-02-17 21:24:57 -03:00
search.py fix: stream SSE responses end-to-end through Next.js proxy (#770) 2026-06-21 14:49:15 -03:00
settings.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
source_chat.py fix: run chat graph invoke off the event loop (#971) 2026-06-25 07:26:46 -03:00
sources.py feat: Recently Viewed section for notebooks and sources (#979) 2026-07-03 12:39:14 -03:00
speaker_profiles.py fix: use model_dump(exclude_unset=True) in PUT profile handlers (#860) 2026-06-13 08:56:33 -03:00
transformations.py feat: per-transformation custom model selection (#978) 2026-07-03 12:30:50 -03:00