Conversation
📝 WalkthroughWalkthroughThese changes expose Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/frontend/core/src/desktop/dialogs/setting/index.tsx`:
- Around line 198-201: Remove the language-based key on FrameworkScope to avoid
remounting the entire settings subtree: in the JSX where FrameworkScope is
rendered (currently keyed with `settings-language-${currentLanguageKey}` and
using `scope={currentServer.scope}`), delete the
`key={...currentLanguageKey...}` prop so the component is keyed only by its
stable identity (`currentServer.scope`), and if you need language-driven
updates, implement them inside a narrower child component instead of on
`FrameworkScope`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3c57b97b-9b1b-4e95-bb5f-42473591abef
📒 Files selected for processing (2)
packages/frontend/core/src/desktop/dialogs/setting/index.tsxpackages/frontend/i18n/src/react.ts
| <FrameworkScope | ||
| key={`settings-language-${currentLanguageKey}`} | ||
| scope={currentServer.scope} | ||
| > |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
cd packages/frontend/core/src/desktop/dialogs/setting && wc -l index.tsxRepository: toeverything/AFFiNE
Length of output: 76
🏁 Script executed:
head -220 packages/frontend/core/src/desktop/dialogs/setting/index.tsx | tail -50Repository: toeverything/AFFiNE
Length of output: 1650
🏁 Script executed:
sed -n '190,210p' packages/frontend/core/src/desktop/dialogs/setting/index.tsxRepository: toeverything/AFFiNE
Length of output: 654
🏁 Script executed:
rg -i "frameworkscope" packages/frontend --type typescript --type typescriptreact -B 2 -A 5Repository: toeverything/AFFiNE
Length of output: 97
🏁 Script executed:
rg "currentLanguageKey" packages/frontend/core/src/desktop/dialogs/setting/index.tsx -B 3 -A 3Repository: toeverything/AFFiNE
Length of output: 539
🏁 Script executed:
sed -n '1,230p' packages/frontend/core/src/desktop/dialogs/setting/index.tsxRepository: toeverything/AFFiNE
Length of output: 7658
🏁 Script executed:
find packages -name "*.ts" -o -name "*.tsx" | xargs grep -l "export.*FrameworkScope" | head -5Repository: toeverything/AFFiNE
Length of output: 214
🏁 Script executed:
rg "FrameworkScope" packages/frontend -A 3 -B 1 | head -80Repository: toeverything/AFFiNE
Length of output: 6772
🏁 Script executed:
rg "currentLanguageKey" packages/frontend/core/src/desktop/dialogs/setting/ -r '$0'Repository: toeverything/AFFiNE
Length of output: 307
🏁 Script executed:
sed -n '240,307p' packages/frontend/core/src/desktop/dialogs/setting/index.tsxRepository: toeverything/AFFiNE
Length of output: 1856
🏁 Script executed:
find packages/frontend/core/src/desktop/dialogs/setting -name "workspace*" -type fRepository: toeverything/AFFiNE
Length of output: 159
🏁 Script executed:
head -50 packages/frontend/core/src/desktop/dialogs/setting/workspace-setting.tsxRepository: toeverything/AFFiNE
Length of output: 194
🏁 Script executed:
find packages/frontend/core/src/desktop/dialogs/setting/workspace-setting -name "*.tsx" | head -3Repository: toeverything/AFFiNE
Length of output: 347
🏁 Script executed:
ls -la packages/frontend/core/src/desktop/dialogs/setting/Repository: toeverything/AFFiNE
Length of output: 1017
🏁 Script executed:
cat packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/index.tsx | head -80Repository: toeverything/AFFiNE
Length of output: 2852
🏁 Script executed:
cat packages/common/infra/src/framework/react/index.tsx | head -100Repository: toeverything/AFFiNE
Length of output: 2383
🏁 Script executed:
rg "language.*scope|scope.*language" packages/frontend/core/src/desktop/dialogs/setting/ -iRepository: toeverything/AFFiNE
Length of output: 45
🏁 Script executed:
rg "remount|re-mount" packages -i | head -20Repository: toeverything/AFFiNE
Length of output: 1653
🏁 Script executed:
head -100 packages/frontend/core/src/desktop/dialogs/setting/workspace-setting/preference/index.tsxRepository: toeverything/AFFiNE
Length of output: 2916
Remove language-based key from FrameworkScope to prevent settings subtree remounting on locale change.
Keying FrameworkScope by currentLanguageKey forces the entire settings tree to remount when the language changes, destroying component state and in-progress interactions in nested settings flows (such as workspace properties and other workspace settings accessed via SubPageContext). Since currentServer.scope is independent of language, the key serves no functional purpose. Remove the key or move language-specific refresh logic to a narrower UI boundary within the tree.
🤖 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/index.tsx` around lines
198 - 201, Remove the language-based key on FrameworkScope to avoid remounting
the entire settings subtree: in the JSX where FrameworkScope is rendered
(currently keyed with `settings-language-${currentLanguageKey}` and using
`scope={currentServer.scope}`), delete the `key={...currentLanguageKey...}` prop
so the component is keyed only by its stable identity (`currentServer.scope`),
and if you need language-driven updates, implement them inside a narrower child
component instead of on `FrameworkScope`.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## canary #14760 +/- ##
==========================================
- Coverage 57.82% 57.29% -0.54%
==========================================
Files 2960 2960
Lines 165735 165735
Branches 24428 24287 -141
==========================================
- Hits 95841 94953 -888
- Misses 66848 67658 +810
- Partials 3046 3124 +78
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
replace #14758
PR Dependency Tree
This tree was auto-generated by Charcoal
Summary by CodeRabbit