Outliner: Problems removing multiple collections in sequence
Closed, ResolvedPublic

Description

If you have a file with multiple collections, and go to "Active Render Layer" in Outliner, if you delete a collection, the new active collection is now the first one, however you can't delete it until you click on it.

Basically after we delete the collection we set a new "active collection", but we don't select it, which I think we should.

Sergey Sharybin (sergey) triaged this task as Normal priority.May 15 2017, 2:10 PM

Although this seems totally easy to solve, there are some things to consider:
Should we only update selection? Wouldn't users expect to see the active collection updated as well, so active & selection stay mostly in sync? Which collections are activated and/or selected when deleting multiple collections? What if there are unselected ones in-between selected ones?
It boils down to a single question: Which collection(s) is/are selected and which one is the active one after deleting collections in any way?

All these questions should be answered in a way that makes sense for users (try to work as expected). So while the code side of this is easy, we have to take care for many cases.

@Julian Eisel (Severin) hey man :) thanks again for your help with this. I think I'm close to getting something working for the single-collection removal case, but am realizing it may be better (from the end-user's perspective) if we handle the multiple / single selection cases similarly... trying to respect the whole "principle of least astonishment" lol...

For the multiple selection case, I was thinking that maybe we could just select / activate the "previous" collection w/ respect to the top-most item in the outliner list.

e.g. If we have 8 collections listed in the outliner (from top to bottom) "Collection1", "Collection2", ... "Collection 8", and we select collections 3, 5, & 7, then the 'Delete' operation in this case should select and activate collection 2 after the deletion of the 3 selected collections.

I recall in our IRC conversation we had over the wkend that it was desirable for the user to be able to continue clicking the 'X' button in the outliner and essentially delete collections "backwards" in the list (as the uiList does in vertex groups, etc). I think the above proposal would satisfy that requirement w/o us having to arbitrarily select an in-between collection in the multiple selection case.

What do you think?

Sorry - that should say "...the top-most *selected item in the outliner list."

For the multiple selection case, I was thinking that maybe we could just select / activate the "previous" collection w/ respect to the top-most item in the outliner list.

Hey, great to hear you're making progress! You're proposed solution is pretty fine with me. In fact I had the same in mind but wanted you to get there yourself ;) Who knows, maybe you would've found a much smarter solution than I did!
That said, I still see two cases to cover:

  • What if collections 3 & 6 are selected (from your example with 8 collections)?
  • What if the first collection is selected?

@Julian Eisel (Severin) - sweet, thanks man! Yeah, I find it super helpful to take time out to discuss these usability-related design problems b.c. these small details can make a big difference in usability :)

I think the nice thing with the approach we discussed is that a single set of selection / activation rules (after a deletion op) will work regardless of the number of items selected... i.e. since we always select/activate the 'previous' item w/ respect to the 'top-most' selected item - it works even if only a single item is selected, etc.

For those two cases you mentioned, what do you think of this:

  • What if collections 3 & 6 are selected (from your example with 8 collections)?

The deletion operation would still select & activate 'Collection2' after deletion (since the top-most item in the list of 'selected items' is collection 3, the 'previous' item would be 'Collection2').

  • What if the first collection is selected?

For this one - I think it should behave like the uiList for the sake of consistency across blender editors (like the vertex groups example we talked about) - in the uiList, if the first item (top-most) is selected & deleted, the item which was right after that becomes the newly selected item. So in the example above, if 'Collection1' is selected and deleted, 'Collection2' would then be selected / activated, etc.

Does this sound good to you?

As far as the object deletion goes, I figured that we could follow the same pattern - if an object or multiple objects are selected for deletion, we follow the same selection/activation rules for objects as we do for collections, but only until the collection is empty. If a deletion operation results in the collection being empty, then we do not attempt to select / activate objects from another collection (there will be no selected / active object in this case)... Moreover, if a collection(s) is deleted, there will also be no selected / active object afterwards in this case. What are your thoughts on this for object selection?

@Julian Eisel (Severin) oh man - major #fail on my part again here lol... so, another thing I didn't consider was how we should handle automatic selection / activation for nested collections... The problem (which I totally overlooked) is that we can have arbitrarily complex collection hierarchies w/ these new nested collections. It becomes really unclear what's best to do when you start thinking about selecting collections in a complex hierarchy where the collections selected for deletion aren't even in the same branches of the outliner tree :|

These are things that I could type more about here, but it's probably better at this point if I discuss this in IRC w/ you. I haven't been online in the mornings here (Texas) these last couple of days because I am taking a Unity dev cert. course at work this week, so I have to go in early everyday and there's a test on Friday :|

...but I'll try to hit you up in IRC before work or maybe during my lunch. I also found a bug in the outliner in my testing that I think I can fix for us - but part of this may actually be a "design" issue - I'm not sure, so I'll post in another phab task. thanks again for your help man o/

Just putting this up for grabs for now b.c. it seems this needs more thought before anything can be implemented & I'm not sure how to proceed. cheers o/

@Danrae Pray (spockTheGray): Let's keep it simple. If the active collection was deleted, just change active collection to 0. That's how we do for "view layers".

Note: Let's try to lower the noise signal ratio a bit, please :) We should try to keep the tracker a bit more concise and to the point otherwise it's hard to follow everything.

@Julian Eisel (Severin) @Dalai Felinto (dfelinto) - just dropped a patch for this - it just handles outliner selection the same way the active item is chosen after deletion.

And sorry for being so verbose on the tracker previously - I'll be more mindful of that moving forward :)