Repository navigation
Add create tag dialog - #9440
Conversation
29c478e to
dc0e1c5
Compare
a6b1b2a to
9fb14ba
Compare
9fb14ba to
1d0574c
Compare
1d0574c to
8279876
Compare
|
Regarding In that case we're going to show a message on the same dialog (see screenshot on the PR description) and disable the button. If for some reason this detection mechanism is not available (it can rarely happen if fetching the list of tags takes a long time), the following error will be displayed after clicking on "Create tag": |
ampinsk
left a comment
There was a problem hiding this comment.
Looks great design wise!
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Test for Mac + Windows:
- Option can be selected in context menu from a commit
- Modal can be closed with X, Cancel button or clicking the background
- Name field prevents invalid characters; converts to
-with inline error messaging - Duplicate names throw inline error messaging; prevents user from using them
- Delete an existing tag in CL and recreate same tag in Desktop; use
-d - Updated tag in CL is reflected in Desktop; use
-f - Light/dark mode check
NOTES/ISSUES:
- There is no limit to the tag length. We should have a cap as Github.com has some limits but just serves up a generic message "Invalid tag name".
- The modal expands as you type. Repro: type a long string with spaces and invalid characters and watch it grow.
- If there are multiple tags for one commit, I cannot see them all especially if they are long in length. Is a tool tip needed?
- I can create a tag on Github.com and the same tag on Desktop and there is no collision. Is this intended or just not implemented yet?
- When multiple tags are added the order of is not arranged by timestamp. Repro with multiple alpha and numeric tags.
- Should user be able to create tag on commit that hasn’t been pushed to the remote yet? Steps: create tag on such a commit, undo the commit. Tags are deleted on Desktop but not in
git tag —list. If you commit again, the tags cannot be duplicated. - If I delete an existing tag in Desktop with
-d, then I update the same tag with-f, should that tag reappear for the same commit?
Push tags when pushing changes to repository
|
Great observations @tierninho ! Thanks for investigating into these edge cases!
Good point! I've checked and GitHub allows a maximum tag length of 245 (since Also, the tag name length can be limited locally by the operating system (seems like all modern operating systems support filenames of up to 255 characters). We can add a check for the length and limit it to 245 characters to prevent the issues when pushing.
Ups, that's a bug, gonna fix it!
You mean in the commit details header? Yeah, I can add a tooltip there, although if the list of tags is very large (large enough to fill all horizontal space) I'm not sure if a tooltip is going to help much. Gonna check this with @ampinsk
This is a really good point! This is not intended and can definitely cause issues to some users. I cannot see an easy way to fix this at the moment though (we can't know which tags are in the remote repository until we fetch it, same should happen at the moment with branches). Should we mark this as a current limitation and find a way to address this for both branches and tags in a similar way?
Oh yes! We're currently displaying the tags in the same order that Unfortunately, I don't think we can consistently sort the tags in a chronological order: we are not able to know when a lightweight tag was created since this information is not stored. I think that a good approach here would be to sort the tags alphabetically, which will be easy to do and easy to understand for users.
Interesting point that we haven't thought about yet! IMHO users should be able to create tags on unpushed commits (that a quite common use-case). I can see two options here:
We obviously shouldn't delete the tag if it's been pushed to the remote, but if a commit is "undoable" I think we have the guarantee that any associated tag has not been pushed. What are your thoughts @billygriffin? (to be clear, when undoing a commit we currently don't delete any associated tag: it's just that the tag is not visible from Desktop since that commit is not reachable anymore).
What do you mean by updating the tag with |
|
Some of the appreciations in #9440 (review) (which are gold!) are related to displaying tags, so I'm gonna address the creation-related things here and the rest in separate PRs! |
|
@rafeca Thanks for all the comments. It looks like you have addressed them all or in progress to do so ⚡ As for:
Here are the steps:
I think the tag shouldn't reappear for the commit as it was deleted, but I am not 100%. 🤔 We might want to wait for this to surface organically as it might be too much of an edge case. Seems to be more of a Git issue and not so much Desktop. |
Co-Authored-By: evelyn masso <[email protected]>
Co-Authored-By: evelyn masso <[email protected]>
Co-Authored-By: evelyn masso <[email protected]>
| if (sanitizedTagName.length > MaxTagNameLength) { | ||
| return new Error( | ||
| `The tag name cannot be longer than ${MaxTagNameLength} characters` | ||
| private getCurrentError(): JSX.Element | null { |
There was a problem hiding this comment.
I've moved this method to return JSX elements now, this way we can have nice rendering of tag names inside errors (it was a bit weird anyways that the method returned an Error object).
outofambit
left a comment
There was a problem hiding this comment.
thanks @rafeca ! this is a really nice refactor! :)


Closes #9429
This PR is based on #9432 since it needs to use the
createTag()method.Description
This PR contains the UI changes to display a dialog that allows users to create tags.
Steps to complete this PR:
dispatcher.showCreateTagDialog()createTag()method added in Add createTag() method to git library wrapper #9432.Screenshots
The current design of the dialog, mimicking the create branch dialog and following the design specs:
Release notes
Notes: no-notes