Show and edit related subtags in the inspector (check_date, note/description, source, conditional, numeric, other)#12005
Conversation
|
This looks really promising. Is there some kind of test instance where this change could be applied? |
Yes, it is at https://pr-12005--ideditor.netlify.app/#disable_features=boundaries&map=20.33/52.45677/13.44966&background=Bing&id=w1126644207 This road segment shows the UI for parking and cycleway tags, for example. |
|
@tordans Where do I need to sign the contract? 😂 But seriously, this is a nice improvement. |
Is it LLM-generated or obtained in some other way? |
@matkoniecz I tried to be very clear in my description that this PR is not yet about the code, but to discuss a UI and UX direction. This is further indicated by the draft state of this PR which is also a signal that the code is not ready for review, yet. – To answer your question: Yes it is. (As will be all my code in the future.) Before I submit the code for review I will have reviewed each line myself and tested the PR meticulously which I will document in the PR. |
|
If you haven’t already, check out what OpenHistoricalMap did with subfields in OpenHistoricalMap#187 and OpenHistoricalMap#217. It involved more DOM-building code than I would’ve liked, but users have taken to these features quite well over the past couple years. (JOSM users have been clamoring for these iD features, fancy that.) The key to making this design work is predictability: the EDTF subfield is activated by a ➕ button within the date field’s body, because it’s only available on date fields. (It’s based on the Multilingual Name subfields.) By contrast, the source subfield is activated by a @ button within the field’s header, because it’s available on every field. I’m not sure that either design will scale to more than a couple possible subfields in a given field. Already I frequently mix up the ➕ and @ buttons before the EDTF validator catches me. Sided and lane-based fields potentially complicate the UI beyond intuitiveness. Basically I expect to end up with a visual representation of this eye-glazing table. Given the limitations of this approach, we could use it for a few basic attributes, then turn the focus to more specialized field designs like #387 and #974. |
|
Overall it is really great interface! Could also Do we want to support adding these associated tags? Probably no
Interface for those was really, really confusing |
OpenHistoricalMap#223 implements this differently by leveraging the existing Add Field menu. As soon as you fill in the Source field, “Source 1” appears in the Add Field menu. If you select that and fill in Source 1, “Source 2” appears in the Add Field menu, and so on. The numbered Source fields are all sorted numerically next to each other. We avoided nesting them under the original field, so that it doesn’t look like one is more important than all the others. This design avoids cluttering the field’s mini toolbar with yet another control that the user has to distinguish. It also has the side benefit of subtly telling you there’s already a source when you go to add another one. |
|
How long this test/demonstration PR should be open? |
|
Leaving some of my thoughts as per request coming from #12332. I think it's a good proof-of-concept long-term proposal that could by default support all (or an easily-maintainable list of) sub-keyed fields without any knowledge about specifics. Personally, I am strongly in favour of showing more fields, especially for subkeys. It has been my experience that mappers often omit or don't notice/fix subkeys (e.g. Overall, this feels very much like a long-term design and implementation feature. In general, I would not expect this to get implemented quickly, nor immediately support certain things in a general way that something like In other words, I don't think it should limit or replace custom fields for specific tags like the #12332 or existing I also think this would work really well in addition to custom fields (without needing replace or be replaced by them) like the "bike lanes" example, as one could incorporate "additional fields/subkeys" toggles and display extra fields that aren't already shown by the custom field, but the whole left/right/both key update logic is preserved. One concern of mine would be how this would support many of such OSM key peculiarities without the code just becoming a long list of hardcoded cases. Even in something as simple as the In that vein, one thing I do not like is the direction of As already mentioned, this also has extra complexity of what input field type to show for sub-keys, like the I think the UI is heading roughly in the right direction by "nesting" subkeys visually. I do however think it needs to be more compact. Again, I realize it's proof-of-concept, so criticizing it feels unfair, but the UX is basically the strength of iD and half the purpose of this feature, so proposing a strong visual solution sounds like the main priority. I really like the idea of additional icons for specific subkeys (I also agree they should be placed under the inputs, so they do not mix with the "action buttons" especially as those change as you edit). Ideally, the icons would also appear next to the fields they reveal, so the user learns what they mean, but I digress into specifics. Although, I again have to point out how this (currently) ends up hard-coding much of this instead of being available via tagging. I also see mentioned above concerns of scale - like what if there is a subtag of a subtag of a subtag and such. I think it's worth considering, but I also think that for common usable fields such precision is likely an overkill and in many cases it's better solved by custom fields if truly needed. My only suggestion would be to provide some sort of visual indication that there are more subkeys, so the user is at least aware. Anyway, in short, I think this is as a good core improvement direction and an essential feature for iD. I think it's great that it solves a large bulk of missing subtagging display. I think UX and a generic support of subkeys are the obvious strong parts of this, but my current early reservations are about hard-coding and maintainability. If there's one broad observation I would mention, then it's that there is no clear "approved for implementation" status for this repo. It's a lot of work to build something like this, so as an outsider I would hope maintainers would indicate whether this would even ever get integrated. Please be aware that I am approaching this feedback more as a picky user rather than a developer, so please read my criticism as constructive. |

This is a draft to experiment with a UI that will allow us to expose related tags next to their field.
I did not review the code in details, yet. This PR is meant to be used to see if this is a good idea in terms of UX, UI and in general.
Related issues
Directly
colonCombofield type ideditor/schema-builder#180 (comment)Indirectly
smoothness:check_datewhen adding/changing the smoothness value of ahighway=*way #8548Screenshots
TODOs:
Tags for testing
source:tagnametagname:1,tagname:2check_date:tagnametagname:conditionalOther related tags
This is buggy still, but the idea is to expose the "cycleway:left:surface" tag; the code about this is very rough but the idea would be to allow to give visibility to the tags in those more complex schema like the
parking:*schema.The general idea is that we always use the label of the field to show the indicator-buttons. For preset types that handle multiple key, the indicator would search for related tags for all those keys and just list them all.
The buttons are only there, when there are tags, so their presence in itself is an indicator.
They render in tree preset-fields: text, check-date-text, textarea which I think will be enough for the cases we will likely see.
What I like about this is, that it will allow use to give more visibility to some related tags without the need to do a bigger update like openstreetmap/id-tagging-schema#1202
Possible simpler version: We could boil this down to something simpler first, which only shows indicator icons and not button in the label bar. The indicator icons could then have a tooltip that just informs users that there are related tags.