Skip to content

Fix the displayed buttons in detail view#178

Merged
chennes merged 1 commit into
FreeCAD:mainfrom
chennes:fixDisplayedButtonState
Aug 16, 2025
Merged

Fix the displayed buttons in detail view#178
chennes merged 1 commit into
FreeCAD:mainfrom
chennes:fixDisplayedButtonState

Conversation

@chennes
Copy link
Copy Markdown
Member

@chennes chennes commented Aug 16, 2025

No description provided.

Copilot AI review requested due to automatic review settings August 16, 2025 19:35

This comment was marked as outdated.

@chennes chennes force-pushed the fixDisplayedButtonState branch from 491f6b8 to 0ea31ca Compare August 16, 2025 19:46
@chennes chennes requested a review from Copilot August 16, 2025 19:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the display of buttons in the addon detail view by refactoring the update check mechanism and improving button visibility logic. The changes remove automatic update checking when viewing addon details and simplify the button display logic based on installation status and available branches.

  • Automatic update checking is removed from the detail view initialization
  • Update button visibility is now based on actual update availability rather than addon type
  • Button display logic is simplified and made more consistent across different installation scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
addonmanager_package_details_controller.py Removes automatic update checking, updates button visibility logic for update availability
Widgets/addonmanager_widget_addon_buttons.py Removes unused display mode enum, simplifies button visibility logic and branch handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -120,9 +120,10 @@ def set_up_updater(self):
if self.addon.repo_type == Addon.Kind.MACRO
else os.path.join(self.addon.mod_directory, self.addon.name)
)
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

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

The line self.ui.set_disabled(self.addon.is_disabled()) has been removed but there's no indication that this functionality has been moved elsewhere. This could result in the UI not properly reflecting the addon's disabled state.

Copilot uses AI. Check for mistakes.
self.ui.button_bar.check_for_update.clicked.connect(
self.check_for_update_worker.do_work
)
self.update_check_thread.started.connect(self.check_for_update_worker.do_work)
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

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

The update check is now triggered automatically when the thread starts rather than when the user clicks the update button. This changes the user interaction model and may cause unwanted automatic update checks.

Copilot uses AI. Check for mistakes.
not presented to the user as an option to change.
:param disabled: Whether the addon is currently disabled."""
:param disabled: Whether the addon is currently disabled.
:param can_be_disabled: Whether the addon can be disabled (i.e., if it is NOT a macro)"""
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

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

The docstring mentions a can_be_disabled parameter that doesn't exist in the function signature. The parameter list should be updated to match the documented behavior.

Copilot uses AI. Check for mistakes.
@chennes chennes merged commit b752f76 into FreeCAD:main Aug 16, 2025
11 checks passed
@chennes chennes deleted the fixDisplayedButtonState branch August 16, 2025 21:29
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.

2 participants