-
Notifications
You must be signed in to change notification settings - Fork 6
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
Remove empty group. Or want some other behaviour when empty group? #33
Conversation
Thank you for writing this up! I'm thrilled you're using cy! It seems there's two related things going on here:
The former is just a bug in the Janet code and should be easy to fix. The latter is a bit more subtle.
The more direct issue is probably that there's no quick way to remove an open "project" right now, once they're open, they're open forever. cy's default configuration is intended to be both comprehensive and simple, so this is an oversight for sure. It's also easy to remedy entirely using Janet. If you'd like to take a stab at that, I can offer some suggestions, but otherwise I'll make that happen as soon as I can. Thanks for using cy! I'd love any other feedback you have. |
At one point I was considering if this should be fixed in Janet or Go. I think why I leaned more Go is because I didn't see any keybinding or action to remove groups.
I remembered why I wanted to remove a project in the first place. I accidentally created second project in the same directory. Didn't find any keybind or action to remove project. So try to remove project by removing its children. So I don't currently see need for recursive removal. I did notice that the second project created had the same name as the first project. Maybe add index to project name if there is more than one with same name. Example: "/projects/name-1".
Although the only reason I wanted to remove a project was because I created a "duplicate". It would be great to have a way to remove projects (groups). Ideas/Things to consider:
I would be probably faster for somebody who knows Janet to remedy this. Have been using cy out of the box and seeing when I hit a wall when I need to use scripting. Probably hit that wall and will start to look into Janet. Closing this issue as empty groups are expected. |
This is all really interesting! Thanks again for all the time you've clearly put into thinking about this stuff. It means a lot to me that you seem to understand cy deeply! Really rewarding to see after all the work I've done. Most of what you describe is both easy to implement just using Janet and also should be in the default configuration anyway. Next week I am about to be very busy and will be unable to work on cy for a couple of months, but if I have a spare couple of hours I think I could write most of this.
Could you elaborate on these two points? I might be misunderstanding this--if you
This is a great idea! I think that being able to create nodes that consist of a layout (which is what tabs use) makes sense in cy's model. While this is straightforward to add to the API, I'm going to have to put some thought into how to present this functionality to the user without making it too confusing. Right now, layouts are specific to each client. Moving away from this is logical, but will be tricky to get right. It might be that the API functionality for this comes well before its use in the default configuration. So in total we have the following, pending any further adjustments:
|
Ah yes, I mean
Idea 1: Idea 2: Or even have both options. |
Not sure if this is the behaviour you want when there no more children in
a group. So this is more of a question what you want to do when there is an
empty group after removing last child?
Bug that brought this up:
Get and error:
This happens because project's children are removed but the project (group) itself
has been not.
When fixing this problem I realized that I was not sure what kind of behaviour
would be wanted when group becomes empty.
Things to consider:
keep empty group?
And while writing this I realized that after removing group there might a
parent group that is now empty. So would have to walk up the tree and check.
So would have to code that if this is the wanted solution.