Skip to content

[API] Loading Bar Start / Stop #3294

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 3 commits into from
Mar 1, 2025
Merged

Conversation

Jack251970
Copy link
Contributor

@Jack251970 Jack251970 commented Feb 28, 2025

For #3242.

@Jack251970 Jack251970 requested a review from cibere February 28, 2025 03:26
@Jack251970 Jack251970 linked an issue Feb 28, 2025 that may be closed by this pull request
Copy link

gitstream-cm bot commented Feb 28, 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.

Copy link
Contributor

coderabbitai bot commented Feb 28, 2025

📝 Walkthrough

Walkthrough

The changes introduce two new public methods—StartLoadingBar and StopLoadingBar—to both the JsonRPCPublicAPI class and the IPublicAPI interface. These methods facilitate the management of a loading bar by delegating their functionality to an internal API instance. The updates enhance the interface of the class and the interface contract, allowing for new operations related to loading bar management.

Changes

Files Change Summary
Flow.Launcher.Core/Plugin/JsonRPCV2Models/.../JsonRPCPublicAPI.cs
Flow.Launcher.Plugin/Interfaces/.../IPublicAPI.cs
Added two new public methods: StartLoadingBar() and StopLoadingBar(). They delegate calls to the internal API to manage the loading bar functionality.

Sequence Diagram(s)

sequenceDiagram
    participant C as Client
    participant API as JsonRPCPublicAPI
    participant IntAPI as Internal API (_api)

    C->>API: StartLoadingBar()
    API->>IntAPI: StartLoadingBar()
    Note over API,IntAPI: Loading bar starts

    C->>API: StopLoadingBar()
    API->>IntAPI: StopLoadingBar()
    Note over API,IntAPI: Loading bar stops
Loading

Poem

I'm a rabbit, hopping through code,
A loading bar now lightens my load.
Start it with flair, then watch it slow,
My digital garden begins to grow.
Carrots and code—watch me go! 🥕🐇


📜 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 5c48aca and c3a8a02.

📒 Files selected for processing (1)
  • Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
🔇 Additional comments (1)
Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs (1)

338-346: Well-designed API addition for loading bar functionality.

The new StartLoadingBar() and StopLoadingBar() methods are well-documented, follow the interface's existing naming conventions, and provide a clean way for plugins to manage loading indicators. This is a good enhancement that complements the existing ShowProgressBoxAsync method by offering a simpler option for indeterminate progress indication.

✨ 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.

This comment has been minimized.

@Jack251970 Jack251970 enabled auto-merge February 28, 2025 08:19
@Jack251970
Copy link
Contributor Author

@cibere Hello, I have resolved all issues with the dev branch installers. Once this PR is merged, you will be able to use the new API functions.

@cibere
Copy link
Contributor

cibere commented Feb 28, 2025

@cibere Hello, I have resolved all issues with the dev branch installers. Once this PR is merged, you will be able to use the new API functions.

Thanks for fixing that. After testing, the api method doesn't seem to do anything.

My test code sends the following to flow:

{"method": "StartLoadingBar", "id": 5, "params": [], "jsonrpc": "2.0"}

then gets the following from flow:

{"jsonrpc":"2.0","id":5,"result":null}

However the loading bar never starts

@Jack251970
Copy link
Contributor Author

@cibere Hello, I have resolved all issues with the dev branch installers. Once this PR is merged, you will be able to use the new API functions.

Thanks for fixing that. After testing, the api method doesn't seem to do anything.

My test code sends the following to flow:

{"method": "StartLoadingBar", "id": 5, "params": [], "jsonrpc": "2.0"}

then gets the following from flow:

{"jsonrpc":"2.0","id":5,"result":null}

However the loading bar never starts

I wonder where you call this api function?

@cibere
Copy link
Contributor

cibere commented Mar 1, 2025

@cibere Hello, I have resolved all issues with the dev branch installers. Once this PR is merged, you will be able to use the new API functions.

Thanks for fixing that. After testing, the api method doesn't seem to do anything.

My test code sends the following to flow:

{"method": "StartLoadingBar", "id": 5, "params": [], "jsonrpc": "2.0"}

then gets the following from flow:

{"jsonrpc":"2.0","id":5,"result":null}

However the loading bar never starts

I wonder where you call this api function?

in a result's action

@Jack251970
Copy link
Contributor Author

@cibere Hello, I have resolved all issues with the dev branch installers. Once this PR is merged, you will be able to use the new API functions.

Thanks for fixing that. After testing, the api method doesn't seem to do anything.
My test code sends the following to flow:

{"method": "StartLoadingBar", "id": 5, "params": [], "jsonrpc": "2.0"}

then gets the following from flow:

{"jsonrpc":"2.0","id":5,"result":null}

However the loading bar never starts

I wonder where you call this api function?

in a result's action

It does have problem here. Let me check further. Maybe this is why these functions are not added into public api.

Copy link

github-actions bot commented Mar 1, 2025

@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
Contributor Author

oh no, I forget to merge latest commits which fixes mainVM issue...

@Jack251970
Copy link
Contributor Author

@cibere Please use the latest installer in this PR. Now it works well with csharp codes as follows.

AsyncAction = async c =>
{
    context.API.StartLoadingBar();
    await System.Threading.Tasks.Task.Delay(3000);   // Test for time-consuming task
    context.API.StopLoadingBar();
    return true;
}

Copy link
Contributor

@cibere cibere left a comment

Choose a reason for hiding this comment

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

Thank you for this :)

@Jack251970 Jack251970 merged commit 57f20ae into Flow-Launcher:dev Mar 1, 2025
7 checks passed
@Jack251970 Jack251970 changed the title Add loading bar api functions for all plugins [API] Loading Bar Start / Stop Mar 1, 2025
Copy link

gitstream-cm bot commented Mar 1, 2025

🥷 Code experts: no user but you matched threshold 10

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

See details

Flow.Launcher.Core/Plugin/JsonRPCV2Models/JsonRPCPublicAPI.cs

Activity based on git-commit:

Jack251970 cibere
MAR
FEB 10 additions & 0 deletions 5 additions & 0 deletions
JAN 2 additions & 5 deletions
DEC
NOV
OCT

Knowledge based on git-blame:
Jack251970: 6%

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Activity based on git-commit:

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

Knowledge based on git-blame:
Jack251970: 14%

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

@jjw24 jjw24 added enhancement New feature or request and removed 1 min review labels Mar 4, 2025
@jjw24 jjw24 added this to the 1.20.0 milestone Mar 4, 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.

TriggerLoadingBar API method
3 participants