Page MenuHomePhabricator

VisualEditor: [Regression wmf6] For all Image Types after changing the alignment to left, it automatically selects the alignment as right when it is positioned at the left of the page, but it doesn't change position in CE surface until save
Closed, ResolvedPublic

Description

Steps to reproduce:

1.Open a page with VE
2.Insert an image
3.Change the Image type to "Frame"
4.Click on "Apply changes"
5.Reopen the media settings dialog

Observed Result:
Though the image is on the right , the alignment is set to Left on the Media Settings dialog, and if you click on "Apply Changes" button now, it will move the image to left


Version: unspecified
Severity: normal

Details

Reference
bz65564

Event Timeline

bzimport raised the priority of this task from to High.
bzimport set Reference to bz65564.

The same issue appears when you change the Image type to Basic too

The issue of default alignment between inline and block is more complex than I initially thought. I made an additional fix to this behavior in this commit https://gerrit.wikimedia.org/r/#/c/134554/ (which is merged now)

This should fix the current bug as well (it did on my tests locally, but please verify)

I hope no more default-alignment problems pop up.

This issue is still occurring for image type Basic.

Change 134660 had a related patch set uploaded by Mooeypoo:
Don't update image model twice

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

Change 134660 merged by jenkins-bot:
Don't update image model twice

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

Right now, when you add an image and make it basic and select Right alignment, it moves it to the left and sets alignment as "Left".

Yes, that's intended. This happens to images that have default alignment; default in a block image is opposite the text direction ("right" in ltr) and default for inline images, which is what the basic change does, is with text direction ("left" in ltr).

This is intended.

This is happening for all image types now in Betalabs.

Change 135699 had a related patch set uploaded by Mooeypoo:
Another default alignment fix to MWImageModel

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

Change 135699 merged by jenkins-bot:
Another default alignment fix to MWImageModel

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

This issue still happening but the behavior got slightly changed.Previouslt after changing the alignment of any image types to "Left" and then reopening the Media Settings dialog was setting the alignment as "Right" , even though it was still on the left.Now the same issue happens but you need to save the page first after changing the alignment to left and then reopen the media settings dialog to see it.

So the new steps to reproduce is:

1.Insert any type of image
2.Change the alignment to left
3.Click on "Apply Changes"
4.Click on "Save Page"
5.Reopen the page
6.Reopen the Media Settings dialog>Advanced Settings

Observed Result:
The alignment tab is set to "Right"

Change 136971 had a related patch set uploaded by Mooeypoo:
Adjust default alignment when switching from inline to block

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

Change 136971 merged by jenkins-bot:
Adjust default alignment when switching from inline to block

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

Verified the fix in Betalabs

Verified the fix in test2

Verified the fix in en.wiki running wmf 8