Sloth-ninja makes Company Search remember what matters

Solicitors can now return to companies they follow or have recently checked without starting each search again.

workflowknowledge-management

Company Search gains a practical memory layer that keeps each user's activity separate and stays out of the way if the supporting database update is absent.

  • Starred companies: mark a company for quick return, even before it has appeared in the saved list.
  • Recent companies: reopen up to 25 recently viewed companies, while starred entries remain protected.
  • Safer interactions: star changes appear immediately, but revert with a clear message if the update fails.

The page records views in the background, so opening a company does not wait on the save. If a deployment has not yet received the database update, the search page simply behaves as before instead of showing an error.

So what Firms that revisit the same counterparties, clients or targets should care: this turns company lookup from a repeated task into a usable working list.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

2 commits from Sloth-ninja/JessicaOSS, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
b7e83974 Company-search saves: starred + recent companies sloth-ninja 2026-07-28 ↗ GitHub
commit body
Application code for the starred/recent companies feature over the
company_search_saves table (migration #49).

Backend: self-contained lib/companySearchSaves.ts (recordCompanyView with
snapshot refresh + 25-recent prune that never prunes starred rows;
setCompanyStar that inserts a not-yet-saved company from its snapshot;
listCompanySaves), all 42P01/42703-tolerant so an unmigrated production DB
degrades to empty lists / no-ops. Routes on the existing /companies router
(same requireAuth + research limiter, sibling try/catch + fixed generic
detail, caller id from the session): GET /companies/saves,
POST /companies/:companyNumber/view, PUT /companies/:companyNumber/star, with
exported validateViewBody / validateStarBody body validation.

Frontend: company-search rail shows Starred then Recent sections (star toggle
per row) when the search box is empty, a header star toggle for the open
company, best-effort fire-and-forget view recording on open, and optimistic
star updates with rollback. mikeApi getCompanySaves/recordCompanyView/
setCompanyStar + types.

Tests: +20 backend (upsert/snapshot/prune, star/unstar incl. insert-with-
snapshot, cross-user isolation, 42P01/42703 degradation, route validation).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
89de3ae8 Merge remote-tracking branch 'origin/main' into company-search-saves sloth-ninja 2026-07-28 ↗ GitHub
# Conflicts:
#	backend/src/routes/companies.test.ts
#	backend/src/routes/companies.ts
#	docs/BUILD_LOG.md
#	frontend/src/app/lib/mikeApi.ts

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-1135.md from inside the repo you want the changes in.

⬇ Download capture-thread-1135.md