Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Binary file added demo/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions demo/demo.tape
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@

# https://github.com/golangci/golangci-lint
golangci-lint

# demo tools
vhs
];
};
}
Expand Down
1 change: 1 addition & 0 deletions internal/ui/styles.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
18 changes: 16 additions & 2 deletions internal/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os/exec"
"runtime"
"strings"
"time"

"github.com/charmbracelet/bubbles/list"
"github.com/charmbracelet/bubbles/spinner"
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
}