Gitea: [feature request - ui tweak] ssh key adding form UI usability

Created on 10 Mar 2019  路  5Comments  路  Source: go-gitea/gitea

Description

When adding new SSH key, key title should be automatically populated from public key comment field.

Additionally, in my personal opinion, swapping order of these two fields (making the key content textarea go above the title) would make it more intuitive. I often just paste the key into the first field available before realizing it's the "title" and the key should go into the other one.

The JS code:

var $sshKeyContent = $('#ssh-key-content')
$sshKeyContent.change(function() {
    var $sshKeyTitle = $('#ssh-key-title');
    if ( $sshKeyContent.val().length > 0 && $sshKeyTitle.val() === "" ){
        $sshKeyTitle.val( $sshKeyContent.val().trimRight().match( /^ssh-[^ ]* [^ ]* (.*)$/ )[1] );
    }
} );

Screenshots


image

kinenhancement stale

Most helpful comment

I just noticed this was already implemented 2 YEARS AGO in #950 but it only works when the key comment does not contain any spaces. I will fix that.

All 5 comments

Please send a PR to fix that.

I just noticed this was already implemented 2 YEARS AGO in #950 but it only works when the key comment does not contain any spaces. I will fix that.

please don't swap the textboxes. Since their purpose is clearly stated, it makes sense they way it is. And yes, the comment is inserted automatically into the "key name" field

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

This has been resolved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jakimfett picture jakimfett  路  3Comments

lunny picture lunny  路  3Comments

ghost picture ghost  路  3Comments

thehowl picture thehowl  路  3Comments

kifirkin picture kifirkin  路  3Comments