A weak point of our context menus, is that currently they don't show correct operators when nothing is selected - we just give users a list of operators that don't work in the case, and which throw a variety of error messages. I find this to be a poor user experience.
{F8364570}
In a situation like this, when nothing is selected, the operators in here don't do anything - sometimes they silently fail, other times the user is presented with an error message, as seen here:
{F8364572, size=full}
or
{F8364571, size=full}
This patch makes it so we show the Add menu, plus other operators that make sense in this case. This has the additional benefit of making the Add menu more discoverable.
Only the 3D View Object Mode and mesh Edit Mode are covered here, but if accepted, other editors and modes can be added too.
Here's the 3D View Object Context Menu with nothing selected:
{F8364574}