Closed WilczynskiT closed 1 year ago
@microsoft-github-policy-service agree
The result:
Thanks for this, it surprisingly simple, and thought provoking. So there's some improvements I'd like to make:
leaf nodes are redundant, this one shouldn't do it since the text is already on the right for this one.
first child is not always the right one, it needs to handle out of order children, some child is special, it contains a "name", "title" or "id" or "key", the way this child, perhaps better identified using xs:key/xs:keyref and DTD ID/IDREF. For example, in the basket.xml
example it shows this, but clearly promoting a namespace attribute makes no sense here, it just happens to be the first child.
Similarly, in Hamlet the SPEECH elements are lucky they are promoting SPEAKER, only because it is the first child but what if it was the last child, it would then promote a LINE element which would be bad. So we need some smart selection of the right child to promote from some schema hints, and or some heuristics perhaps.
There's a bug in the Hamlet example, is this a line wrapping problem? So promoted text will need to be trimmed or something:
for some types of XML like HTML this doesn't work at all, the promoted content is just not useful.
the text is the same color as the element which makes one think this text should be "findable" using CTRL+F, but it isn't. I agree it shouldn't be, but to help set this expectation we may need to lighten/darken it to "dim" the text to make it appear more like a hint and not an actual editable label. Speaking of editing there is in fact also some weird ghosting when you edit the label because the longer text label sits underneath the text box, so we should remove it in the editing case?
Hello @lovettchris,
I added some changes. So:
Let me know what you think ;)
Thanks Tomasz, this is looking great. I'm going to do a bit more work on it after I merge this PR.
See my additions in https://github.com/microsoft/XmlNotepad/pull/288/
Hello @lovettchris,
I did the #60 ;)