From 76593f1ebc1134dafb2bc444755988cfbb62826a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Dec 2025 11:14:03 +0000 Subject: [PATCH 1/5] Initial plan From eaa6adc0ee41ba0124ad26cfe39feb744c5f713d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Dec 2025 11:19:29 +0000 Subject: [PATCH 2/5] Initial exploration - preparing to implement auto-refresh feature Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- src/@types/vscode.proposed.chatParticipantAdditions.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/@types/vscode.proposed.chatParticipantAdditions.d.ts b/src/@types/vscode.proposed.chatParticipantAdditions.d.ts index 71520fa1ec..aa7001a3d2 100644 --- a/src/@types/vscode.proposed.chatParticipantAdditions.d.ts +++ b/src/@types/vscode.proposed.chatParticipantAdditions.d.ts @@ -105,6 +105,7 @@ declare module 'vscode' { isComplete?: boolean; toolSpecificData?: ChatTerminalToolInvocationData; fromSubAgent?: boolean; + presentation?: 'hidden' | 'hiddenAfterComplete' | undefined; constructor(toolName: string, toolCallId: string, isError?: boolean); } From 127af23f6b9262424cfe64ab28c1846eec074777 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Dec 2025 11:25:59 +0000 Subject: [PATCH 3/5] Add auto-refresh configuration for pull requests queries Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- package.json | 6 +++++ package.nls.json | 1 + src/common/settingKeys.ts | 1 + src/view/prsTreeDataProvider.ts | 43 ++++++++++++++++++++++++++++++++- 4 files changed, 50 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 121adffe67..115129dc12 100644 --- a/package.json +++ b/package.json @@ -263,6 +263,12 @@ } ] }, + "githubPullRequests.queries.refreshInterval": { + "type": "number", + "default": 0, + "minimum": 0, + "markdownDescription": "%githubPullRequests.queries.refreshInterval.markdownDescription%" + }, "githubPullRequests.labelCreated": { "type": "array", "items": { diff --git a/package.nls.json b/package.nls.json index 73c02b7684..f1fecfd410 100644 --- a/package.nls.json +++ b/package.nls.json @@ -29,6 +29,7 @@ "githubPullRequests.queries.markdownDescription": "Specifies what queries should be used in the GitHub Pull Requests tree. All queries are made against **the currently opened repos**. Each query object has a `label` that will be shown in the tree and a search `query` using [GitHub search syntax](https://help.github.com/en/articles/understanding-the-search-syntax). By default these queries define the categories \"Copilot on My Behalf\", \"Local Pull Request Branches\", \"Waiting For My Review\", \"Assigned To Me\" and \"Created By Me\". If you want to preserve these, make sure they are still in the array when you modify the setting. \n\n**Variables available:**\n - `${user}` - currently logged in user \n - `${owner}` - repository owner, ex. `microsoft` in `microsoft/vscode` \n - `${repository}` - repository name, ex. `vscode` in `microsoft/vscode` \n - `${today-Nd}` - date N days ago, ex. `${today-7d}` becomes `2025-01-04`\n\n**Example custom queries:**\n```json\n\"githubPullRequests.queries\": [\n {\n \"label\": \"Waiting For My Review\",\n \"query\": \"is:open review-requested:${user}\"\n },\n {\n \"label\": \"Mentioned Me\",\n \"query\": \"is:open mentions:${user}\"\n },\n {\n \"label\": \"Recent Activity\",\n \"query\": \"is:open updated:>${today-7d}\"\n }\n]\n```", "githubPullRequests.queries.label.description": "The label to display for the query in the Pull Requests tree.", "githubPullRequests.queries.query.description": "The GitHub search query for finding pull requests. Use GitHub search syntax with variables like ${user}, ${owner}, ${repository}. Example: 'is:open author:${user}' finds your open pull requests.", + "githubPullRequests.queries.refreshInterval.markdownDescription": "Automatically refresh pull requests queries at the specified interval. Set to `0` to disable auto-refresh. The minimum refresh interval is 5 minutes.", "githubPullRequests.queries.copilotOnMyBehalf": "Copilot on My Behalf", "githubPullRequests.queries.waitingForMyReview": "Waiting For My Review", "githubPullRequests.queries.assignedToMe": "Assigned To Me", diff --git a/src/common/settingKeys.ts b/src/common/settingKeys.ts index 1376c4c7bc..b5f554d417 100644 --- a/src/common/settingKeys.ts +++ b/src/common/settingKeys.ts @@ -23,6 +23,7 @@ export type NotificationVariants = 'off' | 'pullRequests'; export const POST_CREATE = 'postCreate'; export const POST_DONE = 'postDone'; export const QUERIES = 'queries'; +export const QUERIES_REFRESH_INTERVAL = 'queries.refreshInterval'; export const PULL_REQUEST_LABELS = 'labelCreated'; export const FOCUSED_MODE = 'focusedMode'; export const CREATE_DRAFT = 'createDraft'; diff --git a/src/view/prsTreeDataProvider.ts b/src/view/prsTreeDataProvider.ts index e433636fca..0e35645d5a 100644 --- a/src/view/prsTreeDataProvider.ts +++ b/src/view/prsTreeDataProvider.ts @@ -11,7 +11,7 @@ import { AuthProvider } from '../common/authentication'; import { commands, contexts } from '../common/executeCommands'; import { Disposable } from '../common/lifecycle'; import Logger from '../common/logger'; -import { FILE_LIST_LAYOUT, PR_SETTINGS_NAMESPACE, QUERIES, REMOTES } from '../common/settingKeys'; +import { FILE_LIST_LAYOUT, PR_SETTINGS_NAMESPACE, QUERIES, QUERIES_REFRESH_INTERVAL, REMOTES } from '../common/settingKeys'; import { ITelemetry } from '../common/telemetry'; import { createPRNodeIdentifier } from '../common/uri'; import { EXTENSION_ID } from '../constants'; @@ -47,6 +47,7 @@ export class PullRequestsTreeDataProvider extends Disposable implements vscode.T private _initialized: boolean = false; private _notificationsProvider?: NotificationsManager; private _notificationClearTimeout: NodeJS.Timeout | undefined; + private _autoRefreshTimer: NodeJS.Timeout | undefined; get view(): vscode.TreeView { return this._view; @@ -94,6 +95,10 @@ export class PullRequestsTreeDataProvider extends Disposable implements vscode.T clearTimeout(this._notificationClearTimeout); this._notificationClearTimeout = undefined; } + if (this._autoRefreshTimer) { + clearInterval(this._autoRefreshTimer); + this._autoRefreshTimer = undefined; + } } }); @@ -150,6 +155,9 @@ export class PullRequestsTreeDataProvider extends Disposable implements vscode.T if (e.affectsConfiguration(`${PR_SETTINGS_NAMESPACE}.${FILE_LIST_LAYOUT}`)) { this.refreshAll(); } + if (e.affectsConfiguration(`${PR_SETTINGS_NAMESPACE}.${QUERIES_REFRESH_INTERVAL}`)) { + this.setupAutoRefresh(); + } })); this._register(this._view.onDidChangeCheckboxState(e => TreeUtils.processCheckboxUpdates(e, []))); @@ -160,6 +168,39 @@ export class PullRequestsTreeDataProvider extends Disposable implements vscode.T this._register(this._view.onDidCollapseElement(collapsed => { this.prsTreeModel.updateExpandedQueries(collapsed.element, false); })); + + // Initialize auto-refresh timer + this.setupAutoRefresh(); + } + + private setupAutoRefresh(): void { + // Clear existing timer if any + if (this._autoRefreshTimer) { + clearInterval(this._autoRefreshTimer); + this._autoRefreshTimer = undefined; + } + + // Get the refresh interval setting in minutes + const config = vscode.workspace.getConfiguration(PR_SETTINGS_NAMESPACE); + const intervalMinutes = config.get(QUERIES_REFRESH_INTERVAL, 0); + + // If interval is 0, auto-refresh is disabled + if (intervalMinutes === 0) { + return; + } + + // Enforce minimum of 5 minutes + const actualIntervalMinutes = Math.max(intervalMinutes, 5); + const intervalMs = actualIntervalMinutes * 60 * 1000; + + // Set up the timer + this._autoRefreshTimer = setInterval(() => { + Logger.appendLine('Auto-refreshing pull requests queries', 'PullRequestsTreeDataProvider'); + this.prsTreeModel.forceClearCache(); + this.refreshAllQueryResults(true); + }, intervalMs); + + Logger.appendLine(`Auto-refresh enabled with interval of ${actualIntervalMinutes} minutes`, 'PullRequestsTreeDataProvider'); } private filterNotificationsToKnown(notifications: PullRequestModel[]): PullRequestModel[] { From d2fa0b9ea336ab5302eacf34b02a2548bd527b62 Mon Sep 17 00:00:00 2001 From: Alex Ross <38270282+alexr00@users.noreply.github.com> Date: Wed, 17 Dec 2025 15:54:03 +0100 Subject: [PATCH 4/5] Better setting name --- package.json | 4 ++-- package.nls.json | 2 +- src/common/settingKeys.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 115129dc12..dbf7652914 100644 --- a/package.json +++ b/package.json @@ -263,11 +263,11 @@ } ] }, - "githubPullRequests.queries.refreshInterval": { + "githubPullRequests.queriesRefreshInterval": { "type": "number", "default": 0, "minimum": 0, - "markdownDescription": "%githubPullRequests.queries.refreshInterval.markdownDescription%" + "markdownDescription": "%githubPullRequests.queriesRefreshInterval.markdownDescription%" }, "githubPullRequests.labelCreated": { "type": "array", diff --git a/package.nls.json b/package.nls.json index f1fecfd410..228a11dc89 100644 --- a/package.nls.json +++ b/package.nls.json @@ -29,7 +29,7 @@ "githubPullRequests.queries.markdownDescription": "Specifies what queries should be used in the GitHub Pull Requests tree. All queries are made against **the currently opened repos**. Each query object has a `label` that will be shown in the tree and a search `query` using [GitHub search syntax](https://help.github.com/en/articles/understanding-the-search-syntax). By default these queries define the categories \"Copilot on My Behalf\", \"Local Pull Request Branches\", \"Waiting For My Review\", \"Assigned To Me\" and \"Created By Me\". If you want to preserve these, make sure they are still in the array when you modify the setting. \n\n**Variables available:**\n - `${user}` - currently logged in user \n - `${owner}` - repository owner, ex. `microsoft` in `microsoft/vscode` \n - `${repository}` - repository name, ex. `vscode` in `microsoft/vscode` \n - `${today-Nd}` - date N days ago, ex. `${today-7d}` becomes `2025-01-04`\n\n**Example custom queries:**\n```json\n\"githubPullRequests.queries\": [\n {\n \"label\": \"Waiting For My Review\",\n \"query\": \"is:open review-requested:${user}\"\n },\n {\n \"label\": \"Mentioned Me\",\n \"query\": \"is:open mentions:${user}\"\n },\n {\n \"label\": \"Recent Activity\",\n \"query\": \"is:open updated:>${today-7d}\"\n }\n]\n```", "githubPullRequests.queries.label.description": "The label to display for the query in the Pull Requests tree.", "githubPullRequests.queries.query.description": "The GitHub search query for finding pull requests. Use GitHub search syntax with variables like ${user}, ${owner}, ${repository}. Example: 'is:open author:${user}' finds your open pull requests.", - "githubPullRequests.queries.refreshInterval.markdownDescription": "Automatically refresh pull requests queries at the specified interval. Set to `0` to disable auto-refresh. The minimum refresh interval is 5 minutes.", + "githubPullRequests.queriesRefreshInterval.markdownDescription": "Automatically refresh pull requests queries at the specified interval. Set to `0` to disable auto-refresh. The minimum refresh interval is 5 minutes.", "githubPullRequests.queries.copilotOnMyBehalf": "Copilot on My Behalf", "githubPullRequests.queries.waitingForMyReview": "Waiting For My Review", "githubPullRequests.queries.assignedToMe": "Assigned To Me", diff --git a/src/common/settingKeys.ts b/src/common/settingKeys.ts index b5f554d417..4e82eecbf2 100644 --- a/src/common/settingKeys.ts +++ b/src/common/settingKeys.ts @@ -23,7 +23,7 @@ export type NotificationVariants = 'off' | 'pullRequests'; export const POST_CREATE = 'postCreate'; export const POST_DONE = 'postDone'; export const QUERIES = 'queries'; -export const QUERIES_REFRESH_INTERVAL = 'queries.refreshInterval'; +export const QUERIES_REFRESH_INTERVAL = 'queriesRefreshInterval'; export const PULL_REQUEST_LABELS = 'labelCreated'; export const FOCUSED_MODE = 'focusedMode'; export const CREATE_DRAFT = 'createDraft'; From 184edcb7114631b7db611a6f0fba91455ddf2dae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 17 Dec 2025 15:02:07 +0000 Subject: [PATCH 5/5] Reset auto-refresh timer when manual refresh occurs Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --- .../vscode.proposed.chatSessionsProvider.d.ts | 5 ++++ src/view/prsTreeDataProvider.ts | 23 +++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/@types/vscode.proposed.chatSessionsProvider.d.ts b/src/@types/vscode.proposed.chatSessionsProvider.d.ts index bd4e624430..772fc387b9 100644 --- a/src/@types/vscode.proposed.chatSessionsProvider.d.ts +++ b/src/@types/vscode.proposed.chatSessionsProvider.d.ts @@ -95,6 +95,11 @@ declare module 'vscode' { */ description?: string | MarkdownString; + /** + * An optional badge that provides additional context about the chat session. + */ + badge?: string | MarkdownString; + /** * An optional status indicating the current state of the session. */ diff --git a/src/view/prsTreeDataProvider.ts b/src/view/prsTreeDataProvider.ts index 0e35645d5a..54b9b0c53d 100644 --- a/src/view/prsTreeDataProvider.ts +++ b/src/view/prsTreeDataProvider.ts @@ -197,12 +197,20 @@ export class PullRequestsTreeDataProvider extends Disposable implements vscode.T this._autoRefreshTimer = setInterval(() => { Logger.appendLine('Auto-refreshing pull requests queries', 'PullRequestsTreeDataProvider'); this.prsTreeModel.forceClearCache(); - this.refreshAllQueryResults(true); + this.tryReset(true); + this.fireRefresh(); }, intervalMs); Logger.appendLine(`Auto-refresh enabled with interval of ${actualIntervalMinutes} minutes`, 'PullRequestsTreeDataProvider'); } + private resetAutoRefreshTimer(): void { + // Only reset if auto-refresh is currently enabled + if (this._autoRefreshTimer) { + this.setupAutoRefresh(); + } + } + private filterNotificationsToKnown(notifications: PullRequestModel[]): PullRequestModel[] { return notifications.filter(notification => { if (!this.prsTreeModel.hasPullRequest(notification)) { @@ -414,9 +422,7 @@ export class PullRequestsTreeDataProvider extends Disposable implements vscode.T } } - private refreshAllQueryResults(reset?: boolean) { - this.tryReset(!!reset); - + private fireRefresh() { if (!this._children || this._children.length === 0) { this._onDidChangeTreeData.fire(); return; @@ -429,6 +435,15 @@ export class PullRequestsTreeDataProvider extends Disposable implements vscode.T this.refreshQueryResultsForFolder(); } + private refreshAllQueryResults(reset?: boolean) { + this.tryReset(!!reset); + + // Reset the auto-refresh timer whenever a refresh is triggered + this.resetAutoRefreshTimer(); + + this.fireRefresh(); + } + private refreshQueryResultsForFolder(manager?: WorkspaceFolderNode, reset?: boolean) { if (!manager && this._children[0] instanceof WorkspaceFolderNode) { // Not permitted. There're multiple folder nodes, therefore must specify which one to refresh