Skip to content

Conversation

saneks222
Copy link

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
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
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
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/translation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants