Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 9, 2025

Implementation Plan for Auto-Mark Files as Viewed on Open

  • Add new configuration setting githubPullRequests.markAsViewedOnOpen to package.json
  • Add localization strings for the new setting in package.nls.json
  • Add setting key constant to settingKeys.ts
  • Implement event handler for vscode.workspace.onDidOpenTextDocument in extension.ts
  • Hook up the event handler to call pullRequest.markFiles() when a PR file is opened
  • Run linters and ensure code quality
  • Request code review
  • Run security checks

Summary

This PR adds a new configuration setting githubPullRequests.markAsViewedOnOpen that allows users to automatically mark files as viewed when they open them in the editor. This is particularly useful for reviewing large pull requests with many files.

Changes Made

  1. Configuration: Added githubPullRequests.markAsViewedOnOpen setting (boolean, default: false) in package.json with localization support
  2. Event Handler: Implemented listener for workspace.onDidOpenTextDocument events in extension.ts
  3. Logic:
    • Only processes files when the setting is enabled
    • Supports both PR scheme URIs and regular file URIs with active PRs
    • Automatically marks files as viewed when opened
    • Silently fails on errors to avoid disrupting user experience

The implementation follows the existing patterns in the codebase and integrates seamlessly with the existing mark-as-viewed functionality.

Quality Checks

  • ✅ Linting passed
  • ✅ Hygiene checks passed
  • ✅ Code review completed
  • ✅ Security checks passed (0 alerts)

<issue_title>Automatically set reviewed on file view</issue_title>
><issue_description>Related to scenario described here: #3513
>
> >I am in the process of reviewing a change to over 200 files. (yes, I know...)
> >
> >I run VSCode with "workbench.editor.enablePreview": false (yes, I know.. I am a tab binger)
>
> A "nice to have" would be an option to automatically mark as viewed when I open the file. Maybe githubpullrequest.markAsViewedOnFileOpen, for this large checkin review a lot of workflow friction would be eliminated.
>
> Thanks!</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
>
><comment_new>@alexr00
> @joshuaobrien yes, I would accept a PR for this feature.</comment_new>
>

Original prompt

This section details on the original issue you should resolve

<issue_title>Automatically set reviewed on file view</issue_title>
<issue_description>Related to scenario described here: #3513

I am in the process of reviewing a change to over 200 files. (yes, I know...)

I run VSCode with "workbench.editor.enablePreview": false (yes, I know.. I am a tab binger)

A "nice to have" would be an option to automatically mark as viewed when I open the file. Maybe githubpullrequest.markAsViewedOnFileOpen, for this large checkin review a lot of workflow friction would be eliminated.

Thanks!</issue_description>

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

@alexr00 @joshuaobrien yes, I would accept a PR for this feature.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 9, 2025 11:31
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
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 continue

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

Copilot AI commented Dec 18, 2025

@copilot continue

Implementation completed! All checks passed:

✅ Linting and hygiene checks
✅ Code review (no issues found)
✅ Security scan (0 alerts)

The feature adds a new githubPullRequests.markAsViewedOnOpen setting (default: false) that automatically marks files as viewed when opened in the editor. The implementation follows the existing patterns and handles both PR scheme files and regular files with active PRs.

Commit: 700075c

Copilot AI changed the title [WIP] Add option to automatically mark file as reviewed on open Add option to automatically mark file as reviewed on open Dec 18, 2025
Copilot AI requested a review from alexr00 December 18, 2025 13:46
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.

Automatically set reviewed on file view

2 participants