Skip to content

Feature: Redesigned MainWindow - #3467

Merged
mindmonk merged 36 commits into
developfrom
feature/redesign-mainwindow
Oct 4, 2024
Merged

mindmonk merged 36 commits into
developfrom
feature/redesign-mainwindow

Conversation

@mindmonk

@mindmonk mindmonk commented Jun 26, 2024 •

Copy link
Copy Markdown

This pull request introduces a redesign of the MainWindow. The changes include:

  1. Title Bar and Stage Style:
  • Removed the custom title bar, which previously contained the logo and various functions.
  • Changed the StageStyle from UNDECORATED to the default DECORATED to utilize the operating system's native title bar. This includes standard functionalities for closing, minimizing, maximizing, and displaying the app name.
  1. Preferences Button:
  • The Preferences button is now located below the Vault List.
  1. Add Vault Button:
  • The Add Vault button has been styled consistently with the Preferences Button.

Please note, elements for displaying Debug Mode, Supporter Certificate, and Update Notification will be introduced in a separate pull request.

Redesign MainWindow

mindmonk added 3 commits May 28, 2024 21:56
removed main_window_title area
moved main_window_resize functions to MainWindowController
put add vault button under the vault list and wrapped both in a ScrollPane
bound vault list height properties to amount of entries and width to scroll pane width
add listener to scroll down after adding a vault
moved preferences button under vault list
new style classes for new elements
changed wording
@coderabbitai

coderabbitai Bot commented Jun 26, 2024 •

Copy link
Copy Markdown

Walkthrough

The changes in this pull request primarily involve updates to the configuration files and Java classes associated with the Cryptomator Desktop App. Key modifications include the upgrade of dependency versions in .idea/compiler.xml, the introduction of a compactMode property in the Settings class, and the addition of a new NotificationBar control. Several UI components and FXML files have been altered to accommodate these changes, including the removal of the showMinimizeButton property and the MainWindowTitleController and ResizeController classes, streamlining the user interface and enhancing functionality.

Changes

File Path Change Summary
.idea/compiler.xml Updated dependency versions, added new dependencies, and removed outdated ones.
src/main/java/org/cryptomator/common/settings/Settings.java Added compactMode property, removed showMinimizeButton, updated constructor and listener.
src/main/java/org/cryptomator/common/settings/SettingsJson.java Removed showMinimizeButton, added compactMode property.
src/main/java/org/cryptomator/ui/controls/NotificationBar.java Introduced new notification bar control with methods for text and visibility management.
src/main/java/org/cryptomator/ui/mainwindow/MainWindowController.java Updated constructor, added new methods for preferences and settings management.
src/main/java/org/cryptomator/ui/mainwindow/MainWindowModule.java Removed certain controller bindings and modified main window initialization style.
src/main/java/org/cryptomator/ui/mainwindow/MainWindowSceneFactory.java Updated constructor and simplified close action handling.
src/main/java/org/cryptomator/ui/mainwindow/MainWindowTitleController.java Class removed, eliminating title bar management logic.
src/main/java/org/cryptomator/ui/mainwindow/ResizeController.java Class removed, removing window resizing management logic.
src/main/java/org/cryptomator/ui/mainwindow/VaultListCellController.java Added dependency on Settings, introduced compactMode property methods.
src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java Integrated Settings, added compactMode property, and updated vault list UI components.
src/main/java/org/cryptomator/ui/preferences/InterfacePreferencesController.java Removed showMinimizeButtonCheckbox, added compactModeCheckbox.
src/main/resources/css/dark_theme.css Added new styles for NotificationBar, removed outdated styles for buttons and badges.
src/main/resources/css/light_theme.css Updated button styles, added notification styles, and improved overall organization.
src/main/resources/fxml/main_window.fxml Added three NotificationBar components for various notifications.
src/main/resources/fxml/main_window_resize.fxml File deleted, removing resizing UI logic.
src/main/resources/fxml/main_window_title.fxml File deleted, removing title bar UI logic.
src/main/resources/fxml/preferences_interface.fxml Replaced showMinimizeButtonCheckbox with compactModeCheckbox.
src/main/resources/fxml/vault_list.fxml Updated vault list layout, replaced button with styled HBox, and redefined context menu.
src/main/resources/fxml/vault_list_cell.fxml Added visibility management for vault display label based on compactMode.
src/main/resources/i18n/strings.properties Added new strings for UI components, updated existing strings, and removed deprecated entries.

Possibly related PRs

🐰 In the world of code, we hop and play,
With compact modes brightening our day.
Notifications now dance with flair,
As we tidy our styles with utmost care.
So here's to the changes, both big and small,
In the Cryptomator, we celebrate all! 🎉


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c5d4c9a and 1cea7bc.

📒 Files selected for processing (2)
  • src/main/java/org/cryptomator/ui/controls/NotificationBar.java (1 hunks)
  • src/main/java/org/cryptomator/ui/mainwindow/MainWindowModule.java (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/org/cryptomator/ui/controls/NotificationBar.java
🔇 Additional comments (4)
src/main/java/org/cryptomator/ui/mainwindow/MainWindowModule.java (4)

Line range hint 1-140: LGTM: Removed bindings for MainWindowTitleController and ResizeController

The removal of bindings for MainWindowTitleController and ResizeController is consistent with the switch to using the native title bar. This simplification aligns with the PR objectives and should reduce potential conflicts with native window management.

To ensure these removals don't have unintended consequences, please run the following commands:

#!/bin/bash
# Check for any remaining references to the removed controllers
rg "MainWindowTitleController" src/main/java/org/cryptomator/ui/mainwindow/
rg "ResizeController" src/main/java/org/cryptomator/ui/mainwindow/

# Verify that window title and resize functionality are handled correctly
# This might require manual testing, but we can check for any custom implementations
rg "setTitle" src/main/java/org/cryptomator/ui/mainwindow/
rg "setResizable" src/main/java/org/cryptomator/ui/mainwindow/

Line range hint 1-140: Overall changes look good, consider dark mode appearance

The changes in MainWindowModule.java successfully implement the main objectives of the PR:

  1. Redesigning the MainWindow
  2. Using the native title bar
  3. Simplifying the module by removing custom window management

These modifications should improve the application's integration with the operating system and potentially reduce maintenance overhead.

However, as mentioned in the PR comments, there might be an issue with the dark mode appearance, particularly for Windows users.

To address this, please consider the following:

  1. Test the application in both light and dark modes on different operating systems.
  2. Document the behavior of the title bar in dark mode for Windows users in the user guide or README.
  3. Investigate if there's a programmatic way to detect or influence the title bar color in Windows dark mode.

You may want to run the following command to check for any existing dark mode related code:

#!/bin/bash
# Search for dark mode related code
rg -i "dark.?mode|theme" src/main/java/org/cryptomator/ui/

If no results are found, it might be worth considering adding theme detection or user preferences for title bar appearance in a future update.


16-16: LGTM: ErrorComponent import uncommented

The uncommented import of ErrorComponent aligns with the redesign of the MainWindow. This change suggests that error handling capabilities have been added or modified.

To ensure this import is being utilized, please run the following command:


43-43: LGTM: MainWindow height adjusted and decoration style changed

The minimum height increase to 498px and the removal of StageStyle.UNDECORATED align with the PR objectives of redesigning the MainWindow and using the native title bar. These changes should result in a taller window with the OS-native title bar.

To ensure these changes have the desired effect, please run the following commands:

✅ Verification successful

Verified: Removal of StageStyle.UNDECORATED Confirmed

All instances of StageStyle.UNDECORATED and stage.initStyle have been successfully removed from the codebase. The minimum height adjustment to 498px and the use of the native title bar are correctly implemented as per the PR objectives.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the removal of UNDECORATED style
rg "StageStyle.UNDECORATED" src/main/java/org/cryptomator/ui/mainwindow/MainWindowModule.java

# Check for any other stage style settings that might interfere
rg "stage.initStyle" src/main/java/org/cryptomator/ui/mainwindow/

Length of output: 8214


Script:

#!/bin/bash
# Search for any remaining instances of StageStyle.UNDECORATED in the entire codebase
rg "StageStyle\.UNDECORATED"

# Identify all usages of stage.initStyle to ensure no other styles are being set
rg "stage\.initStyle"

Length of output: 54


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@infeo infeo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good so far. I'm asking myself, that on a full vault list, if we could seperate the Preferences (not part of the vault list) and the actual list of vaults more.

Comment thread src/main/resources/fxml/vault_list.fxml Resolved
@mindmonk
mindmonk requested a review from infeo July 4, 2024 08:34

@infeo infeo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When i start the app on Windows, the margins on the left are not correct. I have to extend the window to the left, to fix it.
grafik

Additionally, there is a green border around the main window.

@mindmonk
mindmonk requested a review from infeo September 17, 2024 12:08
@mindmonk

Copy link
Copy Markdown
Author

Note: (Only Windows) In Cryptomator's Dark Mode, as shown in the screenshot, the title bar remains white despite Windows Dark Mode being enabled. This happens unless the "Title bars and window borders" option under Settings > Colors is activated. Enabling this option allows the title bar to follow the system accent color, resulting in a more cohesive dark theme.
TitleBar

@mindmonk mindmonk linked an issue Oct 2, 2024 that may be closed by this pull request
2 tasks done
@mindmonk mindmonk linked an issue Oct 2, 2024 that may be closed by this pull request
2 tasks done
Feature: Add Option to Enable Compact Vault List View
Feature: Introduce NotificationBars for Update is available, Support Cryptomator, and DEBUG MODE
@mindmonk
mindmonk marked this pull request as ready for review October 2, 2024 09:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 10

🧹 Outside diff range and nitpick comments (18)
src/main/resources/fxml/vault_list_cell.fxml (1)

26-26: LGTM! Consider adding a tooltip for the vault name.

The addition of visible and managed attributes tied to the compactMode property is a good way to implement the compact view mentioned in the PR objectives. This change allows for a more flexible and adaptive layout.

As a minor suggestion, consider adding a tooltip for the vault name (similar to the one for the path) in case it gets truncated in compact mode:

 <VBox spacing="4" HBox.hgrow="ALWAYS">
-    <Label styleClass="header-label" text="${controller.vault.displayName}"/>
+    <Label styleClass="header-label" text="${controller.vault.displayName}">
+        <tooltip>
+            <Tooltip text="${controller.vault.displayName}"/>
+        </tooltip>
+    </Label>
     <Label styleClass="detail-label" text="${controller.vault.displayablePath}" textOverrun="CENTER_ELLIPSIS" visible="${!controller.compactMode}" managed="${!controller.compactMode}">
         <tooltip>
             <Tooltip text="${controller.vault.displayablePath}"/>
         </tooltip>
     </Label>
 </VBox>

This would ensure that users can always see the full vault name, even if it's truncated in the compact view.

src/main/resources/fxml/main_window.fxml (2)

19-23: LGTM: Support notification bar added with suggestion

The support notification bar is a good addition, providing users with information about support or contributions based on their license status.

Consider adding a comment explaining the logic behind notify="${!controller.licenseValid}" for better code readability and maintainability.


28-31: Debug mode notification bar added with suggestions

The addition of the debug mode notification bar is a good feature for developers and testers. However, there are a few points to consider:

  1. Unlike the other notification bars, this one is not dismissable. Is this intentional?
  2. The text "DEBUG MODE" is hardcoded. Consider using a localized string for better internationalization support.
  3. The onMouseClicked event is linked to #showGeneralPreferences. Is this the intended behavior for a debug mode notification?

Consider addressing these points to improve consistency and maintainability.

src/main/java/org/cryptomator/ui/mainwindow/MainWindowSceneFactory.java (2)

25-28: LGTM: Constructor changes align with the redesign objectives.

The updated constructor signature and initialization of the window field are consistent with the PR's goal of using the OS native title bar. The use of the @MainWindow annotation is a good practice for dependency injection.

Consider adding a final modifier to the window field for better immutability:

-	private Stage window;
+	private final Stage window;

Line range hint 1-39: Summary: MainWindowSceneFactory changes successfully implement the redesign objectives.

The modifications to MainWindowSceneFactory effectively implement the redesign goals outlined in the PR objectives. The removal of the custom title bar controller and the transition to using the OS native title bar functionalities have been carried out consistently throughout the class.

Key points:

  1. The constructor and field changes align with the new design approach.
  2. The setupDefaultAccelerators method has been simplified while maintaining the necessary functionality.
  3. The changes are generally well-structured and follow good coding practices.

Consider the following recommendations to further improve the implementation:

  1. Ensure thorough testing on different operating systems, particularly macOS, to verify the correct behavior of window management functions.
  2. Document the rationale behind the OS-specific handling in the setupDefaultAccelerators method to aid future maintenance.
  3. Consider creating a small test suite to verify the correct setup of accelerators across different platforms.

These changes represent a significant shift in the application's UI architecture. Ensure that this new approach is consistently applied across the entire application and that it doesn't introduce any regressions in terms of functionality or user experience.

src/main/java/org/cryptomator/ui/mainwindow/VaultListCellController.java (3)

22-22: LGTM: New field added, but consider adding documentation.

The new compactMode field is correctly declared as private and final, and its type ObservableValue<Boolean> is appropriate for reactive programming in JavaFX. However, the purpose of this field isn't immediately clear from its name or surrounding context.

Consider adding a brief comment explaining the purpose and usage of the compactMode field. For example:

/**
 * Represents the compact mode setting.
 * When true, the UI should use a more compact layout.
 */
private final ObservableValue<Boolean> compactMode;

30-32: LGTM: Constructor updated correctly, consider adding null check.

The constructor has been properly updated to include the Settings parameter, and the compactMode field is correctly initialized. This change allows for dependency injection, which is a good practice.

Consider adding a null check for the settings parameter to prevent potential NullPointerExceptions:

@Inject
VaultListCellController(Settings settings) {
    this.glyph = vault.flatMap(Vault::stateProperty).map(this::getGlyphForVaultState);
    Objects.requireNonNull(settings, "Settings must not be null");
    this.compactMode = settings.compactMode;
}

74-80: LGTM: Property accessor methods added correctly.

The new public methods compactModeProperty() and getCompactMode() are correctly implemented, providing appropriate access to the compactMode property. The naming convention follows JavaFX standards for property accessors.

For consistency with other properties in the class (e.g., vaultProperty()), consider adding a setter method for compactMode:

public void setCompactMode(boolean value) {
    if (compactMode instanceof WritableValue) {
        ((WritableValue<Boolean>) compactMode).setValue(value);
    } else {
        throw new UnsupportedOperationException("compactMode is not writable");
    }
}

This addition would complete the property pattern and provide symmetry with other properties in the class.

src/main/java/org/cryptomator/ui/controls/NotificationBar.java (2)

1-20: LGTM! Consider clarifying FXML usage.

The class structure is well-defined for a custom JavaFX control. The use of BooleanProperty for state management is appropriate.

The @FXML annotation on notificationLabel suggests that this class might be used with FXML. However, there's no FXML file loaded in the constructor. If FXML is not being used, consider removing the annotation to avoid confusion.


1-102: Approve implementation with suggestions for future improvements.

The NotificationBar class is well-implemented, following JavaFX best practices and providing a functional custom control. The use of properties and bindings ensures reactive behavior, and the layout is set up effectively.

For future improvements, consider:

  1. Adding customization options for colors and styles.
  2. Implementing animation for showing/hiding the notification.
  3. Adding support for different types of notifications (e.g., info, warning, error) with corresponding styles.
  4. If this control is to be used extensively, consider creating a builder pattern for easier instantiation with various options.

These enhancements would make the NotificationBar more versatile and easier to use across different parts of the application.

src/main/java/org/cryptomator/ui/mainwindow/MainWindowModule.java (1)

Line range hint 39-45: LGTM: Removal of custom title bar initialization

The removal of stage.initStyle(StageStyle.UNDECORATED); aligns with the PR objective of using the native title bar. This change will allow the application to utilize the operating system's standard window decorations.

For improved clarity, consider explicitly setting the stage style to DECORATED:

 static Stage provideMainWindow(@PrimaryStage Stage stage, StageInitializer initializer) {
 	initializer.accept(stage);
+	stage.initStyle(StageStyle.DECORATED);
 	stage.setTitle("Cryptomator");
 	stage.setMinWidth(650);
 	stage.setMinHeight(440);
 	return stage;
 }

This makes the intention clear and ensures consistent behavior across different JavaFX implementations.

src/main/java/org/cryptomator/common/settings/Settings.java (1)

Remaining References to showMinimizeButton Found in i18n Properties Files

The showMinimizeButton property has been successfully removed from Java and FXML files. However, the following i18n properties files still contain references to showMinimizeButton:

  • src/main/resources/i18n/strings_vi.properties
  • src/main/resources/i18n/strings_sw.properties
  • src/main/resources/i18n/strings_zh_TW.properties
  • src/main/resources/i18n/strings_zh.properties
  • src/main/resources/i18n/strings_sk.properties
  • src/main/resources/i18n/strings_sv.properties
  • src/main/resources/i18n/strings_uk.properties
  • src/main/resources/i18n/strings_tr.properties
  • src/main/resources/i18n/strings_pt.properties
  • src/main/resources/i18n/strings_ru.properties
  • src/main/resources/i18n/strings_pt_BR.properties
  • src/main/resources/i18n/strings_pl.properties
  • src/main/resources/i18n/strings_ro.properties
  • src/main/resources/i18n/strings_ko.properties
  • src/main/resources/i18n/strings_el.properties
  • src/main/resources/i18n/strings_it.properties
  • src/main/resources/i18n/strings_nl.properties
  • src/main/resources/i18n/strings_ja.properties
  • src/main/resources/i18n/strings_ar.properties
  • src/main/resources/i18n/strings_zh_HK.properties
  • src/main/resources/i18n/strings_de.properties
  • src/main/resources/i18n/strings_fil.properties
  • src/main/resources/i18n/strings_fr.properties
  • src/main/resources/i18n/strings_es.properties
  • src/main/resources/i18n/strings_id.properties
  • src/main/resources/i18n/strings_nb.properties
  • src/main/resources/i18n/strings_hu.properties
  • src/main/resources/i18n/strings_hr.properties
  • src/main/resources/i18n/strings_he.properties
  • src/main/resources/i18n/strings_da.properties
  • src/main/resources/i18n/strings_ca.properties
  • src/main/resources/i18n/strings_bg.properties
  • src/main/resources/i18n/strings_ba.properties
  • src/main/resources/i18n/strings_be.properties
  • src/main/resources/i18n/strings_cs.properties

Please manually verify whether these localization keys are still necessary. If they are no longer in use, consider removing them to maintain a clean and efficient codebase.

🔗 Analysis chain

Line range hint 1-214: Verify complete removal of showMinimizeButton

The removal of the showMinimizeButton property aligns with the PR objectives of redesigning the MainWindow and removing the custom title bar. However, we should ensure that all references to showMinimizeButton have been removed or updated throughout the codebase to prevent any potential issues.

To verify the complete removal of showMinimizeButton, please run the following script:

If any occurrences are found, please update or remove them accordingly.


Re-verify complete removal of showMinimizeButton

The initial search found multiple references to showMinimizeButton in i18n properties files. Additionally, there were issues searching JavaScript files due to incorrect file type specifications. To ensure that all references have been removed, please run the following corrected script:

If any references are still found after running this script, please update or remove them accordingly to ensure the property has been fully deprecated throughout the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for any remaining references to showMinimizeButton in the codebase

# Test: Search for showMinimizeButton in all Java files
echo "Searching for showMinimizeButton in Java files:"
rg --type java 'showMinimizeButton'

# Test: Search for showMinimizeButton in all FXML files
echo "Searching for showMinimizeButton in FXML files:"
rg --type xml 'showMinimizeButton'

# Test: Search for showMinimizeButton in all JavaScript files (if applicable)
echo "Searching for showMinimizeButton in JavaScript files:"
rg --type js 'showMinimizeButton'

Length of output: 4480


Script:

#!/bin/bash
# Description: Comprehensive search for any remaining references to showMinimizeButton in the codebase

# Search in Java files excluding i18n properties
echo "Searching for showMinimizeButton in Java files (excluding i18n properties):"
rg --type java --glob '!**/i18n/*.properties' 'showMinimizeButton'

# Search in FXML files
echo "Searching for showMinimizeButton in FXML files:"
rg --type xml 'showMinimizeButton'

# Search in JavaScript files
echo "Searching for showMinimizeButton in JavaScript files:"
rg --type js 'showMinimizeButton'

# Search in all i18n properties files
echo "Searching for showMinimizeButton in i18n properties files:"
rg --type properties 'showMinimizeButton'

Length of output: 871


Script:

#!/bin/bash
# Description: Comprehensive search for any remaining references to showMinimizeButton in the codebase

# Search in Java files excluding i18n properties
echo "Searching for showMinimizeButton in Java files (excluding i18n properties):"
rg --type java --glob '!**/i18n/*.properties' 'showMinimizeButton'

# Search in FXML files
echo "Searching for showMinimizeButton in FXML files:"
rg --type xml 'showMinimizeButton'

# Search in JavaScript files
echo "Searching for showMinimizeButton in JavaScript files:"
rg 'showMinimizeButton' --glob '**/*.js'

# Search in all i18n properties files
echo "Searching for showMinimizeButton in i18n properties files:"
rg 'showMinimizeButton' --glob '**/*.properties'

Length of output: 4750

src/main/resources/i18n/strings.properties (1)

389-391: New notification strings added

The addition of notification strings for available updates and support is a good improvement for user communication.

However, consider adding more context to the support notification:

-main.notification.support=Support Cryptomator.
+main.notification.support=Support Cryptomator by becoming a supporter.

This change provides clearer information about the action expected from the user.

src/main/java/org/cryptomator/ui/mainwindow/MainWindowController.java (2)

97-109: Adjust access modifiers for @FXML methods

The methods showGeneralPreferences(), showContributePreferences(), and showUpdatePreferences() are annotated with @FXML and declared as public. If these methods are only accessed via FXML and not from other classes, they can have their access modifiers reduced to private or package-private (no modifier) to enhance encapsulation and adhere to best practices.

Adjust the access modifiers as follows:

 @FXML
-public void showGeneralPreferences() {
+void showGeneralPreferences() {
     appWindows.showPreferencesWindow(SelectedPreferencesTab.GENERAL);
 }

 @FXML
-public void showContributePreferences() {
+void showContributePreferences() {
     appWindows.showPreferencesWindow(SelectedPreferencesTab.CONTRIBUTE);
 }

 @FXML
-public void showUpdatePreferences() {
+void showUpdatePreferences() {
     appWindows.showPreferencesWindow(SelectedPreferencesTab.UPDATES);
 }

111-134: Use standard naming conventions for boolean getters

The methods getDebugModeEnabled(), getUpdateAvailable(), and getLicenseValid() return boolean values. According to Java naming conventions, boolean getters should use the is prefix to enhance readability.

Rename the methods to follow convention:

 public boolean getDebugModeEnabled() {
     return debugModeEnabledProperty().get();
 }

+public boolean isDebugModeEnabled() {
+    return debugModeEnabledProperty().get();
+}

 public boolean getUpdateAvailable() {
     return updateAvailable.get();
 }

+public boolean isUpdateAvailable() {
+    return updateAvailable.get();
+}

 public boolean getLicenseValid() {
     return licenseHolder.isValidLicense();
 }

+public boolean isLicenseValid() {
+    return licenseHolder.isValidLicense();
+}

Don't forget to update any references to these methods throughout the codebase.

src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java (2)

77-78: Inconsistent access modifiers for FXML-injected fields

The addVaultButton field is declared private, while other @FXML-injected fields like vaultList and root are public. For consistency, consider using the same access modifier for all @FXML fields.


283-285: Use primitive type in getCellSize()

The method getCellSize() returns a Double object, but since the value should not be null, consider returning the primitive type double to avoid unnecessary boxing.

src/main/resources/css/light_theme.css (1)

325-328: Implement Debug Notification Styling

The .notification-debug class defines a fixed height and sets the background color to RED_5, likely indicating an error or critical alert. Confirm that the RED_5 color provides sufficient contrast and meets accessibility standards.

Consider verifying the contrast ratio for accessibility compliance.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 4778ba0 and 4bc9b1d.

📒 Files selected for processing (21)
  • .idea/compiler.xml (1 hunks)
  • src/main/java/org/cryptomator/common/settings/Settings.java (4 hunks)
  • src/main/java/org/cryptomator/common/settings/SettingsJson.java (1 hunks)
  • src/main/java/org/cryptomator/ui/controls/NotificationBar.java (1 hunks)
  • src/main/java/org/cryptomator/ui/mainwindow/MainWindowController.java (3 hunks)
  • src/main/java/org/cryptomator/ui/mainwindow/MainWindowModule.java (1 hunks)
  • src/main/java/org/cryptomator/ui/mainwindow/MainWindowSceneFactory.java (1 hunks)
  • src/main/java/org/cryptomator/ui/mainwindow/MainWindowTitleController.java (0 hunks)
  • src/main/java/org/cryptomator/ui/mainwindow/ResizeController.java (0 hunks)
  • src/main/java/org/cryptomator/ui/mainwindow/VaultListCellController.java (3 hunks)
  • src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java (9 hunks)
  • src/main/java/org/cryptomator/ui/preferences/InterfacePreferencesController.java (2 hunks)
  • src/main/resources/css/dark_theme.css (2 hunks)
  • src/main/resources/css/light_theme.css (2 hunks)
  • src/main/resources/fxml/main_window.fxml (1 hunks)
  • src/main/resources/fxml/main_window_resize.fxml (0 hunks)
  • src/main/resources/fxml/main_window_title.fxml (0 hunks)
  • src/main/resources/fxml/preferences_interface.fxml (1 hunks)
  • src/main/resources/fxml/vault_list.fxml (1 hunks)
  • src/main/resources/fxml/vault_list_cell.fxml (1 hunks)
  • src/main/resources/i18n/strings.properties (2 hunks)
💤 Files with no reviewable changes (4)
  • src/main/java/org/cryptomator/ui/mainwindow/MainWindowTitleController.java
  • src/main/java/org/cryptomator/ui/mainwindow/ResizeController.java
  • src/main/resources/fxml/main_window_resize.fxml
  • src/main/resources/fxml/main_window_title.fxml
🔇 Additional comments (44)
src/main/resources/fxml/main_window.fxml (4)

6-6: LGTM: NotificationBar import added

The import of NotificationBar is correctly added to support the new notification components in the redesigned MainWindow.


13-13: Verify the impact of reduced minimum width

The reduction of minWidth from 650 to 600 aligns with the redesign objectives. However, please ensure that this change doesn't negatively impact the layout or responsiveness of the application, especially for users with smaller screens.

To verify the impact, please test the application on various screen sizes and resolutions to ensure all elements remain properly visible and accessible.


14-18: LGTM: Update notification bar added

The addition of the update notification bar is well-implemented and aligns with the PR objectives. It provides a clear way to notify users about available updates and allows them to access update preferences easily.


Line range hint 1-34: Overall changes align with PR objectives, clarification needed on some elements

The changes in this file largely align with the PR objectives, particularly the removal of the custom title bar and the ResizeController. The addition of notification bars enhances the user interface as intended.

However, there are a few points that require clarification:

  1. The PR mentions repositioning of the Preferences button and styling changes to the Add Vault button. These elements are not visible in this FXML file. Could you please clarify where these changes are implemented?

  2. The PR objectives mention that elements for displaying Debug Mode, Supporter Certificate, and Update Notification will be addressed in a subsequent pull request. However, this file already includes notification bars for updates and debug mode. Is this intentional, or should these be removed for now?

To ensure all PR objectives are met, please provide information on where the Preferences and Add Vault button changes are implemented, and confirm the intention behind including the notification bars mentioned above.

src/main/java/org/cryptomator/ui/mainwindow/MainWindowSceneFactory.java (2)

21-22: LGTM: Field changes align with the redesign objectives.

The addition of the window field and removal of mainWindowTitleController are consistent with the PR's goal of using the OS native title bar instead of a custom one.


33-34: LGTM: Simplified accelerator setup, but verify macOS behavior.

The changes to the setupDefaultAccelerators method align with the redesign objectives and simplify the logic. Using window::close directly is consistent with the move to the OS native title bar.

Please verify that this change doesn't affect the closing functionality on macOS, as mentioned in the previous review comments. You may want to test this on a macOS system to ensure the close shortcut works as expected.

To assist with verification, you can run the following command to check for any macOS-specific handling in the codebase:

This will help identify if there are any other places in the code that might need adjustment for macOS compatibility.

src/main/java/org/cryptomator/ui/mainwindow/VaultListCellController.java (2)

3-3: LGTM: Import statement added correctly.

The new import for org.cryptomator.common.settings.Settings is necessary for the Settings dependency introduced in the constructor. It's correctly placed with other imports.


Line range hint 1-86: Summary: Changes align with PR objectives, minor improvements suggested.

The modifications to VaultListCellController introduce a new compactMode property, which aligns with the PR objective of redesigning the MainWindow. The changes are well-implemented, following JavaFX best practices and maintaining consistency with the existing code structure.

Key points:

  1. The Settings dependency is correctly injected and used to initialize the compactMode property.
  2. Proper accessor methods for compactMode have been added.
  3. The changes support the potential for a more flexible UI layout, which could be part of the redesign effort.

While the implementation is solid, consider the following minor improvements:

  1. Add documentation for the compactMode field to clarify its purpose.
  2. Include a null check for the settings parameter in the constructor.
  3. For consistency, add a setter method for the compactMode property.

These changes contribute to the overall goal of redesigning the MainWindow while maintaining code quality and consistency.

src/main/java/org/cryptomator/common/settings/SettingsJson.java (2)

57-58: New compactMode property added

The addition of the compactMode boolean property aligns with the PR objectives of redesigning the MainWindow. This property likely corresponds to the new compact user interface mode mentioned in the AI summary.

However, there are a few points to consider:

  1. The property lacks a default value, unlike most other boolean properties in this class.
  2. There's no JavaDoc comment explaining the purpose and usage of this new property.

Consider adding a default value and a JavaDoc comment for better clarity and consistency:

+    /**
+     * Indicates whether the application is in compact mode.
+     * In compact mode, the UI elements are condensed for a more space-efficient layout.
+     */
     @JsonProperty("compactMode")
-    boolean compactMode;
+    boolean compactMode = false; // or true, depending on the desired default behavior

Let's verify the removal of showMinimizeButton property:


Line range hint 1-93: Alignment with PR objectives and suggestions for further review

The changes in this file partially support the PR objectives of redesigning the MainWindow:

  1. The addition of compactMode aligns with the new UI design, potentially allowing for a more condensed layout.
  2. The removal of showMinimizeButton (if confirmed by the verification script) is consistent with the switch to using the OS native title bar, as mentioned in the PR objectives.

However, to fully understand and verify the implementation of the redesign, consider reviewing the following areas:

  1. The main UI component files (e.g., MainWindow.java or similar) to see how compactMode is being used.
  2. Any theme-related files to ensure proper handling of dark mode, especially considering the comment about Windows title bar color in dark mode.
  3. Files related to the repositioning of the Preferences and Add Vault buttons.

To ensure a comprehensive implementation of the new design:

  1. Implement a migration strategy for users upgrading from versions that used showMinimizeButton.
  2. Consider adding a method in this class or a related service to handle the Windows-specific dark mode title bar issue mentioned in the PR comments.
  3. Ensure that the compactMode setting is properly persisted and loaded across application restarts.

Let's check for related changes in other files:

✅ Verification successful

Addition of compactModeCheckbox has been successfully verified.

All references to compactMode have been appropriately updated across the codebase, ensuring consistent functionality.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usage of compactMode setting
rg "compactMode" --type java

Length of output: 1769


Line range hint 1-145: Overall changes align well with PR objectives, with a minor addition.

The modifications in this file are consistent with the PR's goal of redesigning the MainWindow:

  1. Removal of showMinimizeButtonCheckbox aligns with the switch to using the OS-provided title bar.
  2. Addition of compactModeCheckbox introduces a new UI customization option, which, while not explicitly mentioned in the PR description, could enhance user control over the interface layout.

The changes are minimal and focused, maintaining the overall structure and readability of the code. However, it would be beneficial to update the PR description to include information about the new compact mode feature for completeness.

To ensure all related changes have been properly implemented, let's check for any remaining references to the old title bar or minimize button:

.idea/compiler.xml (3)

33-39: New dependencies added to the project

Several new dependencies have been added to the project:

  • javapoet 1.13.0
  • google-java-format 1.5
  • error_prone_annotations 2.23.0
  • kotlinpoet 1.11.0
  • kotlin-reflect 1.6.10
  • incap 0.2
  • checker-compat-qual 2.5.5

These additions suggest an expansion of the project's toolset, potentially for code generation, formatting, and additional static analysis.

Could you please provide some context on the reasons for adding these new dependencies? It would be helpful to understand how they align with the project's goals and what improvements they bring to the development process.


Line range hint 1-72: Overall assessment of compiler.xml changes

The changes to .idea/compiler.xml reflect significant updates to the project's build configuration and dependencies. Here's a summary of the key points:

  1. Dependency versions have been updated, particularly for Dagger and Guava libraries.
  2. New dependencies have been added, potentially enhancing code generation, formatting, and static analysis capabilities.
  3. There are duplicate entries in the processorPath configuration that need to be removed.

These changes generally improve the project by keeping dependencies up-to-date and expanding the development toolset. However, the duplicate entries issue should be addressed to ensure a clean and efficient configuration.

Please address the duplicate entries issue, and ensure that all new dependencies are necessary and aligned with the project's goals. Once these points are addressed, the changes will significantly enhance the project's build configuration.


17-18: Approval: Version updates for dependencies

The updates to dependency versions, particularly for Dagger (2.49 to 2.51.1), Guava (31.0.1-jre to 33.0.0-jre), and other related libraries, are good improvements. These updates likely include bug fixes, performance enhancements, and potentially new features.

To ensure these updates don't introduce any compatibility issues, please verify:

  1. The project builds successfully with these new versions.
  2. All tests pass after the update.
  3. There are no deprecation warnings or new compiler errors related to these libraries.

Also applies to: 20-20, 27-28, 30-32

src/main/java/org/cryptomator/common/settings/Settings.java (5)

63-63: LGTM: Addition of compactMode property

The new compactMode property aligns well with the PR objectives for redesigning the MainWindow. It follows the existing pattern for property declarations in this class.


100-100: LGTM: Proper initialization of compactMode

The compactMode property is correctly initialized in the constructor using the json object, consistent with other property initializations. This ensures that the compact mode setting can be persisted and loaded from the JSON configuration.


127-127: LGTM: Listener added for compactMode

A change listener has been correctly added for the compactMode property. This ensures that changes to the compact mode setting will trigger the somethingChanged method, likely initiating a save operation. This is consistent with the handling of other properties in the class.


181-181: LGTM: Serialization of compactMode

The compactMode property is correctly included in the serialized method. This ensures that the compact mode setting will be properly persisted when the settings are saved. The serialization is consistent with the handling of other properties in this method.


Line range hint 1-214: Summary: Changes in Settings.java align with PR objectives

The modifications to the Settings class, including the addition of the compactMode property and the removal of showMinimizeButton, are well-implemented and consistent with the PR objectives. The new compactMode property is properly initialized, listened to for changes, and serialized. These changes support the redesign of the MainWindow as described in the PR summary.

A few key points:

  1. The compactMode property has been added and integrated correctly.
  2. The showMinimizeButton property has been removed (though not visible in this snippet).
  3. All changes are consistent with the existing code style and patterns.

The only remaining action is to verify the complete removal of showMinimizeButton from the codebase, as suggested in the previous comment.

src/main/resources/i18n/strings.properties (3)

387-388: New menu items for adding vaults

These new entries align with the PR objective of redesigning the MainWindow. They provide clear options for users to create a new vault or open an existing one.


Line range hint 1-391: Overall assessment of changes

The changes to the strings.properties file align well with the PR objectives of redesigning the MainWindow:

  1. New menu items for adding vaults improve user interaction.
  2. New notification strings enhance user communication.
  3. The addition of a compact mode preference allows for a more flexible UI.

These changes seem to improve the overall user experience and provide more options for customization. The internationalization strings are clear and consistent with the existing style.

However, to ensure a comprehensive review, it would be beneficial to see the complete diff, including removed lines, as mentioned in the previous comment about inconsistencies with the AI-generated summary.


304-304: New preference for compact vault list

This new preference aligns with the PR objective of redesigning the MainWindow. It allows users to choose between a standard and compact view for the vault list.

To ensure this new preference is properly implemented, let's check for its usage in the codebase:

✅ Verification successful

The new compact vault list preference is properly implemented and utilized across the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the usage of the new compact mode preference
rg --type java "compactMode" -C 3

Length of output: 9946

src/main/resources/fxml/vault_list.fxml (1)

35-35: Verify that event handler methods are defined in the controller

The event handlers #toggleMenu, #didClickAddNewVault, and #didClickAddExistingVault are referenced in the FXML. Please ensure these methods are properly defined in VaultListController.

You can run the following script to check if these methods are defined:

Also applies to: 54-54, 59-59

src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java (1)

256-259: LGTM: Addition of showPreferences() method

The showPreferences() method is correctly implemented, providing a way to open the preferences window.

src/main/resources/css/dark_theme.css (7)

184-187: Styles for .button-bar are correctly implemented

The styles for .button-bar set the appropriate background and border properties, ensuring consistent appearance within the main window.


190-192: Styles for .button-left are properly defined

The border settings for .button-left are correctly applied, which should render the left button's border as intended.


195-197: Styles for .button-right are properly defined

The border settings for .button-right are correctly applied, ensuring the right button's border displays appropriately.


320-322: Definition of .notification-label is appropriate

The text color and font weight for .notification-label are set correctly, which should display notification texts prominently.


325-328: Styles for .notification-debug are correctly specified

Setting a fixed height and background color for .notification-debug ensures visual consistency for debug notifications.


331-335: Styles for .notification-update are correctly specified

The fixed height and background color for .notification-update are appropriately set to highlight update notifications.


337-340: Styles for .notification-support are correctly specified

Defining the fixed height and background color for .notification-support ensures support notifications are displayed consistently.

src/main/resources/css/light_theme.css (8)

180-181: Ensure Border Consistency for Windows Main Window

The added border properties for .main-window.os-windows set an explicit top border on Windows platforms. This change helps maintain visual consistency with the native title bar and ensures that the main window has a defined boundary.


184-187: Verify the Styling of the Button Bar in Main Window

The new .main-window .button-bar class applies background and border styling to the button bar:

  • The background color is set to MAIN_BG.
  • A top border is added with CONTROL_BORDER_NORMAL.

Ensure that this styling aligns with the overall design and that it does not conflict with other components' styles.


190-192: Check Border Styling for Left Buttons in Button Bar

The .main-window .button-bar .button-left class adds a right border to the left buttons. This separation may improve visual clarity between buttons. Confirm that this border renders correctly across different platforms and does not create unwanted visual artifacts.


195-197: Check Border Styling for Right Buttons in Button Bar

Similarly, the .main-window .button-bar .button-right class adds a left border to the right buttons. Ensure that this complements the styling of the left buttons and maintains consistency in the button bar's appearance.


314-319: Add Section for NotificationBar Styling

The addition of the NotificationBar section organizes styles related to notifications, improving code readability and maintainability.


320-322: Define Styling for Notification Labels

The .notification-label class sets the text fill to white and makes the font bold. This ensures that notification text stands out against the background.


331-335: Implement Update Notification Styling

The .notification-update class styles update notifications with a yellow background (YELLOW_5) and fixed height. Ensure that this visual cue effectively conveys informational messages to the user.


337-340: Implement Support Notification Styling

The .notification-support class uses the PRIMARY color for its background, aligning it with the application's primary theme. This styling highlights support-related notifications.

Comment thread .idea/compiler.xml Resolved
Comment thread src/main/resources/fxml/vault_list.fxml Resolved
Comment thread src/main/resources/fxml/vault_list.fxml Resolved
@mindmonk
mindmonk requested a review from infeo October 2, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Put close (x) button on left side on Mac

3 participants