Skip to content
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

isPRFiles doesn't include "PR Files with single commit selected" #172

Closed
fregante opened this issue May 9, 2023 · 1 comment · Fixed by #180
Closed

isPRFiles doesn't include "PR Files with single commit selected" #172

fregante opened this issue May 9, 2023 · 1 comment · Fixed by #180
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@fregante
Copy link
Member

fregante commented May 9, 2023

Example:

https://github.com/refined-github/refined-github/pull/6635/commits/3b9ad8cd926337efa500c0a496639022cd15c74d

https://github.com/refined-github/refined-github/pull/6635/files/0971327bfbf6509d7c2b8b9abb7868228c43f844..715c21222c67ce7f320f979ecd226c356ff565fe

It appears that isPRFiles is always used together with isPRCommit:

https://github.com/refined-github/refined-github/blob/930d7d5a43536c87c65f189092d868c26ec69dee/source/features/restore-file.tsx#L143-L144

@fregante fregante added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels May 9, 2023
@fregante
Copy link
Member Author

fregante commented May 9, 2023

There are several related URLs here:

# PR commit list
https://github.com/refined-github/refined-github/pull/6635/commits

# PR single commit
https://github.com/refined-github/refined-github/pull/6635/commits/3b9ad8c

# PR file list
https://github.com/refined-github/refined-github/pull/6635/files
https://github.com/refined-github/refined-github/pull/6635/files/0971327 # this means "every commit until 0971327"
https://github.com/refined-github/refined-github/pull/6635/files/3b9ad8c..1e9c7cb # this means specifically "Between commit A and B"

The 2nd and 3rd views are similar but the PR single commit:

  • lacks "Viewed" checkbox
  • has commit information

Our current detection for these URL is a bit messy. I think we need:

  • isPRCommitList
  • isPRCommit
  • isPRFiles (which includes the single commit)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Development

Successfully merging a pull request may close this issue.

1 participant