juice-interface icon indicating copy to clipboard operation
juice-interface copied to clipboard

[IDEA] Allow "searching" by project ID on the projects page

Open peripheralist opened this issue 3 years ago • 2 comments

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.

peripheralist avatar Feb 24 '22 03:02 peripheralist

@aeolianeth @johnnyd-eth this kinda turned into an open ended riff lol. got any thoughts?

peripheralist avatar Feb 24 '22 03:02 peripheralist

@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).

aeolianeth avatar Mar 19 '22 21:03 aeolianeth