Repository navigation
Improved submodule support - #15176
Conversation
|
|
||
| const disableSelection = isCommitting || rebaseConflictState !== null | ||
| const checkboxTooltip = isUncommittableSubmodule | ||
| ? 'This submodule cannot be checked in because it contains changes have not been committed.' |
There was a problem hiding this comment.
| ? 'This submodule cannot be checked in because it contains changes have not been committed.' | |
| ? 'This submodule cannot be checked in because it contains changes that have not been committed.' |
Other thoughts are is the terminology "checked in" ideal - can't articulate what it is but it feels off to me - maybe it it is because in the UI we just use the word commit? Maybe this should be "This submodule change cannot be added to a commit in this repository, because..." or "This submodule change cannot be committed, because..."
Similarly for next tooltip, "Only changes that have been committed within the submodule will be added to this repository" or "committed to this repository"
There was a problem hiding this comment.
Yeah I used checked in in an attempt to differentiate the actions in the main repo vs the actions in the submodule repo. I think "This submodule change cannot be added to a commit in this repository, because…" should be clear enough 🤔 Thanks for your suggestions!!
| readonly shortSHA: string | JSX.Element | ||
|
|
||
| /** Long SHA to display within the tooltip. */ | ||
| readonly longSHA: string |
There was a problem hiding this comment.
Just a thought since this is a formatting component -> feel free to ignore. We could pass in just longSHA: string | Commit. If is a string, we shorten it here using shortenSha method and if it is a commit we use commit.shortSha and commit.sha.
There was a problem hiding this comment.
(Or make longSHA? and commit? properties and use the defined one :D)
There was a problem hiding this comment.
Well, the problem is the short SHA is either a string or a JSX.Element, if you need something custom (like we do in the submodule interstitial to use a Ref component to wrap the SHA).
There was a problem hiding this comment.
That could be done either as another component extending this or as boolean asRef and still keep all the formatting to his component or components.
Co-Authored-By: tidy-dev <[email protected]>
tidy-dev
left a comment
There was a problem hiding this comment.
✨ Tested it out (on my mac) and everything worked as expected. Thanks for the tooltip changes and adding the feature flag.
(Feel free to ignore the tool tip commit sha component suggestions)
| } | ||
|
|
||
| private renderSubmoduleInfo() { | ||
| // TODO: only for GH submodules? |
There was a problem hiding this comment.
Just remembered - I meant to ask if this is needed - does it work just fine for non GH submodules?
There was a problem hiding this comment.
I only tested this with GH and bitbucket repos and it worked fine, but maybe it doesn't with other hosting services? 🤔
|
Thanks for the quick review! I'll explore the tooltipped component suggestion in another PR, and also submit some unit tests for the new submodule status stuff. |
…-utils-1.4.1 Bump loader-utils from 1.1.0 to 1.4.1
Description
This PR improves submodule support on GitHub Desktop by making sure it renders something useful to users instead of the
Subproject commit a901a6a0d95895e34c031c7ae8d3ab6d345a67fd.Screenshots
submodule-changes-with-interstitial.mov
In the video you can see:
desktop-notifications): you can partially select it because you can commit its addition to the repo, but not the non-committed changes within itdesktop-trampoline): you can partially select it because you can commit the change in the commit it points to, but not the nont-committed changes within itsp-ios-tools): can be selected and committed normallytest-repo): it can’t be selected at all because it only has non-committed changes 😢For 1, 2 and 4, you will get a tooltip if you hover over the checkbox, explaining why selection is either disabled or partial
Release notes
Notes: [Improved] Improve submodule support