Skip to content

Open result repository on search enter #21972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

aceArt-GmbH
Copy link
Contributor

image
Pressing enter on search opens the first result. This allows for faster navigation without any mouse involvement.
I could add a focus ring to the first element to indicate this new behavior.

@silverwind
Copy link
Member

silverwind commented Nov 29, 2022

I think the feature also needs the up and down arrow keys be able to move this selection. Also please make it so the feature only becomes active when at least 1 character has been typed into the search box.

You could indicate a selection via something like border. It should be subtle.

border-left: 2px solid var(--color-primary);
padding-left: calc(1em - 2px);

image

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 29, 2022
@silverwind silverwind added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Nov 29, 2022
@aceArt-GmbH
Copy link
Contributor Author

I think the feature also needs the up and down arrow keys be able to move this selection.

I did not intend this PR to make the UI totally keyboard driven. I am not even sure how to capture the arrow keys without changing behavior on the rest of the page.
Normally the page should be navigated using the tab key.

You could indicate a selection via something like border. It should be subtle.

I am not sure if this is subtle enough to just indicated the onEnter.

I could also just add this logic to footer.tmpl on our instance

@aceArt-GmbH aceArt-GmbH force-pushed the search-click branch 2 times, most recently from 007a943 to 69fff70 Compare December 1, 2022 11:57
@aceArt-GmbH
Copy link
Contributor Author

Also please make it so the feature only becomes active when at least 1 character has been typed into the search box.

Why this?

@silverwind I updated according to your suggestion

@silverwind
Copy link
Member

Why this?

Because the input element has autofocus and if someone accidentially hits enter, they might go somewhere they did not intend to go to.

I am not sure if this is subtle enough to just indicated the onEnter.

I think border is probably not too good looking, probably should slightly alter background color.

@aceArt-GmbH
Copy link
Contributor Author

aceArt-GmbH commented Dec 2, 2022

image
I added a small outline, just like the normal tab focus outline would be

Also please make it so the feature only becomes active when at least 1 character has been typed into the search box.

Added it

@lunny lunny added topic/ui Change the appearance of the Gitea UI and removed type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Dec 12, 2022
@aceArt-GmbH
Copy link
Contributor Author

Is there any interest in this feature or rather not? 🙃

@lunny lunny added this to the 1.19.0 milestone Jan 1, 2023
@lunny lunny removed this from the 1.19.0 milestone Feb 16, 2023
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants