Page MenuHomePhabricator

Sense should have at least one Gloss
Closed, ResolvedPublic3 Story Points

Description

Problem:
As an editor I want to be able to remove Glosses from a Sense in order to fix mistakes. However each Sense must have at least one Gloss in order to be able to identify what it is.

Acceptance criteria:

  • I can not remove the last Gloss of a Sense
  • I can remove all other Glosses of a Sense

BDD
GIVEN I am on a Lexeme page
AND I edit a Sense
WHEN I try to remove the last Gloss of a Sense
THEN the remove Gloss action is grayed out

Notes:

  • What about the API? It shouldn't be allowed there either.

Event Timeline

Lydia_Pintscher updated the task description. (Show Details)

Similar to the way removing the last representation of a form is not allowed.

Addshore added a subscriber: Addshore.EditedJun 26 2018, 11:16 AM

Similar to the way removing the last representation of a form is not allowed.

Example of that on forms in the current state would be:

Example response from the API:

{"errors":[{"code":"unprocessable-request","data":{"messages":[{"name":"wikibaselexeme-api-error-form-must-have-at-least-one-representation","parameters":[],"html":{"*":"Form must have at least one representation"}}]},"module":"main","*":"Form must have at least one representation"}],"servedby":"deployment-mediawiki-09","*":"See https://wikidata.beta.wmflabs.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."}
RazShuty updated the task description. (Show Details)Jun 26 2018, 11:18 AM
RazShuty set the point value for this task to 3.

Should the UI also prevent this (disable the “remove” of the last gloss, or disable the “save” button if all glosses are gone), or should there only be a backend error? (Note that for forms, the UI currently doesn’t delete the last representation, according to @Addshore.)

Vvjjkkii renamed this task from Sense should have at least one Gloss to ceaaaaaaaa.Jul 1 2018, 1:01 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed the point value for this task.
JJMC89 renamed this task from ceaaaaaaaa to Sense should have at least one Gloss.Jul 1 2018, 3:29 AM
JJMC89 raised the priority of this task from High to Needs Triage.
JJMC89 updated the task description. (Show Details)
JJMC89 set the point value for this task to 3.
JJMC89 added a subscriber: Aklapper.

@Lydia_Pintscher what about graying out the “remove” button of the last gloss instead of graying out the “save” button when the glosses are empty? I’ve implemented that for form representations as an experiment, and it feels more natural to me this way.

Edit: now a separate task, see T199703

Change 446285 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Addshore):
[mediawiki/extensions/WikibaseLexeme@master] Add ChangeOps for editing senses

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

I'm ok either way. Could you check with UX please?

@Lucas_Werkmeister_WMDE’s suggestion seems sensible, particularly since he tried already. I see the advantage that we block on the concerning thingy, not on the save button in general.

I want to point out that we might need to review this and other behavior from the point of UX so there might be changes to it (e.g. in this case we might need an error message or so). Or general: UX is behavior as well as looks and not all problems can be solved with another visual design (few can, actually).

This is not to discount efforts to make the best out of what can be done now (as trying it out was, I think, and helped greatly!). We just need to keep in mind that it might need some changes in the future beyond colors and position of elements – this is, behavior of features and UI (and I guess using vue.js it will be easier to do such changes!) (@WMDE-leszek @Lydia_Pintscher )

Change 450599 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseLexeme@master] Prevent empty sense glosses in front-end

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

hoo updated the task description. (Show Details)
hoo removed a project: Patch-For-Review.
hoo moved this task from Peer Review to Test (Product Review) on the Wikidata-Senses-Iteration2 board.
hoo added a subscriber: hoo.

Change 450599 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Prevent empty sense glosses in front-end

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