Skip to content

confirm-release - New feature#9049

Merged
SunsetTechuila merged 10 commits into
refined-github:mainfrom
jfagoagas:confirm-release-publish
Mar 8, 2026
Merged

confirm-release - New feature#9049
SunsetTechuila merged 10 commits into
refined-github:mainfrom
jfagoagas:confirm-release-publish

Conversation

@jfagoagas
Copy link
Copy Markdown
Contributor

@jfagoagas jfagoagas commented Mar 7, 2026

Closes #9039

Adds a native confirmation dialog before publishing a release. Targets the button[publish-release="true"] attribute so the "Save draft" button is not affected.

Test URLs

Screenshot

Copilot AI review requested due to automatic review settings March 7, 2026 08:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Refined GitHub feature that prompts for confirmation before publishing a GitHub release, reducing accidental publishes on release create/edit pages.

Changes:

  • Add new confirm-release feature that intercepts publishing and shows a native confirmation dialog.
  • Register the feature in the main feature entrypoint.
  • Document the feature in the README feature list.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

File Description
source/refined-github.ts Registers the new confirm-release feature so it runs with the extension.
source/features/confirm-release.tsx Implements the publish confirmation behavior on release create/edit pages.
readme.md Adds documentation entry for the new feature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/features/confirm-release.tsx Outdated
@jfagoagas jfagoagas changed the title feat(release): confirm-release feat(releases): confirm-release Mar 7, 2026
Comment thread build/__snapshots__/features-meta.json Outdated
@SunsetTechuila SunsetTechuila changed the title feat(releases): confirm-release confirm-release - New feature Mar 7, 2026
Comment thread source/features/confirm-release.tsx Outdated
Copy link
Copy Markdown
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than that, LGTM. I'll let @SunsetTechuila merge this after that condition is removed

@jfagoagas jfagoagas requested a review from SunsetTechuila March 7, 2026 17:32
@SunsetTechuila
Copy link
Copy Markdown
Member

@jfagoagas #9049 (comment)

@jfagoagas
Copy link
Copy Markdown
Contributor Author

@jfagoagas #9049 (comment)

Thanks for the heads up, addressed in 02baf2f

@fregante
Copy link
Copy Markdown
Member

fregante commented Mar 7, 2026

What we've been trying to say:

  • do not use event.submitter, drop that selector check altogether
  • use a better selector than just form

@SunsetTechuila
Copy link
Copy Markdown
Member

It's not that easy - GitHub captures the submission event before us. I'll take it from there

@SunsetTechuila SunsetTechuila requested a review from fregante March 8, 2026 08:17
@fregante
Copy link
Copy Markdown
Member

fregante commented Mar 8, 2026

GitHub captures the submission event before us

If GitHub actually triggers and awaits a real submit event, we should be able to capture it by attaching the listener on the form element rather than using event delegation. Can you try that? The current code is a bit fickle.

The code would look something like observe(form selector, form => form.addEventListener('submit', fn, true))

Also I just remembered we have avoid-accidental-submissions that does the same thing, except differently. Do you feel this should be rolled into that feature and use the same logic instead of confirm()?

@fregante
Copy link
Copy Markdown
Member

fregante commented Mar 8, 2026

I'm also ok with merging this as is and keep my changes as a wishlist.

@SunsetTechuila
Copy link
Copy Markdown
Member

SunsetTechuila commented Mar 8, 2026

The code would look something like observe(form selector, form => form.addEventListener('submit', fn, true))

This doesn't work - they added a window-level listener with capture: true

Also I just remembered we have avoid-accidental-submissions that does the same thing, except differently. Do you feel this should be rolled into that feature and use the same logic instead of confirm()?

avoid-accidental-submissions only prevents submission on the first Enter press, nothing more. If you agree that we should show a confirmation dialog before publishing a new release, then - as part of avoid-accidental-submissions - it would be a special case. Personally, I would leave everything as it is

@fregante
Copy link
Copy Markdown
Member

fregante commented Mar 8, 2026

only prevents submission on the first Enter press, nothing more

Yes, we thought you get one chance at fat-fingering while filling that form. I guess the release page is longer and has more chances though.

Good to go

@SunsetTechuila
Copy link
Copy Markdown
Member

SunsetTechuila commented Mar 8, 2026

So it should work.

It doesn't 🤷‍♂️. Maybe it's because requestSubmit, which is called by quickSubmit, re-dispatches the event as a custom one. There is a lot going on, I don't know

@SunsetTechuila SunsetTechuila merged commit 187d419 into refined-github:main Mar 8, 2026
8 checks passed
@SunsetTechuila
Copy link
Copy Markdown
Member

@jfagoagas Thank you

@jfagoagas
Copy link
Copy Markdown
Contributor Author

@jfagoagas Thank you

Thank you both! Great review 🙌

@fregante
Copy link
Copy Markdown
Member

fregante commented Apr 7, 2026

I got asked 3 times and I hate it already. See #9169

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

feature: Confirm dialog before publishing a release

4 participants