Skip to content

xfd: avoid overwriting reason when afd outcome is toggled - #2382

Open
siddharthvp wants to merge 1 commit into
masterfrom
afd-target
Open

xfd: avoid overwriting reason when afd outcome is toggled#2382
siddharthvp wants to merge 1 commit into
masterfrom
afd-target

Conversation

@siddharthvp

Copy link
Copy Markdown
Member

When AFD outcome dropdown is switched, reset the reason text only if it ends in "because", the same heuristic used when modifying the AFD target.

Switch from jQuery to plain JS usage.

@siddharthvp

Copy link
Copy Markdown
Member Author

Comment thread src/modules/twinklexfd.js Outdated
$(afdTarget).parent().hide();
}
// Reset reason if the user hasn't modified it much
if (reason.value.endsWith('because ')) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In my testing, doesn't appear to handle the blank case. That is, if a user opens the XFD -> AFD form, then selects Merging, with this patch loaded it currently fills in nothing, instead of filling in "I propose merging because". Looks like a regression that will lead to none of the reasons ever being loaded unless the user types "because " into the reason field before making their selection.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same bug still appears to be present in my testing. As a recap, pre-patch the behavior is to display no default reason when switching to "delete" reason, and to display a default reason when switching to "merge", "redirect", "draftify". Currently this patch never displays anything, unless the user types "because " into the reason box, then switches.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it works for me. Can you try in safe mode?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Like &safemode=1? Won't that disable Twinkle?

When AFD outcome dropdown is switched, reset the reason text only if it ends in "because", the same heuristic used when modifying the AFD target.

Switch from jQuery to plain JS usage.
@FaviFake

FaviFake commented Aug 5, 2026

Copy link
Copy Markdown

In addition to the complaints at WT:TW, I've seen a couple users complain about this issue in their AfD nomination statements.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants