Repository navigation
Refactor: Standardize naming convention to camelCase - #14079
Conversation
📝 WalkthroughWalkthroughA comprehensive naming convention migration from snake_case to camelCase across API endpoint definitions and their consumers throughout the frontend codebase. The refactoring updates the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
web/src/hooks/use-document-request.ts (1)
166-168:⚠️ Potential issue | 🟡 Minor
useMemois being used incorrectly for a side effect.
useMemois intended for memoizing computed values, not for executing side effects likesetDocs. This should beuseEffectinstead.🔧 Proposed fix
- useMemo(() => { - setDocs(data.docs); - }, [data.docs]); + useEffect(() => { + setDocs(data.docs); + }, [data.docs]);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@web/src/hooks/use-document-request.ts` around lines 166 - 168, Replace the incorrect useMemo side-effect with useEffect: find the useMemo block that calls setDocs(data.docs) (in the useDocumentRequest hook) and change it to useEffect(() => { setDocs(data.docs); }, [data.docs]); and ensure useEffect is imported from React; keep the same dependency [data.docs] so state updates when docs change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@web/src/hooks/use-document-request.ts`:
- Around line 166-168: Replace the incorrect useMemo side-effect with useEffect:
find the useMemo block that calls setDocs(data.docs) (in the useDocumentRequest
hook) and change it to useEffect(() => { setDocs(data.docs); }, [data.docs]);
and ensure useEffect is imported from React; keep the same dependency
[data.docs] so state updates when docs change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ed7dae51-f8d4-4d91-94e7-01507f97ceb1
📒 Files selected for processing (13)
web/src/hooks/use-chat-request.tsweb/src/hooks/use-chunk-request.tsweb/src/hooks/use-document-request.tsweb/src/hooks/use-knowledge-request.tsweb/src/hooks/use-llm-request.tsxweb/src/hooks/use-user-setting-request.tsxweb/src/pages/dataset/dataset-overview/index.tsxweb/src/pages/next-search/hooks.tsweb/src/services/knowledge-service.tsweb/src/services/next-chat-service.tsweb/src/services/plugin-service.tsweb/src/services/user-service.tsweb/src/utils/api.ts
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14079 +/- ##
=======================================
Coverage 96.66% 96.66%
=======================================
Files 10 10
Lines 690 690
Branches 108 108
=======================================
Hits 667 667
Misses 8 8
Partials 15 15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
### What problem does this PR solve? Refactor: Standardize naming convention to camelCase ### Type of change - [x] Refactoring
What problem does this PR solve?
Refactor: Standardize naming convention to camelCase
Type of change