diff --git a/README.md b/README.md index ccf12d9..6f82c41 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ GitHub CLI extension to list your owned PRs and issues across repositories unlike `gh pr list` and `gh issue list`, which are repo-scoped. +![demo](demo/demo.gif) + Key features: - List your pull requests across all repositories grouped into: diff --git a/demo/demo.gif b/demo/demo.gif new file mode 100644 index 0000000..d1f90ea Binary files /dev/null and b/demo/demo.gif differ diff --git a/demo/demo.tape b/demo/demo.tape new file mode 100644 index 0000000..f5d641e --- /dev/null +++ b/demo/demo.tape @@ -0,0 +1,68 @@ +Output demo/demo.gif + +Set FontSize 30 +Set Width 2400 +Set Height 1200 +Set Theme "Github" +Set Shell "bash" +Env PS1 ">> " + +Type "gh own --demo" +Sleep 300ms +Enter +Sleep 1.5s + +# Navigate through all PR tabs +Tab +Sleep 600ms +Tab +Sleep 600ms +Tab +Sleep 600ms + +# Open selected item — shows "→ Opening ... in browser…" status +Enter +Sleep 2.5s + +# Navigate back to Created tab +Shift+Tab +Sleep 100ms +Shift+Tab +Sleep 100ms +Shift+Tab +Sleep 500ms + +# Filter demo +Type "/" +Sleep 500ms +Type "ci" +Sleep 1s +Escape +Sleep 500ms + +Ctrl+C +Sleep 500ms + +# Issues demo +Type "gh own issue --demo" +Sleep 300ms +Enter +Sleep 1.5s + +# Navigate through all issue tabs +Tab +Sleep 600ms +Tab +Sleep 600ms + +# Open selected item — shows "→ Opening ... in browser…" status +Enter +Sleep 2.5s + +# Navigate back to Created tab +Shift+Tab +Sleep 100ms +Shift+Tab +Sleep 500ms + +Ctrl+C diff --git a/flake.nix b/flake.nix index b10c63f..b96eeaa 100644 --- a/flake.nix +++ b/flake.nix @@ -45,6 +45,9 @@ # https://github.com/golangci/golangci-lint golangci-lint + + # demo tools + vhs ]; }; } diff --git a/internal/ui/styles.go b/internal/ui/styles.go index 49bce90..fb73307 100644 --- a/internal/ui/styles.go +++ b/internal/ui/styles.go @@ -78,4 +78,5 @@ func helpView(state list.FilterState) string { var ( DocStyle = lipgloss.NewStyle().Padding(1, 2, 1, 2) WindowStyle = lipgloss.NewStyle().Align(lipgloss.Left) + StatusStyle = lipgloss.NewStyle().Foreground(colorAccent) ) diff --git a/internal/ui/ui.go b/internal/ui/ui.go index 74e57cc..28e8818 100644 --- a/internal/ui/ui.go +++ b/internal/ui/ui.go @@ -6,6 +6,7 @@ import ( "os/exec" "runtime" "strings" + "time" "github.com/charmbracelet/bubbles/list" "github.com/charmbracelet/bubbles/spinner" @@ -62,6 +63,9 @@ func (t Tab) Name() string { return t.name } +// clearStatusMsg is sent after a delay to clear the status bar. +type clearStatusMsg struct{} + type Model struct { tabs []Tab activeTab int @@ -73,6 +77,7 @@ type Model struct { spinner spinner.Model err error fetchCmd tea.Cmd + statusMsg string } // TabsMsg signals that data loading is complete and tabs are ready. @@ -158,6 +163,9 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return m, cmd } return m, nil + case clearStatusMsg: + m.statusMsg = "" + return m, nil } var cmd tea.Cmd @@ -182,7 +190,11 @@ func (m Model) View() string { ) doc.WriteString("\n") - doc.WriteString(helpView(m.tabs[m.activeTab].list.FilterState())) + if m.statusMsg != "" { + doc.WriteString(StatusStyle.Render(m.statusMsg)) + } else { + doc.WriteString(helpView(m.tabs[m.activeTab].list.FilterState())) + } out := DocStyle.Render(doc.String()) return out @@ -294,5 +306,7 @@ func (m Model) handleEnter() (Model, tea.Cmd, bool) { return m, nil, true } - return m, openURLCmd(it.url), true + m.statusMsg = "→ Opening " + it.url + " in browser…" + clearCmd := tea.Tick(2*time.Second, func(time.Time) tea.Msg { return clearStatusMsg{} }) + return m, tea.Batch(openURLCmd(it.url), clearCmd), true }