Skip to content

feat: open pull request without close & auto refresh #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025

Conversation

jinwoo1225
Copy link
Owner

No description provided.

@Copilot Copilot AI review requested due to automatic review settings June 4, 2025 03:55
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds an automatic refresh cycle for the PR list with a countdown indicator and changes the “open PR” action so the app remains open instead of quitting.

  • Delegate help menus now show an r key with a live countdown to the next refresh.
  • ListModel in tui.go gains tickMsg/refreshCmd logic and a nextRefresh field for periodic data reload.
  • Keymap updated to include a dedicated Refresh binding for the r key.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
main.go Switched to pointer delegate; updated help funcs to include dynamic “r” refresh key and prevent quitting on open.
internal/ui/tui.go Added tickMsg, refreshedMsg, refreshCmd, nextRefresh timing, and update logic for auto-refresh.
internal/ui/keymap.go Added Refresh binding for r and ensured quit keys are registered.
Comments suppressed due to low confidence (2)

main.go:143

  • Instead of creating a new key.Binding inline for refresh, use the predefined ui.Keys.Refresh binding to maintain consistency across help menus and centralize key mapping.
key.NewBinding(

internal/ui/tui.go:128

  • The new auto-refresh logic (tickMsg, refreshedMsg, refreshCmd, NextRefresh) currently has no test coverage. Adding unit tests for these cases will help prevent regressions.
func (m *ListModel) Init() tea.Cmd {

Comment on lines +67 to +72
err error
wg sync.WaitGroup
)
wg.Add(1)
go func() {
defer wg.Done()
Copy link
Preview

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shared err variable is written by multiple goroutines without synchronization, leading to a data race. Declare separate error variables inside each goroutine or send errors over a channel to avoid concurrent writes.

Suggested change
err error
wg sync.WaitGroup
)
wg.Add(1)
go func() {
defer wg.Done()
// Removed shared err variable to avoid data race.
wg sync.WaitGroup
)
wg.Add(1)
go func() {
defer wg.Done()
var err error

Copilot uses AI. Check for mistakes.

@jinwoo1225 jinwoo1225 merged commit 2839e03 into main Jun 4, 2025
@jinwoo1225 jinwoo1225 deleted the feat/open_without_close_and_auto_refresh branch June 4, 2025 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant