-
Notifications
You must be signed in to change notification settings - Fork 515
refactor(store): Extract types from app-store.ts into modular type files #706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Create store/types/ directory with 8 modular type files: - usage-types.ts: ClaudeUsage, CodexUsage, isClaudeUsageAtLimit - ui-types.ts: ViewMode, ThemeMode, KeyboardShortcuts, etc. - settings-types.ts: ApiKeys - chat-types.ts: ChatMessage, ChatSession, FeatureImage - terminal-types.ts: TerminalState, TerminalTab, etc. - project-types.ts: Feature, FileTreeNode, ProjectAnalysis - state-types.ts: AppState, AppActions interfaces - index.ts: Re-exports all types - Update electron.ts to import from store/types/usage-types (breaks circular dependency between electron.ts and app-store.ts) - Update app-store.ts to import and re-export types for backward compatibility - existing imports from @/store/app-store continue to work This is PR 1 of the app-store refactoring plan. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary of ChangesHello @Shironex, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request represents a foundational step in refactoring the application's state management. By moving all type definitions into a dedicated and modular directory structure, it enhances the clarity and navigability of the codebase. This change not only addresses a critical circular dependency but also sets the stage for future improvements by making the core store logic cleaner and more focused on state management rather than type declarations. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughAdds a new UI store types directory with multiple type modules (chat, project, settings, state, terminal, UI, usage), a barrel export, and updates one import in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request is a significant and well-executed refactoring that extracts type definitions from the monolithic app-store.ts into a modular store/types/ directory. This greatly improves code organization, breaks a circular dependency, and enhances maintainability. The changes are clear and the use of a central index.ts for re-exports ensures backward compatibility. I've added a few suggestions to further improve the separation of types from implementation logic, which aligns with the goal of this refactoring.
Address Gemini review feedback - reduce code duplication by having FeatureImage extend ImageAttachment instead of duplicating properties. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Response to Gemini ReviewThank you for the thorough review! Here's my response to each suggestion: ✅ Applied:
|
Summary
app-store.ts(4,419 lines) into a modularstore/types/directoryelectron.tsandapp-store.tsChanges
New Files Created (
apps/ui/src/store/types/)usage-types.tsui-types.tssettings-types.tschat-types.tsterminal-types.tsproject-types.tsstate-types.tsindex.tsFiles Modified
apps/ui/src/lib/electron.ts- Import from@/store/types/usage-typesinstead of@/store/app-store(breaks circular dependency)apps/ui/src/store/app-store.ts- Import types from./typesand re-export for backward compatibilityBackward Compatibility
All existing imports from
@/store/app-storecontinue to work:Test Plan
npm run build)npm run lint- 0 errors)npm run test:packages- 519 tests)npm run test:server- 1,415 tests)Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.