You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
use-first-commit-message-for-new-prs overrides user set title when refreshing page #7191
When opening a PR and refreshing the page, Github will keep the previously entered title and body.
When use-first-commit-message-for-new-prs is enabled, refreshing the page will overwrite the title with the first commit.
I guess the above URL will only work if you have permissions on the source/target repo, you can use any URL for opening a PR.
Note that it doesn't seem to reproduce for cross-repo PRs.
changed the title [-]use-first-commit-message-for-new-prs overrides user set title when refreshing page[/-][+]`use-first-commit-message-for-new-prs` overrides user set title when refreshing page[/+]on Dec 29, 2023
I assumed the first time you open the page the feature replaces the title with the first commit, and then when you refresh GIthub restores whatever was in the field, whether it's the first commit or the user wrote something.
I'll give it a try and open a PR if it works properly.
Activity
fregante commentedon Dec 29, 2023
Possible solutions:
session:resumeeventI think that's what's refilling the field here
[-]use-first-commit-message-for-new-prs overrides user set title when refreshing page[/-][+]`use-first-commit-message-for-new-prs` overrides user set title when refreshing page[/+]pgimalac commentedon Dec 30, 2023
@fregante what do you think of just not replacing the title if the page was reloaded, using the logic described in https://stackoverflow.com/questions/5004978/check-if-page-gets-reloaded-or-refreshed-in-javascript/53307588#53307588 ?
Let me know if that would work for you, I can open a PR.
fregante commentedon Dec 31, 2023
I think we still need to cover reloads for the feature to work normally, right?
If you don't touch the field, what happens when you reload the page? Does first commit stay in the title?
pgimalac commentedon Dec 31, 2023
I assumed the first time you open the page the feature replaces the title with the first commit, and then when you refresh GIthub restores whatever was in the field, whether it's the first commit or the user wrote something.
I'll give it a try and open a PR if it works properly.
fregante commentedon Dec 31, 2023
That may be right, it should be tested:
pgimalac commentedon Dec 31, 2023
I tested what you described and it works properly.
I implemented a fix and it also works as expected. I'll open a PR.