Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

Implementation Plan for Pull Requests Auto-Refresh

  • Add configuration setting githubPullRequests.queriesRefreshInterval in package.json (number type, minimum 5 minutes, default 0 for no auto-refresh)
  • Add localized description string in package.nls.json
  • Add constant for the new setting in src/common/settingKeys.ts
  • Implement auto-refresh timer logic in src/view/prsTreeDataProvider.ts:
    • Add timer state management (interval ID, configuration listener)
    • Create method to start/stop/restart timer based on setting value
    • Convert minutes to milliseconds and ensure minimum 5 minute enforcement
    • Call existing refresh logic when timer fires
    • Clean up timer on dispose
    • Reset timer whenever manual refresh occurs (prevents immediate auto-refresh after manual refresh)
  • Compile and verify no TypeScript errors
  • Run linting and hygiene checks
  • Rebase on latest main branch and resolve conflicts

Changes Made

Timer Reset Logic

Added resetAutoRefreshTimer() method that restarts the auto-refresh timer whenever refreshAllQueryResults() is called. This prevents the auto-refresh from firing immediately after a manual refresh.

Refactored Refresh Logic

  • Extracted fireRefresh() method containing the core refresh logic
  • refreshAllQueryResults() now calls resetAutoRefreshTimer() to restart the countdown
  • Auto-refresh timer callback uses fireRefresh() directly to avoid recursive resets

This ensures that any manual refresh (via UI button, configuration change, or other triggers) resets the auto-refresh waiting period.

Rebase and Conflict Resolution

Rebased the branch on the latest main branch and resolved merge conflicts in src/common/settingKeys.ts where new settings were added in main.

Original prompt

This section details on the original issue you should resolve

<issue_title>Allow auto refresh of the pull requests</issue_title>
<issue_description>Please add a new configuration option to automatically refresh the queries in the pull requests section, so there is no need to refresh them manually.

This configuration option should be a number: 0 means no auto-refresh, while a positive value is the refresh rate.
</issue_description>

<agent_instructions>Add the pull requests view refresh frequency setting for a number of minutes. Don't allow it to be less than 5 minutes. </agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 10, 2025 11:19
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Add auto refresh configuration for pull requests Add auto-refresh configuration for pull requests queries Dec 10, 2025
Copilot AI requested a review from alexr00 December 10, 2025 11:38
Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

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

@copilot, good start. Reset the refresh waiting time whenever this.refreshAllQueryResults(true) is called.

Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

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

@copilot, also update the branch + resolve conflicts.

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 17, 2025

@copilot, good start. Reset the refresh waiting time whenever this.refreshAllQueryResults(true) is called.

Done in commit 184edcb. The auto-refresh timer now resets whenever refreshAllQueryResults(true) is called, preventing immediate auto-refresh after manual refreshes.

Copy link
Contributor Author

Copilot AI commented Dec 17, 2025

@copilot, also update the branch + resolve conflicts.

I've successfully rebased the branch on the latest main and resolved all merge conflicts in src/common/settingKeys.ts. The rebase is complete in commit 745f4a8.

However, I'm unable to force push the rebased branch automatically. The branch needs to be force-pushed to update the PR. Could you please force push the copilot/add-pull-request-refresh-option branch, or let me know how to proceed with the force push?

The branch is currently at commit 745f4a8 (Reset auto-refresh timer when manual refresh occurs) and is rebased on top of 4c47a03 (Localize template strings).

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.

Allow auto refresh of the pull requests

2 participants