Repository navigation
Feature: Notification Window with JavaFX - #4069
Conversation
Signed-off-by: Armin Schrenk <[email protected]>
Signed-off-by: Armin Schrenk <[email protected]>
Signed-off-by: Armin Schrenk <[email protected]>
and reduce css Signed-off-by: Armin Schrenk <[email protected]>
Signed-off-by: Armin Schrenk <[email protected]>
Signed-off-by: Armin Schrenk <[email protected]>
Signed-off-by: Armin Schrenk <[email protected]>
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds a notification subsystem and UI: NotificationManager (debounce + queue) and FxNotificationManager (UI poller), NotificationComponent/Module/Controller/FXML/CSS, NotificationScoped and NotificationWindow DI annotations, and SystemBarUtil for OS-aware placement. Wires notifications into Vault, FxApplication, and FxApplicationWindows. Removes EventMap and simplifies VaultEvent to two fields. Also updates module-info.java (SSLContextProvider entries) and adds small UI enum/icon/resource changes. Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings⏰ 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)
🔇 Additional comments (3)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (6)
src/main/java/org/cryptomator/ui/fxapp/FxApplication.java (1)
92-92: Address the TODO comment.The TODO indicates that NotificationListener initialization is not yet implemented. Please ensure this is tracked and completed to fully integrate the notification system introduced in this PR.
Do you want me to open a new issue to track this task, or would you like assistance implementing the NotificationListener initialization?
src/main/java/org/cryptomator/ui/notification/NotificationComponent.java (1)
21-28: Minor inefficiency:window()called twice.The
window()method is invoked twice—once for assignment and once implicitly in the return. Consider caching the result to avoid potential redundant instantiation (though Dagger scoping likely handles this).default Stage showNotification() { var window = window(); window.setScene(scene().get()); window.sizeToScene(); window.show(); window.requestFocus(); - return window; + return window; }The current code is functionally correct given
@NotificationScopedensures a single instance per component. No change needed.src/main/resources/fxml/notification.fxml (1)
38-38: Remove commented-out code.This commented-out Label element appears to be leftover from development. Consider removing it to keep the FXML clean.
<center> <VBox spacing="12"> - <!--Label text="${controller.message}" styleClass="label-large" wrapText="true"/--> <Label text="${controller.description}" styleClass="label" wrapText="true"/> </VBox> </center>src/main/java/org/cryptomator/ui/fxapp/FxNotificationRadar.java (1)
36-46: Address TODO and consider rescheduling.The TODO on line 37 indicates incomplete documentation. Additionally, if continuous monitoring is desired, the method should reschedule itself after completing the check.
Would you like me to help complete the documentation and implement continuous polling?
src/main/java/org/cryptomator/event/NotificationManager.java (1)
32-33: Consider making fieldsprivate.These fields have package-private visibility. For encapsulation, mark them
privateunless there's a specific reason for package access.-Cache<Path, FilesystemEvent> eventCache; -Queue<FilesystemEvent> eventsRequiringNotification; +private final Cache<Path, FilesystemEvent> eventCache; +private final Queue<FilesystemEvent> eventsRequiringNotification;src/main/java/org/cryptomator/ui/notification/NotificationController.java (1)
57-65: Reminder: Complete translations and event-specific messaging.The TODO on line 57 and the placeholder default case need to be addressed before release. The current default message asks users to report a bug, which is appropriate for unexpected states.
Would you like help implementing specific message cases for different
FilesystemEventtypes?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
src/main/java/module-info.java(1 hunks)src/main/java/org/cryptomator/common/EventMap.java(0 hunks)src/main/java/org/cryptomator/event/NotificationManager.java(1 hunks)src/main/java/org/cryptomator/ui/common/FxmlFile.java(1 hunks)src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java(1 hunks)src/main/java/org/cryptomator/ui/fxapp/FxApplication.java(1 hunks)src/main/java/org/cryptomator/ui/fxapp/FxApplicationModule.java(2 hunks)src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java(6 hunks)src/main/java/org/cryptomator/ui/fxapp/FxNotificationRadar.java(1 hunks)src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java(3 hunks)src/main/java/org/cryptomator/ui/notification/NotificationComponent.java(1 hunks)src/main/java/org/cryptomator/ui/notification/NotificationController.java(1 hunks)src/main/java/org/cryptomator/ui/notification/NotificationModule.java(1 hunks)src/main/java/org/cryptomator/ui/notification/NotificationScoped.java(1 hunks)src/main/java/org/cryptomator/ui/notification/NotificationWindow.java(1 hunks)src/main/java/org/cryptomator/ui/notification/NotifyAction.java(1 hunks)src/main/resources/css/light_theme.css(1 hunks)src/main/resources/fxml/notification.fxml(1 hunks)
💤 Files with no reviewable changes (1)
- src/main/java/org/cryptomator/common/EventMap.java
🧰 Additional context used
🧠 Learnings (13)
📓 Common learnings
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
📚 Learning: 2024-11-21T16:57:58.292Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.javasrc/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.javasrc/main/java/org/cryptomator/ui/fxapp/FxApplicationModule.javasrc/main/java/org/cryptomator/ui/fxapp/FxApplication.javasrc/main/java/org/cryptomator/ui/mainwindow/VaultListController.javasrc/main/java/org/cryptomator/ui/fxapp/FxNotificationRadar.java
📚 Learning: 2024-11-24T16:41:49.825Z
Learnt from: purejava
Repo: cryptomator/cryptomator PR: 3311
File: src/main/java/org/cryptomator/ui/vaultoptions/MasterkeyOptionsController.java:52-56
Timestamp: 2024-11-24T16:41:49.825Z
Learning: In the Cryptomator project, null checks for JavaFX FXML injected components in the `initialize` method (e.g., in `MasterkeyOptionsController.java`) are unnecessary, as null values would indicate a severe issue with the JavaFX framework.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.javasrc/main/java/org/cryptomator/ui/fxapp/FxApplication.javasrc/main/java/org/cryptomator/ui/mainwindow/VaultListController.java
📚 Learning: 2024-11-21T16:31:37.834Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/mainwindow/VaultListContextMenuController.java:85-97
Timestamp: 2024-11-21T16:31:37.834Z
Learning: In `VaultListContextMenuController.didClickRemoveVault`, adding error handling and additional safety measures around vault removal is considered out of scope for this PR.
Applied to files:
src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java
📚 Learning: 2024-12-11T13:52:43.966Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/dialogs/SimpleDialogController.java:55-67
Timestamp: 2024-12-11T13:52:43.966Z
Learning: In the `SimpleDialogController` class of the Cryptomator application, the actions passed to the `handleOk()` and `handleCancel()` methods are responsible for their own error handling. Therefore, wrapping these actions with try-catch blocks in the controller is unnecessary.
Applied to files:
src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java
📚 Learning: 2024-11-24T16:47:01.698Z
Learnt from: purejava
Repo: cryptomator/cryptomator PR: 3311
File: src/main/java/org/cryptomator/ui/vaultoptions/MasterkeyOptionsController.java:0-0
Timestamp: 2024-11-24T16:47:01.698Z
Learning: In Cryptomator, avoid adding unnecessary complexity to error handling in UI controllers unless it's critical.
Applied to files:
src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java
📚 Learning: 2024-12-11T13:52:42.201Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/dialogs/SimpleDialogController.java:27-45
Timestamp: 2024-12-11T13:52:42.201Z
Learning: In the Cryptomator project, parameter validation is performed in the `SimpleDialog` builder, so it's unnecessary to duplicate validation in controller classes like `SimpleDialogController`.
Applied to files:
src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java
📚 Learning: 2025-03-21T15:58:30.027Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3780
File: src/main/java/org/cryptomator/ui/eventview/EventListCellController.java:113-128
Timestamp: 2025-03-21T15:58:30.027Z
Learning: In Cryptomator's event system, entries are removed directly from the model (FileSystemEventAggregator) and then automatically synced to the view (FxFSEventList) with a potential delay of up to one second. This follows a model-view pattern where verification of removal is handled by the synchronization mechanism rather than explicit logging.
Applied to files:
src/main/java/org/cryptomator/ui/fxapp/FxNotificationRadar.javasrc/main/java/org/cryptomator/event/NotificationManager.java
📚 Learning: 2025-01-17T12:01:11.981Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3675
File: src/main/java/org/cryptomator/networking/SSLContextWithPKCS12TrustStore.java:21-21
Timestamp: 2025-01-17T12:01:11.981Z
Learning: In the Linux implementation of SSLContextProvider, the PKCS12 trust store file path is configured using the property "cryptomator.networking.truststore.p12Path".
Applied to files:
src/main/java/module-info.java
📚 Learning: 2025-01-09T12:32:51.042Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3675
File: src/main/java/org/cryptomator/launcher/Cryptomator.java:124-131
Timestamp: 2025-01-09T12:32:51.042Z
Learning: In Cryptomator's SSL context configuration, fallback mechanism is not necessary since we're only changing the default SSLContext. If loading fails, the former default SSLContext remains usable.
Applied to files:
src/main/java/module-info.java
📚 Learning: 2025-01-09T12:32:51.042Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3675
File: src/main/java/org/cryptomator/launcher/Cryptomator.java:124-131
Timestamp: 2025-01-09T12:32:51.042Z
Learning: Priority is not used for SSLContextProvider service in Cryptomator, making the use of findFirst() appropriate for provider selection.
Applied to files:
src/main/java/module-info.java
📚 Learning: 2024-10-10T15:37:28.895Z
Learnt from: JaniruTEC
Repo: cryptomator/cryptomator PR: 3270
File: src/main/java/org/cryptomator/common/locationpresets/GoogleDriveMacLocationPresetsProvider.java:21-21
Timestamp: 2024-10-10T15:37:28.895Z
Learning: The `LocationPresetsProvider.resolveLocation` method in the Cryptomator project handles the expansion of the tilde `~` to the user's home directory.
Applied to files:
src/main/java/module-info.java
📚 Learning: 2025-11-08T09:11:39.167Z
Learnt from: overheadhunter
Repo: cryptomator/cryptomator PR: 3948
File: src/main/java/module-info.java:2-2
Timestamp: 2025-11-08T09:11:39.167Z
Learning: In the Cryptomator project's module structure, the `UpdateMechanism` service from `org.cryptomator.integrations.update` is loaded by the integrations library modules (e.g., integrations-api or platform-specific modules like integrations-linux), not by the desktop module. The desktop module imports `UpdateMechanism` for type references only, so no `uses` declaration is needed in `org.cryptomator.desktop`'s module-info.java.
Applied to files:
src/main/java/module-info.java
🧬 Code graph analysis (3)
src/main/java/org/cryptomator/ui/notification/NotificationScoped.java (1)
src/main/java/org/cryptomator/ui/notification/NotificationController.java (1)
NotificationScoped(24-156)
src/main/java/org/cryptomator/ui/notification/NotificationComponent.java (1)
src/main/java/org/cryptomator/ui/notification/NotificationController.java (1)
NotificationScoped(24-156)
src/main/java/org/cryptomator/ui/notification/NotificationModule.java (2)
src/main/java/org/cryptomator/ui/fxapp/FxApplicationModule.java (1)
Module(30-83)src/main/java/org/cryptomator/ui/notification/NotificationController.java (1)
NotificationScoped(24-156)
🪛 Biome (2.1.2)
src/main/resources/css/light_theme.css
[error] 1196-1196: 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] 1197-1197: 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] 1198-1198: 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] 1199-1199: 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] 1200-1200: 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] 1201-1201: 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] 1202-1202: 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] 1202-1202: Unexpected unknown function: dropshadow
Use a known function instead.
See MDN web docs for more details.
(lint/correctness/noUnknownFunction)
[error] 1206-1206: 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] 1210-1210: 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] 1211-1211: 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] 1212-1212: 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] 1216-1216: 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] 1217-1217: 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] 1220-1220: Unexpected unknown pseudo-class pressed
See MDN web docs for more details.
(lint/correctness/noUnknownPseudoClass)
[error] 1221-1221: 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] 1225-1225: 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] 1226-1226: 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] 1229-1229: Unexpected unknown pseudo-class pressed
See MDN web docs for more details.
(lint/correctness/noUnknownPseudoClass)
[error] 1230-1230: 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] 1234-1234: 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] 1235-1235: 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] 1236-1236: 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] 1240-1240: 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] 1241-1241: 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] 1244-1244: Unexpected unknown pseudo-class pressed
See MDN web docs for more details.
(lint/correctness/noUnknownPseudoClass)
[error] 1245-1245: 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: Analyze (java-kotlin)
🔇 Additional comments (15)
src/main/java/module-info.java (1)
18-21: SSLContextProvider service wiring looks correct; please verify selection behavior with multiple providersThe new imports plus the
uses SSLContextProvider;andprovides SSLContextProvider with SSLContextWithWindowsCertStore, SSLContextWithMacKeychain, SSLContextWithPKCS12TrustStore;declarations are consistent and should make all three implementations visible to the ServiceLoader from this module.Given earlier decisions to select the SSLContextProvider via
ServiceLoader.load(SSLContextProvider.class)…findFirst()without an explicit priority mechanism, the order in theprovidesclause will effectively define which implementation is tried first. With three providers in one module, this could mean that on some platforms the PKCS12‑based provider is never reached if the first one is present but not actually usable there.Please double‑check that the selection logic either:
- filters by an
isSupported()/similar flag before callingfindFirst(), or- otherwise guarantees that the intended provider for each platform (e.g., PKCS12 on Linux) is the one actually chosen.
Also, the new
uses org.cryptomator.event.NotificationHandler;declaration is structurally fine; just ensure there is at least one correspondingprovidesdeclaration in the module graph for the notification feature to function as expected.Also applies to: 61-67
src/main/java/org/cryptomator/ui/notification/NotifyAction.java (1)
1-3: LGTM!The record provides a clean, immutable data holder for pairing action labels with their executable callbacks, following Java best practices for simple data structures.
src/main/java/org/cryptomator/ui/fxapp/FxApplicationModule.java (1)
16-16: LGTM!The NotificationComponent is properly wired into the DI module following the established subcomponent pattern.
Also applies to: 43-44
src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java (1)
142-142: LGTM!The formatting changes improve code conciseness while preserving the existing logic and behavior.
Also applies to: 158-159
src/main/java/org/cryptomator/ui/common/FxmlFile.java (1)
60-61: LGTM!The NOTIFICATION enum constant is properly added following the established pattern, with correct punctuation for the enum declaration.
src/main/resources/css/light_theme.css (1)
1189-1246: LGTM! (Note: Static analysis warnings are false positives)The notification window styling is well-structured and follows the established patterns in this theme file. The static analysis tool (Biome) is flagging JavaFX-specific CSS properties and pseudo-classes as errors because it's a web CSS linter. All flagged items are valid JavaFX CSS:
- Properties prefixed with
-fx-are JavaFX-specific and valid- The
:pressedpseudo-class is a valid JavaFX pseudo-class- The
dropshadow()function is a valid JavaFX CSS effect functionsrc/main/java/org/cryptomator/ui/notification/NotificationWindow.java (1)
1-12: LGTM!The qualifier annotation follows the standard JSR-330/Dagger pattern and will properly distinguish the notification window Stage in dependency injection.
src/main/java/org/cryptomator/ui/notification/NotificationScoped.java (1)
1-11: LGTM!The scope annotation follows the standard JSR-330/Dagger pattern and will properly manage the lifecycle of notification-scoped components.
src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java (1)
15-16: LGTM!The new
CHEVRON_LEFTandCHEVRON_RIGHTenum constants are correctly added in alphabetical order with valid Font Awesome 5 unicode values.src/main/java/org/cryptomator/ui/notification/NotificationComponent.java (1)
11-35: LGTM!The subcomponent follows the established Dagger pattern used elsewhere in the codebase. The factory interface and default
showNotification()method provide clean integration withFxApplicationWindows.src/main/resources/fxml/notification.fxml (1)
1-61: LGTM!The FXML layout is well-structured with proper bindings to the controller. The use of
managed="${controller.buttonVisible}"alongsidevisiblecorrectly handles layout space when the button is hidden.src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java (1)
200-202: LGTM!The
showNotification()method follows the established async pattern used by other window-showing methods likeshowEventViewer(). Error handling viareportErrorsis consistent with the codebase conventions.src/main/java/org/cryptomator/ui/fxapp/FxNotificationRadar.java (1)
32-34: Single-shot polling may not continuously monitor notifications.
schedulePollForUpdates()schedules a one-time check after 1000ms. If the intent is continuous polling (as suggested by the name "schedulePollForUpdates"), consider usingscheduleAtFixedRateor re-scheduling after each check.Is single-shot polling intentional? If continuous polling is needed:
public void schedulePollForUpdates() { - scheduler.schedule(this::checkForPendingNotifications, 1000, TimeUnit.MILLISECONDS); + scheduler.scheduleAtFixedRate(this::checkForPendingNotifications, 1000, 1000, TimeUnit.MILLISECONDS); }Alternatively, re-schedule at the end of
checkForPendingNotifications()if you want polling to continue only while there are active vaults.src/main/java/org/cryptomator/ui/notification/NotificationModule.java (1)
28-40: LGTM on Stage configuration.The transparent, always-on-top, non-resizable stage with
Modality.NONEis appropriate for a notification window. TheonShownhandler for positioning after the window has dimensions is the correct approach.src/main/java/org/cryptomator/ui/notification/NotificationController.java (1)
52-55: PotentialIndexOutOfBoundsExceptionininitialize()if list is empty.If
notificationsPropis empty wheninitialize()is called,notificationsProp.get(0)will throw.Add a guard:
@FXML public void initialize() { - selectedEvent.setValue(notificationsProp.get(selectionIndex.get())); + if (!notificationsProp.isEmpty()) { + selectedEvent.setValue(notificationsProp.get(selectionIndex.get())); + } }⛔ Skipped due to learnings
Learnt from: purejava Repo: cryptomator/cryptomator PR: 3311 File: src/main/java/org/cryptomator/ui/vaultoptions/MasterkeyOptionsController.java:52-56 Timestamp: 2024-11-24T16:41:49.825Z Learning: In the Cryptomator project, null checks for JavaFX FXML injected components in the `initialize` method (e.g., in `MasterkeyOptionsController.java`) are unnecessary, as null values would indicate a severe issue with the JavaFX framework.
Signed-off-by: Armin Schrenk <[email protected]>
Signed-off-by: Armin Schrenk <[email protected]>
shouldn't this depend on the position of the tray bar? can't this be moved to any side? |
Signed-off-by: Armin Schrenk <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (5)
src/main/java/org/cryptomator/event/NotificationManager.java (3)
22-25: Malformed HTML in Javadoc.The list markup is inverted as noted in a previous review.
<ul>should contain<li>items, not the other way around.
42-53: Potential race condition between cache check and queue addition.The cache check (
isRecent) and queue addition are not atomic as noted in a previous review. Two threads could simultaneously check the cache for the same event and both add to the queue.
43-44: Confusing method/variable naming:isRecentreturnstruewhen event is NOT recent.As noted in a previous review, the method
isRecentreturnstruewhen the event is newly added to the cache (not recently seen), which contradicts the name. The variablenotRecentlyAddedadds to the confusion.Also applies to: 55-58
src/main/java/org/cryptomator/ui/notification/NotificationController.java (2)
44-44: PotentialIndexOutOfBoundsExceptionif list becomes empty.As noted in a previous review, the listener on
selectionIndexaccessesnotificationsProp.get(n.intValue())without bounds checking. If the list is cleared while the listener is active, this will throw.
141-147: Inverted visibility logic will hide the button when it should be shown.As noted in a previous review,
buttonVisibleProperty()returnsactionText.isEmpty(), which istruewhenactionTextis null/empty. The button will be visible when there's no action text—opposite of the intended behavior. Additionally,isButtonVisible()uses different logic, causing inconsistency.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
src/main/java/org/cryptomator/common/vaults/Vault.java(5 hunks)src/main/java/org/cryptomator/event/NotificationManager.java(1 hunks)src/main/java/org/cryptomator/event/VaultEvent.java(1 hunks)src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java(5 hunks)src/main/java/org/cryptomator/ui/fxapp/FxNotificationRadar.java(1 hunks)src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java(3 hunks)src/main/java/org/cryptomator/ui/notification/NotificationController.java(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3780
File: src/main/java/org/cryptomator/ui/eventview/EventListCellController.java:113-128
Timestamp: 2025-03-21T15:58:30.027Z
Learning: In Cryptomator's event system, entries are removed directly from the model (FileSystemEventAggregator) and then automatically synced to the view (FxFSEventList) with a potential delay of up to one second. This follows a model-view pattern where verification of removal is handled by the synchronization mechanism rather than explicit logging.
📚 Learning: 2025-01-09T12:33:23.183Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3675
File: src/main/java/org/cryptomator/common/integrations/IntegrationsLoaderCopy.java:65-73
Timestamp: 2025-01-09T12:33:23.183Z
Learning: The `IntegrationsLoaderCopy` class in `org.cryptomator.common.integrations` package is a temporary solution for module visibility problems and will be removed soon. No improvements or refactoring should be suggested for this class.
Applied to files:
src/main/java/org/cryptomator/common/vaults/Vault.java
📚 Learning: 2024-11-24T16:47:01.698Z
Learnt from: purejava
Repo: cryptomator/cryptomator PR: 3311
File: src/main/java/org/cryptomator/ui/vaultoptions/MasterkeyOptionsController.java:0-0
Timestamp: 2024-11-24T16:47:01.698Z
Learning: In Cryptomator, avoid adding unnecessary complexity to error handling in UI controllers unless it's critical.
Applied to files:
src/main/java/org/cryptomator/common/vaults/Vault.javasrc/main/java/org/cryptomator/ui/mainwindow/VaultListController.java
📚 Learning: 2024-07-17T10:12:26.832Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3494
File: src/main/java/org/cryptomator/common/settings/SettingsProvider.java:50-50
Timestamp: 2024-07-17T10:12:26.832Z
Learning: The constructor of the `SettingsProvider` class in the Cryptomator project is marked with the `Inject` annotation, indicating that it is managed by a dependency injection framework and not called directly in written code.
Applied to files:
src/main/java/org/cryptomator/common/vaults/Vault.java
📚 Learning: 2025-03-21T15:58:30.027Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3780
File: src/main/java/org/cryptomator/ui/eventview/EventListCellController.java:113-128
Timestamp: 2025-03-21T15:58:30.027Z
Learning: In Cryptomator's event system, entries are removed directly from the model (FileSystemEventAggregator) and then automatically synced to the view (FxFSEventList) with a potential delay of up to one second. This follows a model-view pattern where verification of removal is handled by the synchronization mechanism rather than explicit logging.
Applied to files:
src/main/java/org/cryptomator/common/vaults/Vault.javasrc/main/java/org/cryptomator/event/VaultEvent.javasrc/main/java/org/cryptomator/event/NotificationManager.java
📚 Learning: 2024-11-21T16:57:58.292Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
Applied to files:
src/main/java/org/cryptomator/ui/fxapp/FxNotificationRadar.javasrc/main/java/org/cryptomator/ui/notification/NotificationController.javasrc/main/java/org/cryptomator/ui/mainwindow/VaultListController.java
📚 Learning: 2024-11-24T16:41:49.825Z
Learnt from: purejava
Repo: cryptomator/cryptomator PR: 3311
File: src/main/java/org/cryptomator/ui/vaultoptions/MasterkeyOptionsController.java:52-56
Timestamp: 2024-11-24T16:41:49.825Z
Learning: In the Cryptomator project, null checks for JavaFX FXML injected components in the `initialize` method (e.g., in `MasterkeyOptionsController.java`) are unnecessary, as null values would indicate a severe issue with the JavaFX framework.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.javasrc/main/java/org/cryptomator/ui/mainwindow/VaultListController.java
📚 Learning: 2024-12-11T13:52:43.966Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/dialogs/SimpleDialogController.java:55-67
Timestamp: 2024-12-11T13:52:43.966Z
Learning: In the `SimpleDialogController` class of the Cryptomator application, the actions passed to the `handleOk()` and `handleCancel()` methods are responsible for their own error handling. Therefore, wrapping these actions with try-catch blocks in the controller is unnecessary.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.javasrc/main/java/org/cryptomator/ui/mainwindow/VaultListController.java
📚 Learning: 2024-12-11T13:52:42.201Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/dialogs/SimpleDialogController.java:27-45
Timestamp: 2024-12-11T13:52:42.201Z
Learning: In the Cryptomator project, parameter validation is performed in the `SimpleDialog` builder, so it's unnecessary to duplicate validation in controller classes like `SimpleDialogController`.
Applied to files:
src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java
⏰ 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: Compile and Test
🔇 Additional comments (4)
src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java (1)
19-19: LGTM! Formatting improvements.The import reordering and formatting adjustments improve readability without altering behavior.
Also applies to: 142-144, 160-165
src/main/java/org/cryptomator/common/vaults/Vault.java (1)
26-26: LGTM! Notification integration is correct.The Vault now forwards filesystem events to the NotificationManager in addition to the existing FileSystemEventAggregator, enabling the notification feature while preserving existing behavior.
Also applies to: 82-82, 95-96, 115-115, 269-269
src/main/java/org/cryptomator/event/VaultEvent.java (1)
6-8: LGTM! API simplification is cleaner.The VaultEvent record has been simplified from a three-field comparable type to a two-field data holder. Event deduplication/debouncing is now handled by NotificationManager's cache-based mechanism, which is a cleaner separation of concerns.
src/main/java/org/cryptomator/ui/fxapp/FxNotificationRadar.java (1)
32-34: Clarify the one-shot scheduling design.The method
schedulePollForUpdates()schedules a single check after 1000ms but does not reschedule itself. Despite the class name "Radar" and method name "poll" suggesting continuous monitoring, the implementation executes only once (called fromFxApplication.start()). The callbackcheckForPendingNotifications()does not reinvokeschedulePollForUpdates(), unlike the similar pattern inFxFSEventList.checkForEventUpdates()which does implement recurring polls. Clarify whether one-shot behavior is intentional; if so, rename toscheduleNotificationCheck()for accuracy.Likely an incorrect or invalid review comment.
Signed-off-by: Armin Schrenk <[email protected]>
Signed-off-by: Armin Schrenk <[email protected]>
@overheadhunter i did not find a way to detect the tray-menu location. We can also choose a simpler approach and show the notification always on the same spot, os-independent. |
There was a problem hiding this comment.
Actionable comments posted: 4
♻️ Duplicate comments (2)
src/main/java/org/cryptomator/ui/notification/NotificationController.java (2)
141-147: Make button visibility logic consistent and ignore empty text.
buttonVisibleProperty()andisButtonVisible()use slightly different semantics:
- Line 142:
buttonVisibleProperty()returnsactionText.isEmpty().not(), i.e. visible when non-empty.- Line 146:
isButtonVisible()returnsactionText.get() != null, which is alsotruefor an empty string.This mismatch can cause subtle differences between FXML-bound visibility and programmatic checks, especially if
actionTextis ever set to"". A previous review comment already pointed out this inconsistency.Consider unifying the two, e.g.:
public ObservableBooleanValue buttonVisibleProperty() { - return actionText.isEmpty().not(); + return actionText.isEmpty().not(); } public boolean isButtonVisible() { - return actionText.get() != null; + var text = actionText.get(); + return text != null && !text.isEmpty(); }or simply delegate
isButtonVisible()tobuttonVisibleProperty().get()so there is exactly one source of truth.
41-46: Guard against invalid indices when dereferencingnotificationsProp.The code assumes that
selectionIndexalways points to a valid element innotificationsProp, but several places dereference without any bounds checks:
- Line 44:
notificationsProp.get(n.intValue())in theselectionIndexlistener.- Line 55:
notificationsProp.get(selectionIndex.get())ininitialize().- Lines 103–105:
nextNotification()can moveselectionIndexwhilenotificationsPropmight be empty in edge cases.If the list is ever empty (or shrinks concurrently with index changes), these
get(...)calls can throwIndexOutOfBoundsException. Earlier review comments on this file already highlighted the same risk.Consider defensively checking that the index is within
[0, notificationsProp.size())before callingget, and either skipping the update or clearingselectedEventwhen out of range. If you decide to rely on the invariant “window is only ever created with a non-empty list and only this controller mutates it,” it’s still worth documenting that invariant near the constructor/initialize to justify the unchecked access.Also applies to: 53-56, 93-106
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/main/java/org/cryptomator/common/vaults/Vault.java(5 hunks)src/main/java/org/cryptomator/event/NotificationManager.java(1 hunks)src/main/java/org/cryptomator/ui/notification/NotificationController.java(1 hunks)src/main/java/org/cryptomator/ui/notification/NotificationModule.java(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- src/main/java/org/cryptomator/common/vaults/Vault.java
- src/main/java/org/cryptomator/ui/notification/NotificationModule.java
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
📚 Learning: 2024-11-24T16:41:49.825Z
Learnt from: purejava
Repo: cryptomator/cryptomator PR: 3311
File: src/main/java/org/cryptomator/ui/vaultoptions/MasterkeyOptionsController.java:52-56
Timestamp: 2024-11-24T16:41:49.825Z
Learning: In the Cryptomator project, null checks for JavaFX FXML injected components in the `initialize` method (e.g., in `MasterkeyOptionsController.java`) are unnecessary, as null values would indicate a severe issue with the JavaFX framework.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-11-21T16:57:58.292Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-12-11T13:52:43.966Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/dialogs/SimpleDialogController.java:55-67
Timestamp: 2024-12-11T13:52:43.966Z
Learning: In the `SimpleDialogController` class of the Cryptomator application, the actions passed to the `handleOk()` and `handleCancel()` methods are responsible for their own error handling. Therefore, wrapping these actions with try-catch blocks in the controller is unnecessary.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2025-03-21T15:58:30.027Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3780
File: src/main/java/org/cryptomator/ui/eventview/EventListCellController.java:113-128
Timestamp: 2025-03-21T15:58:30.027Z
Learning: In Cryptomator's event system, entries are removed directly from the model (FileSystemEventAggregator) and then automatically synced to the view (FxFSEventList) with a potential delay of up to one second. This follows a model-view pattern where verification of removal is handled by the synchronization mechanism rather than explicit logging.
Applied to files:
src/main/java/org/cryptomator/event/NotificationManager.java
⏰ 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: Compile and Test
🔇 Additional comments (3)
src/main/java/org/cryptomator/ui/notification/NotificationController.java (1)
69-91: Clarify behavior when the notification action fails.
handleButtonAction()always removes the current notification in thefinallyblock, even if executing the action (once implemented) throws an exception. This means failed actions will still drop the notification with no chance to retry.If the intent is “fire-and-forget, at-most-once UI hint,” this is fine; otherwise, consider:
- Catching exceptions around the action and keeping the event in the list if the action fails, or
- Logging/reporting failures so they aren’t silently swallowed while still removing the event.
Right now the
TODOindicates this path is unfinished, so it may be worth deciding the desired semantics before wiring the executor.src/main/java/org/cryptomator/event/NotificationManager.java (2)
71-77: Concurrency pattern incloneTolooks reasonable with currentaddEventsync.
cloneTo(...)synchronizes onthiswhile bulk‑copying and clearingeventsRequiringNotification. BecauseaddEvent(...)enqueues under the samesynchronized (this)block, the combination effectively acts as a “drain queue atomically into target” operation without losing or duplicating events.Given that
eventsRequiringNotificationis already aConcurrentLinkedQueue, this is slightly redundant but acceptable, and the explicit monitor helps enforce the drain‑and‑clear atomicity.No changes strictly required here; just ensure any future refactors to
addEvent(e.g., removing itssynchronizedblock) keep this contract in mind.
8-9: DI imports are intentionally mixed to support Dagger's compatibility layer.The codebase uses
javax.inject.*imports throughout, andmodule-info.javaexplicitly requires bothjakarta.injectandstatic javax.inject. This is intentional—Dagger 2.57.2 (the project's DI framework) supports both the legacyjavax.injectstandard and the newerjakarta.injectstandard. The project compiles and runs successfully with this configuration, so no changes are needed.Likely an incorrect or invalid review comment.
Signed-off-by: Armin Schrenk <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
src/main/java/org/cryptomator/event/NotificationManager.java (1)
41-53:offer(...)currently never accepts events, so notifications will never be producedRight now the switch expression always falls through to
default -> false, with the only concrete case left as a commented “example”. That means noFilesystemEventwill ever be enqueued and the whole notification pipeline remains effectively disabled despite the Javadoc claiming eligible events are accepted.Before merging, either:
- wire at least one real
FilesystemEventsubtype through toaddEvent(...), or- explicitly document/annotate
offeras a stub if the feature is intentionally dormant in this PR.
🧹 Nitpick comments (2)
src/main/java/org/cryptomator/event/NotificationManager.java (2)
55-80: Concurrency & deduplication logic looks correct; queue type/synchronization could be simplifiedThe combination of:
computeIfAbsenton the CaffeineasMap()and- enqueuing under
synchronized (this)with a shared lock used incloneTo(...)gives you an atomic “check‑dedupe‑and‑enqueue” behavior and avoids the earlier race condition;
addEventcorrectly returnstrueonly when a new event was added.Given that both
addEventandcloneTooperate under the same intrinsic lock, you’re effectively serializing all access toeventsRequiringNotification. In that setup, usingConcurrentLinkedQueueis a bit redundant; a plainQueue<VaultEvent>(e.g.ArrayDeque) behind the same lock would suffice and make the locking model simpler, or you could move to a purely lock‑free pattern with the concurrent queue and a differentcloneToimplementation. Not urgent, just something to consider.
30-39: Consider making internal stateprivate finalfor stronger encapsulation
eventCacheandeventsRequiringNotificationare currently package‑visible and non‑final, even though they are only set in the constructor and treated as internal implementation details.Making them
private finalwould better express their immutability and prevent accidental external access or reassignment:- Cache<FSEventBucket, FilesystemEvent> eventCache; - ConcurrentLinkedQueue<VaultEvent> eventsRequiringNotification; + private final Cache<FSEventBucket, FilesystemEvent> eventCache; + private final ConcurrentLinkedQueue<VaultEvent> eventsRequiringNotification;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/main/java/org/cryptomator/event/NotificationManager.java(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
📚 Learning: 2025-03-21T15:58:30.027Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3780
File: src/main/java/org/cryptomator/ui/eventview/EventListCellController.java:113-128
Timestamp: 2025-03-21T15:58:30.027Z
Learning: In Cryptomator's event system, entries are removed directly from the model (FileSystemEventAggregator) and then automatically synced to the view (FxFSEventList) with a potential delay of up to one second. This follows a model-view pattern where verification of removal is handled by the synchronization mechanism rather than explicit logging.
Applied to files:
src/main/java/org/cryptomator/event/NotificationManager.java
📚 Learning: 2024-11-21T16:57:58.292Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
Applied to files:
src/main/java/org/cryptomator/event/NotificationManager.java
📚 Learning: 2024-07-27T13:14:40.963Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3267
File: src/main/java/org/cryptomator/ui/vaultoptions/VaultOptionsController.java:54-56
Timestamp: 2024-07-27T13:14:40.963Z
Learning: The user `infeo` has clarified that in the Cryptomator project, it is intentional for the vault options to be disabled when the vault is unlocked and not disabled when the vault is locked. This is a specific design decision for the `VaultOptionsController.java` within the context of PR 3267.
Applied to files:
src/main/java/org/cryptomator/event/NotificationManager.java
I remember that either AWT or JavaFX API allows you to differentiate between total screen area and usable screen area, where the latter doesn't contain the rect occupied by the tray bar (or macOS menu bar). By comparing both rects, you can find out where the position. Edit: See |
Signed-off-by: Armin Schrenk <[email protected]>
Signed-off-by: Armin Schrenk <[email protected]>
Signed-off-by: Armin Schrenk <[email protected]>
Signed-off-by: Armin Schrenk <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (2)
src/main/java/org/cryptomator/ui/notification/NotificationController.java (2)
8-8: Deferred: javax.inject import tracked in issue #4070.This import uses
javax.injectinstead ofjakarta.inject, which was previously flagged and deferred to a broader refactoring effort tracked in issue #4070.
58-60: Guard against empty list ininitialize().Line 59 unconditionally accesses
notificationsProp.get(selectionIndex.get())without verifying the list is non-empty. If the notification list starts empty, this will throwIndexOutOfBoundsException.Apply this diff:
@FXML public void initialize() { - selectedEvent.setValue(notificationsProp.get(selectionIndex.get())); + if (!notificationsProp.isEmpty()) { + selectedEvent.setValue(notificationsProp.get(selectionIndex.get())); + } }
🧹 Nitpick comments (4)
src/main/java/org/cryptomator/ui/common/SystemBarUtil.java (1)
16-29: Consider documenting edge case behavior.The implementation correctly follows the suggestion from the PR discussion to use
Screen.getVisualBounds(). The logic is sound for typical scenarios where a single system bar occupies one side of the screen.However, consider adding JavaDoc to document:
- The method's purpose and return value
- The assumption stated in line 19 (system bar fills a whole side)
- Edge case behavior: when
bounds == visualBounds(no system bar detected), the method defaults toPlacement.BOTTOM- Edge case behavior: if system bars exist on multiple sides, only the first detected placement is returned (priority: LEFT → TOP → RIGHT → BOTTOM)
This documentation would help future maintainers understand the intended behavior and assumptions.
src/main/java/org/cryptomator/ui/notification/NotificationController.java (3)
62-70: Add null guard inadjustTextsfor defensive programming.Line 64 unconditionally calls
newEvent.actualEvent(). IfselectedEventis ever set tonull(e.g., when the list becomes empty or selection is cleared), this will throwNullPointerException.Apply this diff:
private void adjustTexts(ObservableValue<? extends VaultEvent> observable, VaultEvent oldEvent, VaultEvent newEvent) { + if (newEvent == null) { + message.set(""); + description.set(""); + actionText.set(null); + return; + } switch (newEvent.actualEvent()) { default -> { message.set("NO CONTENT");
73-95: Consider defensive null check onselectedEvent.Lines 76-77 call
ev.actualEvent()without checking ifevis null. While the current design ensuresselectedEventshould have a value when this method is invoked, adding a null guard would make the code more robust to future changes.@FXML public void handleButtonAction() { try { var ev = selectedEvent.get(); + if (ev == null) { + return; + } switch (ev.actualEvent()) {
145-151: Minor inconsistency in visibility checks.
buttonVisibleProperty()returns true only whenactionTextis non-null and non-empty (viaisEmpty().not()), whileisButtonVisible()returns true for any non-null value, even an empty string. For consistency, consider aligning both methods.public boolean isButtonVisible() { - return actionText.get() != null; + return actionText.get() != null && !actionText.get().isEmpty(); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/main/java/org/cryptomator/ui/common/SystemBarUtil.java(1 hunks)src/main/java/org/cryptomator/ui/fxapp/FxApplication.java(3 hunks)src/main/java/org/cryptomator/ui/fxapp/FxNotificationRadar.java(1 hunks)src/main/java/org/cryptomator/ui/notification/NotificationController.java(1 hunks)src/main/java/org/cryptomator/ui/notification/NotificationModule.java(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- src/main/java/org/cryptomator/ui/fxapp/FxNotificationRadar.java
- src/main/java/org/cryptomator/ui/notification/NotificationModule.java
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
📚 Learning: 2024-11-24T16:41:49.825Z
Learnt from: purejava
Repo: cryptomator/cryptomator PR: 3311
File: src/main/java/org/cryptomator/ui/vaultoptions/MasterkeyOptionsController.java:52-56
Timestamp: 2024-11-24T16:41:49.825Z
Learning: In the Cryptomator project, null checks for JavaFX FXML injected components in the `initialize` method (e.g., in `MasterkeyOptionsController.java`) are unnecessary, as null values would indicate a severe issue with the JavaFX framework.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-11-21T16:57:58.292Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.javasrc/main/java/org/cryptomator/ui/fxapp/FxApplication.java
📚 Learning: 2024-12-11T13:52:43.966Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/dialogs/SimpleDialogController.java:55-67
Timestamp: 2024-12-11T13:52:43.966Z
Learning: In the `SimpleDialogController` class of the Cryptomator application, the actions passed to the `handleOk()` and `handleCancel()` methods are responsible for their own error handling. Therefore, wrapping these actions with try-catch blocks in the controller is unnecessary.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-07-27T13:14:40.963Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3267
File: src/main/java/org/cryptomator/ui/vaultoptions/VaultOptionsController.java:54-56
Timestamp: 2024-07-27T13:14:40.963Z
Learning: The user `infeo` has clarified that in the Cryptomator project, it is intentional for the vault options to be disabled when the vault is unlocked and not disabled when the vault is locked. This is a specific design decision for the `VaultOptionsController.java` within the context of PR 3267.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-12-11T08:28:24.864Z
Learnt from: overheadhunter
Repo: cryptomator/cryptomator PR: 3641
File: .github/workflows/win-exe.yml:20-21
Timestamp: 2024-12-11T08:28:24.864Z
Learning: In the Cryptomator project, it's acceptable to update the JDK version (e.g., to JDK 23) while keeping the JavaFX version at an older version (e.g., JavaFX 22.0.2), as this has not caused problems in the past.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
⏰ 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: Compile and Test
🔇 Additional comments (2)
src/main/java/org/cryptomator/ui/common/SystemBarUtil.java (1)
9-14: LGTM!The enum correctly represents the four possible system bar placements.
src/main/java/org/cryptomator/ui/fxapp/FxApplication.java (1)
33-57: LGTM! Clean dependency injection wiring.The integration of
FxNotificationRadarfollows the established pattern for other dependencies in this class. The scheduling call is appropriately placed alongside the existingfxFSEventList.schedulePollForUpdates().Also applies to: 103-103
Signed-off-by: Armin Schrenk <[email protected]>
Signed-off-by: Armin Schrenk <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/main/java/org/cryptomator/ui/common/SystemBarUtil.java (1)
42-54: Make system bar detection more robust to double precision and clarify Javadoc.The overall approach and priority order look good. Two small robustness tweaks:
Double comparison:
getBounds()/getVisualBounds()returndoubles; using!=risks treating tiny rounding differences as “bar present”. Consider comparing with a small epsilon instead of strict inequality.Bottom vs. no-bar semantics: The method intentionally returns
BOTTOMwhen there is no bar, but the@paramtext currently suggests a bar always exists. Clarifying that the screen may or may not host a bar would better reflect the implementation.Example adjustment:
public class SystemBarUtil { + private static final double BOUNDS_EPSILON = 0.5; + public static Placement getPlacementOfSystembar(Screen screen) { var bounds = screen.getBounds(); var vBounds = screen.getVisualBounds(); //assumption: the system bar fills a whole screen side - if (bounds.getMinX() != vBounds.getMinX()) { + if (Math.abs(bounds.getMinX() - vBounds.getMinX()) > BOUNDS_EPSILON) { return Placement.LEFT; - } else if (bounds.getMinY() != vBounds.getMinY()) { + } else if (Math.abs(bounds.getMinY() - vBounds.getMinY()) > BOUNDS_EPSILON) { return Placement.TOP; - } else if (bounds.getMaxX() != vBounds.getMaxX()) { + } else if (Math.abs(bounds.getMaxX() - vBounds.getMaxX()) > BOUNDS_EPSILON) { return Placement.RIGHT; } else { return Placement.BOTTOM; } }And in the Javadoc:
- * @param screen a {@link Screen} where an OS bar exists + * @param screen the {@link Screen} whose OS bar placement should be determined (may have none)src/main/java/org/cryptomator/ui/notification/NotificationController.java (1)
154-160: Unify button visibility semantics between property and getter
buttonVisibleProperty()treats any non‑empty string (including whitespace‑only) as “visible”, whileisButtonVisible()usesisBlank(), which hides the button for whitespace‑only labels. This divergence is subtle but can become a source of confusion.You can keep the behavior you want and ensure consistency by delegating the boolean getter to the property:
public ObservableBooleanValue buttonVisibleProperty() { return actionText.isEmpty().not(); } public boolean isButtonVisible() { - return actionText.get() != null && !actionText.get().isBlank(); + return buttonVisibleProperty().get(); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/main/java/org/cryptomator/ui/common/SystemBarUtil.java(1 hunks)src/main/java/org/cryptomator/ui/notification/NotificationController.java(1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
📚 Learning: 2024-11-24T16:41:49.825Z
Learnt from: purejava
Repo: cryptomator/cryptomator PR: 3311
File: src/main/java/org/cryptomator/ui/vaultoptions/MasterkeyOptionsController.java:52-56
Timestamp: 2024-11-24T16:41:49.825Z
Learning: In the Cryptomator project, null checks for JavaFX FXML injected components in the `initialize` method (e.g., in `MasterkeyOptionsController.java`) are unnecessary, as null values would indicate a severe issue with the JavaFX framework.
Applied to files:
src/main/java/org/cryptomator/ui/common/SystemBarUtil.javasrc/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-11-21T16:57:58.292Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
Applied to files:
src/main/java/org/cryptomator/ui/common/SystemBarUtil.javasrc/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-07-27T13:14:40.963Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3267
File: src/main/java/org/cryptomator/ui/vaultoptions/VaultOptionsController.java:54-56
Timestamp: 2024-07-27T13:14:40.963Z
Learning: The user `infeo` has clarified that in the Cryptomator project, it is intentional for the vault options to be disabled when the vault is unlocked and not disabled when the vault is locked. This is a specific design decision for the `VaultOptionsController.java` within the context of PR 3267.
Applied to files:
src/main/java/org/cryptomator/ui/common/SystemBarUtil.javasrc/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-12-11T13:52:43.966Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/dialogs/SimpleDialogController.java:55-67
Timestamp: 2024-12-11T13:52:43.966Z
Learning: In the `SimpleDialogController` class of the Cryptomator application, the actions passed to the `handleOk()` and `handleCancel()` methods are responsible for their own error handling. Therefore, wrapping these actions with try-catch blocks in the controller is unnecessary.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-12-11T08:28:24.864Z
Learnt from: overheadhunter
Repo: cryptomator/cryptomator PR: 3641
File: .github/workflows/win-exe.yml:20-21
Timestamp: 2024-12-11T08:28:24.864Z
Learning: In the Cryptomator project, it's acceptable to update the JDK version (e.g., to JDK 23) while keeping the JavaFX version at an older version (e.g., JavaFX 22.0.2), as this has not caused problems in the past.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-11-21T16:31:37.834Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/mainwindow/VaultListContextMenuController.java:85-97
Timestamp: 2024-11-21T16:31:37.834Z
Learning: In `VaultListContextMenuController.didClickRemoveVault`, adding error handling and additional safety measures around vault removal is considered out of scope for this PR.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
⏰ 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: Compile and Test
There was a problem hiding this comment.
Pull request overview
This PR adds a notification window feature to Cryptomator that displays filesystem events from unlocked vaults. The feature polls for events at regular intervals and presents them in a customizable, always-on-top notification window with navigation controls.
- Introduces a new notification system with polling mechanism and event debouncing
- Implements a JavaFX-based notification window with paging and action buttons
- Integrates window placement logic based on OS and system bar position
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/resources/fxml/notification.fxml | Defines the UI layout for the notification window with header, content, and navigation controls |
| src/main/resources/css/light_theme.css | Adds styling for the notification window including rounded borders, shadows, and button states |
| src/main/java/org/cryptomator/ui/notification/NotificationWindow.java | Qualifier annotation for dependency injection of notification window components |
| src/main/java/org/cryptomator/ui/notification/NotificationScoped.java | Scope annotation defining lifecycle for notification-related components |
| src/main/java/org/cryptomator/ui/notification/NotificationModule.java | Dagger module configuring notification window creation and placement logic |
| src/main/java/org/cryptomator/ui/notification/NotificationController.java | Controller managing notification display, navigation, and event handling |
| src/main/java/org/cryptomator/ui/notification/NotificationComponent.java | Dagger subcomponent interface for notification window creation |
| src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java | Minor formatting changes to improve code readability |
| src/main/java/org/cryptomator/ui/fxapp/FxNotificationRadar.java | Polls NotificationManager and triggers notification window display |
| src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java | Adds method to show notification window |
| src/main/java/org/cryptomator/ui/fxapp/FxApplicationModule.java | Registers NotificationComponent in the application module |
| src/main/java/org/cryptomator/ui/fxapp/FxApplication.java | Initializes notification polling on application start |
| src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java | Adds chevron left/right icons for notification navigation |
| src/main/java/org/cryptomator/ui/common/SystemBarUtil.java | Utility for determining system bar placement on different operating systems |
| src/main/java/org/cryptomator/ui/common/FxmlFile.java | Registers notification FXML file |
| src/main/java/org/cryptomator/event/VaultEvent.java | Simplifies VaultEvent record by removing count tracking and comparison logic |
| src/main/java/org/cryptomator/event/NotificationManager.java | Manages notification events with debouncing and queuing functionality |
| src/main/java/org/cryptomator/common/vaults/Vault.java | Integrates NotificationManager to handle filesystem events |
| src/main/java/org/cryptomator/common/EventMap.java | Deleted as event tracking is now handled by FileSystemEventAggregator and NotificationManager |
| src/main/java/module-info.java | Reorders imports for better organization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Armin Schrenk <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
src/main/java/org/cryptomator/ui/notification/NotificationController.java (1)
52-62: Lambda parameters named_will not compile on modern JDKsUsing
_as a lambda parameter (selectionIndex.addListener((_, _, n) -> { ... })) is illegal in Java 9+ and will fail compilation. Rename the parameters to valid identifiers and update the body accordingly, e.g.:- selectionIndex.addListener((_, _, n) -> { - if (!events.isEmpty()) { - selectedEvent.setValue(events.get(n.intValue())); - } - }); + selectionIndex.addListener((observable, oldIndex, newIndex) -> { + if (!events.isEmpty()) { + int idx = newIndex.intValue(); + if (idx >= 0 && idx < events.size()) { + selectedEvent.setValue(events.get(idx)); + } + } + });
🧹 Nitpick comments (4)
src/main/java/org/cryptomator/ui/notification/NotificationModule.java (1)
33-38: Track translation of hard-coded window titleThe
"Filesystem notification"title is currently hard-coded with a TODO. Once the feature stabilizes, consider moving this into the existingResourceBundleto keep UI strings localized.src/main/java/org/cryptomator/ui/fxapp/FxApplication.java (1)
33-57: DI wiring is fine; consider aligning field name with typeThe new
FxNotificationManager notificationRadarfield is correctly injected and stored; no functional issues.If you touch this again, consider renaming the field to something closer to the type (e.g.,
notificationManagerorfxNotificationManager) for readability, unless “radar” is an intentional term used elsewhere.src/main/java/org/cryptomator/ui/notification/NotificationController.java (2)
83-105: Consider guarding against a nullselectedEventinprocessEvent()Right now
processEvent()assumesselectedEvent.get()is never null and would throw an NPE if that invariant is broken. To fail more gracefully in the UI, you could add a fast null check:- var ev = selectedEvent.get(); - switch (ev.actualEvent()) { + var ev = selectedEvent.get(); + if (ev == null) { + // optional: log or show BUG_MSG-like text + return; + } + switch (ev.actualEvent()) {Not strictly required with the current flow, but it makes the controller more robust against future changes.
64-80: Hard-coded “NO CONTENT” / BUG_MSG texts should eventually be localizedYou’ve already left a
//TODO: Translations!marker. Once the notification types are fleshed out, consider moving these strings into the existingResourceBundleand replacing them with keys so the notification window is fully localizable.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
src/main/java/org/cryptomator/event/NotificationManager.java(1 hunks)src/main/java/org/cryptomator/ui/fxapp/FxApplication.java(3 hunks)src/main/java/org/cryptomator/ui/fxapp/FxNotificationManager.java(1 hunks)src/main/java/org/cryptomator/ui/notification/NotificationController.java(1 hunks)src/main/java/org/cryptomator/ui/notification/NotificationModule.java(1 hunks)src/main/resources/fxml/notification.fxml(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- src/main/resources/fxml/notification.fxml
- src/main/java/org/cryptomator/event/NotificationManager.java
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
📚 Learning: 2024-11-21T16:57:58.292Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
Applied to files:
src/main/java/org/cryptomator/ui/fxapp/FxNotificationManager.javasrc/main/java/org/cryptomator/ui/notification/NotificationModule.javasrc/main/java/org/cryptomator/ui/notification/NotificationController.javasrc/main/java/org/cryptomator/ui/fxapp/FxApplication.java
📚 Learning: 2025-11-08T09:11:39.167Z
Learnt from: overheadhunter
Repo: cryptomator/cryptomator PR: 3948
File: src/main/java/module-info.java:2-2
Timestamp: 2025-11-08T09:11:39.167Z
Learning: In the Cryptomator project's module structure, the `UpdateMechanism` service from `org.cryptomator.integrations.update` is loaded by the integrations library modules (e.g., integrations-api or platform-specific modules like integrations-linux), not by the desktop module. The desktop module imports `UpdateMechanism` for type references only, so no `uses` declaration is needed in `org.cryptomator.desktop`'s module-info.java.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationModule.java
📚 Learning: 2024-11-24T16:41:49.825Z
Learnt from: purejava
Repo: cryptomator/cryptomator PR: 3311
File: src/main/java/org/cryptomator/ui/vaultoptions/MasterkeyOptionsController.java:52-56
Timestamp: 2024-11-24T16:41:49.825Z
Learning: In the Cryptomator project, null checks for JavaFX FXML injected components in the `initialize` method (e.g., in `MasterkeyOptionsController.java`) are unnecessary, as null values would indicate a severe issue with the JavaFX framework.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-12-11T13:52:43.966Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/dialogs/SimpleDialogController.java:55-67
Timestamp: 2024-12-11T13:52:43.966Z
Learning: In the `SimpleDialogController` class of the Cryptomator application, the actions passed to the `handleOk()` and `handleCancel()` methods are responsible for their own error handling. Therefore, wrapping these actions with try-catch blocks in the controller is unnecessary.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-07-27T13:14:40.963Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3267
File: src/main/java/org/cryptomator/ui/vaultoptions/VaultOptionsController.java:54-56
Timestamp: 2024-07-27T13:14:40.963Z
Learning: The user `infeo` has clarified that in the Cryptomator project, it is intentional for the vault options to be disabled when the vault is unlocked and not disabled when the vault is locked. This is a specific design decision for the `VaultOptionsController.java` within the context of PR 3267.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-12-11T08:28:24.864Z
Learnt from: overheadhunter
Repo: cryptomator/cryptomator PR: 3641
File: .github/workflows/win-exe.yml:20-21
Timestamp: 2024-12-11T08:28:24.864Z
Learning: In the Cryptomator project, it's acceptable to update the JDK version (e.g., to JDK 23) while keeping the JavaFX version at an older version (e.g., JavaFX 22.0.2), as this has not caused problems in the past.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-11-21T16:31:37.834Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/mainwindow/VaultListContextMenuController.java:85-97
Timestamp: 2024-11-21T16:31:37.834Z
Learning: In `VaultListContextMenuController.didClickRemoveVault`, adding error handling and additional safety measures around vault removal is considered out of scope for this PR.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
🧬 Code graph analysis (1)
src/main/java/org/cryptomator/ui/fxapp/FxNotificationManager.java (1)
src/main/java/org/cryptomator/ui/fxapp/FxApplication.java (1)
FxApplicationScoped(18-124)
⏰ 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: Compile and Test
🔇 Additional comments (3)
src/main/java/org/cryptomator/ui/notification/NotificationModule.java (1)
58-76: Window placement heuristic looks consistent and non-overlappingThe
placeWindowlogic (macOS top-right, else top-center for top system bar, otherwise bottom-right using visual bounds) now avoids off-screen placement and should not overlap taskbars/menus. No further changes needed here from my side.src/main/java/org/cryptomator/ui/fxapp/FxNotificationManager.java (1)
25-55: Polling and FX-thread handoff look sound; ensureschedulePollForUpdates()is called onceThe use of
scheduleAtFixedRateplusPlatform.runLaterkeepsNotificationManager.addTo(...)and list mutation on the FX thread, which is good for thread safety.Just make sure
schedulePollForUpdates()is only invoked once per application lifecycle (as inFxApplication.start()), otherwise multiple pollers will be scheduled.src/main/java/org/cryptomator/ui/fxapp/FxApplication.java (1)
101-104: Notification polling is correctly hooked into application startupCalling
notificationRadar.schedulePollForUpdates()alongside the existingfxFSEventListpolling cleanly integrates notifications into the startup sequence. No further changes needed here.
* add Cryptomator title * include vault name in message * remove bottom section and move button to current message area
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
src/main/java/org/cryptomator/ui/notification/NotificationController.java (1)
55-64: Rename_lambda parameters; they are illegal in Java 9+ and will not compile.Using
_as a parameter name is a compile error on current JDKs. This listener must use valid identifiers; while you’re touching it, a small bounds check on the index would also make it more defensive.- selectionIndex.addListener((_, _, n) -> { - if (!events.isEmpty()) { - selectedEvent.setValue(events.get(n.intValue())); - } - }); + selectionIndex.addListener((observable, oldIndex, newIndex) -> { + if (!events.isEmpty()) { + int index = newIndex.intValue(); + if (index >= 0 && index < events.size()) { + selectedEvent.setValue(events.get(index)); + } + } + });Please recompile on your target JDK after this change to confirm there are no remaining uses of
_as an identifier in lambdas.
🧹 Nitpick comments (3)
src/main/resources/css/light_theme.css (1)
1195-1251: JavaFX CSS here is fine; Biome errors are false positives against the wrong CSS dialect.The
.notification-windowblock uses standard JavaFX CSS (-fx-background-color, radii,-fx-effect: dropshadow(...), and:pressedpseudo-class), which are valid for JavaFX controls but unknown to a web‑CSS linter. I’d keep these styles as‑is and instead adjust Biome config (e.g., exclude JavaFX CSS or use a JavaFX‑aware rule set) so it doesn’t flag the-fx-*properties,dropshadow, or:pressedhere.Based on learnings, this mirrors prior acceptance of JavaFX-specific
-fx-underline; please just verify your CSS tooling is intentionally configured for JavaFX rather than standard browser CSS.src/main/java/org/cryptomator/ui/notification/NotificationController.java (2)
88-111: Consider a null guard inprocessSelectedEvent()for robustness.If the action is ever triggered while
selectedEventisnull(e.g., due to future changes in selection wiring),ev.actualEvent()will NPE. The UI flow likely prevents this today, but a cheap defensive check keeps the controller safe:@FXML public void processSelectedEvent() { - try { - var ev = selectedEvent.get(); - switch (ev.actualEvent()) { + var ev = selectedEvent.get(); + if (ev == null) { + return; + } + try { + switch (ev.actualEvent()) { //TODO: executorService.submit(callback.action()); default -> { } //normally nothing } } finally { removeSelectedEvent(); } }
136-174: Property accessors are fine, but you may want consistent return types.
vaultNameProperty(),messageProperty(), anddescriptionProperty()returnObservableValue<String>, whileactionTextProperty()returnsStringProperty. Functionally this works, but for API clarity you might either (a) expose all asStringPropertyor (b) expose all as the more generalObservableValue<String>, depending on how FXML and other callers are expected to use them.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/main/java/org/cryptomator/ui/fxapp/FxApplication.java(3 hunks)src/main/java/org/cryptomator/ui/notification/NotificationController.java(1 hunks)src/main/resources/css/light_theme.css(2 hunks)src/main/resources/fxml/notification.fxml(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- src/main/java/org/cryptomator/ui/fxapp/FxApplication.java
- src/main/resources/fxml/notification.fxml
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
📚 Learning: 2025-02-23T09:08:51.746Z
Learnt from: overheadhunter
Repo: cryptomator/cryptomator PR: 3757
File: src/main/resources/css/light_theme.css:361-366
Timestamp: 2025-02-23T09:08:51.746Z
Learning: The `-fx-underline` property is a valid JavaFX CSS property for Labeled controls, as documented in the JavaFX CSS Reference Guide (https://openjfx.io/javadoc/21/javafx.graphics/javafx/scene/doc-files/cssref.html#labeled).
Applied to files:
src/main/resources/css/light_theme.css
📚 Learning: 2024-11-24T16:41:49.825Z
Learnt from: purejava
Repo: cryptomator/cryptomator PR: 3311
File: src/main/java/org/cryptomator/ui/vaultoptions/MasterkeyOptionsController.java:52-56
Timestamp: 2024-11-24T16:41:49.825Z
Learning: In the Cryptomator project, null checks for JavaFX FXML injected components in the `initialize` method (e.g., in `MasterkeyOptionsController.java`) are unnecessary, as null values would indicate a severe issue with the JavaFX framework.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-11-21T16:57:58.292Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-12-11T13:52:43.966Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/dialogs/SimpleDialogController.java:55-67
Timestamp: 2024-12-11T13:52:43.966Z
Learning: In the `SimpleDialogController` class of the Cryptomator application, the actions passed to the `handleOk()` and `handleCancel()` methods are responsible for their own error handling. Therefore, wrapping these actions with try-catch blocks in the controller is unnecessary.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-07-27T13:14:40.963Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3267
File: src/main/java/org/cryptomator/ui/vaultoptions/VaultOptionsController.java:54-56
Timestamp: 2024-07-27T13:14:40.963Z
Learning: The user `infeo` has clarified that in the Cryptomator project, it is intentional for the vault options to be disabled when the vault is unlocked and not disabled when the vault is locked. This is a specific design decision for the `VaultOptionsController.java` within the context of PR 3267.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-12-11T08:28:24.864Z
Learnt from: overheadhunter
Repo: cryptomator/cryptomator PR: 3641
File: .github/workflows/win-exe.yml:20-21
Timestamp: 2024-12-11T08:28:24.864Z
Learning: In the Cryptomator project, it's acceptable to update the JDK version (e.g., to JDK 23) while keeping the JavaFX version at an older version (e.g., JavaFX 22.0.2), as this has not caused problems in the past.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-11-21T16:31:37.834Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/mainwindow/VaultListContextMenuController.java:85-97
Timestamp: 2024-11-21T16:31:37.834Z
Learning: In `VaultListContextMenuController.didClickRemoveVault`, adding error handling and additional safety measures around vault removal is considered out of scope for this PR.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-11-19T23:01:51.307Z
Learnt from: gepbird
Repo: cryptomator/cryptomator PR: 3621
File: src/main/java/org/cryptomator/ui/keyloading/hub/HubConfig.java:55-58
Timestamp: 2024-11-19T23:01:51.307Z
Learning: In the Cryptomator project, updating `LegacyRegisterDeviceController` is not necessary when changing URI construction methods.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-11-24T16:47:01.698Z
Learnt from: purejava
Repo: cryptomator/cryptomator PR: 3311
File: src/main/java/org/cryptomator/ui/vaultoptions/MasterkeyOptionsController.java:0-0
Timestamp: 2024-11-24T16:47:01.698Z
Learning: In Cryptomator, avoid adding unnecessary complexity to error handling in UI controllers unless it's critical.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-12-11T13:52:42.201Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/dialogs/SimpleDialogController.java:27-45
Timestamp: 2024-12-11T13:52:42.201Z
Learning: In the Cryptomator project, parameter validation is performed in the `SimpleDialog` builder, so it's unnecessary to duplicate validation in controller classes like `SimpleDialogController`.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
🪛 Biome (2.1.2)
src/main/resources/css/light_theme.css
[error] 117-117: 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] 118-118: 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] 1201-1201: 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] 1202-1202: 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] 1203-1203: 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] 1204-1204: 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] 1205-1205: 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] 1206-1206: 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] 1207-1207: 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] 1207-1207: Unexpected unknown function: dropshadow
Use a known function instead.
See MDN web docs for more details.
(lint/correctness/noUnknownFunction)
[error] 1211-1211: 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] 1215-1215: 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] 1216-1216: 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] 1217-1217: 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] 1221-1221: 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] 1222-1222: 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] 1225-1225: Unexpected unknown pseudo-class pressed
See MDN web docs for more details.
(lint/correctness/noUnknownPseudoClass)
[error] 1226-1226: 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] 1230-1230: 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] 1231-1231: 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] 1234-1234: Unexpected unknown pseudo-class pressed
See MDN web docs for more details.
(lint/correctness/noUnknownPseudoClass)
[error] 1235-1235: 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] 1239-1239: 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] 1240-1240: 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] 1241-1241: 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] 1245-1245: 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] 1246-1246: 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] 1249-1249: Unexpected unknown pseudo-class pressed
See MDN web docs for more details.
(lint/correctness/noUnknownPseudoClass)
[error] 1250-1250: 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). (2)
- GitHub Check: Analyze (java-kotlin)
- GitHub Check: Compile and Test
🔇 Additional comments (2)
src/main/resources/css/light_theme.css (1)
116-119:.label-window-titlestyle is consistent with existing label sizing.Font family/size align with other title/large labels and follow the established Open Sans usage; no issues here.
src/main/java/org/cryptomator/ui/notification/NotificationController.java (1)
40-52: Constructor wiring and paging binding look solid.Injecting the
Stage, grabbing the shared events list fromFxNotificationManager, and using a simple binding forpaging(currentIndex + 1 / size) is straightforward and idiomatic for JavaFX properties; no changes needed here.
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (2)
src/main/java/org/cryptomator/ui/notification/NotificationController.java (2)
7-7: Verifyjavax.inject.Injectis intentional (project seems to use Jakarta Inject 2.x).
Given the earlier discussion in this PR stream aboutjavax.inject↔jakarta.inject, please double-check the effective dependency graph/tooling expectation here before merging.
55-65: Fix compile error + harden selection listener (no_params; add bounds handling; avoid forcing index=0 when empty).
(_, _, n)won’t compile on Java 9+; also!events.isEmpty()doesn’t guaranteenis in range.@FXML public void initialize() { - selectionIndex.addListener((_, _, n) -> { - if (!events.isEmpty()) { - selectedEvent.setValue(events.get(n.intValue())); - } - }); + selectionIndex.addListener((obs, oldIdx, newIdx) -> { + int idx = newIdx.intValue(); + if (idx >= 0 && idx < events.size()) { + selectedEvent.setValue(events.get(idx)); + } else { + selectedEvent.setValue(null); + } + }); selectedEvent.addListener(this::selectTexts); - - selectionIndex.setValue(0); + selectionIndex.setValue(events.isEmpty() ? -1 : 0); }
🧹 Nitpick comments (1)
src/main/resources/fxml/notification.fxml (1)
30-42: Hide pager without leaving a “layout gap” (bindmanagedtoo).
visiblealone doesn’t remove the node from layout; bindmanagedto the same condition so the close button doesn’t get offset when the pager is hidden.- <HBox styleClass="dialog-header" alignment="CENTER_LEFT" visible="${!controller.singleEvent}"> + <HBox styleClass="dialog-header" alignment="CENTER_LEFT" + visible="${!controller.singleEvent}" + managed="${!controller.singleEvent}">
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/main/java/org/cryptomator/ui/notification/NotificationController.java(1 hunks)src/main/resources/fxml/notification.fxml(1 hunks)
🧰 Additional context used
🧠 Learnings (10)
📓 Common learnings
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
📚 Learning: 2024-11-21T16:57:58.292Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java:151-165
Timestamp: 2024-11-21T16:57:58.292Z
Learning: In the file `src/main/java/org/cryptomator/ui/fxapp/FxApplicationWindows.java`, when reviewing the method `showDokanySupportEndWindow`, suggestions to add error handling to asynchronous dialog creation (e.g., `CompletableFuture`) may be considered out of scope for certain pull requests.
Applied to files:
src/main/resources/fxml/notification.fxmlsrc/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-11-24T16:41:49.825Z
Learnt from: purejava
Repo: cryptomator/cryptomator PR: 3311
File: src/main/java/org/cryptomator/ui/vaultoptions/MasterkeyOptionsController.java:52-56
Timestamp: 2024-11-24T16:41:49.825Z
Learning: In the Cryptomator project, null checks for JavaFX FXML injected components in the `initialize` method (e.g., in `MasterkeyOptionsController.java`) are unnecessary, as null values would indicate a severe issue with the JavaFX framework.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-12-11T13:52:43.966Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/dialogs/SimpleDialogController.java:55-67
Timestamp: 2024-12-11T13:52:43.966Z
Learning: In the `SimpleDialogController` class of the Cryptomator application, the actions passed to the `handleOk()` and `handleCancel()` methods are responsible for their own error handling. Therefore, wrapping these actions with try-catch blocks in the controller is unnecessary.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-07-27T13:14:40.963Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3267
File: src/main/java/org/cryptomator/ui/vaultoptions/VaultOptionsController.java:54-56
Timestamp: 2024-07-27T13:14:40.963Z
Learning: The user `infeo` has clarified that in the Cryptomator project, it is intentional for the vault options to be disabled when the vault is unlocked and not disabled when the vault is locked. This is a specific design decision for the `VaultOptionsController.java` within the context of PR 3267.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-12-11T08:28:24.864Z
Learnt from: overheadhunter
Repo: cryptomator/cryptomator PR: 3641
File: .github/workflows/win-exe.yml:20-21
Timestamp: 2024-12-11T08:28:24.864Z
Learning: In the Cryptomator project, it's acceptable to update the JDK version (e.g., to JDK 23) while keeping the JavaFX version at an older version (e.g., JavaFX 22.0.2), as this has not caused problems in the past.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-11-21T16:31:37.834Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/mainwindow/VaultListContextMenuController.java:85-97
Timestamp: 2024-11-21T16:31:37.834Z
Learning: In `VaultListContextMenuController.didClickRemoveVault`, adding error handling and additional safety measures around vault removal is considered out of scope for this PR.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-11-19T23:01:51.307Z
Learnt from: gepbird
Repo: cryptomator/cryptomator PR: 3621
File: src/main/java/org/cryptomator/ui/keyloading/hub/HubConfig.java:55-58
Timestamp: 2024-11-19T23:01:51.307Z
Learning: In the Cryptomator project, updating `LegacyRegisterDeviceController` is not necessary when changing URI construction methods.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-11-24T16:47:01.698Z
Learnt from: purejava
Repo: cryptomator/cryptomator PR: 3311
File: src/main/java/org/cryptomator/ui/vaultoptions/MasterkeyOptionsController.java:0-0
Timestamp: 2024-11-24T16:47:01.698Z
Learning: In Cryptomator, avoid adding unnecessary complexity to error handling in UI controllers unless it's critical.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
📚 Learning: 2024-12-11T13:52:42.201Z
Learnt from: infeo
Repo: cryptomator/cryptomator PR: 3618
File: src/main/java/org/cryptomator/ui/dialogs/SimpleDialogController.java:27-45
Timestamp: 2024-12-11T13:52:42.201Z
Learning: In the Cryptomator project, parameter validation is performed in the `SimpleDialog` builder, so it's unnecessary to duplicate validation in controller classes like `SimpleDialogController`.
Applied to files:
src/main/java/org/cryptomator/ui/notification/NotificationController.java
⏰ 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: Compile and Test
# Conflicts: # src/main/java/org/cryptomator/common/EventMap.java # src/main/java/org/cryptomator/common/vaults/Vault.java
This PR adds a Notification window (and mechanism) to Cryptomator.
The mechanism currently only supports events inside the cryptographic filesystem of a vault.
General logic
After vault unlock, events can be received. For every event, the
NotificationManagertries to add the event to its internal queue. The event is added, ifIn a regular interval, the internal queue of the NotificationManager is added to an ObservableList inside the
FxNotificationRadar. If the observable list is not empty, the notification window is opened, displaying all available notifications in a seperate window.Notification window
The notification window is an always-on-top, undecorated, not movable or resizable window with 4 main elements:
Current images:


The window placement is for
The window is closed with either the OS-specifc close shortcut, a close button or the list of notifications is empty.