Skip to content

Conversation

czarkoff
Copy link
Contributor

When a commit message happens to contain a commit link and the user elects to right-click it, instead of navigating them to the commit, present a menu with options to navigate to it or to copy SHA.

I've reused translations for "Copy SHA." "Navigate to" remains untranslated in most locales, and the English wording choice might be questionable.

When a commit message happens to contain a commit link and the user elects to right-click it, instead of navigating them to the commit,  present a menu with options to navigate to it or to copy SHA.
`_lastHover` in the `if` is also swapped for `match`for consistency with the block body
@love-linger love-linger self-assigned this Nov 24, 2024
@love-linger
Copy link
Collaborator

Why not click the SHA, navigate to the target COMMIT then copy the SHA if it is the right one you want to copy after checking?

@love-linger love-linger added the enhancement New feature or request label Nov 24, 2024
@love-linger love-linger merged commit 12f7531 into sourcegit-scm:develop Nov 24, 2024
13 checks passed
love-linger added a commit that referenced this pull request Nov 24, 2024
* remove unnecessary namespace using
* do NOT set tooltip currently, because CommitDetail.GetParent may cause UI lags and the tooltip DataTemplate is not provided.
* add translations for zh_CN and zh_TW

Signed-off-by: leo <longshuang@msn.cn>
@czarkoff
Copy link
Contributor Author

Why not click the SHA, navigate to the target COMMIT then copy the SHA if it is the right one you want to copy after checking?

Well, navigation cancels current selection, and you might need quite a bit of it in some cases. For instance I was trying to select some of the commits for cherry-pick from a list of cherry-picked commits elsewhere:

image

The ability to do so without navigation came in very handy.

@czarkoff
Copy link
Contributor Author

Why have you removed the tooltips for the commits? Are there some negative side effects that I didn't recognize?

@love-linger
Copy link
Collaborator

love-linger commented Nov 24, 2024

Why have you removed the tooltips for the commits? Are there some negative side effects that I didn't recognize?

4 reasons:

  • Run command in UI thread, especially not using async, is not recommended
  • Like parent SHA, can we cache the queried commit to avoid fetching it if we hover it again?
  • As I said, you haven't provided a proper DataTemplate for the tooltip
  • I'll provide a common control for all SHA

@czarkoff
Copy link
Contributor Author

Understood, thank you for explanation. Please let me know if you wish me to do some of that.

@czarkoff czarkoff deleted the copy-sha-in-commit-message branch November 24, 2024 10:59
love-linger added a commit that referenced this pull request Nov 24, 2024
@ChiahongHong
Copy link
Contributor

@czarkoff @love-linger
There might be a bug that needs to be fixed:

bug_1125.mp4

@love-linger
Copy link
Collaborator

Fixed by PR #741

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.

3 participants