-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
New feature: pin emulator to the top of the list #70
Comments
@okwasniewski I'd be keen to give it a shot. Do you have any contribution guidelines or documentation on setting up the project the right way? I want to make sure I follow the correct procedures to avoid any potential conflicts. Also, I wanted to mention that I was able to successfully build and run the app without any issues. Looking forward to working with you on this project! |
Hey @dnafication! I'm happy that you want to contribute! At the moment I don't have any guidelines (maybe it's time to create something 😄). If you've been able to build & run the app without issues then that's great. One guideline that I would like new contributors to follow is to format the code with Xcode built-in formatting tools (CMD+I). Besides that I think it's up to you - I don't want to enforce any strict rules. |
Thanks for the response. I do have a design related question. I've noticed that the menu item already show a tick ✔️ based on the |
You could add an emoji next to the item's title. How I see this feature is that from the platform submenu user can select "Pin to top" and this would add the emoji (📌) and also show the emulator on top of each section (separate pins for iOS/Android). You can achieve this by filtering the list of devices. Be careful when adding something to item's title as actions rely on item title so you can follow the way that the version is added to item title and show the pin only in |
Great! I did manage to add a "Pin simulator" item in the submenu under each device. I am very new to Swift/AppKit/iOS/macOS in general 😄, so pardon me for asking stupid questions. What options do I have to persist user's pinned simulators? I believe the device list is dynamically retrieved every time the menu is loaded. So, we will need a way to track the list of pinned simulators somewhere. Can you suggest any sample code within the application that has similar functionality or some terms that I can google and understand? Appreciate the help! I will update the text to |
Looks like |
So regarding how to persist data, you can follow the approach of using UserDefaults. I was thinking about actually persisting the whole emulator list in there and then checking if something has changed. This would allow you to store I can work on persisting the items and then on top of that, you could add |
Sure. Let me know when you have completed the persistence functionality and then I'll continue with it. |
I would suggest to not do it. Your source of truth is outside data, e.g. from Regarding optional device id. For favorites you can simple persist list of devices. Since id is optional, you can store combination of the name and device id to cover both Android and iOS, e.g. with format like |
That's a valid point. Let's follow this path and store an array of devices. For android you can store just the name (as it should be unique) and for iOS you can store You can follow how CustomCommands are saving data to UserDefaults ( |
Thanks @Garfeild and @okwasniewski for pointing me the right direction. I'll come up with a PR soon. |
@dnafication I would suggest to wait until my PR #88 is merged. It will be easier to navigate |
@dnafication FYI I've merged #88, so you can continue working on this issue 👍🏻 |
Thanks 🙏 |
The goal of this issue is to add a new feature that would allow users to "pin" simulators / emulators to the top of its corresponding sections (iOS/Android).
This would require adding a new field in the
Device
struct and then filtering the list when populatingNSMenu
so that favorite items are pinned to the top.The text was updated successfully, but these errors were encountered: