Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some nice keyboard shortcuts for staging and selecting #4884

Merged
merged 11 commits into from
Sep 16, 2024

Conversation

estib-vega
Copy link
Contributor

@estib-vega estib-vega commented Sep 11, 2024

☕️ Reasoning

As seen in #4734

DISCLAIMER
Not all items in that issue are implemented in this PR.

It would be great if we and stage/un-stage files using only the keys!

🧢 Changes

  • Clicking on 'Escape' will close the commit message input field (both the modal and the lane field)
  • If at least one file list item is selected, clicking Ctrl or cmd + 'a' will select all files in the list
  • If at least one file list item is selected, clicking the space-bar will open the commit message input from the lane.
  • If at least one file list item is selected and the commit message input is open, clicking the space-bar will toggle the staging of the selected files.

Pressing 'Escape' will close the commit input file
Add the ability to control externally when the commit message text input is focused.

Also:
Opent the commit input when a file is selected and the space bar is pressed
Stage or unstage the files by pressing the space-bar on the selected files.
Click enter to focus on the commit message input field
Select all files with meta-key + 'a'.
Also, `fileIdSelection` will make sure that the no duplicates are added to the selection
Copy link

vercel bot commented Sep 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gitbutler-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 16, 2024 9:44am

@estib-vega estib-vega changed the title keyboard-shortcuts Add some nice keyboard shortcuts for staging and selecting Sep 11, 2024
return;
}

// Stage/unstage files
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe remove these comments as they are not super helpful.

Comment on lines 223 to 226
// Only one file selected
//
// Select all hunks if none are selected,
// otherwise ignore all hunks
Copy link
Contributor

Choose a reason for hiding this comment

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

Any chance you could format and punctuate this a bit better? I see one comma, and two questionable line breaks 😂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't, you, like

.them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haha, I'll just remove them 👍

@estib-vega estib-vega merged commit 07c6db3 into master Sep 16, 2024
14 checks passed
@estib-vega estib-vega deleted the keyboard-shortcuts branch September 16, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants