niccokunzmann / mundraub-android

📱Android App for Mundraub, Na-Ovoce and other fruit maps
https://f-droid.org/en/packages/eu.quelltext.mundraub/
GNU General Public License v3.0
33 stars 22 forks source link

Cancelling add entry creates empty entry #299

Open Heineken opened 5 years ago

Heineken commented 5 years ago

If I press "+", then "Back", an empty entry is created. That shouldn't happen. An entry without the mandatory fields shouldn't be accepted anyway (#300).


We're using Polar.sh so you can upvote and help fund this issue. We receive the funding once the issue is completed & confirmed by you. Thank you in advance for helping prioritize & fund our work.

Fund with Polar

niccokunzmann commented 5 years ago

Thanks for reporting this issue! According to https://github.com/niccokunzmann/mundraub-android/issues/34, plants are not saved when they contain the default information. When you click + on the list of own plants, and go back, no plant is saved. When you do it on the map, the location is set from the map.

Would you like to delete the plants, if they only contain default information regardless of the location?

niccokunzmann commented 5 years ago

Related code: https://github.com/niccokunzmann/mundraub-android/blob/92599213455f8661de96f02168cd9d41f93638dc/app/src/main/java/eu/quelltext/mundraub/plant/Plant.java#L303

Depending on the usage, this should also be renamed to "shouldBeDeleted"

Heineken commented 5 years ago

Having a "delete" button in the "add" dialogue is confusing. IMHO it should be renamed "Cancel". Regardless of what has been entered, expected behaviour on pressing "back" or "Cancel" button in "add entry" or "edit entry" is

niccokunzmann commented 5 years ago

So, the view for editing a plant and creating a plant is the same at the moment. The difference is only in the "delete" / "cancel" button, as I understand. Correct?

Heineken commented 5 years ago

Hmm, both should have the Cancel button and the delete button should be moved to the list as an trash can icon.

niccokunzmann commented 5 years ago

I wonder what the behavior of the cancel button is. According to some Google advice about designing Android apps, whenever I modify a field, I expect it to be saved immediately. So, for me, there is only saving or deleting the plant at the end of the view. I can understand that the "go back" behavior has some differences for useless plants. However, I do not know how to distinct the three actions: cancel, delete, save. I am ok with leave&save-if-useful, save, delete.

I also wonder if this is a case: If you like to map many plants of a known type, then you place them on the map to add the type later.

Heineken commented 5 years ago

I wonder what the behavior of the cancel button is. According to some Google advice about designing Android apps, whenever I modify a field, I expect it to be saved immediately.

Really? That contradicts my PC/Phone experience. Yours not?

So, for me, there is only saving or deleting the plant at the end of the view. I can understand that the "go back" behavior has some differences for useless plants. However, I do not know how to distinct the three actions: cancel, delete, save.

What do you mean? You don't know what to do? Or how to detect the user's intention?

I am ok with leave&save-if-useful, save, delete.

I see. Well, yeah, for a new entry that is ok. I just wouldn't label it 'delete'. Whatever happens under the hood... But what about cancelling the edit of an existing plant? Currently indeed a change is saved when I go back. So I did not press OK, yet the app did the same is as if I had pressed. Surprise!

I also wonder if this is a case: If you like to map many plants of a known type, then you place them on the map to add the type later.

Imaginable. Or: I find a tree/bush, but I am not sure about the type, so I take the photo and look it up later.

niccokunzmann commented 5 years ago

I can summarize the change I would be willing to implement as the first three: Please copy it over and modify it, so it matches your expected behavior. (I need some clarity about the edge cases which I can not get from reading all above, so I would like to try a new method)

- [ ] When I edit an **existing plant**, there is a button named "Delete". When I press it, the plant is gone.
- [ ] When I open a **new plant** from the **map**, there is a button named "Cancel". When I press it, the plant is gone.
- [ ] When I open a **new plant** from the **list of my plants**, there is a button named "Cancel". When I press it, the plant is gone.
- [ ] When I edit an **existing plant**. When I press the **back button**, ... .
- [ ] When I open a **new plant** from the **map**, when I press the **back button**, ... .
- [ ] When I open a **new plant** from the **list of my plants**, when I press the **back button**, ... .
Heineken commented 5 years ago

Sorry for the delay.

Am 22. September 2019 09:12:25 MESZ schrieb Nicco Kunzmann notifications@github.com:

I can summarize the change I would be willing to implement as the first three: Please copy it over and modify it, so it matches your expected behavior.

- [ ] When I edit an **existing plant**, there is a button named
"Delete". When I press it, the plant is gone.
- [ ] When I open a **new plant** from the **map**, there is a button
named "Cancel". When I press it, the plant is gone.
- [ ] When I open a **new plant** from the **list of my plants**, there
is a button named "Cancel". When I press it, the plant is gone.
- [ ] When I edit an **existing plant**. When I press the **back
button**, ... .
- [ ] When I open a **new plant** from the **map**, when I press the
**back button**, ... .
- [ ] When I open a **new plant** from the **list of my plants**, when
I press the **back button**, ... .

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/niccokunzmann/mundraub-android/issues/299#issuecomment-533856120

niccokunzmann commented 5 years ago

Thanks! This is something one can clearly implement.

However, before someone implements this, I would like to talk about it:

  1. ok
  2. ok
  3. ok
  4. let's talk about the mental model (I do not use many apps): For me, the back button is just going back to a view from before. Changes still happened. Is it normal to use the back-button to revert changes? Do you have examples?
  5. So, when I do this: You see, on my phone, the ok button is not visible unless I scroll down. Also, I think, the default is for me that I would like to create a plant. So, if I open the view to create a new plant, I expect a new plant to be created.
    1. When I just press back, the plant is gone
    2. When I edited any fields of the plant, e.g. the type of the plant or made a photo, chances are that this plant exists. Then, I would like the plant to still be there.
  6. ok, this is the way we have it - similar to 5.1 and 5.2

I am not against anyone else making these changes. What do you think about (4) and (5.1) and (5.2)?

Heineken commented 5 years ago
  1. E.G. edit a contact in my stock contact manager. Same for calendar. Edit a note in AnkiDroid. In order to avoid ambiguity, there is a dialog "discard changes?" OK, now as I look for it, I find counter examples. BUT there is no OK button. E.G. permissions dialog for an app. Settings in K-9 mail client. I think database GUIs (calendar, contacts, Anki) are what we should look to, not app settings.
  2. Doesn't matter if it is visible out not. Give me said dialog and I know what is going on. --
niccokunzmann commented 5 years ago

Thanks. To me, it is clear now, what to do when the buttons are pressed. I created a new issue for this: #307 I opened the new issue, so people do not need to read all of the discussion in order to get started. From my experience, long discussions make it less likely to get implemented.

If you like to specify the dialog, we can open a new issue for that, too - once it is specified enough to be implemented stepwise. I guess, the dialog would appear always if a plant is to be deleted or changes discarded?

Heineken commented 5 years ago

Correct.

niccokunzmann commented 5 years ago

I added the two points in #307. If you think, this conversation clarified everything, you can close the issue.