Repository navigation
feat(projects): on-demand project data layer + fix truncated list - #355
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 followednextToken. Once PR #348 added the heavyprojectSummarymarkdown to the listselectionSet, items grew large enough that a single page held only a handful of projects.Changes
leanSelectionSet(list/active set) drops theprojectSummaryfull text but keeps the tinyprojectSummaryUpdatedAt;fullSelectionSet(incl. summary) is used for on-demand by-id loads (detail page, Sonic). ThesummaryEmbeddingvector was never client-selected.fetchProjectsnow followsnextToken(limit 1000), so the active set is complete again with much smaller pages.loadProjectsByIds/resolveProjectsByIds/searchProjectsRemote/ensureProjectSummaries, plus a cache-version SWR key.getProjectByIdmerges the full summary onto the fresh active object;getProjectNamesByIdsloads missing ids on demand.searchProjectsAI query reusing the existingproject-vector-searchLambda.useMeetingSonicDatapre-warms full summaries at recording start;project-detailscallsensureProjectSummarieson mount.Testing
npx tsc --noEmit— cleannpm run lint— clean (0 errors)npm run build— compiled successfully, all routes incl./projects,/projects/[id],/meetings/[id]