Skip to content

Improve Topmost Feature #3728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 14, 2025
Merged

Improve Topmost Feature #3728

merged 4 commits into from
Jun 14, 2025

Conversation

Jack251970
Copy link
Member

@Jack251970 Jack251970 commented Jun 14, 2025

Changes

  • Set topmost default value to false

Follow on with #3541.

TODO

  • Improve topmost feature description
  • Reorganize topmost setting option position

@prlabeler prlabeler bot added the enhancement New feature or request label Jun 14, 2025
@Jack251970 Jack251970 added this to the Future milestone Jun 14, 2025
Copy link
Contributor

coderabbitai bot commented Jun 14, 2025

📝 Walkthrough

Walkthrough

The changes update the default value and description of the "Show At Topmost" setting, modify its explanatory text in the English language file, and adjust the icon and spacing for its UI representation in the settings pane. No changes were made to logic, bindings, or public APIs.

Changes

Files/Groups Change Summary
Flow.Launcher.Infrastructure/UserSettings/Settings.cs Changed default value of _showAtTopmost from true to false.
Flow.Launcher/Languages/en.xaml Updated the text and tooltip for "Show At Topmost" to clarify its behavior and wording.
Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml Adjusted icon, added blank lines for readability, and changed margin above card group for UI spacing.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Settings UI
    participant Settings.cs

    User ->> Settings UI: Opens General Settings
    Settings UI ->> Settings.cs: Reads ShowAtTopmost default value
    Settings.cs -->> Settings UI: Returns false (new default)
    Settings UI -->> User: Displays updated text and icon for "Show At Topmost"
Loading

Possibly related PRs

Suggested labels

kind/ui

Suggested reviewers

  • Jack251970

Poem

A toggle at the top, now set to rest,
No longer always foremost, just at your behest.
With icons refreshed and tooltips anew,
The settings pane sparkles, inviting review.
A hop and a tweak, the rabbit approves,
For clarity and comfort, the UI improves! 🐇✨


📜 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 f30c6fc and 4c7f966.

📒 Files selected for processing (2)
  • Flow.Launcher/Languages/en.xaml (1 hunks)
  • Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • Flow.Launcher/Languages/en.xaml
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: gitStream.cm
  • GitHub Check: build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this 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.

Copy link

gitstream-cm bot commented Jun 14, 2025

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

This comment has been minimized.

@Jack251970
Copy link
Member Author

@onesounds If you have a chance, could you please implement the TODOs as described above?

This comment has been minimized.

@onesounds
Copy link
Contributor

image

Done. I’m not entirely happy with using the converter (since I’m not sure if it will ever be reused in the future, or if it might need to handle reverse logic at some point — in which case, we might consider renaming it). Anyway, I’ll leave the wording and the converter details up to you.

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

🧹 Nitpick comments (2)
Flow.Launcher/Converters/BoolNegationConverter.cs (1)

7-22: Minor polishing: mark the converter as sealed and add [ValueConversion] attribute

The converter is stateless and will never be inherited from.
Making it sealed enables inlining and reflects intent.
Adding the attribute improves tooling support (Blend shows valid source/target types).

-    public class BoolNegationConverter : IValueConverter
+    [ValueConversion(typeof(bool), typeof(bool))]
+    public sealed class BoolNegationConverter : IValueConverter
Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml (1)

67-83: Explicitly set binding mode for IsEnabled to clarify intent

IsEnabled is a read-only DP from the view-model’s perspective, but without Mode=OneWay WPF will still default to TwoWay and try to push updates back, which generates superfluous binding-errors in the debug window.

-                    OnContent="{DynamicResource enable}"   IsEnabled="{Binding Settings.HideWhenDeactivated, Converter={StaticResource BoolNegationConverter}}"/>
+                    OnContent="{DynamicResource enable}"
+                    IsEnabled="{Binding Settings.HideWhenDeactivated,
+                                         Converter={StaticResource BoolNegationConverter},
+                                         Mode=OneWay}" />

This is purely defensive but avoids noisy logs.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c06fdb9 and f30c6fc.

📒 Files selected for processing (3)
  • Flow.Launcher/Converters/BoolNegationConverter.cs (1 hunks)
  • Flow.Launcher/Languages/en.xaml (1 hunks)
  • Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Flow.Launcher/Languages/en.xaml
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: gitStream workflow automation
  • GitHub Check: gitStream workflow automation
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: build
  • GitHub Check: Check Spelling
🔇 Additional comments (1)
Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml (1)

18-22: Good addition of a reusable converter resource

Registering BoolNegationConverter at page scope keeps XAML tidy and avoids multiple instantations.
Nothing to change here.

Comment on lines 7 to 22
public class BoolNegationConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool b)
return !b;
return value;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool b)
return !b;
return value;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Return a sentinel value for non-boolean inputs to avoid runtime binding errors

Convert/ConvertBack currently return the original value when it is not a bool.
For bindings where the target expects a bool, returning, e.g. a string will raise a runtime error and WPF will silently dump a binding‐error in the output window.

-            if (value is bool b)
-                return !b;
-            return value;
+            if (value is bool b)
+                return !b;
+            return DependencyProperty.UnsetValue;   // let WPF decide what to do

You may need using System.Windows; for DependencyProperty.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public class BoolNegationConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool b)
return !b;
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool b)
return !b;
return value;
}
}
public class BoolNegationConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool b)
return !b;
return DependencyProperty.UnsetValue; // let WPF decide what to do
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool b)
return !b;
return DependencyProperty.UnsetValue; // let WPF decide what to do
}
}
🤖 Prompt for AI Agents
In Flow.Launcher/Converters/BoolNegationConverter.cs around lines 7 to 22, the
Convert and ConvertBack methods return the original value when it is not a bool,
which can cause runtime binding errors in WPF if the target expects a bool. To
fix this, modify both methods to return DependencyProperty.UnsetValue for
non-boolean inputs instead of the original value. Add "using System.Windows;" if
needed to access DependencyProperty.

@Jack251970
Copy link
Member Author

image

Done. I’m not entirely happy with using the converter (since I’m not sure if it will ever be reused in the future, or if it might need to handle reverse logic at some point — in which case, we might consider renaming it). Anyway, I’ll leave the wording and the converter details up to you.

why do we need this disable relationship? even if hiding option is on, this option can help make sure Flow window is on topper of other Topmost windows.

@onesounds
Copy link
Contributor

onesounds commented Jun 14, 2025

As I understand it, this feature only works when "lost focus" is turned off, right? I'm genuinely asking because I’m not sure. From what I know, this feature operates only when "lost focus" is off. If it's on, the window hides anyway when focus is lost, so this feature wouldn't make sense. If this isn't the functionality I’m thinking of, then I guess I don’t really understand what this feature is. I don't think I'm the right person to write or organize the description for it.

Wait a second — is this feature actually meant to ignore other programs' "Always on Top" setting?
If that's the case, then it shouldn’t be linked (to the lost focus setting).

This comment has been minimized.

- en.xaml: Updated "showAtTopmost" and tooltip text
- SettingsPaneGeneral.xaml: Added "Hide Notify Icon" card and updated icon
- Adjusted card group margins
Copy link

@check-spelling-bot Report

🔴 Please review

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

❌ Errors and Warnings Count
❌ forbidden-pattern 22
⚠️ non-alpha-in-dictionary 13

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

gitstream-cm bot commented Jun 14, 2025

🥷 Code experts: onesounds

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

See details

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Activity based on git-commit:

onesounds Jack251970
JUN 2 additions & 1 deletions
MAY 5 additions & 3 deletions 73 additions & 28 deletions
APR 104 additions & 38 deletions 34 additions & 83 deletions
MAR 10 additions & 0 deletions 142 additions & 94 deletions
FEB 10 additions & 4 deletions
JAN 17 additions & 4 deletions

Knowledge based on git-blame:
Jack251970: 30%
onesounds: 20%

Flow.Launcher/Languages/en.xaml

Activity based on git-commit:

onesounds Jack251970
JUN 1 additions & 0 deletions 8 additions & 0 deletions
MAY 15 additions & 2 deletions 14 additions & 3 deletions
APR 45 additions & 23 deletions 22 additions & 21 deletions
MAR 8 additions & 3 deletions 67 additions & 42 deletions
FEB 15 additions & 9 deletions
JAN 1 additions & 0 deletions

Knowledge based on git-blame:
onesounds: 42%
Jack251970: 12%

Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Activity based on git-commit:

onesounds Jack251970
JUN 1 additions & 1 deletions 1 additions & 2 deletions
MAY 51 additions & 11 deletions
APR 130 additions & 69 deletions 11 additions & 8 deletions
MAR 43 additions & 62 deletions 44 additions & 20 deletions
FEB 1 additions & 1 deletions
JAN 8 additions & 1 deletions

Knowledge based on git-blame:
onesounds: 60%
Jack251970: 16%

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

@onesounds
Copy link
Contributor

image
I made some changes. This seems like the most accurate description.

@Jack251970
Copy link
Member Author

@onesounds I think it is good to go👍

@Jack251970 Jack251970 requested a review from onesounds June 14, 2025 15:20
@Jack251970 Jack251970 merged commit bb76e4e into dev Jun 14, 2025
15 checks passed
@Jack251970 Jack251970 deleted the topmost_description branch June 14, 2025 17:26
@Jack251970 Jack251970 modified the milestones: Future, 2.0.0 Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants