Skip to content

Fix plugin package loading#745

Merged
ghutchis merged 2 commits intoOpenChemistry:masterfrom
ghutchis:enh-load-packages
Feb 25, 2026
Merged

Fix plugin package loading#745
ghutchis merged 2 commits intoOpenChemistry:masterfrom
ghutchis:enh-load-packages

Conversation

@ghutchis
Copy link
Member

@ghutchis ghutchis commented Feb 24, 2026

Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

Summary by CodeRabbit

Release Notes

  • New Features

    • Menu automatically updates when extensions are modified or added.
  • Improvements

    • Streamlined package installation workflow—packages now install only when explicitly confirmed by the user.
  • Chores

    • Enhanced debug logging messages for better clarity.

Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
@ghutchis
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 24, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 24, 2026

Walkthrough

This PR modifies MainWindow to implement dynamic menu updates when extensions change. It introduces an initialization flag to track completion of the initial menu-building phase, simplifies package installation logic to only proceed upon user confirmation, and updates debug messaging terminology.

Changes

Cohort / File(s) Summary
Menu Building & Initialization
avogadro/mainwindow.cpp, avogadro/mainwindow.h
Adds ExtensionPlugin::actionsChanged reaction to trigger dynamic menu rebuilds. Introduces m_initialized flag to conditionally rebuild menu bar after initial setup. Simplifies loadPackages flow to install packages only on user confirmation. Updates debug message from "Load cached packages" to "Load registered packages".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • matterhorn103

Poem

🐰 A rabbit hops through menu trees,
With flags to track where changes please,
Extensions dance, reactions flow,
Dynamic menus steal the show—
Simpler paths make packages grow! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix plugin package loading' directly relates to the main changes in the PR, which focus on modifying how plugin packages are loaded and installed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@avogadro/mainwindow.cpp`:
- Around line 1333-1335: The preprocessor guard around the debug logging
statement using qDebug() << "Load registered packages" is wrong (uses `#ifndef`
DEBUG) so the log runs in release builds; change the guard to `#ifndef` NDEBUG so
the qDebug() call is compiled only in non-release builds, matching the other
debug-only blocks in this file.
- Around line 320-325: Replace the incorrect preprocessor guard that uses DEBUG
with the standard NDEBUG macro so the qDebug() call is compiled only in debug
builds; specifically, find the conditional around the qDebug() call (currently
using "#ifndef DEBUG") in mainwindow.cpp (near where the menu/buildMenuBar
lambda and m_menuBuilder are used) and change it to "#ifndef NDEBUG" to match
the rest of the codebase and suppress debug output in release builds.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dad15ac and 26c3d0c.

📒 Files selected for processing (2)
  • avogadro/mainwindow.cpp
  • avogadro/mainwindow.h

Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
@ghutchis ghutchis merged commit a72eeba into OpenChemistry:master Feb 25, 2026
13 of 27 checks passed
@ghutchis ghutchis deleted the enh-load-packages branch February 25, 2026 02:07
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.

1 participant