[IDEA] Allow "searching" by project ID on the projects page
Problem to solve
Right now projects can only be searched by handle, but ID would also be cool.
Proposal
Undecided what the best implementation might be. If we allow using the search bar to "search for projects by handle or ID" then we could simply add a projectId filter to the projects graph query—but we'd need to know if the user is intending to search by handle or ID.
Easiest way to do this would just be to assume ID if the search text is only numbers, but this would be awkward for a project with a handle that's only numbers. More robust—but more complex—way to solve it would be to run simultaneous "handle search" and "filter by projectId" graph queries if the search text is only numbers, and then append the results into a single list (i.e. if the user searched for '123' and there were a project with the handle '@123', both the project with ID 123 and handle 123 would both appear in the search results).
Maybe simpler solution would be to have a toggle in the search bar to select if you're searching by handle or ID, but this would be more lame from a UX perspective.
Another option, user types id: as a prefix to their search, then the number, and we use that to run a project id filtered query (no handle would ever have a : in it). This would kinda feel like those advanced google queries (i.e. site:), which might be ok given that most people probably won't ever be searching by ID.
@aeolianeth @johnnyd-eth this kinda turned into an open ended riff lol. got any thoughts?
@aeolianeth @johnnyd-eth this kinda turned into an open ended riff lol. got any thoughts?
sorry missed this 🙈
but we'd need to know if the user is intending to search by handle or ID.
Do we though? Less efficient, but wondering if we could always execute 2 queries (one for ID and one for handle) and merge the results (removing duplicates).