I think the general rule on loading should probably be to make the first group the current layer if there are only groups at the top level (i.e. the document author has used them for layer-like structure). Under that rule such a document template would do what you expect.
OK, that sounds right.
The general rule would be that selecting an item (through whatever means) that was not on the current layer would switch to the layer containing that item [in multiple selections, the most recently selected object wins]. I think that's the generally expected behavior for layers.
There's a problem. Right now I ctrl-click to select anything in a group, then I add some new object. I do NOT expect that object to be added into that group simply because something happens to be selected inside it. Your approach will result in a nasty surprise when later the user moves or deletes the group, and some unexpected outside object is affected.
What do you think? Keeping groupmode attr would have prevented this, and in general I don't see much reason for removing it. I think keeping a persistent distinction between groups and layers (the layers still being able to nest into each other) would be cleaner and more intuitive.
Finally right-clicking on the current layer name in the statusbar must display a menu with "lock/unlock" and "hide/show" commands (for the current layer) as well as the list of sibling layers of the current.
Hmm, I was thinking ancestors, but siblings are more useful. Maybe a hybrid approach of putting an indented menu like:
#svg324 #g430 #g200
#g403 #g404
So all ancestors and siblings of the current layer are shown, and a bullet indicates the current layer.
Agreed.
And when you attempt to create or paste or import something into a locked or invisible layer, Inkscape must display a warning.
Yes. Actually, in the case of a locked layer, such actions should ideally be completely disabled and their corresponding buttons grayed out [ in general we need to do some architecture work so impossible actions are greyed out ].
Yes.
Now that I've had time to use the current layers code on real design work, there was one big logic oversight I made: children of sibling layers also need to be directly selectable.
Why sibling? Logically, objects in ANY non-locked visible layer must be selectable. And that's another big problem with non-distinction of groups and layers: if you always treat them the same, groups lose their main reason for being - if you click something inside a group, it's selected (as in a layer!) instead of selecting the entire group. So, unless I grossly misunderstand your approach, I really think we need to restore groupmode attribute and make layers and groups different kinds of objects.