Skip to content

Remap DAW plugin resolver to components#499

Merged
DropSnorz merged 1 commit into
v2from
chore/projects-components
Jul 21, 2026
Merged

Remap DAW plugin resolver to components#499
DropSnorz merged 1 commit into
v2from
chore/projects-components

Conversation

@DropSnorz

Copy link
Copy Markdown
Owner

No description provided.

@DropSnorz DropSnorz self-assigned this Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a09ddaa4-897a-442b-8c9e-6a57711d8b9f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Plugin lookup associations now target PluginComponent entities. Component-specific repository queries resolve lookup results, project links select component rows in the active plugin view, and missing-plugin indicators use themed font icons.

Changes

Component lookup and navigation

Layer / File(s) Summary
Component lookup model and queries
owlplug-client/src/main/java/com/owlplug/project/model/DawPluginLookup.java, owlplug-client/src/main/java/com/owlplug/plugin/model/*, owlplug-client/src/main/java/com/owlplug/plugin/repositories/*, owlplug-client/src/main/java/com/owlplug/plugin/services/PluginService.java
DawPluginLookup references PluginComponent; component lookup ownership and component-based specifications replace the removed plugin relationship and queries.
Component link selection
owlplug-client/src/main/java/com/owlplug/project/controllers/ProjectInfoController.java, owlplug-client/src/main/java/com/owlplug/plugin/controllers/*
Project links carry component IDs and delegate selection to the active table or tree controller, which selects a matching component row or parent plugin fallback.
Status icon replacement
owlplug-client/src/main/java/com/owlplug/core/components/ApplicationDefaults.java, owlplug-client/src/main/java/com/owlplug/project/ui/ProjectTreeCell.java, owlplug-client/src/main/resources/owlplug.css
Missing-plugin indicators use a styled FontIcon; the removed image constant is no longer referenced, and status icon colors use foreground variables.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ProjectInfoController
  participant PluginsController
  participant PluginTableController
  participant PluginTreeViewController
  ProjectInfoController->>PluginsController: Select component by ID
  PluginsController->>PluginTableController: Delegate for table tab
  PluginsController->>PluginTreeViewController: Delegate for tree tab
  PluginTableController-->>PluginsController: Select component or parent plugin row
  PluginTreeViewController-->>PluginsController: Select component or parent plugin node
Loading

Possibly related PRs

  • DropSnorz/OwlPlug#478: Updates plugin component representation in the table and tree controllers used by this component selection flow.
  • DropSnorz/OwlPlug#481: Introduces navigation behavior overlapping the project plugin hyperlink integration.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No pull request description was provided, so the intent is unclear beyond the code changes. Add a brief description of the behavioral change and why plugin resolution now targets components.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: moving DAW plugin resolution to component-based selection.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/projects-components

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.

@DropSnorz DropSnorz added this to the 2.0.0 milestone Jul 21, 2026
@DropSnorz

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

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 coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
owlplug-client/src/main/java/com/owlplug/project/services/PluginLookupService.java (1)

57-71: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Prevent potential NullPointerException and optimize the query.

If projectPlugin.getName() is null, PluginComponentRepository.nameContains will throw a NullPointerException when calling .toLowerCase(). Additionally, if a generic search matches many components, findAll without pagination will load all matches into memory just to retrieve the first one.

Consider adding a guard for missing names and using PageRequest.of(0, 1) to limit the query result to a single element.

♻️ Proposed refactor
-    Specification<PluginComponent> baseSpec = PluginComponentRepository.nameContains(projectPlugin.getName())
-            .and(PluginComponentRepository.hasFormat(projectPlugin.getFormat()));
-
-    // Prefer an active (successfully scanned, platform-compatible) component.
-    // Fall back to inactive/ghost components only if no active match exists.
-    List<PluginComponent> components = pluginComponentRepository.findAll(
-            baseSpec.and(PluginComponentRepository.isActive(true)));
-
-    if (components.isEmpty()) {
-      components = pluginComponentRepository.findAll(baseSpec);
-    }
-
-    if (!components.isEmpty()) {
-      lookup.setComponent(components.get(0));
-      lookup.setResult(LookupResult.FOUND);
-    }
+    String pluginName = projectPlugin.getName();
+    if (pluginName == null || pluginName.isBlank()) {
+      return lookup;
+    }
+
+    Specification<PluginComponent> baseSpec = PluginComponentRepository.nameContains(pluginName)
+            .and(PluginComponentRepository.hasFormat(projectPlugin.getFormat()));
+
+    // Prefer an active (successfully scanned, platform-compatible) component.
+    // Fall back to inactive/ghost components only if no active match exists.
+    org.springframework.data.domain.Pageable limit = org.springframework.data.domain.PageRequest.of(0, 1);
+    List<PluginComponent> components = pluginComponentRepository.findAll(
+            baseSpec.and(PluginComponentRepository.isActive(true)), limit).getContent();
+
+    if (components.isEmpty()) {
+      components = pluginComponentRepository.findAll(baseSpec, limit).getContent();
+    }
+
+    if (!components.isEmpty()) {
+      lookup.setComponent(components.get(0));
+      lookup.setResult(LookupResult.FOUND);
+    }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@owlplug-client/src/main/java/com/owlplug/project/services/PluginLookupService.java`
around lines 57 - 71, Update the lookup flow around projectPlugin.getName() and
PluginComponentRepository.nameContains to handle a null or missing plugin name
without invoking the specification or throwing; return the existing not-found
result for that case. For valid names, replace the unbounded findAll calls in
the active and fallback searches with a PageRequest.of(0, 1)-limited query while
preserving the preference for active components and selecting the first match.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@owlplug-client/src/main/java/com/owlplug/plugin/controllers/PluginTreeViewController.java`:
- Around line 338-363: Update selectComponentById and selectPluginById to expand
each matched item's collapsed ancestors before selecting it, then select the
TreeItem via the selection model's select(item) overload rather than converting
it to a row index. Preserve the existing component lookup and fallback behavior
while ensuring hidden items become visible and selection scrolling works
correctly.

---

Nitpick comments:
In
`@owlplug-client/src/main/java/com/owlplug/project/services/PluginLookupService.java`:
- Around line 57-71: Update the lookup flow around projectPlugin.getName() and
PluginComponentRepository.nameContains to handle a null or missing plugin name
without invoking the specification or throwing; return the existing not-found
result for that case. For valid names, replace the unbounded findAll calls in
the active and fallback searches with a PageRequest.of(0, 1)-limited query while
preserving the preference for active components and selecting the first match.
🪄 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

Review profile: CHILL

Plan: Pro

Run ID: 6a0f1ac1-ba0c-454e-bc44-7de3c9f465bb

📥 Commits

Reviewing files that changed from the base of the PR and between 449a43f and 8e4ddd2.

⛔ Files ignored due to path filters (1)
  • owlplug-client/src/main/resources/icons/error-red-16.png is excluded by !**/*.png, !**/*.png
📒 Files selected for processing (14)
  • owlplug-client/src/main/java/com/owlplug/core/components/ApplicationDefaults.java
  • owlplug-client/src/main/java/com/owlplug/plugin/controllers/PluginTableController.java
  • owlplug-client/src/main/java/com/owlplug/plugin/controllers/PluginTreeViewController.java
  • owlplug-client/src/main/java/com/owlplug/plugin/controllers/PluginsController.java
  • owlplug-client/src/main/java/com/owlplug/plugin/model/Plugin.java
  • owlplug-client/src/main/java/com/owlplug/plugin/model/PluginComponent.java
  • owlplug-client/src/main/java/com/owlplug/plugin/repositories/PluginComponentRepository.java
  • owlplug-client/src/main/java/com/owlplug/plugin/repositories/PluginRepository.java
  • owlplug-client/src/main/java/com/owlplug/plugin/services/PluginService.java
  • owlplug-client/src/main/java/com/owlplug/project/controllers/ProjectInfoController.java
  • owlplug-client/src/main/java/com/owlplug/project/model/DawPluginLookup.java
  • owlplug-client/src/main/java/com/owlplug/project/services/PluginLookupService.java
  • owlplug-client/src/main/java/com/owlplug/project/ui/ProjectTreeCell.java
  • owlplug-client/src/main/resources/owlplug.css
💤 Files with no reviewable changes (4)
  • owlplug-client/src/main/java/com/owlplug/core/components/ApplicationDefaults.java
  • owlplug-client/src/main/java/com/owlplug/plugin/repositories/PluginRepository.java
  • owlplug-client/src/main/java/com/owlplug/plugin/services/PluginService.java
  • owlplug-client/src/main/java/com/owlplug/plugin/model/Plugin.java

@DropSnorz
DropSnorz force-pushed the chore/projects-components branch from 8e4ddd2 to 2b3fbbb Compare July 21, 2026 17:56
@DropSnorz
DropSnorz merged commit f52aaca into v2 Jul 21, 2026
2 of 4 checks passed
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