Skip to content
New issue

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

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

Already on GitHub? # to your account

Improve "generate new access token" form #33730

Merged
merged 12 commits into from
Feb 27, 2025
Merged

Improve "generate new access token" form #33730

merged 12 commits into from
Feb 27, 2025

Conversation

gsvd
Copy link
Contributor

@gsvd gsvd commented Feb 26, 2025

Fix: #33519

As discussed in PR #33614, the ScopedAccessTokenSelector Vue component is not particularly useful.

This PR removes the component and reverts to using HTML templates. It also introduces some (hopefully) useful refactoring.

The Vue component was causing the UX bug reported in the linked issue. Required form fields are now properly working, as expected (see screenshot).

Screenshot from 2025-02-25 22-00-28

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 26, 2025
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 26, 2025
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/frontend labels Feb 26, 2025
@wxiaoguang
Copy link
Contributor

Thank you very much! It is much clearer than before.

And by the way, there is a scoped-access-warning below, maybe it could also be removed?

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 26, 2025
@lunny lunny added the backport/v1.23 This PR should be backported to Gitea 1.23 label Feb 26, 2025
@gsvd
Copy link
Contributor Author

gsvd commented Feb 26, 2025

Both comments have been processed.

@silverwind
Copy link
Member

For the future, consider using a different source branch name than main because it makes it harder for people to try out the branch.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Feb 27, 2025

Made some optimizations, new UI should look better and easy to use.

And add backend check to make sure the scope won't be empty.

image


image

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 27, 2025
@wxiaoguang wxiaoguang changed the title Remove Vue scoped-access-token-selector component Improve "generate new access token" form Feb 27, 2025
@wxiaoguang wxiaoguang force-pushed the main branch 4 times, most recently from 1f77ce3 to bf6f2db Compare February 27, 2025 07:12
-webkit-mask-image: var(--octicon-chevron-right);
transform: rotate(90deg); /* point the chevron down */
background: currentcolor;
}
Copy link
Member

@silverwind silverwind Feb 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wxiaoguang is this not needed anymore? I recall this class is for "nicer" select boxes with chevron etc, but I think some browser may by default render chevrons as seen in screenshots in #33434, but I'm not sure all of them do.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No code uses it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, it was a single use. I will check if I need to re-introduce it for #33434.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess no ....

We already have "ui dropdown (selection)", or just use the browser native "select". I think we'd better avoid too much "customization".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this was a minor enhancement for the native select, because I think those will render differently based on browser OS, but I will check again if it's really needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean you need to check before merging this PR, or we could merge this PR if no other problem and leave the "check" to the future?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, merge this now.

@lunny
Copy link
Member

lunny commented Feb 27, 2025

Move the “Generate New Token” button to the top of the token list for better accessibility. Currently, users with multiple tokens must scroll to the bottom each time they need to generate a new one, which is inconvenient. Placing it at the top improves efficiency and usability.

@silverwind
Copy link
Member

Move the “Generate New Token” button to the top of the token list for better accessibility. Currently, users with multiple tokens must scroll to the bottom each time they need to generate a new one, which is inconvenient. Placing it at the top improves efficiency and usability.

I see where you are coming from, but placing the button on top would be inconsistent with other similar forms.

@lunny
Copy link
Member

lunny commented Feb 27, 2025

Move the “Generate New Token” button to the top of the token list for better accessibility. Currently, users with multiple tokens must scroll to the bottom each time they need to generate a new one, which is inconvenient. Placing it at the top improves efficiency and usability.

I see where you are coming from, but placing the button on top would be inconsistent with other similar forms.

I believe it’s consistent. Most list pages feature a ‘New’ button in the top right corner, which either switches the view or opens a form window. I’ve never seen a ‘New’ button placed at the bottom of a list.

@lunny
Copy link
Member

lunny commented Feb 27, 2025

Move the “Generate New Token” button to the top of the token list for better accessibility. Currently, users with multiple tokens must scroll to the bottom each time they need to generate a new one, which is inconvenient. Placing it at the top improves efficiency and usability.

I see where you are coming from, but placing the button on top would be inconsistent with other similar forms.

I believe it’s consistent. Most list pages feature a ‘New’ button in the top right corner, which either switches the view or opens a form window. I’ve never seen a ‘New’ button placed at the bottom of a list.

This could be another PRs since this is not the last place putting the button at the bottom.

@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 27, 2025
@lunny lunny enabled auto-merge (squash) February 27, 2025 19:15
@lunny lunny merged commit 303af55 into go-gitea:main Feb 27, 2025
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 27, 2025
@GiteaBot
Copy link
Collaborator

I was unable to create a backport for 1.23. @gsvd, please send one manually. 🍵

go run ./contrib/backport 33730
...  // fix git conflicts if any
go run ./contrib/backport --continue

@GiteaBot GiteaBot added the backport/manual No power to the bots! Create your backport yourself! label Feb 27, 2025
@silverwind
Copy link
Member

Does it really need a backport?

@lunny lunny removed the backport/v1.23 This PR should be backported to Gitea 1.23 label Feb 28, 2025
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 3, 2025
* giteaofficial/main:
  Use pullrequestlist instead of []*pullrequest (go-gitea#33765)
  Upgrade act to 0.261.4 and actions-proto-go to v0.4.1 (go-gitea#33760)
  Webhook add X-Gitea-Hook-Installation-Target-Type Header (go-gitea#33752)
  Fix dynamic content loading init problem (go-gitea#33748)
  [skip ci] Updated translations via Crowdin
  Add composor source field (go-gitea#33502)
  upgrade go-crypto from 1.1.5 to 1.1.6 (go-gitea#33745)
  Disable go license generation as part of `make tidy` (go-gitea#33747)
  Refactor repo-diff.ts (go-gitea#33746)
  Use `git diff-tree` for `DiffFileTree` on diff pages (go-gitea#33514)
  [skip ci] Updated translations via Crowdin
  Improve "generate new access token" form (go-gitea#33730)
  Remove superflous tw-content-center (go-gitea#33741)
  Clone repository with Tea CLI (go-gitea#33725)
  allow filtering /repos/{owner}/{repo}/pulls by target base branch queryparam (go-gitea#33684)
  Show info about maintainers are allowed to edit a PR (go-gitea#33738)
  Improve admin user view page (go-gitea#33735)
  [skip ci] Updated translations via Crowdin
  Align sidebar gears to the right (go-gitea#33721)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
backport/manual No power to the bots! Create your backport yourself! lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/translation size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UX,Usability: Creating Personal Access Tokens, provide access form values on error
5 participants