|
|
@@ -142,21 +142,19 @@ func (m Model) View() string {
|
|
|
var output string
|
|
|
if len(m.content) == 0 {
|
|
|
return "loading..."
|
|
|
- } else {
|
|
|
- output = output + m.content
|
|
|
}
|
|
|
- output = output + "\nj/k: down/up\tenter: select\tq: quit"
|
|
|
+ output = output + m.content
|
|
|
+ output = output + lipgloss.NewStyle().Faint(true).Margin(1).Render(m.widget.keyhelp())
|
|
|
return output
|
|
|
}
|
|
|
|
|
|
// WIDGET DEFINITIONS ---------------------------------------------------------
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
-// TODO add keyhelp func to widget interface
|
|
|
-
|
|
|
// interface definition for widgets
|
|
|
type widget interface {
|
|
|
- render() tea.Msg
|
|
|
+ render() tea.Msg // renders content
|
|
|
+ keyhelp() string // renders key usage
|
|
|
}
|
|
|
|
|
|
// -------- creatIssue definitions --------------------------------------------
|
|
|
@@ -340,6 +338,12 @@ func (c create) render() tea.Msg {
|
|
|
return output
|
|
|
}
|
|
|
|
|
|
+func (c create) keyhelp() string {
|
|
|
+ var output string
|
|
|
+ output = output + "\ntab/shift+tab: down/up\t\tenter: input value\t\tctrl+c: quit"
|
|
|
+ return output
|
|
|
+}
|
|
|
+
|
|
|
// -------- Issue widget definitions ------------------------------------------
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
@@ -382,6 +386,12 @@ func (i Issue) render() tea.Msg {
|
|
|
return borderStyle.Render(output)
|
|
|
}
|
|
|
|
|
|
+func (i Issue) keyhelp() string {
|
|
|
+ var output string
|
|
|
+ output = output + "\nj/k: down/up\t\tq: quit"
|
|
|
+ return output
|
|
|
+}
|
|
|
+
|
|
|
// -------- IssueCollection widget definitions --------------------------------
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
@@ -408,6 +418,12 @@ func (ic IssueCollection) render() tea.Msg {
|
|
|
return output
|
|
|
}
|
|
|
|
|
|
+func (ic IssueCollection) keyhelp() string {
|
|
|
+ var output string
|
|
|
+ output = output + "\nj/k: down/up\t\tenter: select\t\tq: quit"
|
|
|
+ return output
|
|
|
+}
|
|
|
+
|
|
|
// tea.Cmd definitions --------------------------------------------------------
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|