Skip to content

Conversation

Jack251970
Copy link
Member

@Jack251970 Jack251970 commented Feb 22, 2025

Add minimize & background button for progress box & Set progress box topmost

  • Minimize button is for users to temporarily hide progress box for this progress when they do not want to check the progress for now. They can view progress if they want from taskbar.

  • Background button is for users to permanently hide progress for this progress when they do not care the progress. This will not cancel the progress. (It is different from cancel button & close button which is used to cancel the progress.)

  • Set progress box topmost since we support to temporarily and permanently hide this window now.

Test

Original:
Screenshot 2025-02-22 190132

New:
Screenshot 2025-02-22 190249

@Jack251970 Jack251970 marked this pull request as ready for review February 22, 2025 11:15

This comment has been minimized.

Copy link

gitstream-cm bot commented Feb 22, 2025

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

@Jack251970 Jack251970 requested a review from onesounds February 22, 2025 11:18
Copy link
Contributor

coderabbitai bot commented Feb 22, 2025

📝 Walkthrough

Walkthrough

This pull request adds a new localized string resource for "Background" in the English language file. Additionally, it updates the ProgressBoxEx dialog by adding a minimize button and a background action button. The corresponding event handlers in both XAML and C# files have been modified, with method names updated to better reflect their functionalities, and the window now includes the Topmost="True" attribute to keep it above other windows.

Changes

File(s) Change Summary
Flow.Launcher/Languages/en.xaml Added new string resource: <system:String x:Key="commonBackground">Background</system:String>.
Flow.Launcher/ProgressBoxEx.xaml and .../ProgressBoxEx.xaml.cs - Added Topmost="True" attribute to the Window.
- Expanded grid layout with a new column for additional buttons.
- Introduced new buttons: one for minimizing (event Button_Minimize) and one for background action (event Button_Background).
- Updated btnCancel click event from Button_Click to Button_Cancel.
- Renamed event handler methods in code-behind (i.e. Button_Click to Button_Cancel and Button_Cancel to Button_Minimize), with the new functionality for minimizing and hiding the window.
Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs Updated method signature for ShowProgressBoxAsync to replace forceClosed with cancelProgress.
Flow.Launcher/PublicAPIInstance.cs Updated method signature for ShowProgressBoxAsync to replace forceClosed with cancelProgress.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI as "ProgressBoxEx UI"
    participant Handlers as "Event Handlers"
    
    User->>UI: Click Cancel Button
    UI->>Handlers: Trigger Button_Cancel()
    Handlers-->>UI: Execute ForceClose()
    
    User->>UI: Click Minimize Button
    UI->>Handlers: Trigger Button_Minimize()
    Handlers-->>UI: Set WindowState = Minimized
    
    User->>UI: Click Background Button
    UI->>Handlers: Trigger Button_Background()
    Handlers-->>UI: Hide Window
Loading

Suggested labels

enhancement, 20 min review

Suggested reviewers

  • onesounds
  • taooceros

Poem

I hop along in lines of code,
Where buttons dance on a glowing node.
A minimize here, a background there,
With clicks that sing and update with flair.
I nibble on bugs with a joyful beat,
Coding through fields where changes meet.
🐇 Keep on hopping in each new feat!

Tip

CodeRabbit's docstrings feature is now available as part of our Pro Plan! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


📜 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 942ea3e and ed5e0bb.

📒 Files selected for processing (3)
  • Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs (1 hunks)
  • Flow.Launcher/ProgressBoxEx.xaml.cs (4 hunks)
  • Flow.Launcher/PublicAPIInstance.cs (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Flow.Launcher/PublicAPIInstance.cs
🧰 Additional context used
🧠 Learnings (1)
Flow.Launcher/ProgressBoxEx.xaml.cs (1)
Learnt from: taooceros
PR: Flow-Launcher/Flow.Launcher#3170
File: Flow.Launcher/ProgressBoxEx.xaml.cs:79-88
Timestamp: 2025-01-10T04:58:20.225Z
Learning: In Flow.Launcher, avoid hiding base class methods with the `new` keyword. Instead, use event handlers, method overriding (where the base method is virtual), or create new methods with different names to extend functionality.
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: gitStream.cm
🔇 Additional comments (10)
Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs (1)

324-335: Good clarification of method purpose and improved parameter naming.

The parameter rename from forceClosed to cancelProgress makes the intention clearer - it's an action that will be called when the user cancels the progress, not when the window is forcibly closed. This aligns well with the PR objective of improving the progress box functionality.

Flow.Launcher/ProgressBoxEx.xaml.cs (9)

11-11: Updated field name for better clarity.

The rename from _forceClosed to _cancelProgress better reflects the purpose of this action - it's invoked when progress is canceled, not just when the window is forcibly closed.


13-16: Updated constructor parameter for consistency with interface.

The parameter rename in the constructor matches the change in the IPublicAPI interface, maintaining consistent naming throughout the codebase.


19-19: Updated method signature to match interface changes.

The method signature has been properly updated to reflect the parameter rename in the interface.


28-29: Updated constructor calls to use the renamed parameter.

Both constructor calls now correctly pass the cancelProgress parameter instead of forceClosed.

Also applies to: 38-39


98-101: Renamed method for clarity about its purpose.

Renaming from Button_Click to Button_Cancel better describes what the button does - it cancels the progress operation.


103-106: Added minimize functionality.

The previous Button_Cancel method has been repurposed as Button_Minimize, adding the ability to minimize the progress box instead of closing it. This aligns with the PR objective of allowing users to temporarily hide the progress box.


108-111: Added background functionality.

The new Button_Background method adds the ability to hide the window without canceling the operation, allowing users to continue the process in the background as mentioned in the PR objectives.


115-117: Updated to use the renamed field.

The ForceClose method now correctly calls the renamed _cancelProgress action.


1-119:

❓ Verification inconclusive

Verify if the progress box is set as topmost.

According to the PR objectives, the progress box should be set as topmost to ensure it remains accessible. However, I don't see this property being set in the provided code. This might be implemented in the XAML file.


🏁 Script executed:

#!/bin/bash
# Check if the Topmost property is set in the XAML file
rg -i "Topmost\s*=\s*\"True\"" --type=xaml

Length of output: 71


Below is a revised review comment based on our verification so far:

Action: Verify that the Progress Box is set as Topmost

Our PR objectives specify that the progress box must remain accessible by always staying on top. However, the C# code in ProgressBoxEx.xaml.cs does not set the Topmost property, and our initial search for a matching setting in the XAML files (using a file-type–specific command) ran into issues. Please take one of the following actions:

  • Verify in the XAML file: Check that ProgressBoxEx.xaml (or the corresponding XAML file used for this window) includes an attribute setting Topmost="True".
  • If absent: Update the XAML file to set Topmost="True" to ensure the window stays accessible as intended by the PR objectives.

Since our automated search was inconclusive due to the file type issue (“unrecognized file type: xaml”), please ensure a manual check (or use an alternative search command) confirms the Topmost property status.

✨ Finishing Touches
  • 📝 Generate Docstrings

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 generate docstrings to generate docstrings for 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.

@Jack251970 Jack251970 added the kind/ui related to UI, icons, themes, etc label Feb 25, 2025
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
⚠️ ignored-expect-variant 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.

@Jack251970
Copy link
Member Author

@onesounds Sorry for the ping. What do you think of this design?

@onesounds
Copy link
Contributor

@onesounds Sorry for the ping. What do you think of this design?

Good.

@jjw24 jjw24 merged commit 65f85cf into Flow-Launcher:dev Feb 28, 2025
6 of 7 checks passed
@jjw24 jjw24 added enhancement New feature or request and removed 5 min review labels Feb 28, 2025
@jjw24 jjw24 added this to the 1.20.0 milestone Feb 28, 2025
Copy link

gitstream-cm bot commented Feb 28, 2025

🥷 Code experts: no user but you matched threshold 10

Jack251970 has most 👩‍💻 activity in the files.
Jack251970 has most 🧠 knowledge in the files.

See details

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Activity based on git-commit:

Jack251970
FEB 17 additions & 17 deletions
JAN 21 additions & 3 deletions
DEC 8 additions & 73 deletions
NOV 84 additions & 1 deletions
OCT
SEP

Knowledge based on git-blame:
Jack251970: 11%

Flow.Launcher/Languages/en.xaml

Activity based on git-commit:

Jack251970
FEB 10 additions & 7 deletions
JAN 1 additions & 0 deletions
DEC
NOV
OCT
SEP

Knowledge based on git-blame:
Jack251970: 2%

Flow.Launcher/ProgressBoxEx.xaml

Activity based on git-commit:

Jack251970
FEB 32 additions & 2 deletions
JAN 108 additions & 2 deletions
DEC
NOV
OCT
SEP

Knowledge based on git-blame:
Jack251970: 100%

Flow.Launcher/ProgressBoxEx.xaml.cs

Activity based on git-commit:

Jack251970
FEB 15 additions & 10 deletions
JAN 167 additions & 53 deletions
DEC
NOV
OCT
SEP

Knowledge based on git-blame:
Jack251970: 100%

Flow.Launcher/PublicAPIInstance.cs

Activity based on git-commit:

Jack251970
FEB 24 additions & 3 deletions
JAN 45 additions & 47 deletions
DEC 25 additions & 32 deletions
NOV 16 additions & 0 deletions
OCT
SEP

Knowledge based on git-blame:
Jack251970: 17%

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request kind/ui related to UI, icons, themes, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants