-
Notifications
You must be signed in to change notification settings - Fork 489
feat: add default AI profile selection to settings view #180
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
- Introduced default AI profile management in the settings view, allowing users to select a default profile for new features. - Updated the Add Feature dialog to utilize the selected AI profile, setting default model and thinking level based on the chosen profile. - Enhanced the Feature Defaults section to display and manage the default AI profile, including a dropdown for selection and relevant information display.
WalkthroughAdds a per-user persisted default AI profile setting, exposes it in Settings UI, and applies the chosen profile’s model and thinking level when opening the Add Feature dialog (falling back to existing defaults when none is set). Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User
participant SettingsView
participant AppStore
participant AddFeatureDialog
Note over User,SettingsView: User selects default AI profile
User->>SettingsView: choose profile (id or "None")
SettingsView->>AppStore: setDefaultAIProfileId(profileId)
AppStore-->>SettingsView: persisted state updated
Note over User,AddFeatureDialog: Later, user opens Add Feature dialog
User->>AddFeatureDialog: open dialog
AddFeatureDialog->>AppStore: read defaultAIProfileId, aiProfiles
AppStore-->>AddFeatureDialog: return defaultAIProfileId, aiProfiles
AddFeatureDialog->>AddFeatureDialog: lookup profile by id
alt profile found
AddFeatureDialog->>AddFeatureDialog: init newFeature.model & thinkingLevel from profile
else none found
AddFeatureDialog->>AddFeatureDialog: init defaults (model="opus", thinkingLevel="none")
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 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. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
Comment |
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 introduces a significant quality-of-life improvement by allowing users to define a default AI profile in the application settings. This enhancement ensures that when new features are created, they automatically inherit the pre-selected AI model and thinking level, reducing manual configuration and accelerating the workflow for users who frequently use specific AI settings. 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
|
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 introduces the ability to set a default AI profile for new features. It adds a defaultAIProfileId to the application's global state, making it persistent across sessions. A new UI section is implemented in the FeatureDefaultsSection within the settings view, allowing users to select a preferred AI profile or 'None' from a dropdown. This selection is then used in the AddFeatureDialog to automatically pre-populate the AI model and thinking level for newly created features based on the chosen default profile.
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/ui/src/store/app-store.ts (1)
746-746: Consider clearing defaultAIProfileId when the selected profile is deleted.The setter doesn't validate that the
profileIdexists inaiProfiles. When a profile is deleted viaremoveAIProfile(line 1512), consider adding logic to cleardefaultAIProfileIdif it matches the deleted profile:removeAIProfile: (id) => { const profile = get().aiProfiles.find((p) => p.id === id); if (profile && !profile.isBuiltIn) { + // Clear default if this profile was selected + if (get().defaultAIProfileId === id) { + set({ defaultAIProfileId: null }); + } set({ aiProfiles: get().aiProfiles.filter((p) => p.id !== id) }); } },This prevents dangling references. The current code in
AddFeatureDialog(lines 137-139) gracefully handles missing profiles with optional chaining, but proactive cleanup is cleaner.Also applies to: 2271-2271
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/ui/src/components/views/board-view/dialogs/add-feature-dialog.tsx(2 hunks)apps/ui/src/components/views/settings-view.tsx(2 hunks)apps/ui/src/components/views/settings-view/feature-defaults/feature-defaults-section.tsx(5 hunks)apps/ui/src/store/app-store.ts(5 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/ui/src/components/views/settings-view/feature-defaults/feature-defaults-section.tsx (1)
apps/ui/src/store/app-store.ts (2)
AIProfile(270-279)PlanningMode(267-267)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: e2e
🔇 Additional comments (6)
apps/ui/src/store/app-store.ts (1)
497-497: LGTM! State field added correctly.The
defaultAIProfileIdfield is properly typed asstring | nullto represent optional profile selection.apps/ui/src/components/views/board-view/dialogs/add-feature-dialog.tsx (1)
136-147: LGTM! Profile lookup and defaults initialization implemented correctly.The code defensively looks up the default profile and applies its settings with appropriate fallbacks. The effect correctly re-runs when
defaultAIProfileIdoraiProfileschange while the dialog is open, ensuring fresh defaults.apps/ui/src/components/views/settings-view.tsx (1)
46-48: LGTM! Store state and actions correctly wired to FeatureDefaultsSection.All necessary props (
defaultAIProfileId,aiProfiles,onDefaultAIProfileIdChange) are properly passed down to enable AI profile selection in the settings UI.Also applies to: 133-134, 141-141
apps/ui/src/components/views/settings-view/feature-defaults/feature-defaults-section.tsx (3)
54-57: LGTM! Defensive profile lookup.The
selectedProfilecomputation correctly handles the case wheredefaultAIProfileIdmight not match any existing profile (e.g., if a profile was deleted).
193-213: LGTM! Select component correctly handles null value.The value conversion logic (
defaultAIProfileId ?? "none"andv === "none" ? null : v) properly represents the absence of a selection and converts between null and the "none" sentinel value.
215-219: LGTM! Clear and informative user feedback.The descriptive text appropriately shows either the selected profile's configuration or explains the "None" option's behavior.
- Added logic to clear the default AI profile ID if the selected profile is being removed from the AI profiles list. This ensures that the application maintains a valid state when profiles are deleted.
Resolved
Preview
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.