Page MenuHomePhabricator

Hide report button for ineligible users
Closed, ResolvedPublic

Description

Background

Currently, the report button is shown to all logged-in users, and eligibility is only enforced later in the flow. This results in users being blocked after initiating the reporting process, which creates a poor user experience. The report button should only be visible to users who meet the eligibility criteria.

Current behavior:

  • Report button is visible to all of logged-in users.
  • Eligibility is checked only after the user enters the flow.

Expected behavior:

  • The report button is only shown to users who meet all eligibility criteria.
  • Ineligible users should not see the report entry point at all.

Task

Move eligibility checks to only show the report button if the user meets all eligibility criteria:

  • Logged-in
  • Account age > 3 hours
  • At least 1 edit
  • Not currently blocked

Acceptance criteria:

  • Report button is not visible to users who do not meet eligibility criteria

Event Timeline

Change #1276718 had a related patch set uploaded (by Ayush8620; author: Ayush8620):

[mediawiki/extensions/ReportIncident@master] Hide report button for ineligible users

https://gerrit.wikimedia.org/r/1276718

Submitted a patch to hide the report button for users who do not meet eligibility requirements by enforcing checks at the UI entry point.

Review here

Madalina updated the task description. (Show Details)

Removed the "Verified email" from the eligibility list as we're already showing a prompt to users asking them to validate.

Change #1277063 had a related patch set uploaded (by STran; author: STran):

[mediawiki/extensions/ReportIncident@master] Only show the "Report" button/link to users who can send a report

https://gerrit.wikimedia.org/r/1277063

Change #1277077 had a related patch set uploaded (by Ayush8620; author: Ayush8620):

[mediawiki/extensions/ReportIncident@master] Hide report button for ineligible users

https://gerrit.wikimedia.org/r/1277077

Change #1277077 abandoned by Ayush8620:

[mediawiki/extensions/ReportIncident@master] Hide report button for ineligible users

Reason:

Dublicated

https://gerrit.wikimedia.org/r/1277077

Thanks! I removed the verified email requirement from the eligibility checks and updated the corresponding unit tests.

The report button is now shown to users regardless of email confirmation status, while still enforcing the remaining criteria (logged-in, minimum account age, at least one edit, not blocked).

Review here

Change #1277063 merged by jenkins-bot:

[mediawiki/extensions/ReportIncident@master] Only show the "Report" button/link to users who can send a report

https://gerrit.wikimedia.org/r/1277063

Change #1276718 abandoned by Mszwarc:

[mediawiki/extensions/ReportIncident@master] Hide report button for ineligible users

Reason:

Duplicate patch for https://phabricator.wikimedia.org/T424230 Tran's (who first claimed the task) patch was merged

https://gerrit.wikimedia.org/r/1276718