Skip to content

Conversation

@DropSnorz
Copy link
Owner

Relates to #386

@coderabbitai
Copy link

coderabbitai bot commented Oct 26, 2025

Walkthrough

Adds directory validation UI to the plugin-path fragment: controller now accepts ApplicationDefaults, computes existence/read/write checks, exposes DirectoryChecks/DirectoryCheck types, and updates three new labels with SVG check/cross icons. FXML and CSS updated; constructor call sites adjusted.

Changes

Cohort / File(s) Summary
Plugin path controller
owlplug-client/src/main/java/com/owlplug/core/controllers/fragments/PluginPathFragmentController.java
Constructor extended to accept ApplicationDefaults; new field applicationDefaults. Adds UI fields directoryExistLabel, canReadLabel, canWriteLabel, and SVGPath placeholders checkPath, crossPath. Adds checkDirectory(String) returning DirectoryChecks, stores and uses DirectoryChecks in refresh(), initializes SVG paths in init(). Adds public static nested classes DirectoryChecks and DirectoryCheck.
Fragment FXML (plugin path)
owlplug-client/src/main/resources/fxml/fragments/PluginPathFragment.fxml
Adds three new Label elements with fx:id directoryExistLabel, canReadLabel, canWriteLabel arranged in an HBox (spacing 10.0) replacing prior inline labels; minor imports/formatting tweaks.
Options / Welcome — constructor call sites
owlplug-client/src/main/java/com/owlplug/core/controllers/OptionsController.java, .../dialogs/WelcomeDialogController.java
Updated instantiations of PluginPathFragmentController to pass this.getApplicationDefaults() (new seventh argument) for VST2/VST3/AU/LV2 fragment controllers.
SVG path constants
owlplug-client/src/main/java/com/owlplug/core/ui/SVGPaths.java
New class SVGPaths added exposing public static final String check and cross containing SVG path data used by the controller for check/cross icons.
CSS changes
owlplug-client/src/main/resources/owlplug.css
Adds root variable --warning-color and two new classes .label-success and .label-warning that apply -fx-text-fill using success-color and warning-color.
Options view layout
owlplug-client/src/main/resources/fxml/OptionsView.fxml
Reduced pluginPathContainer VBox spacing from 30.0 to 10.0 and adjusted top padding from 16.0 to 10.0.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI as PluginPath TextField
    participant Controller as PluginPathFragmentController
    participant SVG as SVGPaths (check/cross)
    participant Labels as {Exist / Read / Write Labels}

    User->>UI: enter or change plugin path
    UI->>Controller: notify text change / refresh()
    activate Controller
    Controller->>Controller: init SVGPaths (check/cross) if needed
    Controller->>Controller: checkDirectory(path)
    Note over Controller: returns DirectoryChecks {exists, canRead, canWrite}
    Controller->>Labels: update each Label text, tooltip, styleClass
    Controller->>SVG: set graphic to checkPath or crossPath based on each DirectoryCheck.status
    deactivate Controller
    Labels->>User: show check/cross + status messages
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay attention to:
    • PluginPathFragmentController.java — correctness of directory checks (exist/read/write), null/blank handling, and lifecycle wiring (init/refresh) for SVGPaths and labels.
    • Constructor signature changes — ensure all call sites updated correctly (OptionsController, WelcomeDialogController, or other callers).
    • PluginPathFragment.fxml — fx:id bindings for the three new labels must match controller fields.
    • SVGPaths.java — verify SVG path strings are valid and used correctly (SVGPath.setContent).
    • owlplug.css — check color variable names and class names for consistency with applied style classes.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.76% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description Check ❓ Inconclusive The description "Relates to #386" is extremely minimal and does not directly describe any aspect of the changeset. While it does create a reference to an issue, it conveys no meaningful information about what the PR accomplishes, why the changes were made, or what problems they solve. The description consists solely of an issue link without explaining the actual modifications or objectives, making it difficult to understand the changeset's purpose from the description alone. This falls below the threshold of providing a meaningful description, even in a lenient evaluation context. To improve this check, consider adding a brief description of the changes and objectives. For example, the description could explain what directory validation features are being added to the options UI, why these checks matter (e.g., user feedback on plugin directory permissions), or how issue #386 motivated these changes. Even 2-3 sentences would provide valuable context for future reviewers and maintain clearer commit history.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Plugin directory exists and write checks in options" accurately captures the primary objective of the changeset. The PR introduces directory validation UI enhancements in the options view, specifically adding three check labels (directoryExistLabel, canReadLabel, canWriteLabel) and implementing validation logic via a new checkDirectory() method. The title clearly references the directory existence and write permission checks, which are central to the changes. While the title does not mention read checks, the instructions note that titles need not cover every detail, and this title effectively summarizes the main change from a user-facing perspective without being misleading or overly vague.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/perms-check

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2de9818 and bf1ef02.

📒 Files selected for processing (7)
  • owlplug-client/src/main/java/com/owlplug/core/controllers/OptionsController.java (1 hunks)
  • owlplug-client/src/main/java/com/owlplug/core/controllers/dialogs/WelcomeDialogController.java (1 hunks)
  • owlplug-client/src/main/java/com/owlplug/core/controllers/fragments/PluginPathFragmentController.java (9 hunks)
  • owlplug-client/src/main/java/com/owlplug/core/ui/SVGPaths.java (1 hunks)
  • owlplug-client/src/main/resources/fxml/OptionsView.fxml (1 hunks)
  • owlplug-client/src/main/resources/fxml/fragments/PluginPathFragment.fxml (1 hunks)
  • owlplug-client/src/main/resources/owlplug.css (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • owlplug-client/src/main/resources/fxml/OptionsView.fxml
🚧 Files skipped from review as they are similar to previous changes (1)
  • owlplug-client/src/main/resources/fxml/fragments/PluginPathFragment.fxml
🧰 Additional context used
🪛 Biome (2.1.2)
owlplug-client/src/main/resources/owlplug.css

[error] 14-14: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)


[error] 38-38: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)


[error] 42-42: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)


[error] 46-46: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (1)
owlplug-client/src/main/resources/owlplug.css (1)

14-14: CSS styling updates look good.

The new color variable warning-color and label classes follow the established pattern in the stylesheet. .label-success and .label-warning mirror the existing .label-danger implementation, maintaining visual consistency.

Note: Static analysis flags lines 14, 38, 42, and 46 as "Unknown property" errors, but these are false positives. Biome is a JavaScript/TypeScript linter and doesn't recognize JavaFX CSS (-fx-* properties) or CSS custom properties in this context. The syntax is valid for your project.

Also applies to: 37-39, 45-47


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.

@DropSnorz
Copy link
Owner Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Oct 26, 2025

✅ 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.

Copy link

@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: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7825845 and 2de9818.

📒 Files selected for processing (4)
  • owlplug-client/src/main/java/com/owlplug/core/controllers/fragments/PluginPathFragmentController.java (5 hunks)
  • owlplug-client/src/main/resources/fxml/OptionsView.fxml (1 hunks)
  • owlplug-client/src/main/resources/fxml/fragments/PluginPathFragment.fxml (1 hunks)
  • owlplug-client/src/main/resources/owlplug.css (2 hunks)
🧰 Additional context used
🪛 Biome (2.1.2)
owlplug-client/src/main/resources/owlplug.css

[error] 14-14: Expected a color but instead found '#'.

Expected a color here.

Ensure the color is specified in a valid hexadecimal format. Examples: #000, #000f, #ffffff, #ffffffff

(parse)


[error] 14-14: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)


[error] 42-42: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (7)
owlplug-client/src/main/resources/fxml/OptionsView.fxml (1)

30-30: LGTM - Layout density adjustment.

The reduced spacing aligns well with the expanded plugin path UI that now includes validation warnings.

Also applies to: 33-33

owlplug-client/src/main/resources/owlplug.css (1)

41-43: LGTM - Consistent styling pattern.

The .label-warning class follows the existing pattern for .label-danger and .label-disabled. This will work correctly once the warning-color syntax error on line 14 is fixed.

owlplug-client/src/main/resources/fxml/fragments/PluginPathFragment.fxml (2)

3-14: LGTM - Improved import clarity and JavaFX upgrade.

The explicit imports improve maintainability and the JavaFX 17 namespace update is appropriate.


32-39: LGTM - Warning label element properly configured.

The warningLabel is correctly set up for controller binding with appropriate styling and margin.

owlplug-client/src/main/java/com/owlplug/core/controllers/fragments/PluginPathFragmentController.java (3)

55-56: LGTM - Warning label field and initialization.

The warningLabel field is properly declared and correctly initialized as hidden by default.

Also applies to: 90-91


149-167: LGTM - Validation logic is sound.

The directory validation checks cover the essential requirements: existence, type, and write permissions.


192-201: LGTM - Clean validation result types.

The DirectoryCheckResult record and DirectoryCheckStatus enum provide a type-safe, immutable structure for validation results.

@DropSnorz
Copy link
Owner Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Oct 29, 2025

✅ 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.

1 similar comment
@coderabbitai
Copy link

coderabbitai bot commented Oct 29, 2025

✅ 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.

@DropSnorz DropSnorz merged commit c312dd3 into master Oct 30, 2025
2 of 3 checks passed
@DropSnorz DropSnorz moved this to Done in OwlPlug 1.31 Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants