Helium314 / SCEE

OpenStreetMap surveyor app for experienced OSM contributors
GNU General Public License v3.0
141 stars 10 forks source link

Allow user to write commit message #494

Open SLMapper opened 10 months ago

SLMapper commented 10 months ago

Use case The current message for custom quest is not very specific, so I would like to overwrite it.

Edit user-defined element selection

Proposed Solution

Helium314 commented 10 months ago

This is likely a lot of work, as StreetComplete is designed to have one changeset comment per edit type (i.e. per quest or overlay). The comment is currently determined from the edit type when uploading the quest, and not set when doing the edit.

I will not implement it myself, but I'm ok with having this customizable. Note that a proper implementation would need to change too much, and is very likely to cause merge conflicts on larger refactors in SC. So, as weird as it sounds, I'd prefer some hacky workaround that is less likely to cause merge conflicts, and does not break anything in case it has to be removed.

SLMapper commented 10 months ago

Sounds totally understandable, thanks. I will think about it

Helium314 commented 10 months ago

This is likely a lot of work, as StreetComplete is designed to have one changeset comment per edit type (i.e. per quest or overlay). The comment is currently determined from the edit type when uploading the quest, and not set when doing the edit.

It could be done by using the edit source for storing a serialized map of changeset tags instead of the source only. That would technically allow for changeset comment specified for any individual edit.

SLMapper commented 10 months ago

I do not understand this. Do you talk about adding additional properties to the object instead of to the changeset?

Helium314 commented 10 months ago

An ElementEdit stores the changes to the element, and the value that's supposed to go into the source changeset tag (and some more stuff). This source value could be used to encode all changeset tags, so they can be set when creating the edit instead of when uploading. Only thing necessary is decoding the source into actual tags on uploading, but that's pretty simple.

SLMapper commented 10 months ago

And this could be done to provide a better automated commit message (not a custom one), right?

Helium314 commented 10 months ago

Could also be done, yes. E.g. add the name of the current custom overlay.

SLMapper commented 10 months ago

Sorry, just to clarify: this would also enable a custom message or not?

Helium314 commented 10 months ago

Yes, automated or not.

rusty-snake commented 3 months ago

While a custom commit message might be great to tell addition details, it might be worth to add some simpler solution first because the "Edit user-defined element selection" is very unsatisfying and unfriendly to review on bigger changes.

I would suggeste to add a commit to user-defined overlays. So in addition to a name, node/way/relation selection, ... you have a "Save changes from this overlay with ..."