feat: add "other" option and notes field to image deletion reasons list#6704
Open
amahuli03 wants to merge 9 commits intocommons-app:mainfrom
Open
feat: add "other" option and notes field to image deletion reasons list#6704amahuli03 wants to merge 9 commits intocommons-app:mainfrom
amahuli03 wants to merge 9 commits intocommons-app:mainfrom
Conversation
…field and "other" option
Initially had designed it to allow reviewers to submit only notes with no boxes checked. This doesn't make sense Also initially designed it to allow reviewers to submit image for deletion with only "Other" option checked but no notes provided. This also doesn't make sense.
Member
|
Would you mind changing "Other notes" to "Justification"? |
the "OK" button does not enable until there is both a box checked AND some text in the justification text field. The second requirement is the new one
The previous alertDialogPositiveButtonDisableTest() was a no-op. getListener() returned null so the simulated click was silently skipped, and the button defaulted to enabled regardless of any logic. The new test actually checks a checkbox via the view hierarchy and asserts the button stays disabled when no justification text has been entered.
…teraction The previous alertDialogPositiveButtonEnableTest() was a no-op. getListener() returns null so the simulated click was silently skipped, and the button defaulted to enabled regardless of any logic. The new test checks a checkbox and enters justification text via the view hierarchy, asserting the button enabled only when both conditions are met.
Author
|
@nicolas-raoul Done! Let me know if there's any other changes or clarfication needed. |
|
✅ Generated APK variants! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description (required)
The deletion nomination options previously provided vague deletion reasons and no way for users to specify reasons other than the ones listed and/or a justification in text form. This made deletion reasons vague and unhelpful.
Now the deletion reasons list for "out of scope" gives the "other" option. Both "out of scope" and "copyright" deletion dialog pages require a justification in text in order to nominate an image for deletion.
Fixes #6643
Fixes part of #6710
What changes did you make and why?
modified
app/src/main/java/fr/free/nrw/commons/delete/DeleteHelper.kt:setMultiChoiceItems()with custom dialog layoutOther: specify belowoption in spam reasons listmodified
app/src/main/res/values/strings.xml:delete_helper_ask_spam_other--this is "Other: specify below" optiondelete_helper_other_notes_hint-- this is notes sectionadded
app/src/main/res/layout/dialog_deletion_reason.xml:Update (March 6, 2026): Following @nicolas-raoul 's comment, I have updated the hint in the text field to say "Justification" instead of "Other notes"
Update (March 6, 2026): Per #6710, I have updated this PR to enforce justification text in order to submit a deletion nomination.
Tests performed (required)
Performed manual testing, observing behavior and logs that I added for testing this screen.
Navigated to review -> click "No" to nominate image for deletion.
Verified that "Other" option and notes text field appears with correct strings.
Tested with all checkbox and text combinations.
Verified that "OK" button is only enabled if either
Checked Logcat output to confirm deletion reasons properly combine selections and custom text.
(Update March 6, 2026) I added 2 new tests in
DeleteHelperTest.kt:I realized that the existing unit tests for this logic were not actually testing anything, since the listener they used to simulate checkbox clicks was never assigned. The simulated interaction was skipped every time, making the tests pass by default, not because the logic was correct. I replaced them with 2 new tests:
buttonRemainsDisabledWhenCheckboxCheckedButNoText: verifies that checking a delation reason checkbox alone is not enough to enable the OK buttonbuttonEnabledWhenCheckboxCheckedAndTextEntered: verifies that the OK button enabled correctly when both a checkbox is checks and justification text is provided.Screenshots (for UI changes only)