d2c91b376b2503003b4bcc4158472a2c7e8589b6

Author
Ayman Bagabas <ayman.bagabas@gmail.com>
Committer
Ayman Bagabas <ayman.bagabas@gmail.com>
Date

Message

fix(ui): shorten commit hash in status bar and when copying

Diff

 1diff --git a/ui/pages/repo/log.go b/ui/pages/repo/log.go
 2index 9e15fc3894fe71d974faab721a2165292be5e4ac..93c1aa5dd58e673f8863f567d8cb5bfcf112512a 100644
 3--- a/ui/pages/repo/log.go
 4+++ b/ui/pages/repo/log.go
 5@@ -362,7 +362,7 @@ func (l *Log) StatusBarValue() string {
 6 	if email := c.Author.Email; email != "" {
 7 		who += " <" + email + ">"
 8 	}
 9-	value := c.ID.String()
10+	value := c.ID.String()[:7]
11 	if who != "" {
12 		value += " by " + who
13 	}
14diff --git a/ui/pages/repo/logitem.go b/ui/pages/repo/logitem.go
15index 06e27ea858d5bccb43fde70f554bdecc3f8b86cd..bf4d1ca2af399aec72e90969932b1f458b6d2759 100644
16--- a/ui/pages/repo/logitem.go
17+++ b/ui/pages/repo/logitem.go
18@@ -64,7 +64,7 @@ func (d LogItemDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd {
19 	case tea.KeyMsg:
20 		switch {
21 		case key.Matches(msg, d.common.KeyMap.Copy):
22-			return copyCmd(item.Hash(), fmt.Sprintf("Commit hash %q copied to clipboard", item.Hash()))
23+			return copyCmd(item.Hash(), "Commit hash copied to clipboard")
24 		}
25 	}
26 	return nil