Waboodoo / HTTP-Shortcuts

Android app to create home screen shortcuts that trigger arbitrary HTTP requests
https://http-shortcuts.rmy.ch
MIT License
1.17k stars 113 forks source link

What about showing the result in a new notice? #228

Closed RuofengX closed 2 years ago

RuofengX commented 3 years ago

Show the request result in a system notice. Also when running js script, a waiting circle icon will show up, it is a foreground animation so you can do nothing but wait the result.

RuofengX commented 3 years ago

I added a series of js codes to show the latency of one request, and js scripts cause a foreground animation showing up, and I can do nothing but wait. Also I want the result could show up in a notice and user can do further things such as copy it to the clipboard, see the detail or just retry .

Waboodoo commented 3 years ago

Just to clarify: By "system notice" you mean a notification, i.e., you want the request to be sent in the background and the result to be displayed in a notification, possibly with additional actions?

I like the idea, though it will require quite a bit of refactoring for this to work. The app currently relies on being in the foreground (hence the blocking loading spinner), as the Android OS would otherwise kill the request before it's done.

snarfed commented 1 year ago

@Waboodoo I'd love the option to use a notification instead of the foreground spinner too. I often run a shortcut that takes a few seconds, and I have to wait for it to complete each time. I'd love for it to run in the background instead!

I definitely get that this could take some work to implement; totally ok if that makes it low priority. Let me know if you want me to open a new issue to track instead of commenting here.

(And thank you for this app, it's amazing!)

Waboodoo commented 1 year ago

@snarfed There is actually already a possibility to do this, it's just super hidden and limited right now, and I'm planning to improve this eventually, but for now:

You can make a shortcut run (partially) in the background (i.e., without showing the spinner), if all of the following apply:

If all of these conditions apply, then your shortcut should be able to run without the spinner.

snarfed commented 1 year ago

Awesome! This does indeed work. Thank you!

Before this, I had my shortcuts configured to show a toast on error. I'm definitely looking forward to your eventual work to use a notif instead of a spinner, or whatever your planned improvement is, so I can turn that back on. I'll file a new issue to track it. Thanks again!