Repository navigation
feat: 設定状態管理を選択購読型ストアへ再設計し、無関係なfeatureの再レンダリングを防ぐ - #41
Merged
Merged
Conversation
12 tasks
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.
概要
Closes #31
設定状態を React 標準の
useSyncExternalStoreベースの選択購読型ストアへ再設計し、feature A の設定変更で feature B や共通UIが不要に再レンダリングされないようにしました。実装内容
src/core/store/settingsStore.ts): 保存キュー、debounce、即時保存条件、sequence 制御、retry、settings-changed外部イベント同期、window 破棄時の flush を維持した SettingsStore を新設src/core/context/AppSettings.tsx):useSettingsSelector(useSyncExternalStore+ equality メモ化)、useSettings/useSettingsLoading/useSettingsError/useSettingsSaveStatus/useShortcutError/useUpdateSettingsなどを提供。legacyuseAppSettings全体 Context 購読 API は削除useFeatureSettings: selector 版へ移行し、feature slice 参照を維持SidebarSaveStatus/SettingsSaveStatusBarを新設し、AppContentはsaveStatusを購読しない構成へ。保存状態の変化は保存状態UIだけへ通知される検証
npm run check:quickパス(tsc / biome / scripts / ai-context / ai-foundation / release-version / verify-architecture 311 checks)src/core/store/settingsSelectors.test.tsx: feature A 変更時に feature B が再レンダリングされない / 保存状態変化で feature が再レンダリングされない / shortcutError の分離 / no-op 更新の抑制 / 外部settings-changedpayload 適用src/App.saveStatus.test.tsx: App 実描画レベルで保存状態遷移中に feature 設定コンポーネントが再レンダリングされないことを render count で検証受け入れ条件との対応