Repository navigation
Enable compile-time checks for injects - #10618
Conversation
831ca4e to
1f78382
Compare
|
Important Review skippedToo many files! This PR contains 243 files, which is 93 over the limit of 150. ⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 410238ee51ae95c344dec1d07af566b771ad66f0 and 907abff. 📒 Files selected for processing (243)
You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughUpdated the muse_framework submodule reference. Large-scale IoC rewire: many members changed from instance/context-scoped Sequence Diagram(s)sequenceDiagram
participant App as Application
participant NyquistModule as NyquistEffectsModule
participant GlobalIOC as globalIoc()
participant Loader as NyquistPromptLoader
App->>NyquistModule: onPreInit(runMode)
NyquistModule->>Loader: create/store prompt loader (deferred)
App->>NyquistModule: onInit(runMode)
NyquistModule->>GlobalIOC: resolve IParameterExtractorRegistry
GlobalIOC-->>NyquistModule: registry instance
NyquistModule->>GlobalIOC: register parameter extractors
App->>NyquistModule: onAllInited(runMode)
NyquistModule->>Loader: initialize deferred prompt loader
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (2 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
src/project/tests/environment.cpp (1)
18-18: Consider replacing the hardcoded context id with a named constant.
999works, but a named constant (or helper) would make intent clearer and reduce accidental id reuse across suites.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/project/tests/environment.cpp` at line 18, Replace the magic number 999 used when constructing s_testCtx with a named constant to clarify intent and avoid id collisions; define a constant (e.g. constexpr int kTestContextId = 999 or a helper like GetTestContextId()) near the test file scope and use that symbol in the call to muse::modularity::Context in the s_testCtx initialization so the identifier is explicit and easy to reuse or change.src/effects/nyquist/nyquistprompt/NyquistPromptView.qml (1)
68-78: Consider adding navigation support toTextInputArea.The three
FlatButtoncontrols now have proper keyboard navigation (orders 0, 1, 2), which improves accessibility. However, theTextInputAreaat line 82 is not wired into the navigation panel—users may not be able to tab into it seamlessly.If
TextInputAreasupports thenavigationproperty, consider adding it with an appropriate order value to complete the keyboard navigation flow.Also applies to: 102-123
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/effects/nyquist/nyquistprompt/NyquistPromptView.qml` around lines 68 - 78, The TextInputArea instances are not wired into the navigation panel, breaking keyboard tabbability; update each TextInputArea (the component named TextInputArea in this QML) to include navigation.panel: root.navPanel and set navigation.order to follow the FlatButton sequence (use navigation.order: 3 for the first TextInputArea after the buttons, and increment accordingly for the other occurrence(s) so the orders remain sequential), ensuring the TextInputArea(s) participate in the same navigation flow as the FlatButton controls.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@muse_framework`:
- Line 1: The submodule pointer in the superproject references a non-existent
commit (4694067f15fdaf28272c31594a9f7c20f47d3fc4), preventing init/checkout; fix
by ensuring the referenced commit exists on the submodule remote (either push
the missing commit from the submodule repo or retarget the submodule gitlink to
an existing remote commit or branch), then update the superproject: in the
submodule repo fetch/push the missing commit to origin (or check out a reachable
commit), commit the updated gitlink in the superproject, and run git submodule
sync && git submodule update --init --recursive so the submodule can be
initialized and the PR can merge.
In `@src/projectscene/projectscenemodule.cpp`:
- Line 234: The registration of ProjectViewStateCreator is being added to
globalIoc() using IProjectViewStateCreator which holds context-specific state
but onDeinit() is empty, so either unregister that global export in onDeinit()
or move the registration to the context-scoped ioc() to avoid stale references;
specifically, locate the line registering IProjectViewStateCreator with
globalIoc() and change it to register with ioc() (to match
IProjectSceneActionsController) or add an explicit
globalIoc()->unregisterExport<IProjectViewStateCreator>(mname) call in
onDeinit() to clean up the export when ProjectSceneContext is destroyed.
---
Nitpick comments:
In `@src/effects/nyquist/nyquistprompt/NyquistPromptView.qml`:
- Around line 68-78: The TextInputArea instances are not wired into the
navigation panel, breaking keyboard tabbability; update each TextInputArea (the
component named TextInputArea in this QML) to include navigation.panel:
root.navPanel and set navigation.order to follow the FlatButton sequence (use
navigation.order: 3 for the first TextInputArea after the buttons, and increment
accordingly for the other occurrence(s) so the orders remain sequential),
ensuring the TextInputArea(s) participate in the same navigation flow as the
FlatButton controls.
In `@src/project/tests/environment.cpp`:
- Line 18: Replace the magic number 999 used when constructing s_testCtx with a
named constant to clarify intent and avoid id collisions; define a constant
(e.g. constexpr int kTestContextId = 999 or a helper like GetTestContextId())
near the test file scope and use that symbol in the call to
muse::modularity::Context in the s_testCtx initialization so the identifier is
explicit and easy to reuse or change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 6f1b1d84-1118-4c42-a499-7de76204c6f3
📒 Files selected for processing (46)
muse_frameworksrc/app/pluginregistrationapp.cppsrc/appshell/internal/applicationactioncontroller.hsrc/appshell/internal/iappmenumodelhook.hsrc/appshell/internal/sessionsmanager.hsrc/appshell/qml/Audacity/AppShell/appmenumodel.hsrc/au3audio/internal/au3audiodevicesprovider.hsrc/au3wrap/iau3project.hsrc/audio/iaudioengine.hsrc/effects/effects_base/internal/effectexecutionscenario.hsrc/effects/effects_base/internal/effectinstancesregister.hsrc/effects/effects_base/internal/effectparametersprovider.hsrc/effects/effects_base/iparameterextractorregistry.hsrc/effects/effects_base/view/generatedeffectviewermodel.hsrc/effects/nyquist/internal/nyquistpluginsscanner.cppsrc/effects/nyquist/nyquisteffectsmodule.cppsrc/effects/nyquist/nyquisteffectsmodule.hsrc/effects/nyquist/nyquistprompt/NyquistPromptView.qmlsrc/effects/nyquist/nyquistprompt/nyquistpromptviewmodel.hsrc/importexport/export/iffmpegoptionsaccessor.hsrc/importexport/export/view/channelmappingtableviewmodel.hsrc/importexport/export/view/customffmpegpreferencesmodel.hsrc/importexport/export/view/exportpreferencesmodel.hsrc/playback/internal/au3/au3audiooutput.hsrc/playback/internal/au3/au3player.hsrc/playback/internal/playbackcontroller.hsrc/playback/iplaybackmetercontroller.hsrc/playback/view/common/metermodel.hsrc/project/internal/audacityproject.hsrc/project/internal/projectautosaver.hsrc/project/tests/environment.cppsrc/projectscene/internal/projectsceneactionscontroller.hsrc/projectscene/iprojectviewstatecreator.hsrc/projectscene/projectscenemodule.cppsrc/record/internal/au3/au3audioinput.hsrc/record/internal/au3/au3record.hsrc/record/irecordmetercontroller.hsrc/record/view/toolbars/playbacktoolbarrecordlevelitem.hsrc/spectrogram/view/spectrogramchannelrulermodel.hsrc/toast/internal/toastservice.hsrc/toast/itoastprovider.hsrc/toast/view/toastlistmodel.hsrc/trackedit/internal/au3/au3trackeditclipboard.hsrc/trackedit/itrackeditproject.hsrc/trackedit/trackeditmodule.cppsrc/uicomponents/components/polyline.h
387b0bb to
aa05413
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/projectscene/projectscenemodule.cpp (1)
234-234:⚠️ Potential issue | 🟠 MajorContext-bound creator is being exported globally without lifecycle safety.
Line 234 registers
ProjectViewStateCreator(iocContext())inglobalIoc()under a static key, whileonDeinit()(Line 259) does not unregister it. This can leave stale context references and can also cause cross-project context mixups when multiple contexts are created.Suggested fix
void ProjectSceneContext::onDeinit() { + globalIoc()->unregisterExport<IProjectViewStateCreator>(mname); }If this service is inherently context-specific, prefer context IoC registration instead of global export.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/projectscene/projectscenemodule.cpp` at line 234, The ProjectViewStateCreator instance created with iocContext() is being exported to globalIoc() via registerExport which leaks a context-bound object into a global registry; change the registration to the context IoC (use iocContext()->registerExport or equivalent) so the creator lives and is torn down with its context, or if global registration is required, ensure symmetry by unregistering the same key in onDeinit() (remove the globalIoc()->registerExport(...) call and instead call iocContext()->registerExport<IProjectViewStateCreator>(mname, std::make_shared<ProjectViewStateCreator>(iocContext())), or add a matching globalIoc()->unregisterExport(mname) in onDeinit()).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@src/projectscene/projectscenemodule.cpp`:
- Line 234: The ProjectViewStateCreator instance created with iocContext() is
being exported to globalIoc() via registerExport which leaks a context-bound
object into a global registry; change the registration to the context IoC (use
iocContext()->registerExport or equivalent) so the creator lives and is torn
down with its context, or if global registration is required, ensure symmetry by
unregistering the same key in onDeinit() (remove the
globalIoc()->registerExport(...) call and instead call
iocContext()->registerExport<IProjectViewStateCreator>(mname,
std::make_shared<ProjectViewStateCreator>(iocContext())), or add a matching
globalIoc()->unregisterExport(mname) in onDeinit()).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 58c2dcd1-5262-4bbc-937f-7990d3154e9c
📥 Commits
Reviewing files that changed from the base of the PR and between 1f78382 and aa0541313c4a27622a9911904dbc7a461c6acc9a.
📒 Files selected for processing (53)
muse_frameworksrc/app/pluginregistrationapp.cppsrc/appshell/internal/applicationactioncontroller.hsrc/appshell/internal/iappmenumodelhook.hsrc/appshell/internal/sessionsmanager.hsrc/appshell/qml/Audacity/AppShell/appmenumodel.hsrc/au3audio/internal/au3audiodevicesprovider.hsrc/au3wrap/iau3project.hsrc/audio/iaudioengine.hsrc/effects/effects_base/internal/effectexecutionscenario.hsrc/effects/effects_base/internal/effectinstancesregister.hsrc/effects/effects_base/internal/effectparametersprovider.hsrc/effects/effects_base/iparameterextractorregistry.hsrc/effects/effects_base/view/generatedeffectviewermodel.hsrc/effects/nyquist/internal/nyquistpluginsscanner.cppsrc/effects/nyquist/nyquisteffectsmodule.cppsrc/effects/nyquist/nyquisteffectsmodule.hsrc/effects/nyquist/nyquistprompt/NyquistPromptView.qmlsrc/effects/nyquist/nyquistprompt/nyquistpromptviewmodel.hsrc/importexport/export/iffmpegoptionsaccessor.hsrc/importexport/export/view/channelmappingtableviewmodel.hsrc/importexport/export/view/customffmpegpreferencesmodel.hsrc/importexport/export/view/exportpreferencesmodel.hsrc/playback/internal/au3/au3audiooutput.hsrc/playback/internal/au3/au3player.hsrc/playback/internal/playbackcontroller.hsrc/playback/iplaybackmetercontroller.hsrc/playback/view/common/metermodel.hsrc/project/internal/audacityproject.hsrc/project/internal/projectactionscontroller.hsrc/project/internal/projectautosaver.hsrc/project/tests/environment.cppsrc/projectscene/internal/projectsceneactionscontroller.hsrc/projectscene/iprojectviewstatecreator.hsrc/projectscene/projectscenemodule.cppsrc/record/internal/au3/au3audioinput.hsrc/record/internal/au3/au3record.hsrc/record/irecordmetercontroller.hsrc/record/view/toolbars/playbacktoolbarrecordlevelitem.hsrc/spectrogram/view/spectrogramchannelrulermodel.hsrc/toast/dev/toasttestsmodel.hsrc/toast/internal/toastservice.cppsrc/toast/internal/toastservice.hsrc/toast/itoastprovider.hsrc/toast/itoastservice.hsrc/toast/toastmodule.cppsrc/toast/toastmodule.hsrc/toast/view/toastlistmodel.hsrc/trackedit/internal/au3/au3trackeditclipboard.hsrc/trackedit/internal/au3/au3trackeditproject.hsrc/trackedit/itrackeditproject.hsrc/trackedit/trackeditmodule.cppsrc/uicomponents/components/polyline.h
💤 Files with no reviewable changes (1)
- src/toast/internal/toastservice.cpp
✅ Files skipped from review due to trivial changes (15)
- src/effects/effects_base/internal/effectexecutionscenario.h
- src/effects/nyquist/internal/nyquistpluginsscanner.cpp
- muse_framework
- src/importexport/export/iffmpegoptionsaccessor.h
- src/effects/effects_base/iparameterextractorregistry.h
- src/appshell/internal/iappmenumodelhook.h
- src/projectscene/internal/projectsceneactionscontroller.h
- src/record/irecordmetercontroller.h
- src/importexport/export/view/exportpreferencesmodel.h
- src/spectrogram/view/spectrogramchannelrulermodel.h
- src/playback/internal/playbackcontroller.h
- src/trackedit/internal/au3/au3trackeditclipboard.h
- src/uicomponents/components/polyline.h
- src/trackedit/itrackeditproject.h
- src/importexport/export/view/channelmappingtableviewmodel.h
🚧 Files skipped from review as they are similar to previous changes (23)
- src/audio/iaudioengine.h
- src/app/pluginregistrationapp.cpp
- src/appshell/internal/applicationactioncontroller.h
- src/au3wrap/iau3project.h
- src/playback/iplaybackmetercontroller.h
- src/effects/effects_base/internal/effectinstancesregister.h
- src/effects/nyquist/nyquisteffectsmodule.h
- src/projectscene/iprojectviewstatecreator.h
- src/toast/itoastprovider.h
- src/playback/internal/au3/au3player.h
- src/record/internal/au3/au3record.h
- src/effects/effects_base/internal/effectparametersprovider.h
- src/au3audio/internal/au3audiodevicesprovider.h
- src/record/internal/au3/au3audioinput.h
- src/toast/view/toastlistmodel.h
- src/effects/effects_base/view/generatedeffectviewermodel.h
- src/playback/internal/au3/au3audiooutput.h
- src/appshell/qml/Audacity/AppShell/appmenumodel.h
- src/record/view/toolbars/playbacktoolbarrecordlevelitem.h
- src/effects/nyquist/nyquistprompt/NyquistPromptView.qml
- src/trackedit/trackeditmodule.cpp
- src/toast/internal/toastservice.h
- src/effects/nyquist/nyquisteffectsmodule.cpp
aa05413 to
c7ae3f2
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/toast/toastmodule.cpp (1)
51-62: Consider removing the now-emptyToastContextin a follow-up.
ToastContextis now a hollow shell with an emptyonDeinit()and noregisterExports(). While this works, it adds minimal value. Consider removing it entirely if theIContextSetupinterface allows returningnullptrfromnewContext(), or document why it's retained.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/toast/toastmodule.cpp` around lines 51 - 62, The ToastContext class is now empty (empty ToastContext::onDeinit and no registerExports) so either remove it or explicitly document why it remains; update ToastModule::newContext to return nullptr if IContextSetup allows it, or delete the ToastContext type and adjust ToastModule::newContext to not construct it and remove any related declarations/headers; alternatively add a comment in ToastContext explaining its purpose if you must keep it.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/project/tests/audacityproject_tests.cpp`:
- Around line 88-96: Uncrustify flagged spacing around the template
instantiation of
std::make_shared<::testing::NiceMock<au::trackedit::ClipboardMock>>() in the
test setup; fix the spacing so the template and angle brackets follow the
project's style (no extra spaces between ::testing::NiceMock and its template
args or between make_shared and the following <...), then run
tools/codestyle/uncrustify_run_file.sh on this file to apply/verify the
formatting changes; check the block that assigns m_clipboard
(std::make_shared<::testing::NiceMock<au::trackedit::ClipboardMock>>()) and
ensure surrounding lines with m_testCtx, m_currentProject,
trackeditProjectCreator/viewStateCreator/clipboard follow the same uncrustify
style.
---
Nitpick comments:
In `@src/toast/toastmodule.cpp`:
- Around line 51-62: The ToastContext class is now empty (empty
ToastContext::onDeinit and no registerExports) so either remove it or explicitly
document why it remains; update ToastModule::newContext to return nullptr if
IContextSetup allows it, or delete the ToastContext type and adjust
ToastModule::newContext to not construct it and remove any related
declarations/headers; alternatively add a comment in ToastContext explaining its
purpose if you must keep it.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 191c9da2-211a-4571-91bc-903a6259d886
📥 Commits
Reviewing files that changed from the base of the PR and between aa0541313c4a27622a9911904dbc7a461c6acc9a and c7ae3f25ff1858b03155a2587119fbc14667ae82.
📒 Files selected for processing (54)
muse_frameworksrc/app/pluginregistrationapp.cppsrc/appshell/internal/applicationactioncontroller.hsrc/appshell/internal/iappmenumodelhook.hsrc/appshell/internal/sessionsmanager.hsrc/appshell/qml/Audacity/AppShell/appmenumodel.hsrc/au3audio/internal/au3audiodevicesprovider.hsrc/au3wrap/iau3project.hsrc/audio/iaudioengine.hsrc/effects/effects_base/internal/effectexecutionscenario.hsrc/effects/effects_base/internal/effectinstancesregister.hsrc/effects/effects_base/internal/effectparametersprovider.hsrc/effects/effects_base/iparameterextractorregistry.hsrc/effects/effects_base/view/generatedeffectviewermodel.hsrc/effects/nyquist/internal/nyquistpluginsscanner.cppsrc/effects/nyquist/nyquisteffectsmodule.cppsrc/effects/nyquist/nyquisteffectsmodule.hsrc/effects/nyquist/nyquistprompt/NyquistPromptView.qmlsrc/effects/nyquist/nyquistprompt/nyquistpromptviewmodel.hsrc/importexport/export/iffmpegoptionsaccessor.hsrc/importexport/export/view/channelmappingtableviewmodel.hsrc/importexport/export/view/customffmpegpreferencesmodel.hsrc/importexport/export/view/exportpreferencesmodel.hsrc/playback/internal/au3/au3audiooutput.hsrc/playback/internal/au3/au3player.hsrc/playback/internal/playbackcontroller.hsrc/playback/iplaybackmetercontroller.hsrc/playback/view/common/metermodel.hsrc/project/internal/audacityproject.hsrc/project/internal/projectactionscontroller.hsrc/project/internal/projectautosaver.hsrc/project/tests/audacityproject_tests.cppsrc/project/tests/environment.cppsrc/projectscene/internal/projectsceneactionscontroller.hsrc/projectscene/iprojectviewstatecreator.hsrc/projectscene/projectscenemodule.cppsrc/projectscene/tests/tracklabelslayoutmanager_tests.cppsrc/record/internal/au3/au3audioinput.hsrc/record/internal/au3/au3record.hsrc/record/irecordmetercontroller.hsrc/record/view/toolbars/playbacktoolbarrecordlevelitem.hsrc/spectrogram/view/spectrogramchannelrulermodel.hsrc/toast/dev/toasttestsmodel.hsrc/toast/internal/toastservice.cppsrc/toast/internal/toastservice.hsrc/toast/itoastprovider.hsrc/toast/itoastservice.hsrc/toast/toastmodule.cppsrc/toast/toastmodule.hsrc/toast/view/toastlistmodel.hsrc/trackedit/internal/au3/au3trackeditclipboard.hsrc/trackedit/itrackeditproject.hsrc/trackedit/trackeditmodule.cppsrc/uicomponents/components/polyline.h
💤 Files with no reviewable changes (1)
- src/toast/internal/toastservice.cpp
✅ Files skipped from review due to trivial changes (18)
- src/audio/iaudioengine.h
- src/playback/internal/playbackcontroller.h
- src/trackedit/internal/au3/au3trackeditclipboard.h
- src/effects/effects_base/internal/effectexecutionscenario.h
- muse_framework
- src/effects/effects_base/iparameterextractorregistry.h
- src/playback/iplaybackmetercontroller.h
- src/effects/nyquist/internal/nyquistpluginsscanner.cpp
- src/toast/itoastprovider.h
- src/projectscene/tests/tracklabelslayoutmanager_tests.cpp
- src/importexport/export/iffmpegoptionsaccessor.h
- src/projectscene/internal/projectsceneactionscontroller.h
- src/uicomponents/components/polyline.h
- src/appshell/internal/applicationactioncontroller.h
- src/spectrogram/view/spectrogramchannelrulermodel.h
- src/projectscene/projectscenemodule.cpp
- src/importexport/export/view/exportpreferencesmodel.h
- src/importexport/export/view/customffmpegpreferencesmodel.h
🚧 Files skipped from review as they are similar to previous changes (28)
- src/importexport/export/view/channelmappingtableviewmodel.h
- src/au3wrap/iau3project.h
- src/effects/effects_base/view/generatedeffectviewermodel.h
- src/effects/effects_base/internal/effectinstancesregister.h
- src/projectscene/iprojectviewstatecreator.h
- src/record/irecordmetercontroller.h
- src/app/pluginregistrationapp.cpp
- src/toast/toastmodule.h
- src/effects/nyquist/nyquistprompt/nyquistpromptviewmodel.h
- src/playback/internal/au3/au3audiooutput.h
- src/project/internal/projectautosaver.h
- src/toast/itoastservice.h
- src/record/internal/au3/au3record.h
- src/toast/view/toastlistmodel.h
- src/appshell/qml/Audacity/AppShell/appmenumodel.h
- src/effects/nyquist/nyquisteffectsmodule.cpp
- src/effects/nyquist/nyquisteffectsmodule.h
- src/playback/internal/au3/au3player.h
- src/record/view/toolbars/playbacktoolbarrecordlevelitem.h
- src/record/internal/au3/au3audioinput.h
- src/project/tests/environment.cpp
- src/trackedit/trackeditmodule.cpp
- src/trackedit/itrackeditproject.h
- src/appshell/internal/sessionsmanager.h
- src/effects/nyquist/nyquistprompt/NyquistPromptView.qml
- src/playback/view/common/metermodel.h
- src/appshell/internal/iappmenumodelhook.h
- src/effects/effects_base/internal/effectparametersprovider.h
19040fa to
a0224f9
Compare
| muse::Inject<IEffectsProvider> effectsProvider{ this }; | ||
| muse::Inject<IParameterExtractorRegistry> parameterExtractorRegistry{ this }; | ||
| muse::Inject<au::context::IGlobalContext> globalContext{ this }; |
There was a problem hiding this comment.
might be just naming but I find this confusing, wdyt?
muse::Inject<au::context::IGlobalContext> globalContext{ this };
per instance inject of a global context
I find terms of context and inject and global collapsing a bit here
There was a problem hiding this comment.
yeah, that's true. It is a per-project global context and is confusing indeed
There was a problem hiding this comment.
I would imagine something like this be easier on the eyes and brain:
muse::Inject<au::context::IProjectContext> projectContext{ this };
ormuse::Inject<au::context::IInstanceContext> instanceContext{ this };
ormuse::Inject<au::context::ILocalContext> context{ this };
or even simplymuse::Inject<au::context::IContext> context{ this };
There was a problem hiding this comment.
Sure, that's worth looking into, not in this PR though
There was a problem hiding this comment.
We discussed this issue until we found a good term.
There was a problem hiding this comment.
- IProjectContext - Yes, to a large extent this is the context of the project, but it exists without an opened project
- IInstanceContext - By instance we mean a process, so this doesn't apply here.
- ILocalContext - It's not clear in relation to what it is local, we don't have a non-local context
- IContext - Very abstract :)
We've decided to leave this issue for later. But if you do, we'd be interested to see your solution.
luapmartin
left a comment
There was a problem hiding this comment.
nice ! it's great that modules are getting properly discerned between global and "local" or "project" or "contextable" (I feel we still need a proper naming there)
it would be great if we would list somewhere on a meta-issue the sub-task of the remaining modules to be "globalized"
Approved already since I trust the discussion on the added comment will be speedy, thanks
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/projectscene/tests/tracklabelslayoutmanager_tests.cpp (1)
28-34: 🧹 Nitpick | 🔵 TrivialConsider mocking additional injected services.
TimelineContext(persrc/projectscene/view/timeline/timelinecontext.h:64-67) has additionalInject<>services beyondglobalContext:dispatcher,selectionController, andplayback. These aren't mocked in the test fixture. If any test exercises code paths that use these services, resolution will fail since they're not registered inm_testCtx.The current tests appear to focus on layout logic that may not need these services, but this could become an issue as test coverage expands.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 60940a3e-64bc-4529-84ad-a89febf0a0d5
📥 Commits
Reviewing files that changed from the base of the PR and between 3429cb794433aaa3b6a6d8c0f1cb4c5bf3f8c2d3 and 3cd088ee0ca6f7c413aaf1f1c25ce1336a14f827.
📒 Files selected for processing (5)
src/au3wrap/tests/mocks/au3projectmock.hsrc/project/tests/audacityproject_tests.cppsrc/project/tests/environment.cppsrc/projectscene/tests/tracklabelslayoutmanager_tests.cppsrc/testing/testcontext.h
| muse::modularity::ContextPtr m_testCtx; | ||
| std::unique_ptr<Audacity4Project> m_currentProject = nullptr; | ||
| std::shared_ptr<au::project::TrackeditProjectCreatorMock> m_trackeditProjectCreator; | ||
| std::shared_ptr<au::projectscene::ProjectViewStateCreatorMock> m_projectViewStateCreator; | ||
| std::shared_ptr<au::trackedit::ClipboardMock> m_clipboard; | ||
|
|
||
| void SetUp() override | ||
| { | ||
| m_currentProject = std::make_unique<Audacity4Project>(muse::modularity::globalCtx()); | ||
| m_testCtx = au::testutils::makeTestContext(); | ||
|
|
||
| m_clipboard = std::make_shared<::testing::NiceMock<au::trackedit::ClipboardMock> >(); | ||
|
|
||
| m_currentProject = std::make_unique<Audacity4Project>(m_testCtx); | ||
| m_currentProject->trackeditProjectCreator.set(m_trackeditProjectCreator); | ||
| m_currentProject->viewStateCreator.set(m_projectViewStateCreator); | ||
| m_currentProject->clipboard.set(m_clipboard); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if trackeditProjectCreator or viewStateCreator are called during load/close operations
echo "=== Usage of trackeditProjectCreator in Audacity4Project ==="
rg -n 'trackeditProjectCreator' src/project/internal/audacityproject.cpp
echo ""
echo "=== Usage of viewStateCreator in Audacity4Project ==="
rg -n 'viewStateCreator' src/project/internal/audacityproject.cppRepository: audacity/audacity
Length of output: 476
Initialize uninitialized mocks before injection.
m_trackeditProjectCreator and m_projectViewStateCreator are declared as shared_ptr members but never instantiated in SetUp(). They are then injected via .set() with null/empty values. Since both services are actively called in Audacity4Project (lines 27, 29, 149, 151 in audacityproject.cpp), this will cause null pointer dereferences at runtime.
Initialize both mocks in SetUp():
Proposed fix
void SetUp() override
{
m_testCtx = au::testutils::makeTestContext();
m_clipboard = std::make_shared<::testing::NiceMock<au::trackedit::ClipboardMock> >();
+ m_trackeditProjectCreator = std::make_shared<::testing::NiceMock<au::project::TrackeditProjectCreatorMock> >();
+ m_projectViewStateCreator = std::make_shared<::testing::NiceMock<au::projectscene::ProjectViewStateCreatorMock> >();
m_currentProject = std::make_unique<Audacity4Project>(m_testCtx);
m_currentProject->trackeditProjectCreator.set(m_trackeditProjectCreator);
m_currentProject->viewStateCreator.set(m_projectViewStateCreator);
m_currentProject->clipboard.set(m_clipboard);
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| muse::modularity::ContextPtr m_testCtx; | |
| std::unique_ptr<Audacity4Project> m_currentProject = nullptr; | |
| std::shared_ptr<au::project::TrackeditProjectCreatorMock> m_trackeditProjectCreator; | |
| std::shared_ptr<au::projectscene::ProjectViewStateCreatorMock> m_projectViewStateCreator; | |
| std::shared_ptr<au::trackedit::ClipboardMock> m_clipboard; | |
| void SetUp() override | |
| { | |
| m_currentProject = std::make_unique<Audacity4Project>(muse::modularity::globalCtx()); | |
| m_testCtx = au::testutils::makeTestContext(); | |
| m_clipboard = std::make_shared<::testing::NiceMock<au::trackedit::ClipboardMock> >(); | |
| m_currentProject = std::make_unique<Audacity4Project>(m_testCtx); | |
| m_currentProject->trackeditProjectCreator.set(m_trackeditProjectCreator); | |
| m_currentProject->viewStateCreator.set(m_projectViewStateCreator); | |
| m_currentProject->clipboard.set(m_clipboard); | |
| muse::modularity::ContextPtr m_testCtx; | |
| std::unique_ptr<Audacity4Project> m_currentProject = nullptr; | |
| std::shared_ptr<au::project::TrackeditProjectCreatorMock> m_trackeditProjectCreator; | |
| std::shared_ptr<au::projectscene::ProjectViewStateCreatorMock> m_projectViewStateCreator; | |
| std::shared_ptr<au::trackedit::ClipboardMock> m_clipboard; | |
| void SetUp() override | |
| { | |
| m_testCtx = au::testutils::makeTestContext(); | |
| m_clipboard = std::make_shared<::testing::NiceMock<au::trackedit::ClipboardMock> >(); | |
| m_trackeditProjectCreator = std::make_shared<::testing::NiceMock<au::project::TrackeditProjectCreatorMock> >(); | |
| m_projectViewStateCreator = std::make_shared<::testing::NiceMock<au::projectscene::ProjectViewStateCreatorMock> >(); | |
| m_currentProject = std::make_unique<Audacity4Project>(m_testCtx); | |
| m_currentProject->trackeditProjectCreator.set(m_trackeditProjectCreator); | |
| m_currentProject->viewStateCreator.set(m_projectViewStateCreator); | |
| m_currentProject->clipboard.set(m_clipboard); |
| @@ -26,8 +26,9 @@ class GeneratedEffectViewerModel : public AbstractEffectViewModel | |||
| Q_PROPERTY(int lowerTimeSignature READ lowerTimeSignature NOTIFY timeSignatureChanged FINAL) | |||
| Q_PROPERTY(bool isPreviewAllowed READ isPreviewAllowed CONSTANT FINAL) | |||
|
|
|||
| muse::GlobalInject<IParameterExtractorRegistry> parameterExtractorRegistry; | |||
|
|
|||
| muse::Inject<IEffectsProvider> effectsProvider{ this }; | |||
There was a problem hiding this comment.
Please use muse::ContextInject (replace all)
namespace muse {
using kors::modularity::GlobalInject;
using kors::modularity::GlobalThreadSafeInject;
using kors::modularity::ContextInject;
using kors::modularity::ContextThreadSafeInject;
using kors::modularity::Contextable;
//! NOTE Temporary for compatibility
using kors::modularity::Inject;
using kors::modularity::ThreadSafeInject;
using kors::modularity::Injectable;
//! ----
...
There was a problem hiding this comment.
nice, I think we could make good use of deprecated macros at definition level, modern IDE would be yelling at user and at least would help discover these things and avoid writing new code with deprecated patterns...
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 38319496-c1e3-4802-94d3-52b6d1ffb717
📥 Commits
Reviewing files that changed from the base of the PR and between 3cd088ee0ca6f7c413aaf1f1c25ce1336a14f827 and 410238ee51ae95c344dec1d07af566b771ad66f0.
📒 Files selected for processing (1)
au3/libraries/au3-nyquist-effects/NyquistBase.cpp
410238e to
6eba596
Compare
6eba596 to
907abff
Compare
Resolves: #10609,
Recommended:
QA:
Effect → Nyquist Prompt opens without crash
Valid expression runs and produces output on selected track
Invalid code shows an error, doesn't crash
Prompt can be opened multiple times without errors
Effect menu contains no internal/prompt entries
Nyquist effects repopulate correctly after restart, no duplicate
Built-in effect (e.g. Amplify) executes correctly
Generator (e.g. Tone) inserts audio correctly
Playback and record level meters display correctly
Record starts, stops, and commits to track as expected
Autobot test cases have been run