Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Edit commit message in editor #896

Merged
merged 27 commits into from
Jun 13, 2017
Merged

Edit commit message in editor #896

merged 27 commits into from
Jun 13, 2017

Conversation

kuychaco
Copy link
Contributor

@kuychaco kuychaco commented May 31, 2017

Fixes #818

TODO:

  • add commit grammar
  • activate commit editor if already open
  • add tests
  • obscure commit box when editor is open

If the user has the file expanded, I'd love to gray out the box or display a little overlay with an informational message. If the user clicks it (or the arrow or something) again, it'd find and focus that buffer in the workspace center. Then if the editor is closed, we re-read the text and turn it back on.

  • add command
  • add context menu
  • add button somewhere
  • check if file is unsaved
  • handle case where commit box is empty and commit button is disabled
  • handle splitting commit message file into multiple panes and closing the original
  • delete file after committing
  • toggle the expanded editor instead of "revealing" it
  • prompt to save before destroying editor

@kuychaco kuychaco force-pushed the ku-commit-msg-editor branch from 4c8083c to a8b805d Compare June 1, 2017 11:23
@kuychaco kuychaco force-pushed the ku-commit-msg-editor branch 2 times, most recently from de98744 to d79407e Compare June 1, 2017 12:27
@kuychaco kuychaco force-pushed the ku-commit-msg-editor branch from d79407e to 50d9ddf Compare June 1, 2017 12:27
@kuychaco
Copy link
Contributor Author

kuychaco commented Jun 1, 2017

Here's what I've got so far:

commit-editor2

Could use some UX help around where to put a button to open the editor, and what to do to obscure the commit box when the editor is open. Right now I just hide the commit box using CSS. @simurai @BinaryMuse mind if I ask for your help implementing these?

@simurai
Copy link
Contributor

simurai commented Jun 1, 2017

Added a subtle "expand" button:

expandbutton

If the user clicks it (or the arrow or something) again, it'd find and focus that buffer in the workspace center. Then if the editor is closed, we re-read the text and turn it back on.

Maybe like this:

image

Or rather than "find the expanded commit message", it could close it instead and open the small one again? Then it would be more like a toggle:

image

@simurai
Copy link
Contributor

simurai commented Jun 2, 2017

@kuychaco Ok, added the expanded styles. Still needs wiring up:

  1. On github-CommitView-editor replace hidden class with is-expanded
  2. Make the expand button clickable
  3. Optional: Move the text into the <button> element. Currently it's just a pseudo element.

image

@simurai
Copy link
Contributor

simurai commented Jun 3, 2017

Wire up button

Nice!

Do you like the behaviour? I still think it should toggle the expanded editor instead of "revealing" it.

@kuychaco
Copy link
Contributor Author

kuychaco commented Jun 7, 2017

I still think it should toggle the expanded editor instead of "revealing" it.

Agreed 👍

@kuychaco kuychaco requested a review from BinaryMuse June 7, 2017 21:37
@kuychaco kuychaco force-pushed the ku-commit-msg-editor branch from 72b8d1d to 6828bc1 Compare June 7, 2017 22:02
Copy link
Contributor

@BinaryMuse BinaryMuse left a comment

Choose a reason for hiding this comment

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

One thought, otherwise 👍 . Like the UX here.


sinon.spy(controller.refs.commitView, 'update');
editor.destroy();
await assert.async.isTrue(controller.refs.commitView.update.called);
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 I wonder if this line's intention would be more clear as await until(() => controller.refs.commitView.update.called)

@@ -41,45 +41,53 @@ describe('CommitView', function() {
});
});

it('displays the remaining characters limit based on which line is being edited', async function() {
it.only('displays the remaining characters limit based on which line is being edited', async function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this is just here for debugging but 🔥

@kuychaco kuychaco merged commit 6046c1f into master Jun 13, 2017
@kuychaco kuychaco deleted the ku-commit-msg-editor branch June 13, 2017 00:53
@smashwilson
Copy link
Contributor

🎉

@BinaryMuse BinaryMuse mentioned this pull request Aug 1, 2017
25 tasks
@atomi
Copy link

atomi commented Aug 8, 2017

Can we get a shortcut to git push after committing the git message. Something like ctrl+shift+p?

@BinaryMuse
Copy link
Contributor

@atomi There's already a keybind for the Push command; you can see it by looking next to the "GitHub: Push" command in the command palette, and you can always bind your own keybind if you don't like the included one. See http://flight-manual.atom.io/behind-atom/sections/keymaps-in-depth/ for more.

@atomi
Copy link

atomi commented Aug 8, 2017

@BinaryMuse Thank you for the fast reply! I was thinking more along the lines of a quick push while within the commit input similar to git gui a commit would be ctrl+enter and a push would be something like ctrl+p all within the git commit input.

edit: though i understand ctrl+p and ctrl+shift+p might not make sense here another option is fine with me alt+crtl+p perhaps

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Larger commit message editor
5 participants