chore(knowledge): remove unused knowledge feature (Effort 1)#59
Conversation
Mechanical move of the knowledge feature from src/hooks/queries/knowledge to src/api/knowledge, adding queryOptions factories for the query hooks. No behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K513rsQz6Lg1HbbfYiafrE
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Summary by QodoRefactor knowledge feature into src/api modules with queryOptions factories Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
109 rules 1.
|
|
Triage of Qodo's two findings: 1. 2. No code changes here. Generated by Claude Code |
…Query The mechanical move changed knowledgeKeys.user(userId || "") to userKnowledgeQuery(userId!), shifting the disabled-state cache key from ["...", ""] to ["...", undefined]. Restore ?? "" to keep the move behavior-neutral, matching main. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K513rsQz6Lg1HbbfYiafrE
|
Correction to my earlier triage of finding 2 (the Fixed in (Finding 1 — the pre-existing Generated by Claude Code |
- handleKnowledgeToggle: replace mutateAsync/try-catch with
mutate(vars, { onError }) per project mutation convention
- useUserKnowledgeQuery: use userId! instead of ?? "" in the query key
(fetch is gated by enabled: !!userId)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K513rsQz6Lg1HbbfYiafrE
The knowledge slice (useKnowledge, useKnowledgeToggleMutation, useUserKnowledgeQuery) has never had a consumer anywhere in the app's history — it was introduced alongside the artist_knowledge table but no UI ever called it. Remove the dead code instead of carrying it forward in the src/api restructure. The artist_knowledge DB table is left untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K513rsQz6Lg1HbbfYiafrE
Removes the
knowledgefeature entirely instead of carrying it into thesrc/apirestructure.Why
The knowledge slice (
useKnowledge,useKnowledgeToggleMutation,useUserKnowledgeQuery) has never had a consumer anywhere in the app's git history. It was introduced alongside theartist_knowledgetable but no UI ever called it — there is no "do you know this artist" control in the app. Rather than move dead code into the new structure, this PR deletes it.Changes
src/api/knowledge/*(the 4 slice files).Not touched
artist_knowledgeDB table is left in place (no migration changes).Verification
pnpm run typecheckpasses.pnpm testpasses (20 files, 290 tests).Part of #52.
Generated by Claude Code