Conversation
* add doc * extend "add" method with displayName parameter * add service specific exception
* sidebar entries do not have be closable * make sidebarService exception checked
WalkthroughThe overall change introduces a new Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant SidebarService
participant FileManager
Client->>SidebarService: add(target, displayName)
SidebarService-->>FileManager: Integrate target into sidebar
FileManager-->>SidebarService: Success/Error
SidebarService-->>Client: SidebarEntry/Exception
Client->>SidebarService: SidebarEntry.remove()
SidebarService-->>FileManager: Remove entry from sidebar
FileManager-->>SidebarService: Success/Error
SidebarService-->>Client: Confirmation/Exception
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- pom.xml (1 hunks)
- src/main/java/module-info.java (3 hunks)
- src/main/java/org/cryptomator/integrations/sidebar/SidebarService.java (1 hunks)
- src/main/java/org/cryptomator/integrations/sidebar/SidebarServiceException.java (1 hunks)
Files skipped from review due to trivial changes (2)
- pom.xml
- src/main/java/org/cryptomator/integrations/sidebar/SidebarServiceException.java
Additional comments not posted (5)
src/main/java/module-info.java (2)
22-22: The export statement correctly exposesorg.cryptomator.integrations.sidebar, making theSidebarServiceaccessible as intended.
31-31: Theusesdirective forSidebarServiceis appropriately added, enabling the module to dynamically discover implementations of this service.src/main/java/org/cryptomator/integrations/sidebar/SidebarService.java (3)
24-25: Theaddmethod is well-defined with clear documentation and proper use of annotations. The use of@Blockingis appropriate, indicating potential blocking behavior which is crucial for implementers to handle this operation correctly.
30-39: TheSidebarEntryinterface and itsremovemethod are well-defined. The emphasis on idempotency in the@implSpecis a good practice, ensuring that the method behaves predictably across multiple invocations.
43-45: The staticgetmethod appropriately uses the service loader pattern to provide an instance ofSidebarService. This is a standard and effective way to implement SPIs in Java.
|
Superseded by #36 |
This is a proposal for an new SPI: The
SidebarSPI.This spi is intended to allow an application to add an entry to the filemanager sidebar/navigation pane/bookmark section/etc, such that a user can easily access a certain path (e.g. mounted vault).
The SPI is kept simple: Only a single service, namely the
SidebarServiceoffering a single functionadd(target, displayName)to add an entry to the filemanager sidebar. The function returns an object (SidebarEntry), which is used to remove the entry again. The methods throw an service specificSidebarServiceException.