Skip to content
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

new(ui/electron): allow updater disableing #853

Merged
merged 4 commits into from
Mar 15, 2024
Merged

new(ui/electron): allow updater disableing #853

merged 4 commits into from
Mar 15, 2024

Conversation

Enubia
Copy link
Owner

@Enubia Enubia commented Mar 15, 2024

Summary by CodeRabbit

  • New Features
    • Introduced manual update capabilities alongside existing auto-update functionality.
    • Added version-specific configurations to enhance app customization.
    • Implemented new settings for disabling auto-updates and managing update preferences.
  • Refactor
    • Updated the auto-updater settings and method signatures for improved clarity and functionality.
    • Enhanced settings and header components for better user interaction.
  • Chores
    • Adjusted ESLint configuration to accommodate new development practices.
  • Style
    • Refined user interface elements to accommodate new features and settings.

Copy link
Contributor

coderabbitai bot commented Mar 15, 2024

Walkthrough

The recent update introduces a significant enhancement to the update mechanism within an Electron application, incorporating a manual update option alongside the existing automatic updates. It involves renaming and adjusting properties and methods related to the updater, adding a new ManualUpdater class, and integrating this functionality across various components. Additionally, the update accommodates version-specific configurations and improves user settings related to updates, alongside minor adjustments in the application's UI components and code quality improvements.

Changes

Files Change Summary
electron/main/autoUpdater.ts - Renamed updater to updaterSettings
- Added logPrefix
- Updated method signature for sendStatusToWindow
electron/main/background.ts
electron/main/ipcEvents.ts
- Integrated ManualUpdater
- Conditional instantiation and registration logic for AutoUpdater and ManualUpdater
electron/main/manualUpdater.ts - Introduced ManualUpdater class
electron/main/store.ts
shared/constants/store.ts
shared/types/store.ts
- Added version-specific config and disableAutoUpdates property
eslint.config.js - Disabled 'no-new' rule
shared/constants/events.ts - Added AutoUpdateDisabled, CheckForUpdates, and UpdateStatus constants
src/App.vue
src/components/settings/General.vue
- Adjusted UI and logic for auto-update settings
src/app.ts - Removed createPinia usage
src/components/header/Buttons.vue - Updated event handling to use $emit

🐰✨
In the land of code and pixel sprites,
A rabbit hopped through bugs and bytes.
With a flick and a hop, updates took flight,
Manual or auto, to users' delight.
🌟 No more waiting, control in your sight!
🚀💾🐇

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 96e52fa and 9aff4af.
Files ignored due to path filters (3)
  • i18n/locales/en-US.json is excluded by: !**/*.json
  • package.json is excluded by: !**/*.json
  • pnpm-lock.yaml is excluded by: !**/*.yaml
Files selected for processing (13)
  • electron/main/autoUpdater.ts (3 hunks)
  • electron/main/background.ts (3 hunks)
  • electron/main/ipcEvents.ts (3 hunks)
  • electron/main/manualUpdater.ts (1 hunks)
  • electron/main/store.ts (1 hunks)
  • eslint.config.js (1 hunks)
  • shared/constants/events.ts (1 hunks)
  • shared/constants/store.ts (1 hunks)
  • shared/types/store.ts (1 hunks)
  • src/App.vue (2 hunks)
  • src/app.ts (2 hunks)
  • src/components/header/Buttons.vue (2 hunks)
  • src/components/settings/General.vue (5 hunks)
Files skipped from review due to trivial changes (3)
  • shared/constants/events.ts
  • shared/constants/store.ts
  • src/app.ts
Additional comments: 14
eslint.config.js (1)
  • 14-14: The addition of 'no-new': 'off' to the ESLint configuration disables warnings for using the new keyword without storing the result. While this can accommodate certain design patterns, especially those seen in this PR with ManualUpdater and AutoUpdater, it's crucial to use this practice judiciously to avoid potential memory leaks or unclear code. Ensure that objects instantiated in this manner are managed appropriately.
src/components/header/Buttons.vue (2)
  • 5-5: Removing store from props and relying on alternative state management approaches can enhance component reusability and maintainability. Ensure that the necessary state is still accessible to this component, possibly through global state management or context providers.
  • 16-16: Updating the @click event handler to use $emit aligns with Vue 3's Composition API best practices. This change enhances the component's compatibility with Vue 3 and its overall maintainability.
shared/types/store.ts (1)
  • 43-43: Adding the disableAutoUpdates boolean property to the Updater interface aligns with the PR's objective of providing users with the option to disable automatic updates. Ensure that this property is correctly utilized throughout the application to respect the user's preferences.
electron/main/ipcEvents.ts (4)
  • 11-11: The import of ManualUpdater is correctly done, ensuring that the new functionality for manual updates can be integrated into the IpcEvents class.
  • 17-17: Adding the manualUpdater property to the IpcEvents class is a good practice for encapsulating the functionality related to manual updates. This allows for a clean separation of concerns.
  • 35-37: The registerManualUpdater method is well-implemented, providing a clear and straightforward way to associate a ManualUpdater instance with the IpcEvents class. This is crucial for enabling manual update functionality based on user settings.
  • 168-170: The integration of ManualUpdater within the openSettings method is correctly done, ensuring that the settings window can interact with the manual update process. This is an essential part of providing a seamless user experience for managing updates.
src/components/settings/General.vue (6)
  • 22-23: The addition of disableAutoUpdates and updaterStatus variables is a crucial step in enabling users to control the auto-update functionality from the UI. This aligns with the PR's objective of enhancing user control over the application's update process.
  • 34-36: The saveKeybind function is correctly implemented, providing a way to save the keybind settings and notify the main process. This is important for ensuring that keybind changes are applied immediately.
  • 39-41: The checkForUpdates function is well-implemented, initiating the update check process. This function is essential for allowing users to manually check for updates when auto-updates are disabled.
  • 44-45: The restart function is correctly implemented, providing a way to restart the application. This is necessary for applying updates that have been downloaded.
  • 110-110: The change event handler for the participateInPreRelease checkbox is correctly updated to reflect the user's choice regarding beta updates. This is an important aspect of providing users with control over the update channels.
  • 119-163: The addition of the auto-update settings section in the template, including the UI elements for disabling auto-updates and manually checking for updates, is well-implemented. This provides users with a clear and intuitive interface for managing update preferences.

electron/main/store.ts Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 9aff4af and 8c9cef7.
Files selected for processing (1)
  • electron/main/store.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • electron/main/store.ts

@Enubia Enubia merged commit f65e379 into master Mar 15, 2024
3 checks passed
@Enubia Enubia deleted the updater-options branch April 12, 2024 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant