Skip to content

feat(projects): on-demand project data layer + fix truncated list - #355

Merged
cabcookie merged 1 commit into
mainfrom
feat/projects-on-demand-data-layer
Sep 25, 2026
Merged

cabcookie merged 1 commit into
mainfrom
feat/projects-on-demand-data-layer

Conversation

@cabcookie

Copy link
Copy Markdown
Owner

Summary

Applies the people data-layer principles (PR #351) to projects, and fixes the prod symptom where the projects list showed only < 10 of 1146 projects.

Root cause of the truncated list: client.models.Projects.list() returned only the first DynamoDB page (~1 MB) and never followed nextToken. Once PR #348 added the heavy projectSummary markdown to the list selectionSet, items grew large enough that a single page held only a handful of projects.

Changes

  • Lean vs. full selection sets: leanSelectionSet (list/active set) drops the projectSummary full text but keeps the tiny projectSummaryUpdatedAt; fullSelectionSet (incl. summary) is used for on-demand by-id loads (detail page, Sonic). The summaryEmbedding vector was never client-selected.
  • Pagination: fetchProjects now follows nextToken (limit 1000), so the active set is complete again with much smaller pages.
  • Cache-and-keep store: module-level project cache with loadProjectsByIds / resolveProjectsByIds / searchProjectsRemote / ensureProjectSummaries, plus a cache-version SWR key. getProjectById merges the full summary onto the fresh active object; getProjectNamesByIds loads missing ids on demand.
  • Semantic search: new searchProjects AI query reusing the existing project-vector-search Lambda.
  • Consumers: useMeetingSonicData pre-warms full summaries at recording start; project-details calls ensureProjectSummaries on mount.

Testing

  • npx tsc --noEmit — clean
  • npm run lint — clean (0 errors)
  • npm run build — compiled successfully, all routes incl. /projects, /projects/[id], /meetings/[id]

…etch)

Applies the people data-layer principles (PR #351) to projects and fixes
the prod list silently showing < 10 projects.

Root cause: client.models.Projects.list() returned only the first DynamoDB
page (~1 MB) and never followed nextToken; once PR #348 added the heavy
projectSummary markdown to the list selectionSet, items grew so large that a
page held only a handful of the (1146) projects.

Changes:
- Split selectionSet into leanSelectionSet (list/active set, drops the
  projectSummary full text, keeps the tiny projectSummaryUpdatedAt) and
  fullSelectionSet (on-demand by-id: detail page, Sonic context). The
  summaryEmbedding vector was never client-selected (native DDB write).
- fetchProjects now paginates via nextToken (limit 1000) so the active set is
  complete again, with much smaller pages.
- Module-level project cache (cache-and-keep): loadProjectsByIds /
  resolveProjectsByIds / searchProjectsRemote / ensureProjectSummaries, with a
  cache-version SWR key to re-render consumers. getProjectById merges the full
  summary onto the fresh active object; getProjectNamesByIds loads missing ids
  on demand so a referenced done/archived project is never permanently
  invisible.
- searchProjects AI query (reuses the existing project-vector-search Lambda /
  ProjectVoiceMatch) for typed semantic lookups.
- useMeetingSonicData: pre-warm full summaries (ensureOpenProjectSummaries) at
  recording start; getOpenProjects reads them from the cache.
- project-details: ensureProjectSummaries on mount to render the summary.

Verified: tsc --noEmit clean, eslint clean, next build succeeds.
@cabcookie
cabcookie merged commit 481bb02 into main Sep 25, 2026
1 check passed
@cabcookie
cabcookie deleted the feat/projects-on-demand-data-layer branch September 25, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant