If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Whitespaces and special characters changes should be highlighted in diffs

NEW
Unassigned

Status

Webtools
Elmo
P2
normal
5 months ago
2 months ago

People

(Reporter: flod, Unassigned)

Tracking

Trunk

Firefox Tracking Flags

(Not tracked)

Details

https://l10n.mozilla.org/source/diff/?from=a55fc92d7573&to=444b008f2971&repo=releases%2Fl10n%2Fmozilla-beta%2Fhu

This changeset removed to ZWNJ characters, but the diff doesn't show anything.
A similar issue happens when a trailing or leading space is removed.

We should try to show these changes.

Comment 1

4 months ago
Looking at data we have in browser.dtd, I see some C? categorized characters, notably:

10 10
173 SOFT HYPHEN
8203 ZERO WIDTH SPACE
8204 ZERO WIDTH NON-JOINER
8205 ZERO WIDTH JOINER
8207 RIGHT-TO-LEFT MARK
8288 WORD JOINER

I've asked jfkthame, and we can't just switch a font, so we'll need to render them somehow, and I wonder under which conditions we actually should. And if so, how?

(For space, I think we should just switch on CSS preserve whitespace).

So, for Other characters, should we show them if they're the only member of an orange block? Or rather, if an orange block is only made of special chars?

And if so, how? Hex? Or some svg? I was wondering about some svg span that -- wait for it -- ascii arts like

 ----
| 00 |
| 00 |
 ----

or 

 ----
| ZW |
| S  |
 ----

or so (using the first letter of each word in the name, falling back to something hexy?)
(In reply to Axel Hecht [:Pike] from comment #1)
> (For space, I think we should just switch on CSS preserve whitespace).

You also need some highlighting to see them.

> So, for Other characters, should we show them if they're the only member of
> an orange block? Or rather, if an orange block is only made of special chars?

Can you define what's an orange block? I lost you.

> And if so, how? Hex? Or some svg? I was wondering about some svg span that
> -- wait for it -- ascii arts like

What about highlighting them visually and using the character code as a tooltip of the span?

Comment 3

4 months ago
orange block as in the accesskeys in https://l10n.mozilla.org/source/diff/?from=61a146733cbe&to=%20a87ad7679ad6&repo=l10n-central%2Fit, a changed sequence of code points.

We can't do anything with the special chars with CSS, says jfkthame, they're removed at a level of layout that we don't have access to in the end. I need to replace them with something else.
My idea would be to highlight changes of these characters, and that includes addition and removal. I don't think that would be covered by orange blocks?

No clue if that's applicable here, but what we do in Transvision is to replace them before displaying with styled <span> elements.

Comment 5

4 months ago
Looking at transvision, https://github.com/mozfr/transvision/blob/4250ee94ab6aef48073b92eab3b83dd23b30fcb6/app/classes/Transvision/Strings.php#L118-L133, that highlights whitescape only, and that seems fine to do. (Given I'm not showing &hellip; as &, I don't think there's something to do for ellipses.)

For non-whitespace like zwnj or bidi markers, replacing them will likely break rendering, and I'd rather only do that if we have to. An example of that are "seemingly empty" strings, which are just a special char, or changes to just a special char.

In that sense, I'd do this for all blocks of the diff, not just orange ones, thinking about that.

Another whitespace that I'm lenient about right now are newlines. Any particular suggestion on what to do with those?
(In reply to Axel Hecht [:Pike] from comment #5)
> Another whitespace that I'm lenient about right now are newlines. Any
> particular suggestion on what to do with those?

I'm trying to think of real cases where this kind of changes happened, and I'm failing. I also have a hard time thinking on how to show such change.

Updated

2 months ago
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.