extensions
extensions copied to clipboard
Update restart-system-processes extension
Description
fixes #15148
Screencast
Checklist
- [x] I read the extension guidelines
- [x] I read the documentation about publishing
- [x] I ran
npm run buildand tested this distribution build in Raycast - [x] I checked that files in the
assetsfolder are used by the extension itself - [x] I checked that assets used by the
READMEare placed outside of themetadatafolder
ToDo
- [x] Move Sudo option to preferences
- [x] Use nested lists instead of dropdown form
- [x] Order list by most recent used
- [x] Add Changelog
- [x] Add me as contributor (was removed while publishing somehow)
- [ ] Update Screenshots
Thank you for your contribution! :tada:
🔔 @XInTheDark you might want to have a look.
You can use this guide to learn how to check out the Pull Request locally in order to test it.
You can expect an initial review within five business days.
@XInTheDark This is what I came up with. Feel free to take a look and let me know what you think.
There's one more feature that a friend of mine just mentioned: We could add restarted processes from the advanced mode to the top list, maybe in a separate section called "commonly restarted" or something. It could be an optional feature that would have to be enabled in the preferences first, and would be disabled by default. Then, those items could have a remove-action to remove them from the list. What do you think? I'm unsure - I like the idea but I don't want to make this extension too complex.
Anyway, do you still have the pretty background? If yes, I'd kindly ask you to update the screenshots. Thanks!
@hrueger Amazing update - just tested it and it works well! I really like the new design :)
A small detail: the list doesn't re-render immediately after an item is restarted; it's only reordered the next time the command is launched. The list also reorders when an item is selected then canceled, which is probably unnecessary. I'll put this in the code review in a bit
Regarding the feature suggestion, it's probably unnecessary for now - advanced mode is mainly just a shortcut for users who would otherwise type the command manually in terminal.
I'll generate the screenshots now, and link it here - I don't have write access to this PR I think :)
here are the screenshots uploaded to github
Thanks for the review, should all be fixed now 👍
Edit: never mind, I still have to fix the list not updating immediately
A small detail: the list doesn't re-render immediately after an item is restarted; it's only reordered the next time the command is launched
I tried to implement this, however, I was not be able to make it work. I moved the fetch and state update logic to a small helper:
const [orderedProcesses, setOrderedProcesses] = useState<Process[]>([]);
const fetchProcesses = async () => {
const processes = await orderItems(commonProcesses);
setOrderedProcesses(processes);
};
useEffect(() => {
fetchProcesses();
}, []);
and I tried calling this after performAction in the onAction prop value or in the performAction itself. However, it seems like that must happen before the main window is closed, but we only change the order after closing the main window. So there's kind of a deadlock there 😅
I think we could only close the main window later, but I prefer the current user experience and would rather skip updating the list immediately. What do you think?
Ah sure, in that case I think we can just leave it as it is - not a big deal either way :)
Published to the Raycast Store: https://raycast.com/muzhen_gaming/restart-system-processes
:tada: :tada: :tada:
We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.