Page MenuHomePhabricator

Enhanced RC "new page" indicator causes misalignment in fullwidth character languages: replace nbsp?
Open, MediumPublic

Assigned To
None
Authored By
Arthur2e5
May 18 2016, 12:36 AM
Referenced Files
F5282986: cjk-rc.png
Jan 14 2017, 9:33 AM
F5276980: pasted_file
Jan 12 2017, 5:28 PM
F5276993: pasted_file
Jan 12 2017, 5:28 PM
F5276975: pasted_file
Jan 12 2017, 5:28 PM
F5276989: pasted_file
Jan 12 2017, 5:28 PM
F4602380: Enhanced RC Chinese.png
Oct 14 2016, 7:59 AM
Tokens
"Like" token, awarded by Liuxinyu970226.

Description

In zhwp, the character is used to mark new articles, just like what you do on enwp with N. zh characters (hanzi, kanji, hanja) generally takes a full em block, which according to Unicode EastAsianWidth rules would be twice the width of latin characters.

There are two possible non-language-hardcode solutions IMHO:

  • Use wcwidth (implementations exist on NPM) instead of string length for nbsp padding length calculation
    • This assumes normal-width monospace text to be 0.5em, which is often not the case. (Japanese convention, for example, uses 2/3 em.)
    • This requires a not-too-large range table.
    • This requires a fixed space equal to the sum of the widths of all labels before the time field. While it looks acceptable for the good old nmbD labels, kowiki users would have a very different idea about that. (They have 새글 잔글 봇 데.)
  • Use a tab. The tab-size CSS property can be used if the default 8-col tabstop doesn't look good.
    • This solution sounds nice and clean without all the nbsp problems (why don't you use white-space:pre by the way?), but since browser support for this property is poor, full control over the width cannot be assumed.
    • Also, kowiki.

Or you can go for some table formatting. HTML4-era wisdom. Still, kowiki.


The current output looks like: (replaced with NN)

      00:14
NN     00:13

Example:

Enhanced RC Chinese.png (616×875 px, 143 KB)

Event Timeline

Arthur2e5 renamed this task from Enhanced Recent Changes nbsp aligning not multicol charset-friendly to Enhanced Recent Changes nbsp aligning not multicol-indicator-friendly.May 18 2016, 12:40 AM
Arthur2e5 renamed this task from Enhanced Recent Changes nbsp aligning not multicol-indicator-friendly to Enhanced Recent Changes nbsp aligning not multicol-indicator-charrange-friendly.
Arthur2e5 updated the task description. (Show Details)
  1. There's no multicol-indicator-charrange-friendly existing, let's err... get rid of such confusing context-context-...-context in the next time please?!
  2. "HTML4-era wisdom." We are already more and more HTML5-ize, don't make our interface as degeneration.
  3. "why don't you use white-space:pre by the way?" Are T53462 and T24035 help you?

There's no multicol-indicator-charrange-friendly existing, let's err... get rid of such confusing context-context-...-context in the next time please?!

Good, break it down, break it down.

  • multicol: spanning multiple character columns.
  • indicator: The NmbD thing on RC.
  • charrange: character range, i.e. "these wide characters".
  • friendly: works with foo.

"HTML4-era wisdom." We are already more and more HTML5-ize, don't make our interface as degeneration.

"or" suggests a fallback. Well your fancy HTML5 solution does not work anyway.

"why don't you use white-space:pre by the way?" Are T53462 and T24035 help you?

No idea about what you are talking about or what you think you are talking about, but well that comment comes from the monospace formatting used by table.mw-enhanced-rc th, table.mw-enhanced-rc td.

Nemo_bis renamed this task from Enhanced Recent Changes nbsp aligning not multicol-indicator-charrange-friendly to Enhanced RC "new page" indicator causes misalignment in Chinese (zh): replace nbsp?.Oct 14 2016, 7:52 AM
Nemo_bis triaged this task as Medium priority.

There's no multicol-indicator-charrange-friendly existing, let's err... get rid of such confusing context-context-...-context in the next time please?!

Good, break it down, break it down.

  • multicol: spanning multiple character columns.
  • indicator: The NmbD thing on RC.
  • charrange: character range, i.e. "these wide characters".
  • friendly: works with foo.

In your second explain, what means "NmbD"? Samba? A pornography word? Number of D(days? dates? or what else?)

In your second explain, what means "NmbD"? Samba? A pornography word? Number of D(days? dates? or what else?)

It's "indicator":

Legend:
N This edit created a new page (also see list of new pages)
m This is a minor edit
b This edit was performed by a bot
[...]
D Wikidata edit

In your second explain, what means "NmbD"? Samba? A pornography word? Number of D(days? dates? or what else?)

It's "indicator":

Legend:
N This edit created a new page (also see list of new pages)
m This is a minor edit
b This edit was performed by a bot
[...]
D Wikidata edit

Explanation loop? I don't like it...

Anyway, I'm not sure what browser the reporter is using, in my browser I can also see two dots (or ;) between ( diff | hist )/(somelog) and (indicators)links/timestamp on every entries:

{F5275739}

Say somethin really, I don't like such conversational style of Arthur2e5

Anyway, I'm not sure what browser the reporter is using, in my browser I can also see two dots (or ;) between ( diff | hist )/(somelog) and (indicators)links/timestamp on every entries:

{F5275739}

Say somethin really, I don't like such conversational style of Arthur2e5

@Arthur2e5 refers to Enhanced recent changes?

Explanation loop? I don't like it...

[offtopic] The grammar here, while not optimal, needs a noun.

Anyway, I'm not sure what browser the reporter is using, in my browser I can also see two dots (or ;) between ( diff | hist )/(somelog) and (indicators)links/timestamp on every entries:

Are you sure you are using **enhanced** RC?

Say somethin really, I don't like such conversational style of Arthur2e5

[offtopic] Honestly, I don't like your style either, but these personal opinions does not help the discussions at all

Explanation loop? I don't like it...

[offtopic] The grammar here, while not optimal, needs a noun.

So what are you doing? Explain indicator as nmbd, then explain nmbd as indicator, indicator -> nmbd, nmbd -> indicator, ... no other words to explain one of both?

Anyway, I'm not sure what browser the reporter is using, in my browser I can also see two dots (or ;) between ( diff | hist )/(somelog) and (indicators)links/timestamp on every entries:

Are you sure you are using **enhanced** RC?

I lost... sorry

Ugh, OK. What a mess.

Here are the indicators:

pasted_file (229×429 px, 29 KB)

In regular recent changes they are prefixed to page names:

pasted_file (306×779 px, 84 KB)

While enhanced RC moves them in front of the time, and aligns them for ease of eye-scanning (I guess):

pasted_file (398×1 px, 206 KB)

As stated long ago this alignment is broken in Chinese, as Chinese characters occupy more than one column:

pasted_file (218×1 px, 92 KB)

To fix that I used Jimmy Xu's hack to change them into nmbD: https://zh.wikipedia.org/wiki/User:Artoria2e5/common.js

<!--[if FLAME]
I started with the assumption that everyone using the recent changes page should be at least familiar with the indicator descriptions, and everyone using the enhanced gadget should be used to that alignment. Apologies for my ad hominem attacks, but I was really annoyed when someone's pointless questions suddenly popped up in my inbox.

The same applies to my invocation of CSS selectors, which should be familiar to everyone who uses JQuery.
<![endif]-->

(You received three scratch marks for this.)

Ugh, OK. What a mess.

Here are the indicators:

pasted_file (229×429 px, 29 KB)

In regular recent changes they are prefixed to page names:

pasted_file (306×779 px, 84 KB)

While enhanced RC moves them in front of the time, and aligns them for ease of eye-scanning (I guess):

pasted_file (398×1 px, 206 KB)

As stated long ago this alignment is broken in Chinese, as Chinese characters occupy more than one column:

pasted_file (218×1 px, 92 KB)

To fix that I used Jimmy Xu's hack to change them into nmbD: https://zh.wikipedia.org/wiki/User:Artoria2e5/common.js

<!--[if FLAME]
I started with the assumption that everyone using the recent changes page should be at least familiar with the indicator descriptions, and everyone using the enhanced gadget should be used to that alignment. Apologies for my ad hominem attacks, but I was really annoyed when someone's pointless questions suddenly popped up in my inbox.

The same applies to my invocation of CSS selectors, which should be familiar to everyone who uses JQuery.
<![endif]-->

(You received three scratch marks for this.)

I think you're feel free to get developer access and submit a patch by following https://www.mediawiki.org/wiki/Special:MyLanguage/Gerrit/Tutorial

CREATE DATABASE lxyflame_db
CREATE TABLE lxyflame (請不要讓我失望,祝願您可以用您的patch解決它 varchar(65535))

Converging on a resolution is required for a technical solution. I have not seen any non-zh user speaking, let alone the fact that nobody has expressed their thoughts on ditching language neutrality for a quick workaround. Other WMF wikis that potentially suffer from this bug include kowiki, jawiki, hakwiki, etc., but nobody from these wikis has yet spoken.

On the other hand, if we zh users can agree on "just use nmbD instead", we can quickly have someone add the hack (https://zh.wikipedia.org/wiki/User:Artoria2e5/common.js) to our local versions of this gadget. Shall we do that on zhwiki's VPT first?

Converging on a resolution is required for a technical solution. I have not seen any non-zh user speaking, let alone the fact that nobody has expressed their thoughts on ditching language neutrality for a quick workaround. Other WMF wikis that potentially suffer from this bug include kowiki, jawiki, hakwiki, etc., but nobody from these wikis has yet spoken.

On the other hand, if we zh users can agree on "just use nmbD instead", we can quickly have someone add the hack (https://zh.wikipedia.org/wiki/User:Artoria2e5/common.js) to our local versions of this gadget.

As I said above, you can just submit your hack as a patch (unless if you believe that this require Community-consensus-needed ), and basically this is the best way that you get help from non-zh suggestions

Just noting here, I'm opposed to ditching language neutrality unless there is absolutely no other way to fix this.

Then I refuse to submit a very trivial patch without sufficient expressed support.

Everything is CC-BY-SA by Jimmy Xu and I, so take it as you want as long as...

Just noting here, I'm opposed to ditching language neutrality unless there is absolutely no other way to fix this.

Just FYI, I added a bullet point to the wcwidth solution in comment 0, explaining problems to be expected for enforcing language neutrality in some aforementioned projects potentially affected by this issue. They can make their own version of nmbD though.

zhuyifei1999 renamed this task from Enhanced RC "new page" indicator causes misalignment in Chinese (zh): replace nbsp? to Enhanced RC "new page" indicator causes misalignment in fullwidth character languages: replace nbsp?.Jan 14 2017, 6:36 AM

Just noting here, I'm opposed to ditching language neutrality unless there is absolutely no other way to fix this.

Just FYI, I added a bullet point to the wcwidth solution in comment 0, explaining problems to be expected for enforcing language neutrality in some aforementioned projects potentially affected by this issue. They can make their own version of nmbD though.

So it seems you want suggestion from non-cjk speaker? If yes -> @TTO

Regarding re-titling, I guess my initial "multi-column" title summarizes it better. Not all possibly messed-up wikis use fullwidth indicators; hakwiki, for instance, uses more than one latin character for each indicator.

By the way, I am so lost in these PHP code that I failed to find anything related to this nbsp aligning behavior. I don't think I am capable of giving a clean solution now. Find a nice box and sleep, that's what cats do.

And Liuxinyu, a personal suggestion: Quote as you need. Don't copy and quote the full reply, or you will find yourself wasting a lot of screen space.

Regarding re-titling, I guess my initial "multi-column" title summarizes it better. Not all possibly messed-up wikis use fullwidth indicators; hakwiki, for instance, uses more than one latin character for each indicator.

By the way, I am so lost in these PHP code that I failed to find anything related to this nbsp aligning behavior. I don't think I am capable of giving a clean solution now.

That conflicts System messages style

That conflicts System messages style

Here is another reason for not quoting stuff in full: what is that?

If you are talking about my hyphen usage, I should just say dictation in the English language is not regulated by this coding style convention for dictionary keys in the PHP programming language.

That conflicts System messages style

Here is another reason for not quoting stuff in full: what is that?

i.e. anything which looks like multicol-indicator-charrange-friendly

On the other hand, if you want this change only be applied to zh, then why why why can't you add a LanguageZh class, so other languages will never be affected?

Apologies for my habit of doing post hoc additions, but I happened to address what you have been talking about before seeing your comment. Artoria has decided to abstain from further discussions on this topic for a nice nap in her box. (Noisy human.)


<!--[if FLAME]>
07:16 UTC; The following flame segment by Artoria's box is included as an edit to avoid filling your inboxes with pointless life advices. How can a lifeless box add comments, anyway?

And Liuxinyu, you might want to fix your internal hashtables. You have a good history of mixing up things and misquoting rules.
<![endif]-->

Apologies for my habit of doing post hoc additions, but I happened to address what you have been talking about before seeing your comment.

Because you add If you are talking about my hyphen usage, I should just say dictation in the English language is not regulated by this coding style convention for dictionary keys in the PHP programming language. at the same time of my comment Sat, Jan 14, 15:04

<!--[if FLAME]>
07:16 UTC; The following flame segment by Artoria's box is included as an edit to avoid filling your inboxes with pointless life advices. How can a lifeless box add comments, anyway?

And Liuxinyu, you might want to fix your internal hashtables. You have a good history of mixing up things and misquoting rules.
<![endif]-->

Where's my wrong, let's have a good conversation OK?

Anyway, I don't use C#, so I don't have any "internal hashtables" to fix.

Regarding system messages:

  1. I do not see how that has any relevancy here. multicol-indicator-charrange-friendly is not a system message, but a compound adjective.
  2. Even if it was a system message, please specify what specifically violates the convention.

"hashtables" is a metaphor for how you find rules, whether C# or not doesn't make a difference.

We could add separate messages newpagespace, minoreditspace, etc. which contain the correct space characters to balance the newpageletter, minoreditletter, etc. So for example, in the Chinese translation of MediaWiki, the newpagespace etc. messages would be changed to contain an ideographic space.

Here is an example screenshot (in Japanese):

cjk-rc.png (337×757 px, 27 KB)

I've written a patch that does this, and I'll upload it in a moment.

Change 332031 had a related patch set uploaded (by TTO):
Allow CJK languages to specify flag spacing for enhanced change lists

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

I've written a patch that does this, and I'll upload it in a moment.

Awesome solution! I added an approval there, with some hopefully non-blocking points to enhance non-standard usage:

  • Wrap spaces in their own classes for hackability. Some people might want to save screen width.
  • Yanking columns together don't work for peojects that abuse the "letter" config for longer strings that require word breaks.

@Arthur2e5 Don't you think that your suggestions resulted those comments from Nike?

Do we really need a span here?

Thinkink out loud, can't we just output the actual letter with css visibility: none and user-select: none? That should be the right width automatically.

But I do have some concerns about increasing the already large HTML size on this page.`