Skip to content

Conversation

onesounds
Copy link
Contributor

@onesounds onesounds commented Apr 8, 2025

What's the PR

On Windows 11, the default Korean IME has issues with WPF.
(You can tell whether the issue is present by checking if an underline appears when typing in Korean.)
To make Korean input work properly in Flow, the "Use legacy IME" setting in the IME options must be enabled.

This issue is difficult to fix within WPF itself — it needs to be handled either by the user or by Microsoft.
On Windows 10, there is no new IME, so this issue does not occur.

InfoBar

Therefore, if this setting option exists, it means the user is using Korean + Windows 11.
image

  • A Infobar
  • A button to immediately enable legacy IME
  • A button to open the corresponding settings location

These three elements are shown only when the setting exists and legacy IME is currently off.
If the setting doesn't exist, or legacy IME is already enabled, or was just switched on, the InfoBar is hidden.

And......

  • Add Infobar UserControl
    스크린샷 2025-04-08 123302

  • Add a toggle button to enable or disable the legacy Korean IME registry setting

  • Add a button to open the relevant registry location directly

This comment has been minimized.

@prlabeler prlabeler bot added the bug Something isn't working label Apr 8, 2025
# Conflicts:
#	Flow.Launcher/Languages/en.xaml
#	Flow.Launcher/Resources/Dark.xaml

This comment has been minimized.

# Conflicts:
#	Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

- Adjust Margin
- Cleanup comment
@onesounds onesounds marked this pull request as ready for review April 9, 2025 15:53

This comment has been minimized.

Copy link

gitstream-cm bot commented Apr 9, 2025

🥷 Code experts: Jack251970, Yusyuriv

onesounds, Jack251970 have most 👩‍💻 activity in the files.
onesounds, Yusyuriv have most 🧠 knowledge in the files.

See details

Flow.Launcher/Languages/en.xaml

Activity based on git-commit:

onesounds Jack251970
APR 7 additions & 7 deletions 13 additions & 9 deletions
MAR 8 additions & 3 deletions 67 additions & 42 deletions
FEB 15 additions & 9 deletions
JAN 1 additions & 0 deletions
DEC
NOV

Knowledge based on git-blame:
onesounds: 41%
Yusyuriv: 5%

Flow.Launcher/Resources/Dark.xaml

Activity based on git-commit:

onesounds Jack251970
APR 2 additions & 1 deletions
MAR 14 additions & 9 deletions
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
onesounds: 100%

Flow.Launcher/Resources/Light.xaml

Activity based on git-commit:

onesounds Jack251970
APR 3 additions & 0 deletions
MAR 11 additions & 7 deletions
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
onesounds: 100%

Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

Activity based on git-commit:

onesounds Jack251970
APR 8 additions & 27 deletions 39 additions & 28 deletions
MAR 77 additions & 55 deletions
FEB 17 additions & 8 deletions
JAN 33 additions & 3 deletions
DEC
NOV

Knowledge based on git-blame:
Yusyuriv: 74%
onesounds: 3%

Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Activity based on git-commit:

onesounds Jack251970
APR 32 additions & 6 deletions 10 additions & 7 deletions
MAR 43 additions & 62 deletions 44 additions & 20 deletions
FEB 1 additions & 1 deletions
JAN 8 additions & 1 deletions
DEC
NOV

Knowledge based on git-blame:
onesounds: 67%
Yusyuriv: 30%

To learn more about /:\ gitStream - Visit our Docs

@onesounds
Copy link
Contributor Author

@coderabbitai Please review this PR, milady.

Copy link
Contributor

coderabbitai bot commented Apr 9, 2025

📝 Walkthrough

Walkthrough

This pull request introduces enhancements for Korean IME support, including new string resources for user guidance and a new InfoBar user control for displaying messages. It also updates the theme resource dictionaries with additional colors for the InfoBar states in both dark and light modes. Functionality is added to the settings view model for managing legacy Korean IME settings through registry interactions and commands to open the IME settings. The UI in the settings page is modified to conditionally display InfoBar warnings and toggle options for the Korean IME.

Changes

File(s) Change Summary
Flow.Launcher/Languages/en.xaml Added string resources for Korean IME guidance, including keys for titles, guides, links, and tooltips.
Flow.Launcher/Resources/Controls/InfoBar.xaml
Flow.Launcher/Resources/Controls/InfoBar.xaml.cs
Introduced a new InfoBar user control with layout, dependency properties, and methods for managing its behavior and appearance.
Flow.Launcher/Resources/Dark.xaml
Flow.Launcher/Resources/Light.xaml
Removed NumberBoxPlaceHolder brush and added new SolidColorBrush resources for InfoBar states (Info, Warning, Success, Error) in both themes.
Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs Added properties and methods for managing legacy Korean IME settings via registry interactions and introduced a command to open the IME settings.
Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml Introduced a new XML namespace and a BoolToVisibilityConverter; updated UI elements to include an InfoBar for Korean IME warnings and controls for toggling settings.

Suggested labels

enhancement

Suggested reviewers

  • onesounds

Poem

I'm a rabbit hopping through lines of code,
New strings and brushes light the road.
InfoBar pops up with a gentle view,
Registry tweaks make settings anew.
With a twitch of my nose, I proudly boast—
Code that's sleek from coast to coast!
🐇 Hop on, let the changes glow!

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 218635a and 7192319.

📒 Files selected for processing (3)
  • Flow.Launcher.Infrastructure/Win32Helper.cs (2 hunks)
  • Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (2 hunks)
  • Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs
🔇 Additional comments (12)
Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml (5)

6-6: Clean namespace addition for converters.

The XML namespace for converters is properly added, which enables the use of the BoolToVisibilityConverter.


18-20: Appropriate resource definition.

The BoolToVisibilityConverter is correctly defined in the Page.Resources section, making it available for use throughout the page.


224-228: Attribute reordering for better readability.

The attribute order has been improved with Minimum placed before Value, which is a good practice as it ensures the minimum constraint is applied before setting the value.


320-331: Well-implemented InfoBar for Korean IME notification.

The InfoBar implementation effectively notifies users when the legacy Korean IME is disabled. It properly:

  1. Shows only when the registry key exists
  2. Uses an inverted visibility binding to show only when legacy IME is disabled
  3. Utilizes localized resources for all user-facing text

This provides an excellent user experience by guiding users to enable the legacy IME.


332-348: Good UX for Korean IME settings management.

The CardGroup with toggle switch and settings button provides users with two convenient options:

  1. Direct toggle to enable/disable the legacy Korean IME
  2. Button to open Windows settings for more control

The visibility binding ensures these controls only appear when relevant (when the registry key exists), following good UX principles.

Flow.Launcher.Infrastructure/Win32Helper.cs (7)

3-3: Appropriate using directive addition.

The System.Diagnostics namespace is correctly added to support the Process.Start method used in OpenImeSettings.


522-524: Well-organized region for Korean IME functionality.

The Korean IME functionality is properly organized within its own region, following the established pattern in the file.


524-528: Reliable Windows 11 detection.

The IsWindows11 method correctly identifies Windows 11 by checking the build number (≥22000), which is a reliable approach for OS version detection.


530-533: Concise check for Korean IME existence.

The method efficiently checks for the existence of the Korean IME by leveraging the GetLegacyKoreanIMERegistryValue method.


535-549: Robust registry value checking.

The method handles both integer values and string values that can be parsed to integers, making it resilient against different registry value types. The implementation correctly returns true only when the value is 1.


551-572: Registry modification with proper error handling.

The method attempts to create/modify the registry key and correctly returns a boolean indicating success. The try-catch block prevents application crashes if registry access fails.


574-593: Safe registry value retrieval.

The method safely attempts to read the registry value and returns null if the key doesn't exist or an exception occurs, preventing application crashes.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (4)
Flow.Launcher/Resources/Controls/InfoBar.xaml.cs (3)

50-52: Translate Korean comments to English.

There are Korean comments in the code that should be translated to English for consistency and maintainability.

- SetValue(MessageProperty, value);
- UpdateMessageVisibility(); // Message 속성 변경 시 Visibility 업데이트
+ SetValue(MessageProperty, value);
+ UpdateMessageVisibility(); // Update visibility when Message property changes

76-78: Translate Korean comments to English.

There are Korean comments in the code that should be translated to English for consistency and maintainability.

- SetValue(TitleProperty, value);
- UpdateTitleVisibility(); // Title 속성 변경 시 Visibility 업데이트
+ SetValue(TitleProperty, value);
+ UpdateTitleVisibility(); // Update visibility when Title property changes

22-22: Remove commented code.

This commented line should be removed if not needed, as it adds no value to the codebase.

- //this.DataContext = this;
Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (1)

37-38: Consider adding comments for clarity.

It would be helpful to add a brief comment explaining why IsLegacyKoreanIMEEnabled() is called in the constructor.

- IsLegacyKoreanIMEEnabled();
+ // Initialize the Korean IME status by checking registry
+ IsLegacyKoreanIMEEnabled();
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0444141 and d9a353b.

📒 Files selected for processing (7)
  • Flow.Launcher/Languages/en.xaml (3 hunks)
  • Flow.Launcher/Resources/Controls/InfoBar.xaml (1 hunks)
  • Flow.Launcher/Resources/Controls/InfoBar.xaml.cs (1 hunks)
  • Flow.Launcher/Resources/Dark.xaml (1 hunks)
  • Flow.Launcher/Resources/Light.xaml (1 hunks)
  • Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (4 hunks)
  • Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: gitStream.cm
🔇 Additional comments (28)
Flow.Launcher/Resources/Controls/InfoBar.xaml (6)

1-13: Well-structured UserControl declaration with proper namespace and references.

The UserControl declaration follows good XAML practices with appropriate namespaces and design-time attributes.


14-22: Good structure with nested Border for InfoBar styling.

The outer Grid and Border implementation creates a visually appealing container with proper padding, background and corner radius. The BorderBrush is properly bound to a dynamic resource.


23-28: Well-designed Grid layout with appropriate column definitions.

The three-column Grid layout appropriately allocates space for the icon, content, and close button. The Auto-*-Auto pattern is ideal for this kind of control layout.


29-46: Properly implemented icon section with named parts.

The icon implementation with Border and FontIcon follows best practices:

  • Named parts for template access (Part_IconBorder, PART_Icon)
  • Proper alignment and dimensions
  • Dynamic resource binding for foreground

48-64: Well-structured content area with proper text styling.

The content area correctly implements:

  • Proper binding to InfoBar properties
  • Semantic styling (semibold for title)
  • Text wrapping for the message
  • Appropriate spacing between elements

66-76: Properly implemented close button with event handling.

The close button is well implemented with:

  • Appropriate sizing and alignment
  • Named part for access in code-behind
  • Event handler for click events
  • Font icon for the close glyph
Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml (5)

6-6: Properly added converter namespace.

The namespace for converters is correctly added to access the BoolToVisibilityConverter.


18-20: Well-implemented converter resource.

The BoolToVisibilityConverter is properly registered as a resource with an appropriate key.


224-228: Improved ordering of NumberBox attributes.

The reordering of Minimum before Value ensures validation is properly applied when the control is initialized.


320-331: Well-implemented Korean IME warning InfoBar.

The InfoBar is correctly:

  • Bound for visibility to show only when needed
  • Using localized resources for title and message
  • Set as non-closable since it represents an important system setting
  • Displaying warning state to notify users of potential issues

This implementation fulfills the PR objective of notifying users about Korean IME settings on Windows 11.


332-348: Properly implemented Korean IME settings controls.

The controls for managing Korean IME settings are well implemented:

  • Grouped logically in a CardGroup
  • Show/hide based on registry key existence
  • Include both toggle for enabling legacy IME and a button to open settings
  • Use proper localization for all text elements
  • Follow the application's UI pattern for settings

This implementation fulfills the PR objective of providing controls to enable legacy Korean IME.

Flow.Launcher/Resources/Light.xaml (1)

112-124: Well-designed InfoBar theme resources for light mode.

The added resources provide a complete set of styles for the InfoBar control:

  • Border color with appropriate transparency
  • Icon colors for different states (info, warning, success, error)
  • Background colors for different states with appropriate contrast
  • Consistent naming pattern matching the existing resources

The InfoBar styles align well with the light theme of the application.

Flow.Launcher/Resources/Dark.xaml (1)

117-129: Good implementation of InfoBar theme resources.

The addition of these custom InfoBar resources is well-structured and follows the existing styling patterns in the file. The color choices are appropriately differentiated for each InfoBar state (Info, Warning, Success, Error), providing clear visual distinction for users.

I like how you've set up the system accent color for the info state with proper opacity, while using custom colors for the other states to maintain visual hierarchy.

Flow.Launcher/Resources/Controls/InfoBar.xaml.cs (4)

5-24: Well-structured UserControl implementation.

The InfoBar control is cleanly implemented with the proper initialization and event handling. The structure follows good WPF practices, utilizing the Loaded event to trigger initial UI updates.


25-40: Good use of dependency properties.

The Type property is properly implemented as a dependency property with change notification. This follows WPF best practices and ensures the UI updates appropriately when the property changes.


154-179: Well-implemented style update mechanism.

The UpdateStyle method efficiently handles the appearance changes based on the InfoBar type. It's a clean approach that encapsulates the styling logic in one place, making maintenance easier.


204-216: Clear enum definitions.

The enum definitions are clear and concise, providing a good balance between simplicity and functionality. The InfoBarType enum values correspond well to the styles defined in the UpdateStyle method.

Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (5)

191-207: Well-implemented property with notification.

The LegacyKoreanIMEEnabled property correctly handles changes and notifies related properties. The debug logging is helpful for troubleshooting.


209-227: Good implementation of registry checking properties.

The KoreanIMERegistryKeyExists and KoreanIMERegistryValueIsZero properties are well implemented with proper null handling and type checking. This defensive coding approach helps prevent potential exceptions.


250-277: Robust registry manipulation with proper error handling.

The SetLegacyKoreanIMEEnabled method properly handles registry operations with appropriate error checking and exception handling. The use of constants for registry paths and value names improves maintainability.


279-300: Safe registry reading implementation.

The GetLegacyKoreanIMERegistryValue method safely reads from the registry with proper error handling and resource cleanup. This implementation reduces the risk of resource leaks.


302-312: Simple and effective IME settings opener.

The OpenImeSettings method uses the system settings URI scheme to directly open the relevant settings page. The try-catch block ensures that any errors are properly logged without crashing the application.

Flow.Launcher/Languages/en.xaml (6)

113-113: LGTM: Clarified the tooltip text.

The updated tooltip text more clearly explains that this setting refers to plugin default delay time, which improves user understanding.


114-118: LGTM: Added helpful search delay time options.

These new string resources provide clear descriptions for the various search delay time options, making it more intuitive for users to select their preferred setting.


119-131: LGTM: Excellent Korean IME guidance.

The added strings provide comprehensive guidance for Korean IME users on Windows 11, including:

  • Clear indication of the potential issue
  • Step-by-step instructions for enabling the legacy IME
  • Navigation paths to find the relevant settings
  • Text for UI buttons to directly access settings

This aligns perfectly with the PR objectives to assist users in managing Korean IME settings on Windows 11.


169-169: LGTM: Added default string resource.

The new "Default" string resource will likely be used as a selection option in dropdown menus or settings, providing consistency across the application.


396-396: LGTM: Updated search delay time tips.

The updated tip text now instructs users to select a search delay time rather than inputting it, which aligns with a UI change from text input to selection component. The text also clearly explains the function of the default option.


397-398: LGTM: Added current and new search delay time labels.

These new string resources provide clear labels for displaying the current and new search delay time settings in the UI, improving user understanding when making changes.

Copy link
Contributor

coderabbitai bot commented Apr 9, 2025

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get an overview of the PR changes
git show --name-status

# View the changed files to understand the implementation
git show --pretty=format: --name-only

Length of output: 76733


🏁 Script executed:

#!/bin/bash
# Get the list of actual changed files in the PR, not all files in the repository
git log --name-only -1

# Examine the key files mentioned in the AI summary
echo "Looking at Flow.Launcher/Languages/en.xaml"
git diff HEAD~1 -- Flow.Launcher/Languages/en.xaml

echo "Looking at Flow.Launcher/Resources/Controls/InfoBar.xaml"
git diff HEAD~1 -- Flow.Launcher/Resources/Controls/InfoBar.xaml

echo "Looking at Flow.Launcher/Resources/Controls/InfoBar.xaml.cs"
git diff HEAD~1 -- Flow.Launcher/Resources/Controls/InfoBar.xaml.cs

echo "Looking at Flow.Launcher/Resources/Dark.xaml"
git diff HEAD~1 -- Flow.Launcher/Resources/Dark.xaml

echo "Looking at Flow.Launcher/Resources/Light.xaml"
git diff HEAD~1 -- Flow.Launcher/Resources/Light.xaml

echo "Looking at Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs"
git diff HEAD~1 -- Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

echo "Looking at Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml"
git diff HEAD~1 -- Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Length of output: 1538


🏁 Script executed:

#!/bin/bash
# Let's examine the files using cat instead of git diff
echo "Looking at Flow.Launcher/Languages/en.xaml"
cat Flow.Launcher/Languages/en.xaml

echo "Looking at Flow.Launcher/Resources/Controls/InfoBar.xaml"
cat Flow.Launcher/Resources/Controls/InfoBar.xaml

echo "Looking at Flow.Launcher/Resources/Controls/InfoBar.xaml.cs"
cat Flow.Launcher/Resources/Controls/InfoBar.xaml.cs

echo "Looking at Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs"
cat Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

echo "Looking at Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml"
cat Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Length of output: 66489


@onesounds I've reviewed the Korean IME Infobar PR and it looks excellent. The implementation provides an elegant solution for Korean users on Windows 11 who are experiencing IME issues.

Key strengths of this PR:

  1. Well-designed InfoBar component:

    • Supports multiple states (Info, Warning, Success, Error) with appropriate styling
    • Flexible layout options for different content lengths
    • Clean implementation with proper XAML structure and code-behind
  2. Comprehensive Korean IME support:

    • Registry detection and modification for the legacy IME setting
    • Clear user guidance with explanatory text
    • Two convenient options for users: direct toggle or opening Windows settings
  3. Polished user experience:

    • The InfoBar appears only when needed (Windows 11 + Korean IME + legacy setting disabled)
    • Clear, well-written guidance text that explains both the problem and solution
    • Properly integrated into the settings UI

The PR is well-implemented and ready to merge. It will significantly improve the experience for Korean-language users of Flow Launcher on Windows 11.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

This comment has been minimized.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (1)

229-233: 🛠️ Refactor suggestion

Missing user feedback for failed launches.

The OpenImeSettings method delegates to Win32Helper.OpenImeSettings() which silently catches exceptions without notifying the user if the operation fails.

[RelayCommand]
private void OpenImeSettings()
{
-    Win32Helper.OpenImeSettings();
+    try
+    {
+        Process.Start(new ProcessStartInfo("ms-settings:regionlanguage") { UseShellExecute = true });
+    }
+    catch (Exception e)
+    {
+        Debug.WriteLine($"Error opening IME settings: {e.Message}");
+        App.API.ShowMsg("Failed to open IME settings", "Please try opening Windows Settings > Time & Language > Language & Region manually.");
+    }
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ebff80c and f56d038.

📒 Files selected for processing (2)
  • Flow.Launcher.Infrastructure/Win32Helper.cs (2 hunks)
  • Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (1)
Flow.Launcher.Infrastructure/Win32Helper.cs (6)
  • Win32Helper (20-602)
  • IsLegacyKoreanIMEEnabled (529-543)
  • SetLegacyKoreanIMEEnabled (545-566)
  • IsKoreanIMEExist (524-527)
  • GetLegacyKoreanIMERegistryValue (568-587)
  • OpenImeSettings (589-599)
🔇 Additional comments (8)
Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (4)

184-190: Well-documented feature rationale.

The comment clearly explains the problem with the Korean IME on Windows 11 and WPF applications, along with the solution approach. This documentation is valuable for future maintenance.


191-207: Property implementation handles error cases correctly.

The LegacyKoreanIMEEnabled property correctly notifies property changes and provides user feedback on registry update failures. The error message helps users understand what went wrong.


209-209: Good conditional visibility check.

This property provides a clean way to conditionally display UI elements only when Korean IME is present on the system.


211-227: Robust value parsing with type checks.

The implementation properly handles different potential data types from the registry and includes appropriate fallback parsing. The code handles the case where the registry value might be returned as a string instead of an integer.

Flow.Launcher.Infrastructure/Win32Helper.cs (4)

524-527: Simple and effective existence check.

This method provides a clear way to determine if the Korean IME is installed on the system by checking the registry value existence.


529-543: Thorough type handling for registry value.

The implementation properly handles both integer values and string values that need parsing, ensuring robust behavior regardless of how the registry stores the value.


545-566: Registry modification with proper error handling pattern.

The method correctly handles both the creation of registry keys and setting values with appropriate error handling. The boolean return value allows callers to know whether the operation succeeded or failed.


568-587: Consistent registry access pattern.

This method follows the same careful pattern for accessing registry values with proper error handling by returning null when the key doesn't exist or an exception occurs.

This comment has been minimized.

This comment has been minimized.

Jack251970
Jack251970 previously approved these changes Apr 11, 2025

This comment has been minimized.

@Jack251970 Jack251970 requested a review from Copilot April 11, 2025 03:24
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 8 changed files in this pull request and generated 2 comments.

Files not reviewed (5)
  • Flow.Launcher/Languages/en.xaml: Language not supported
  • Flow.Launcher/Resources/Controls/InfoBar.xaml: Language not supported
  • Flow.Launcher/Resources/Dark.xaml: Language not supported
  • Flow.Launcher/Resources/Light.xaml: Language not supported
  • Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml: Language not supported
Comments suppressed due to low confidence (1)

Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs:210

  • [nitpick] The property name 'KoreanIMERegistryValueIsZero' may be unclear; consider renaming it to something like 'IsLegacyKoreanIMEDisabled' to more explicitly indicate that a value of 0 means the legacy IME is off.
public bool KoreanIMERegistryValueIsZero

This comment has been minimized.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (3)
Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (2)

191-207: Potential UI desynchronization on failure.
If SetLegacyKoreanIMEEnabled(value) fails, the UI will not roll back the property, which can confuse users.


240-244: Handle exceptions for failed IME settings launch.
Currently, this call relies on silent exception handling in Win32Helper.OpenImeSettings. Adding a user-facing error message can improve troubleshooting when the launch fails.

Flow.Launcher.Infrastructure/Win32Helper.cs (1)

593-603: Provide caller feedback or return status on failure.
Silently ignoring exceptions hides potential issues from the user. Consider returning a boolean or rethrowing.

🧹 Nitpick comments (4)
Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (1)

222-238: Consider renaming for clarity.
KoreanIMERegistryValueIsZero might be more descriptive as LegacyIMERegistryValueIsZero or IsLegacyKoreanIMEDisabled to reflect intent more clearly.

Flow.Launcher.Infrastructure/Win32Helper.cs (3)

528-531: Improve method naming.
IsKoreanIMEExist could be more naturally named IsKoreanIMEInstalled or DoesKoreanIMEExist.


549-570: Consider propagating exceptions to enable user feedback.
Silently catching exceptions can hinder debugging and prevent users from knowing why changes fail. Either return an error state or rethrow the exception to the caller.


572-591: Likewise, consider surfacing exceptions.
Swallowing registry access exceptions may obscure issues. Returning or logging error details could aid troubleshooting.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c5f2fca and 218635a.

📒 Files selected for processing (2)
  • Flow.Launcher.Infrastructure/Win32Helper.cs (3 hunks)
  • Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (1)
Flow.Launcher.Infrastructure/Win32Helper.cs (7)
  • Win32Helper (20-606)
  • IsLegacyKoreanIMEEnabled (533-547)
  • SetLegacyKoreanIMEEnabled (549-570)
  • IsKoreanIMEExist (528-531)
  • IsWindows11 (24-27)
  • GetLegacyKoreanIMERegistryValue (572-591)
  • OpenImeSettings (593-603)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: gitStream.cm
🔇 Additional comments (7)
Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs (4)

3-3: No issues with the added import.
This import is needed for the Any() usage.


10-10: No issues with the added import.
This import is needed for referencing Win32Helper.


184-190: Region commentary looks good.
No concerns with the added region and explanatory comment.


209-220: Confirm logic for Windows 10 scenarios.
If the user is on Windows 10 but the registry key is present, this property returns true, which may display the InfoBar unintentionally.

Would you mind verifying behavior on Windows 10? For instance, confirm whether the InfoBar is incorrectly shown due to a leftover registry key. If necessary, we can refine this condition.

Flow.Launcher.Infrastructure/Win32Helper.cs (3)

3-3: No issues with the added import.
This import is necessary for launching processes and debug logging.


24-27: No concerns with IsWindows11 detection.
The straightforward version check suffices for now.


533-547: Logic is clear and concise.
No concerns with checking the registry value and parsing it.

@onesounds
Copy link
Contributor Author

onesounds commented Apr 11, 2025

🔄 Changes Overview

Issue

  • Discovered an issue where the registry key does not exist if the Korean IME is installed but the setting has never been changed.

Current Behavior:

  • The visibility of the entire area is determined based on the existence of a registry key.
  • The visibility of the InfoBar area is determined based on the toggle button state (i.e., the value in the registry).

Updated Behavior:

  • The entire area will only be shown when both of the following conditions are met:
    1. The OS is Windows 11
    2. The Korean IME is installed
  • The InfoBar visibility continues to be controlled by the registry value based on the toggle button state.

Other Notes:

  • ✅ Verified that checking the install status of the Korean IME works correctly.
  • ✅ Confirmed that enabling the toggle switch creates the registry key if it does not already exist.

@onesounds
Copy link
Contributor Author

@coderabbitai review please.

Copy link
Contributor

coderabbitai bot commented Apr 11, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@onesounds I'll review the latest changes to your Korean IME InfoBar PR. Let me check what's been updated since my last review.


🏁 Script executed:

#!/bin/bash
# Get the latest commit information
git log -n 1 --oneline

# Check what files were changed in the most recent commit
git show --name-only HEAD

# Show the actual changes in the most recent commit
git show HEAD

Length of output: 70555


🏁 Script executed:

#!/bin/bash
# Let's get the specific changes related to checking if Korean IME is installed/in use
# First, let's check the commit message to ensure we're looking at the right commit
git log -n 1 --oneline

# Let's examine changes to the Win32Helper.cs file which likely contains IME detection logic
git diff HEAD~1 HEAD -- Flow.Launcher.Infrastructure/Win32Helper.cs

# Let's also check changes to the settings view model which would control visibility
git diff HEAD~1 HEAD -- Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

# And the XAML file that would use the new conditions for visibility
git diff HEAD~1 HEAD -- Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Length of output: 336


🏁 Script executed:

#!/bin/bash
# Since we're having issues with git diff, let's look at the relevant files directly
echo "Examining Win32Helper.cs for Korean IME detection logic"
grep -A 20 -B 5 "Korean" Flow.Launcher.Infrastructure/Win32Helper.cs

echo -e "\nChecking SettingsPaneGeneralViewModel.cs for Korean IME related properties"
grep -A 10 -B 5 "Korean" Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

echo -e "\nExamining SettingsPaneGeneral.xaml for visibility conditions"
grep -A 10 -B 5 "Korean\|IME\|InfoBar" Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

# Let's also get the current content of these files to better understand the implementation
echo -e "\nContent of Win32Helper.cs (Korean IME related methods)"
cat Flow.Launcher.Infrastructure/Win32Helper.cs | grep -A 50 "IsKoreanIME"

echo -e "\nContent of SettingsPaneGeneralViewModel.cs (Korean IME related properties)"
cat Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs | grep -A 50 "KoreanIME"

echo -e "\nContent of the InfoBar.xaml.cs file"
cat Flow.Launcher/Resources/Controls/InfoBar.xaml.cs | head -n 50

Length of output: 14340


@onesounds I've reviewed the latest changes to your Korean IME InfoBar PR. This update adds an important enhancement by checking whether the Korean IME is actually installed on the user's system.

The key improvement in this change is:

  1. More targeted visibility condition:
    bool registryKeyExists = Win32Helper.IsKoreanIMEExist();
    bool koreanLanguageInstalled = InputLanguage.InstalledInputLanguages.Cast

().Any(lang => lang.Culture.Name.StartsWith("ko"));
bool isWindows11 = Win32Helper.IsWindows11();

// Return true if Windows 11 with Korean IME installed, or if the registry key exists
return (isWindows11 && koreanLanguageInstalled) || registryKeyExists;


2. **User experience benefits**:
- The Korean IME section will only appear for users who actually need it (Windows 11 users with Korean language installed)
- Users without Korean language installed won't see irrelevant settings
- The registry key existence is still checked as a fallback to ensure settings remain visible for users who have previously configured the IME

This change is well-implemented and makes the feature even more polished. The logic is sound - checking both OS version and installed languages ensures the InfoBar is shown precisely to the target audience who would benefit from it.

The PR continues to be ready for merging, with this latest enhancement further improving the user experience.



<!-- <agentComponentType>chat-answer</agentComponentType> -->

<!-- <rawResChunk><answer><details>
<summary>🧩 Analysis chain</summary>

@onesounds I'll review the latest changes to your Korean IME InfoBar PR. Let me check what's been updated since my last review.

---

🏁 Script executed:

#!/bin/bash

Get the latest commit information

git log -n 1 --oneline

Check what files were changed in the most recent commit

git show --name-only HEAD

Show the actual changes in the most recent commit

git show HEAD


Length of output: 70555

---

🏁 Script executed:

#!/bin/bash

Let's get the specific changes related to checking if Korean IME is installed/in use

First, let's check the commit message to ensure we're looking at the right commit

git log -n 1 --oneline

Let's examine changes to the Win32Helper.cs file which likely contains IME detection logic

git diff HEAD~1 HEAD -- Flow.Launcher.Infrastructure/Win32Helper.cs

Let's also check changes to the settings view model which would control visibility

git diff HEAD~1 HEAD -- Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

And the XAML file that would use the new conditions for visibility

git diff HEAD~1 HEAD -- Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml


Length of output: 336

---

🏁 Script executed:

#!/bin/bash

Since we're having issues with git diff, let's look at the relevant files directly

echo "Examining Win32Helper.cs for Korean IME detection logic"
grep -A 20 -B 5 "Korean" Flow.Launcher.Infrastructure/Win32Helper.cs

echo -e "\nChecking SettingsPaneGeneralViewModel.cs for Korean IME related properties"
grep -A 10 -B 5 "Korean" Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

echo -e "\nExamining SettingsPaneGeneral.xaml for visibility conditions"
grep -A 10 -B 5 "Korean|IME|InfoBar" Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Let's also get the current content of these files to better understand the implementation

echo -e "\nContent of Win32Helper.cs (Korean IME related methods)"
cat Flow.Launcher.Infrastructure/Win32Helper.cs | grep -A 50 "IsKoreanIME"

echo -e "\nContent of SettingsPaneGeneralViewModel.cs (Korean IME related properties)"
cat Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs | grep -A 50 "KoreanIME"

echo -e "\nContent of the InfoBar.xaml.cs file"
cat Flow.Launcher/Resources/Controls/InfoBar.xaml.cs | head -n 50


Length of output: 14340

---



</details>

@onesounds I've reviewed the latest changes to your Korean IME InfoBar PR. This update adds an important enhancement by checking whether the Korean IME is actually installed on the user's system.

The key improvement in this change is:

1. **More targeted visibility condition**:
   ```csharp
   bool registryKeyExists = Win32Helper.IsKoreanIMEExist();
   bool koreanLanguageInstalled = InputLanguage.InstalledInputLanguages.Cast<InputLanguage>().Any(lang => lang.Culture.Name.StartsWith("ko"));
   bool isWindows11 = Win32Helper.IsWindows11();

   // Return true if Windows 11 with Korean IME installed, or if the registry key exists
   return (isWindows11 && koreanLanguageInstalled) || registryKeyExists;
  1. User experience benefits:
    • The Korean IME section will only appear for users who actually need it (Windows 11 users with Korean language installed)
    • Users without Korean language installed won't see irrelevant settings
    • The registry key existence is still checked as a fallback to ensure settings remain visible for users who have previously configured the IME

This change is well-implemented and makes the feature even more polished. The logic is sound - checking both OS version and installed languages ensures the InfoBar is shown precisely to the target audience who would benefit from it.

The PR continues to be ready for merging, with this latest enhancement further improving the user experience. -->

@onesounds onesounds enabled auto-merge April 11, 2025 04:38
@Jack251970 Jack251970 requested a review from Copilot April 11, 2025 04:39
Copy link

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

❌ Errors Count
❌ forbidden-pattern 22
⚠️ noisy-file 1
⚠️ non-alpha-in-dictionary 19

See ❌ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 8 changed files in this pull request and generated no comments.

Files not reviewed (5)
  • Flow.Launcher/Languages/en.xaml: Language not supported
  • Flow.Launcher/Resources/Controls/InfoBar.xaml: Language not supported
  • Flow.Launcher/Resources/Dark.xaml: Language not supported
  • Flow.Launcher/Resources/Light.xaml: Language not supported
  • Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml: Language not supported
Comments suppressed due to low confidence (2)

Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs:222

  • [nitpick] The property name 'KoreanIMERegistryValueIsZero' may be ambiguous as it returns true when the legacy IME setting is off (0). Consider renaming it to 'IsLegacyKoreanIMEDisabled' to more clearly reflect its purpose.
public bool KoreanIMERegistryValueIsZero

Flow.Launcher/Infrastructure/Win32Helper.cs:567

  • The exception in the registry write operation is swallowed silently; consider logging the exception details to aid in troubleshooting potential registry access issues.
catch (System.Exception)

@onesounds onesounds merged commit 39fccb5 into Flow-Launcher:dev Apr 11, 2025
4 checks passed
@Jack251970 Jack251970 added this to the 1.20.0 milestone Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kind/ui related to UI, icons, themes, etc kind/ux related to user experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants