Repository navigation
suggest-commit-title-limit - Enable on compare pages - #7689
Conversation
|
Interesting, the input field appears to have an attribute It is So that leads me to believe that the selector needs to be changed - happy to change this if it doesn't fit the project code style: Similar selector over here: |
|
@fregante anything else I can do in this PR to make it ready? |
|
Ah, I think I found a bug in my implementation: function getConversationNumber(pathname) {
const [, _owner, _repo, type, prNumber] = pathname.split('/');
return (type === 'pull' || type === 'issues') && Number(prNumber) ? Number(prNumber) : undefined;
}
getConversationNumber('https://github.com/refined-github/refined-github/compare/main...karlhorky:refined-github:test/bun?expand=true')
// => undefinedrefined-github/source/github-helpers/index.ts Lines 15 to 18 in bfbcec1 refined-github/source/features/sync-pr-commit-title.tsx Lines 24 to 26 in 8a57d3b This will warn about a PR titles earlier than necessary, because the suffix will be Fix implementation ideas:
|
👎 Refined GitHub does not try to avoid token usage because token-less usage is not supported: #7231
Good point. We have several options here:
I think being 2 characters off is not a big deal, so even counting 4-digits would be safe for most projects. No HTTP request needed |
|
Looks like fetching the highest issue / PR is possible like this - not sure if there is code like this already somewhere or whether const response = await fetch(`https://api.github.com/repos/refined-github/refined-github/issues?sort=created&direction=desc&per_page=1`);
const result = await response.json();
console.log(result[0].number); // 7726 |
|
That should look something like: const issues = await api.v3('issues?sort=created&direction=desc&per_page=1');
return issues[0].number;But does I think that sorting is actually the default though |
Yep #7726 is a PR Looks like that's the default sorting and direction: const response = await fetch(`https://api.github.com/repos/refined-github/refined-github/issues?per_page=1`);
const result = await response.json();
console.log(result[0].number); // 7727I'll open a PR |
|
Thanks for the release of |



Fixes #7428 (comment)
Test URLs
https://github.com/refined-github/refined-github/compare/main...karlhorky:refined-github:test/bun?expand=true
Screenshot