fix: update guide panel immediately after language switch#14758
fix: update guide panel immediately after language switch#14758HanaB14 wants to merge 1 commit intotoeverything:canaryfrom
Conversation
📝 WalkthroughWalkthroughFour settings components have Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/frontend/core/src/desktop/dialogs/setting/general-setting/index.tsx (1)
65-150: MemoizeuseGeneralSettingList()anduseWorkspaceSettingList()return values to stabilize sidebar memoization.Both hooks currently return fresh arrays on every render, which invalidates the
groupsuseMemo insetting-sidebar/index.tsx(lines 184–202) despite it depending on these lists. Wrapping each array withuseMemowould preserve their identity across renders when dependencies haven't changed, allowing thegroupsmemo to be effective and avoid unnecessary remapping work.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/frontend/core/src/desktop/dialogs/setting/general-setting/index.tsx` around lines 65 - 150, The hook useGeneralSettingList (and similarly useWorkspaceSettingList) returns a new array on every render which breaks the groups memo in setting-sidebar/index.tsx; wrap the returned settings array in React.useMemo so it only recreates when its real dependencies change (e.g., loggedIn, enableEditorSettings, environment, BUILD_CONFIG, hasPaymentFeature, meetingSettings, t) and return that memoized array from useGeneralSettingList/useWorkspaceSettingList to stabilize identity and allow groups useMemo to work properly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@packages/frontend/core/src/desktop/dialogs/setting/general-setting/index.tsx`:
- Around line 65-150: The hook useGeneralSettingList (and similarly
useWorkspaceSettingList) returns a new array on every render which breaks the
groups memo in setting-sidebar/index.tsx; wrap the returned settings array in
React.useMemo so it only recreates when its real dependencies change (e.g.,
loggedIn, enableEditorSettings, environment, BUILD_CONFIG, hasPaymentFeature,
meetingSettings, t) and return that memoized array from
useGeneralSettingList/useWorkspaceSettingList to stabilize identity and allow
groups useMemo to work properly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d0048b65-5014-4344-966f-e479c69998a4
📒 Files selected for processing (4)
packages/frontend/core/src/desktop/dialogs/setting/general-setting/appearance/index.tsxpackages/frontend/core/src/desktop/dialogs/setting/general-setting/appearance/links.tsxpackages/frontend/core/src/desktop/dialogs/setting/general-setting/index.tsxpackages/frontend/core/src/desktop/dialogs/setting/workspace-setting/index.tsx
|
reolaced by #14760 |
replace #14758 #### PR Dependency Tree * **PR #14760** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Enhanced language switching to ensure the settings dialog properly reflects language changes when users update their language preference. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Fixes the issue where the left guide panel does not update immediately after switching display language.
Changes
Testing
Demo
Attached a short before/after video showing the fix.
After.mov
Before.mov
Closes #13291
Summary by CodeRabbit