Skip to content

Conversation

saneks222
Copy link
Contributor

The merge request file viewer has a button for copying the file path, but it is not always convenient. Often, you only want to copy the file name, which is currently not possible. This change request adds this capability.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 17, 2025
@github-actions github-actions bot added modifies/translation modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files labels Sep 17, 2025
@lunny
Copy link
Member

lunny commented Sep 18, 2025

It seems to be a duplicate button.

@saneks222
Copy link
Contributor Author

It seems to be a duplicate button.

Thank you for your reply!
If you think this button is redundant here, perhaps we could move it here? What do you think about this option?

image

@silverwind
Copy link
Member

Call it "Copy filename" and have it in that menu, yes.

@saneks222
Copy link
Contributor Author

Call it "Copy filename" and have it in that menu, yes.

I moved the button to the menu and also attempted to add localization, but encountered issues with Chinese dialects, so I was unable to add localization for it

@wxiaoguang
Copy link
Contributor

Call it "Copy filename" and have it in that menu, yes.

I moved the button to the menu and also attempted to add localization, but encountered issues with Chinese dialects, so I was unable to add localization for it

No need to make other translations. The only thing need to do is to add the en-US. Other languages will be handled by Crowdin.

By the way, there could be some improvments:

  1. No need to introduce ShortName. You can call data-xxx="{{$file.GetDiffFileShortName}}" directly from template
  2. It should use path.Base but not filepath.Base

@saneks222
Copy link
Contributor Author

Call it "Copy filename" and have it in that menu, yes.

I moved the button to the menu and also attempted to add localization, but encountered issues with Chinese dialects, so I was unable to add localization for it

No need to make other translations. The only thing need to do is to add the en-US. Other languages will be handled by Crowdin.

By the way, there could be some improvments:

  1. No need to introduce ShortName. You can call data-xxx="{{$file.GetDiffFileShortName}}" directly from template
  2. It should use path.Base but not filepath.Base

Thanks for the review!
Fixed.

Copy link
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

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

update names

Signed-off-by: wxiaoguang <[email protected]>
@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 Oct 2, 2025
@wxiaoguang wxiaoguang added this to the 1.26.0 milestone Oct 2, 2025
@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 Oct 2, 2025
@wxiaoguang wxiaoguang enabled auto-merge (squash) October 2, 2025 17:42
@wxiaoguang wxiaoguang added the type/enhancement An improvement of existing functionality label Oct 2, 2025
@wxiaoguang wxiaoguang merged commit efc48c3 into go-gitea:main Oct 2, 2025
26 checks passed
rossigee pushed a commit to rossigee/gitea that referenced this pull request Oct 4, 2025
The merge request file viewer has a button for copying the file path,
but it is not always convenient. Often, you only want to copy the file
name, which is currently not possible. This change request adds this
capability.

---------

Signed-off-by: wxiaoguang <[email protected]>
Co-authored-by: a.kiselev <[email protected]>
Co-authored-by: wxiaoguang <[email protected]>
rossigee pushed a commit to rossigee/gitea that referenced this pull request Oct 4, 2025
The merge request file viewer has a button for copying the file path,
but it is not always convenient. Often, you only want to copy the file
name, which is currently not possible. This change request adds this
capability.

---------

Signed-off-by: wxiaoguang <[email protected]>
Co-authored-by: a.kiselev <[email protected]>
Co-authored-by: wxiaoguang <[email protected]>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Oct 5, 2025
* giteaofficial/main:
  fix: auto-expand and auto-scroll for actions logs (go-gitea#35570) (go-gitea#35583)
  [skip ci] Updated translations via Crowdin
  [skip ci] Updated translations via Crowdin
  Fix creating pull request failure when the target branch name is the same as some tag (go-gitea#35552)
  Use bundled version of spectral (go-gitea#35573)
  Add rebase push display wrong comments bug (go-gitea#35560)
  Address some CodeQL security concerns (go-gitea#35572)
  fix(webhook): prevent tag events from bypassing branch filters targets go-gitea#35449 (go-gitea#35567)
  Added button to copy file name in PR files (go-gitea#35509)
  Update JS and PY deps (go-gitea#35565)
  Enable a few more tsconfig options (go-gitea#35553)
  Bump github.com/wneessen/go-mail from 0.6.2 to 0.7.1 (go-gitea#35557)
  add more routes to the "expensive" list (go-gitea#35547)
  Drop json-iterator dependency (go-gitea#35544)
  Add proper error message if session provider can not be created (go-gitea#35520)
  use experimental go json v2 library (go-gitea#35392)
  Use global lock instead of status pool for cron lock (go-gitea#35507)
  Move some functions to gitrepo package (go-gitea#35503)
  Move GetDiverging functions to gitrepo (go-gitea#35524)
  [skip ci] Updated translations via Crowdin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/translation type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants