extensions
extensions copied to clipboard
Color Casket: Make Picker command a no-view command
Description
@slavarazum Fixes the Color Casket Picker command to be a no-view command. Currently the command is set up with an async main function, which the API only supports for no-view commands. (This will generate a warning in future API releases...)
Checklist
- [x] I read the extension guidelines
- [x] I read the documentation about publishing
- [x] I ran
npm run build
and tested this distribution build in Raycast - [x] I checked that files in the
assets
folder are used by the extension itself - [x] I checked that assets used by the
README
are placed outside of themetadata
folder
Thank you for your contribution! :tada:
🔔 @slavarazum you might want to have a look.
Great improvement @fe9lix! Previously no-view
mode did not work with async operations. Looks like now everything is fine.
We still have a problem with the picker call from index
command. It has 10s timeout after which the color is not saved and returning to the Raycast window does not work.
I have tried to change this line to:
onAction={async () => await openColorPicker(defaultFormat)}
timeout still exists.
Do we have any ability to create async actions without timeout like with no-view
mode?
Hi @slavarazum 👋
Can you check it again, I just want to make sure that I didn't break anything 😊
Hi @pernielsentikaer 🙌 Checked latest change and the behavior has changed from what was originally planned.
Separate Pick Color command just copies a result to clipboard. When you run Pick a Color action from Render Color command it copies a result to clipboard and returns to the command view to show it in the history list.
As I can see the new launchCommand
function runs separate Pick Color command without ability of further control from the Render Color command.
It would be nice to have the ability to run async operation from list item action with ability to return to previous state with updates.
It would be nice to have the ability to run async operation from list item action with ability to return to previous state with updates.
@slavarazum If I understand it correctly, you could achieve that with the new command launching API by passing a context object between the two commands.
@fe9lix I want to achieve opening color picker from 2 different commands with 2 different behavior. Running one command from another is not suitable to provide different results.
You can try to check the behavior of the Color Casket actual version by running a separate Pick Color command and with the Pick a Color action from Render Color command.
Expected behavior
https://user-images.githubusercontent.com/5820718/198695767-7faba0d7-3ae3-4473-a9b6-5ffd8ab699f9.mp4
10s Timeout bug
https://user-images.githubusercontent.com/5820718/198695924-86525a3e-026a-4339-8cc3-0fe62145977c.mp4
Hi @slavarazum 👋
Could you give it another spin 😊
@pernielsentikaer Made some additions in #3360 New issue with "root window flickering" appeared. Details in description.
So let's merge this one, right @slavarazum (and continue in the other one)
Published to the Raycast Store: https://raycast.com/slava.razum/color-casket
@pernielsentikaer This one only implement picking in default format with "root window flickering" issue and doesn't cover picking in other formats.
In https://github.com/raycast/extensions/pull/3360 behavior with other formats is already implemented. So, let's merge #3360 to ensure same behavior for picking colors in default and other formats.
As a next step we should wait some additions for launchCommand
function to fix "root window flickering" for no-view
commands.