hub icon indicating copy to clipboard operation
hub copied to clipboard

Automatically focus input field

Open jpetazzo opened this issue 4 years ago • 6 comments
trafficstars

It would be pretty fantastic if the home page of Artifact Hub (https://artifacthub.io/) could automatically focus the input field in the search form.

That way, one could just type in their browser "Ctrl-T artif[ENTER] prometheus[ENTER]" to search for Prometheus (for instance) - assuming that they already visited the Artifact Hub previously and that it's in their browser history :)

The current interface requires to either click with the mouse, or hit [TAB] a dozen of times to get to the field.

If the maintainers think that this would be a good addition, I could give it a stab (I am not familiar with the front end framework used by the Artifact Hub, but "how complicated can it be to focus an input field on a web page!" (famous last words))

jpetazzo avatar Nov 04 '21 07:11 jpetazzo

Hi @jpetazzo 👋

This sounds like a good addition 👍

If you need anything while you work on it, @cynthia-sg will be happy to help. She takes care of the Artifact Hub frontend.

A couple of things to keep in mind that she's just mentioned to me:

  • The search input component is reused in the navigation bar, so it'd be great if you could check where is it being used so that the auto focus only applies to the home page.
  • We may need to modify the login modal to control the focus. Otherwise, when it shows up on the home page the focus may still be on the search input and users may start typing their credentials on it. This modal may appear automatically when the session is no longer valid, for example.

Thanks!

tegioz avatar Nov 04 '21 09:11 tegioz

Hi @jpetazzo

We can take care of this if you'd like 🙂

tegioz avatar Jan 03 '22 08:01 tegioz

Hi!

First of all, happy new year to you and your team and your loved ones!

Sorry, I had kept this github issue on the backburner hoping to find some time to work on it, but... I did not, in fact, find some time to work on it 😬😅

I still hope to be able to spend some time on it in the future, but I don't know when/if that will happen.

So if someone wants to pick it up, please do. Or, if you think this is not important enough, we can either leave the issue open (and hopefully at some point I can take a stab at it!) or close it if you'd rather reduce the number of "noisy" issues.

Thank you! ♥

jpetazzo avatar Jan 03 '22 11:01 jpetazzo

Thanks! Happy new year to you too!

No worries at all, we just wanted to offer some help 😇

I think this is something interesting that we should do as it can be helpful for more users. But there is certainly no urgency so we can leave it open for some more time. If at some point you think you won't have the time to work on it, please let us know and we'll gladly take care of it 🙂

Cheers 👋

tegioz avatar Jan 03 '22 11:01 tegioz

It seemed relatively straightforward, but I might have overlooked important things, as this is the first time that I'm patching React code 😅

jpetazzo avatar Aug 22 '22 17:08 jpetazzo

Thanks for the PR @jpetazzo! @cynthia-sg will take a look at it soon 🙂

tegioz avatar Aug 22 '22 17:08 tegioz

Thank you so much for pushing this past the finish line, and sorry that I wasn't able to put more time into it. I really appreciate the work that you and your team put in making the Artifact Hub! :pray:

jpetazzo avatar Feb 01 '23 21:02 jpetazzo

No worries, thanks! :smile:

cynthia-sg avatar Feb 01 '23 22:02 cynthia-sg