load preference from mod#328
Conversation
WalkthroughThe changes move the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as Any Module (e.g., ai_stackchan)
participant LoadPreference as loadPreference.ts
participant CoreConfig as core config
participant ModuleConfig as module config (optional)
participant Preference as Preference store
Caller->>LoadPreference: loadPreferences(category)
LoadPreference->>CoreConfig: Import base config
LoadPreference->>ModuleConfig: Import module config (if available)
LoadPreference->>LoadPreference: Clone configs and merge
loop For each key in category
LoadPreference->>Preference: get(key)
Preference-->>LoadPreference: value (if exists)
LoadPreference->>LoadPreference: Apply constructor (if needed)
end
LoadPreference-->>Caller: Return merged preferences object
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
firmware/mods/ai_stackchan/mod.js(1 hunks)firmware/mods/ai_stackchan_api/mod.js(1 hunks)firmware/mods/chatgpt/mod.js(1 hunks)firmware/stackchan/main.ts(1 hunks)firmware/stackchan/utilities/loadPreference.ts(1 hunks)firmware/stackchan/utilities/stackchan-util.ts(0 hunks)
💤 Files with no reviewable changes (1)
- firmware/stackchan/utilities/stackchan-util.ts
🧰 Additional context used
🧬 Code Graph Analysis (1)
firmware/stackchan/utilities/loadPreference.ts (1)
firmware/stackchan/utilities/consts.ts (2)
DOMAIN(1-7)PREF_KEYS(9-27)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: build
- GitHub Check: build
🔇 Additional comments (5)
firmware/mods/chatgpt/mod.js (1)
2-3: LGTM! Import change is consistent with the refactor.The change from named import to default import aligns with the extraction of
loadPreferencesto a standalone module.firmware/mods/ai_stackchan/mod.js (1)
3-3: LGTM! Import change aligns with the refactor.The default import from the new
loadPreferencemodule is correct and maintains existing functionality.firmware/mods/ai_stackchan_api/mod.js (1)
3-4: LGTM! Clean separation of imports.Good separation - other utilities remain in
stackchan-utilwhileloadPreferencesis correctly imported from the new standalone module.firmware/stackchan/main.ts (1)
22-23: LGTM! Import refactor is consistent and clean.The import separation maintains existing functionality while properly utilizing the new standalone
loadPreferencemodule.firmware/stackchan/utilities/loadPreference.ts (1)
1-8: LGTM! Imports and setup are correctly structured.The imports are comprehensive and the modConfig initialization properly handles optional module configuration.
meganetaaan
left a comment
There was a problem hiding this comment.
mod側のconfigが上書きで反映されることを確認しました。LGTMです!
#295 の対応になります。詳細はそちらを参照お願いします。
上記以外の変更点として、
Modulesモジュールを使うとpreloadができなくなるため、loadPreferencesを独立させましたSummary by CodeRabbit
New Features
Refactor
Chores