Page MenuHomePhabricator

User-friendly presentation of whitespace-only changes (empty boxes)
Open, Needs TriagePublic8 Estimated Story Points

Description

When a user does nothing but adding or removing a linebreak, and that's part of a conflict, we need to show this conflicting piece of the page somehow, as we are showing everything else. The problem is: This piece of the page does not contain visible content, only one or more linebreaks. And our conflict resolution interface is written in a way that it hides newlines, and tracks them in hidden fields.

It's correct to present two "empty boxes" for the user to pick from. One side contains more or less linebreaks than the other. These are two actual changes that actually conflict, and the user must pick one. However:

  • The yellow/blue visualization of linebreaks is hard to see. (Note: https://gerrit.wikimedia.org/r/589088 already heavily improved this. Before, it was possible to see entirely empty boxes.)
  • When editing such a block, there is nothing, and it's impossible for the user to change the number of linebreaks. This is by design. A trivial solution might be to disable editing for newline-only blocks.

We need some design decision for this. A trivial idea is to replace the two boxes with messages that say something like "here is 1 empty line" and "here are 2 empty lines" to pick from.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Thanks @thiemowmde for bringing this up. I'm not sure yet what the best solution is but will give it some thought. I agree that choosing between two empty boxes is not giving the user enough information about what they are choosing between.

My first idea is that when this happens some context should be brought in. So that when the conflict is about a line break, the sentence before and after are automatically pulled into the conflict and the white space between is highlighted. Is this possible?

Newline issue.png (216×1 px, 19 KB)

Oh yes, this is possible. One concern, though: this means that these two lines are shown twice. One time as context in the otherwise empty boxes (which are not editable, I assume), and another time in the gray boxes above and below (which are editable). And if the user starts editing the gray boxes, the text shown as context might change, and we would need to update it on the fly. That's a little hard to implement, and I'm not sure if it's worth it.

Ah I was picturing pulling those sentences out of the gray boxes and into the selection boxes, eliminating the duplicates and allowing editing there instead. I think it's similar to changing the spelling of one word, but the whole sentence is pulled into the selection box and edited there.

Would this be possible?

I'm not sure. It sounds like it should be possible. But I'm afraid this will leave us with more problems:

  • There is no concept of "sentences" in our code. What we can identify are paragraphs. These are sometimes very long. I feel it would be as confusing as before if we present 2 large paragraphs that did not change, just because the number of newlines between the 2 paragraphs changed. This is pretty much the situation we had before.
  • Pulling out paragraphs from before and after might result in these block not having any content any more. I think we can just hide these then. But I'm not sure.

I don't think it's such a problem actually if it's paragraphs instead of sentences. Most important is communicating with clarity about the changes. After having some more time to consider it, I think this is the clearest way to do that. As long as the whitespace changes are highlighted with color and nothing in the paragraphs are highlighted, then it should be clear where the user needs to put their attention. If the page overall is a bit longer, I think this is ok.

If the gray boxes disappear, then that is also ok. In that case, eliminating duplicates of information is most important.

If it's possible, then this would be my recommendation. For deleting whitespace, it might actually be the only way to communicate the change? Though in that case, we need to consider what gets highlighted.

Lena_WMDE set the point value for this task to 8.Apr 23 2020, 9:12 AM

Change 637687 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/TwoColConflict@master] Fix empty lines being skipped during merge

https://gerrit.wikimedia.org/r/637687

Change 637687 merged by jenkins-bot:
[mediawiki/extensions/TwoColConflict@master] Fix empty lines being skipped during merge

https://gerrit.wikimedia.org/r/637687