Catch queries with duplicate names
Repro is with Brim commit 9377f00.
As shown in the video below, at the moment it's possible to have two saved queries with the same name. This is technically feasible because each query has a separate underlying unique identifier. However, since the app user only sees the query by its name, this has the potential to confuse. For instance, a user might delete one of these queries not realizing another of the same name is still hanging out somewhere in a long list, then assume there was some kind of bug that made the deletion not work. We could instead advise users if they try to save a second query when one of the same name already exists, and guide them towards picking a unique name.
https://user-images.githubusercontent.com/5934157/181648826-33bec933-4a1e-4da3-a470-f89d05b082ee.mp4
Note that when we allow users to sort queries into folders, there could be queries of the same name in different folders, and it seems we should still allow this. Therefore we'll want to catch name clashes when users are dragging queries between folders as well.
There's related issue #2941 where a community user noticed the specific case of duplicate queries that have no name at all. I imagine we should prevent nameless queries altogether, so perhaps we can fix both issues at the same time.