Jump to status options with their first-letter shortcuts.
o/w/d select OPEN/WIP/DONE in the status menu, with the hotkeys shown inline. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package ticket
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
"unicode"
|
||||
)
|
||||
|
||||
// Status represents the workflow state of a ticket.
|
||||
type Status string
|
||||
@@ -28,6 +31,15 @@ func (s Status) Label() string {
|
||||
}
|
||||
}
|
||||
|
||||
// Shortcut returns the status-menu hotkey (first letter of the label).
|
||||
func (s Status) Shortcut() rune {
|
||||
label := s.Label()
|
||||
if label == "" {
|
||||
return 0
|
||||
}
|
||||
return unicode.ToLower([]rune(label)[0])
|
||||
}
|
||||
|
||||
// Index returns the position in AllStatuses, or 0 if unknown.
|
||||
func (s Status) Index() int {
|
||||
for i, st := range AllStatuses {
|
||||
|
||||
Reference in New Issue
Block a user