-
Notifications
You must be signed in to change notification settings - Fork 98
Add auto update setting #519
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes add automatic update version management to the Account interface and implement a new UI in the settings tab that allows users to select between Disabled, Latest, or Custom update versions, with validation and API integration for persisting changes. Changes
Sequence DiagramsequenceDiagram
actor User
participant UI as ClientSettingsTab
participant API as Settings API
participant Account as Account Service
participant State as Component State
User->>UI: Select auto-update option (Disabled/Latest/Custom)
UI->>State: Update autoUpdateMethod state
alt Custom Version Selected
User->>UI: Enter custom version
UI->>State: Validate & update autoUpdateCustomVersion
end
User->>UI: Click Save Changes
UI->>API: POST updated account settings
activate API
API-->>UI: Success response
deactivate API
UI->>Account: Refetch accounts
activate Account
Account-->>UI: Updated account data
deactivate Account
UI->>State: Update UI with new values
UI-->>User: Display confirmation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 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.
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)
src/modules/settings/ClientSettingsTab.tsx (1)
83-90: Consider removing the special case for "-".The special case for
"-"on line 86 appears intended to suppress errors during typing, but it's inconsistent—typing just "-" shows no error, but typing "0.52-" (mid-prerelease) still shows an error. Either debounce the validation or remove this edge case for consistency.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/interfaces/Account.tssrc/modules/settings/ClientSettingsTab.tsx
🧰 Additional context used
🧬 Code graph analysis (1)
src/modules/settings/ClientSettingsTab.tsx (4)
src/components/select/SelectDropdown.tsx (2)
SelectOption(18-26)SelectDropdown(46-222)src/utils/helpers.ts (1)
validator(62-160)src/components/Notification.tsx (1)
notify(151-155)src/components/HelpText.tsx (1)
HelpText(9-25)
⏰ 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: build_n_push
🔇 Additional comments (5)
src/interfaces/Account.ts (1)
25-25: LGTM!The new
auto_update_versionproperty is correctly placed at thesettingslevel, consistent with similar settings likelazy_connection_enabled.Note: The AI summary incorrectly states this property is added to
Account.settings.extra, but the actual placement atAccount.settingslevel is correct based on the existing pattern.src/modules/settings/ClientSettingsTab.tsx (4)
59-74: LGTM!The state initialization logic correctly derives the initial UI state from the stored
auto_update_versionsetting. The use ofvalidator.isValidVersion()to distinguish between keyword values ("disabled"/"latest") and custom version strings is a clean approach.
110-128: LGTM!The save logic correctly constructs the API value: custom version string when applicable, otherwise the method keyword ("disabled"/"latest"). The pattern follows the existing
toggleLazyConnectionimplementation.
92-108: LGTM!The save button enablement logic correctly gates saving when "Custom Version" is selected but no valid version is provided.
170-209: LGTM!The UI implementation is clean:
- Save button correctly uses
isSaveButtonDisabledand callssaveChanges- Dropdown and input layout with conditional enabling is appropriate
- Input validation error display with tooltip provides good UX
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.