sindresorhus/refined-github

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Add undo button for `sync-pr-commit-title` and `clear-pr-merge-commit-message` #4606

fregante posted onGitHub

Since these 2 features are "destructive", maybe we should add a button to allow the user to undo them in place.

<img width="704" alt="Screen Shot" src="https://user-images.githubusercontent.com/1402241/126858267-7bfce07f-f625-4b8b-ab00-ed4ec9bc3a4b.png">

How:

  • both features should try to add that notice if they changed the content
  • the original value of the title is stored in the value attribute and the textareas’s is in the textContent property
  • the button should read these 2 original values, set them back, and disappear

The logic should probably be in sync-pr-commit-title.tsx:

  • export function addNotice() {add notice if it doesn't exist}
  • function onButtonClick() {removeButton && removesync-pr-commit-title’s checkbox}

Related:

FYI: sync-pr-commit-title has 2 parts:

  • sets the commit title to the PR title
  • changes the PR title

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests