Skip to content

Conversation

Feko
Copy link
Contributor

@Feko Feko commented Nov 5, 2024

Summary

Nothing big, just adding keyboard shortcuts for:

  • Pull (starts directly)
  • Push (starts directly)
  • Create Branch (based on selected commit)

Motivation

Those are some of the operations I do most often, it's nice to have shortcuts. I also added those to the Hotkeys window.

Implementation

For creating branch, I didn't use the HotKey="" property of Avalonia XML, as I needed the selected commit. I implemented it on the already existing OnCommitListKeyDown event.

Not sure how to handle localization, I've only added the new strings to en_US.

@love-linger love-linger self-assigned this Nov 6, 2024
@love-linger love-linger added the enhancement New feature or request label Nov 6, 2024
@love-linger love-linger merged commit 2e6eca2 into sourcegit-scm:develop Nov 6, 2024
13 checks passed
love-linger added a commit that referenced this pull request Nov 6, 2024
* add hotkey `Ctrl+Down/⌘+Down` to fetch directly
* keep translation keys of en_US in order
* add translations for zh_CN and zh_TW
* do NOT using namespace under `SourceGit`
* remove the hotkey of `Create Branch` context menu item
   - there are other objects (such as branch and tag) also have the `Create Branch` context menu item without hotkeys
   - on macOS, we already use `⌘+B` to create branch with selected commit, not `Ctrl + B`

Signed-off-by: leo <longshuang@msn.cn>
love-linger added a commit that referenced this pull request Nov 6, 2024
Signed-off-by: leo <longshuang@msn.cn>
love-linger added a commit that referenced this pull request Nov 6, 2024
love-linger added a commit that referenced this pull request Nov 6, 2024
* add hotkey `Ctrl+Down/⌘+Down` to fetch directly
* keep translation keys of en_US in order
* add translations for zh_CN and zh_TW
* do NOT using namespace under `SourceGit`
* use `⇧` instead of `Shift` in hotkey tips
* hotkey mismatch on macOS
* hotkeys to start fetch/pull/push directly not work on macOS
* remove the hotkey of `Create Branch` context menu item
   - there are other objects (such as branch and tag) also have the `Create Branch` context menu item without hotkeys
   - on macOS, we already use `⌘+B` to create branch with selected commit, not `Ctrl + B`

Signed-off-by: leo <longshuang@msn.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants