Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

t/200 Made the InsertColumnCommand work in the opposite direction when Loca… #216

Closed
wants to merge 2 commits into from

Conversation

oleq
Copy link
Member

@oleq oleq commented Sep 18, 2019

Suggested merge commit message (convention)

Fix: Made the InsertColumnCommand and MergeCellCommand work in the opposite direction when Locale#contentLanguageDirection is 'rtl'. Closes ckeditor/ckeditor5#3277.

@oleq oleq requested a review from jodator September 18, 2019 14:39
@oleq
Copy link
Member Author

oleq commented Sep 18, 2019

I figured merge cell commands should be mirrored too. WIP.

@coveralls
Copy link

coveralls commented Sep 18, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling 7fdc0a6 on t/200 into 2c70b67 on master.

@oleq
Copy link
Member Author

oleq commented Sep 18, 2019

Now it's ready for review.

Copy link
Contributor

@jodator jodator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code itself is pretty straight forward but I have doubts about who should dictate left/right here. I think that model and commands should be agnostic of the visual aspect of the text and work on different semantics - so it's "after" for insert column right in LTR but "before" for insert column right in RTL.

I'm flagging this as R- just for the sake of the tools we're using but we need to discuss this I think.

// │ direction │ 'rtl' │ column │ column+1 │
// └───────────┴───────┴───────────────┴──────────────┘
//
if ( ( isOrderRight && isContentLtr ) || ( !isOrderRight && !isContentLtr ) ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets complicated with RTL. And I wonder if we shouldn't put emphasis on the UI for dictating "left"/"right" and have "before"/"after" in the model?

This way the command will accept "before" / "after" params from the UI and will execute them in the model order (as in arrays). The UI would switch command param depending on the content to match the visual aspect of it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other words, the model manipulation should be simpler. It should focus on data direction as in after/before. The visual aspect of the editor, at least in here, could be done on the UI side of things.

This makes sense for me that

@oleq
Copy link
Member Author

oleq commented Sep 19, 2019

A better approach in #218.

@oleq oleq closed this Sep 19, 2019
@oleq oleq deleted the t/200 branch September 19, 2019 15:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants