Page MenuHomePhabricator

OOjs UI fields with dynamic labels get the user cursor out of position when content it too long (e.g. edit summary field)
Closed, ResolvedPublic1 Estimated Story Points

Description

Case below assumes a LTR typing.

  1. I start typing a long sentence in the edit summary, no matter if it is pre-filled or not - my cursor moves while I'm typing, from left to right
  2. At a moment, my cursor getting closer to the right border of the field

On a non-OOui edit summary

  • the text already typed moves to the left
  • my cursor to be still visible and I know what am I typing

On a the new OOui edit summary

  • the text already typed stays where it is, like blocked by the left border (it blinks a bit, like when you try to force typing)
  • my cursor is covered by the counter, I don't know where I am
  • the text I type is overflowed on the right, I don't know what am I typing

Tested on fr.wp and mw.org, while logged-in and logged-out.

Event Timeline

which browser version etc ?

Firefox 54
Chromium 58
Ubuntu 16.04 LTS 64 bits.

Works for me, I see a bit of scroll flickering, but generally it does what I expect.

The flickering is very annoying. It seems that the field is scrolled to the left by the width of the "length label" on every keystroke. We should probably save and restore the horizontal scroll position when rebuilding the label.

I'm seeing weird behaviors in Safari 10. Imagine an edit summary that completely fills the box, plus a couple of characters. Without this, it might looks something like this when I'm nearly done typing:

|--------------------------------------------------|
|One two three four five Once I caught a fish alive|
|--------------------------------------------------|

With this, I see this when I'm at exactly the same point in typing:

|--------------------------------------------------|
|One two three four five Once I caught a fish al194|
|--------------------------------------------------|

I expect to see something like this:

|--------------------------------------------------|
|two three four five Once I caught a fish alive 194|
|--------------------------------------------------|

If I keep typing – if I add "Six seven eight nine ten" – then it adjusts to show more of the edit summary, but the last few characters are always hidden as I type them:

|--------------------------------------------------|
|nce I caught a fish alive Six seven eight nine 180|
|--------------------------------------------------|

unless I explicitly move my cursor to the end of the line (e.g., by pressing the down arrow key).

Iniquity rescinded a token.
Iniquity awarded a token.
Iniquity subscribed.

This is a top complaint in Russian WP, it's better to get fixed as soon as possible.

I've make a video of what I see on my screen while typing.

Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF subscribed.

Hmm, this isn't very good is it? Let's fix this.

Cause found: This is due to positionLabel() changing the padding.

If first clears the padding on the input element, causing a resize, then reapplies it. But it seems that cursor position (this is UA shadow dom of course) is not expecting changes like this to occur, causing stuff to go out of whack. Suggest only resetting the padding when required (possibly round ceil it to values of 5px, to avoid it changing too often)

Change 366481 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[oojs/ui@master] demos: Add examples of TextInputWidget with dynamic label

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

Change 366481 merged by jenkins-bot:
[oojs/ui@master] demos: Add examples of TextInputWidget with dynamic label

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

Change 366486 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[oojs/ui@master] TextInputWidget: When positioning label, don't clear padding if we will set it again

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

Change 366492 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[oojs/ui@master] TextInputWidget: Really make sure cursor is visible after label width changes

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

Am using chrome Version 59.0.3071.115 (Official Build) (64-bit) on a Mac. In addition to what is described above, when the content does starts disappearing behind the counter , if I try to delete and start typing again, the text is oddly repeated.

The counter is a perhaps-nice-to-have gadget, but edit notes are an essential communications tool; the counter makes something that was simple to do, into something frustrating and a struggle.

Will you please disable this counter. If you decide to relaunch it would you please make it an opt-in option and not the default. (I would never turn this on; I do not care about knowing how far I am from the end. Running out of space is.... obvious. You run out of space.)

Again would you please just remove the counter. You can fix it offline. Thanks.

Change 366486 merged by jenkins-bot:
[oojs/ui@master] TextInputWidget: When positioning label, don't clear padding if we will set it again

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

@Jytdog I'm not sure how necessary it is on Wikipedias with Latin alphabet where 255 means 255 (I believe that edit summary field becoming 50px shorter (as I calculated) should've been compensated by its lengthening), but on non-Latin Wikipedias 255 can mean 127 or even 85 (until T6715 is resolved), which you run off pretty fast. In RuWP, we had a gadget for character counter. No we don't need it, and that's good.

Change 366569 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@master] mw.widgets.visibleByteLimit: Temporarily disable whilst OOjs UI label bug is fixed

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

Change 366569 merged by jenkins-bot:
[mediawiki/core@master] mw.widgets.visibleByteLimit: Temporarily disable whilst OOjs UI label bug is fixed

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

Change 366598 had a related patch set uploaded (by Bartosz Dziewoński; owner: Jforrester):
[mediawiki/core@wmf/1.30.0-wmf.9] mw.widgets.visibleByteLimit: Temporarily disable whilst OOjs UI label bug is fixed

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

Change 366599 had a related patch set uploaded (by Bartosz Dziewoński; owner: Jforrester):
[mediawiki/core@wmf/1.30.0-wmf.10] mw.widgets.visibleByteLimit: Temporarily disable whilst OOjs UI label bug is fixed

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

Jdforrester-WMF renamed this task from Cursor doesn't follow what you type on the new OOui edit summary field to OOjs UI fields with dynamic labels get the user cursor out of position when content it too long (e.g. edit summary field).Jul 20 2017, 5:31 PM
Jdforrester-WMF moved this task from Backlog to Doing on the OOUI board.

Status:

  • We'll be disabling the counter feature temporarily – this will happen in about an hour (https://wikitech.wikimedia.org/wiki/Deployments#deploycal-item-20170720T1800).
  • The simpler part of the proper fix I proposed yesterday already went through review, it should be in the next OOjs UI release (Tuesday, 25 July) and it should be deployed to the Wikimedia wikis next week after that (1-3 August).
  • The other part of the fix is still in review and may or may not be in the next release – for the edit summary counter, it should not be necessary, the only edge case it fixes is when the user is deleting text and the counter goes from 9 to 10 remaining characters or from 99 to 100.
  • We'll probably reenable this feature when the simpler part of the fix goes live.

Change 366598 merged by jenkins-bot:
[mediawiki/core@wmf/1.30.0-wmf.9] mw.widgets.visibleByteLimit: Temporarily disable whilst OOjs UI label bug is fixed

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

Change 366599 merged by jenkins-bot:
[mediawiki/core@wmf/1.30.0-wmf.10] mw.widgets.visibleByteLimit: Temporarily disable whilst OOjs UI label bug is fixed

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

Mentioned in SAL (#wikimedia-operations) [2017-07-20T18:35:11Z] <thcipriani@tin> Synchronized php-1.30.0-wmf.10/resources/src/mediawiki.widgets.visibleByteLimit/mediawiki.widgets.visibleByteLimit.js: SWAT: [[gerrit:366599|mw.widgets.visibleByteLimit: Temporarily disable whilst OOjs UI label bug is fixed]] T169982 (duration: 00m 48s)

Mentioned in SAL (#wikimedia-operations) [2017-07-20T18:36:41Z] <thcipriani@tin> Synchronized php-1.30.0-wmf.9/resources/src/mediawiki.widgets.visibleByteLimit/mediawiki.widgets.visibleByteLimit.js: SWAT: [[gerrit:366598|mw.widgets.visibleByteLimit: Temporarily disable whilst OOjs UI label bug is fixed]] T169982 (duration: 00m 47s)

Very grateful that this was disabled at least for now. It is a relief to be able to write edit notes without fighting the software. We take simple things that work for granted, and I would be remiss if I didn't say thanks for making the software functional, simply, again.

If the counter is restored, please keep it out of the way. As I said for me it is useless clutter and if it kluges things up it is a total loss. I understand people have asked for it and that it might be useful in languages with different character sets, and that is a challenge for you all to meet everyone's needs and wants.

Change 366492 abandoned by Bartosz Dziewoński:
TextInputWidget: Really make sure cursor is visible after label width changes

Reason:
This would cause issues with IMEs. Not strictly necessary, we have an acceptable fix for the bug already. I'll look into other options.

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

Change 368960 had a related patch set uploaded (by Bartosz Dziewoński; owner: Jforrester):
[mediawiki/core@master] Revert "mw.widgets.visibleByteLimit: Temporarily disable whilst OOjs UI label bug is fixed"

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

Change 368960 merged by jenkins-bot:
[mediawiki/core@master] Revert "mw.widgets.visibleByteLimit: Temporarily disable whilst OOjs UI label bug is fixed"

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

OK, this will now be live again for next week's release, now with the fix applied.