Repository navigation
Conversation
use-first-commit-message-for-new-prs: do not replace title on page reloaduse-first-commit-message-for-new-prs - Do not replace title on page reload
There was a problem hiding this comment.
I'd be more comfortable targeting this specific GitHub behavior rather than guess the user action. It seems to be easy at this point, assuming that our code runs before Github's session:resume event:
function init () {
if (sessionStorage.getItem(`session-resume:/${getRepo()?.nameWithOwner}/compare`)) {
return false;
}
// …
}|
Hey @fregante, sorry for the delay, I gave it a try but it doesn't work, the code runs before the field is reloaded (the title is the branch name, which is the default) but there is no |
|
session:resume is an event on window. Either way we don't need to do anything about it |
I'm not sure I understand, do you want me to do anything about this PR then ? |
I posted the piece of code I'd like to see inside |
As I said in my previous message I tried replacing the block I added with the one you wrote using |
Closes #7191.
Do not set the title to the first commit message on page reload.
It avoids overwriting user input.
The feature still works on page
load, but not onreload, github just restores whatever input was before, whether the first commit title or user input.Test URLs
https://github.com/pgimalac/refined-github/compare/main...pgimalac:refined-github:pgimalac/fit-rendered-markdown?expand=1
Screenshot
Enregistrement.de.l.ecran.2023-12-31.a.17.53.54.mov