You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
lock the file/line selection controls while a commit is running #3814
I'm working on a large project that has a slow pre-commit hook (> 10 seconds). Several times, I've used the file checkboxes and individual line selection to do a partial commit, and then without realising the commit is still running, I've started selecting more lines for a second commit. Then I realise the first commit is still running, and it's hard to tell from the UI what is going to get committed.
Version
GitHub Desktop version: 1.0.11
OS version: macOS Sierra (10.12.6)
Steps to Reproduce
In a project with a slow pre-commit hook, do a partial commit (just select certain files and/or lines, and then click Commit)
While that partial commit is running, try to change the selection of lines/files.
Expected behavior:
You shouldn't be able to change the file/line selection while the commit is running.
Actual behavior:
You can mess with the file/line selection before the commit is complete, so the UI is now in a state that does not reflect what is really going to get committed.
Reproduces how often: [What percentage of the time does it reproduce?]
100%.
Additional information
I'm guessing that the selection is fixed from the moment the commit button is clicked, but if this is the case it would be good if the UI could reflect this. To avoid confusion, I suggest disabling all the checkboxes and line selection controls as soon as the commit button is clicked, and re-enabling them once the commit has succeeded or failed.
@callumlocke this is an interesting idea, and something that probably needs some design input to ensure the lock/unlock transition isn't overwhelming.
For reference, we're already tracking the isCommitting state at the repository level (so we can disable the commit form), and flowing that down into the other components so they can enable/disable themselves is probably worth exploring:
changed the title [-]Suggestion: lock the file/line selection controls while a commit is running[/-][+]lock the file/line selection controls while a commit is running[/+]on Jan 23, 2018
@iAmWillShepherd@j-f1 the concept of "locking" is only specific to the UI in Desktop - if the commit fails, everything should be "unlocked" in case the user wants to make changes before trying again
#4042 only addresses the commit form textboxes - this issue is related to the partial committing functionality in the diff view, and remains unresolved.
@masungwon@erin-lee i can't assign you due to some weird settings on our project but I marked it as in progress on our project board! You're good to go!
Activity
shiftkey commentedon Jan 23, 2018
@callumlocke this is an interesting idea, and something that probably needs some design input to ensure the lock/unlock transition isn't overwhelming.
For reference, we're already tracking the
isCommittingstate at the repository level (so we can disable the commit form), and flowing that down into the other components so they can enable/disable themselves is probably worth exploring:desktop/app/src/ui/repository.tsx
Line 96 in 6df8a69
[-]Suggestion: lock the file/line selection controls while a commit is running[/-][+]lock the file/line selection controls while a commit is running[/+]iAmWillShepherd commentedon Jan 24, 2018
What would happen if the commit fails? Should the file remain locked?
j-f1 commentedon Jan 24, 2018
I’d say no, because that would prevent you from committing something slightly different to fix the commit.
shiftkey commentedon Jan 28, 2018
@iAmWillShepherd @j-f1 the concept of "locking" is only specific to the UI in Desktop - if the commit fails, everything should be "unlocked" in case the user wants to make changes before trying again
iAmWillShepherd commentedon Jan 31, 2018
Thanks for that clarification, @shiftkey.
iAmWillShepherd commentedon Mar 5, 2018
Fixed in #4042.
shiftkey commentedon Mar 5, 2018
#4042 only addresses the commit form textboxes - this issue is related to the partial committing functionality in the diff view, and remains unresolved.
iAmWillShepherd commentedon Mar 5, 2018
@shiftkey oops, my bad!
masungwon commentedon Aug 3, 2018
@outofambit Could you assign me and @erin-lee to this task? We're almost done with the PR.
outofambit commentedon Aug 3, 2018
@masungwon @erin-lee i can't assign you due to some weird settings on our project but I marked it as in progress on our project board! You're good to go!
shiftkey commentedon Aug 3, 2018
#5341 deals with the changed file checkboxes, but the other part of this is the partial line selections in the diff:
If you wanted to look into that, the relevant property to control the behaviour is
readOnlyinTextDiff.tsx:desktop/app/src/ui/diff/text-diff.tsx
Lines 76 to 83 in 13b21a8
There might need to be some extra work here to plumb
isCommittingaround - it's been a while since I've been in there...