== Use cases ==
* [add] When I am adding a new statement, it should be possible to add an arbitrary number of new references by clicking the "add reference" button. Newly added references get saved when the "save" button for the statement is clicked.
* [edit] When I am editing an existing statement, I want to be able to edit all related references as well. All changes made to the references will be saved when the "save" button for the statement is clicked.
* [remove] When I am editing an existing statement that has references I want to be able to remove an arbitrary number of existing references from this statement by clicking an "remove" button which is placed in the heading of each reference. Removing individual reference snaks from a particular reference is done by clicking the "remove" button just beside the snak as it is working right now. All changes made to the references will only be saved once the "save" button for the statement is clicked.
* [error handling] Changes to the statement will only be saved successful when all data including the references is valid. Otherwise an error is shown just as it works right now for invalid qualifiers or main snaks.
{F1910542}
{F1910539}
{F1910537}
== Tasks ==
Possible as non-breaking changes:
* [x] [Task] When adding/editing a statement the reference section (with the expander and the "wikibase-addreference" button) should be there
* [x] [Task] When adding a statement the reference section should be expanded by default
* ~~[ ] [RFC] The expander should not be there when editing a statement and it's references. Just remove it. The reference section should not be collapsible.~~
* {T116153}
* {T117668}
* [ ] [Task] Block statement saving on invalid (and empty?) references
* [ ] [Task] When checking if a statement is edited (a.k.a. not "equal"), it must consider the references (i. e. editing a reference would enable the save button)
These steps should probably happen in exactly that order:
* [ ] {T117689}
* [ ] {T117692}
* [ ] {T117558}
* [ ] [Task] Remove referenceview edit mode handling