-
Notifications
You must be signed in to change notification settings - Fork 29
Allow defining customized manual and/or automatic link decorators #222
Conversation
@msamsel what is the reason for graying out 2 options? Is it that these are the options set up automatically? If so I think it is safe to skip them in the UI and make them only happen behind the scenes. @dkonopka could you have a look at this from UI/UX point of view? Though the components are aligned with our design in terms of styles I feel that this proposal makes the dialog very heavy. IMO it doesn't look nice if there are more than 2 options. Part of which might be displaying these grayed out options. |
I haven't configure it and it is just default behavior. As this is But it might be somehow improved I see that options for table are not highlighted, so there should be some way to not showing it up. |
So definitely we need to unify that, my first impression was that the last two options were simply disabled. Whereas as I understood from your previous comment it means that the first option is hovered (thus it's white) and others are in their default state (gray background), right? |
@mlewand unfortunately couldn't get mouse pointer on this screenshot. Options have this state:
There is manual test, which has an example of manual decorators. You should be able to get live demo with this menu if you need check more details. |
@mlewand it's appear that feature that switchbutton doesn't have background inside list is available in CKE5: So I just give proper classes to my component and import additional style to manual test, and everything is working nicely without additional hacks. |
@mlewand now grey background is not present for active switch buttons. I reuse class names already available in our theme. |
The UX of ths feature needs to be polished.
As a reference, a gif from the current implementation: RFCShould links be applied to the "link preview" visible on the first view? I'm thinking mostly about the download attribute here. It would be nice if the link gets the But at the same time I find it useful only for these particular attributes. Other, like HTML class doesn't make much sense in this regard. |
I have one doubt about it. When someone creates new link, by default it's opened form view. So in this case it will extend his path. He will have to create new link and then close edition to go to action menu and apply proper decorators. It sounds wrong for me. Another case is that those menus are grouped by function: "action" and "edititng". Providing new decorator to link is editing from my perspective. |
@msamsel can you provide some eta for when this feature will be available? |
I know it's handy to have all need things at the first view, but I can't agree with you. It's a 2-step form (preview & editing), so we should teach users if they want to change anything they should go to the "edit" section. OTOH, I'm not so sure about "switch" buttons - it looks good as a single option (for tables). I'm wondering, maybe we should consider a new UI element - a checkbox? We definitely need an opinion from @oleq here, but at this moment we can live with those switches? |
@poppaul95 I'm sorry there's no precise ETA yet. Initially we were looking to include it in iteration 24th, however we already know that we'll have to put it into iteration 25. The best way to stay up to date is to subscribe ckeditor/ckeditor5-link#186 issue as we'll update it as the feature lands in the |
Interesting point @dkonopka. I think that in this case we should wait to hear more voices on the design. I'm still not convinced whether we should put these toggles in the main view (or both) or in the second. Talking about two view approach, I see couple of problems with this idea:
This should not be our concern at this point, we're giving this option to the developers to see whether this feature will be used. Accept/cancel buttons positionWith new inputs added below, I believe that the ok/cancel buttons should be moved to the very bottom of the balloon. I mean we could go unusual here, but it's a common solution to put action buttons at the bottom of the dropdown if there are multiple options in it. Closing confirmationMy initial impression was that attribute gets applied the moment I toggle it. So I just did that and moved on. Later I was surprised that my changes were not applied. For that reasons apps typically put some sort of confirmation when you're closing "dirty" dropdown/dialog. This would have tipped me of this behavior. |
That's true. Currently entire view works as a form, you need to submit changes with ok button, to apply changes. It's made to be perfectly integrate with "link" command, as it was one of point discussed here: So now all link attributes (href and custom decorators) are passed inside link command. |
I've rebased this PR to the current master to fix an appearing conflicts. |
…itioanl attributes.
I feel like introducing such feature might take some time. If I understand correctly we should implement some sort of feedback for the user that current state is "dirty" and confirm if he really want to close edition. |
Thx for feedback. I added unit tests for this change now. |
tests/manual/linkdecorator.js
Outdated
decorators: [ | ||
{ | ||
decorators: { | ||
IxExternal: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is
. Also most likely isExternal
because we use camel case for props in the project.
…tor uppercase for better readability. Fix all occurance related to this change.
But... you didn't change the configuration documentation, did you @msamsel? |
I'm still in progress. Right now I just implement new config and correct tests and now switch to docs. |
theme/linkform.css
Outdated
* See: https://github.com/ckeditor/ckeditor5-link/issues/186. | ||
*/ | ||
.ck.ck-link-form_layout-vertical { | ||
flex-wrap: wrap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this supposed to work if ckeditor5-link/theme/linkform.css
defines this class with display: block
(not flex?) https://github.com/ckeditor/ckeditor5-theme-lark/pull/233/files#diff-e9ba6bcf18c57cfa9c06993af81ac820R54
Suggested merge commit message (convention)
Feature: Allow on defining customized manual and/or automatic link decorators. Closes ckeditor/ckeditor5#4829 .
Additional information
Required theme-lark PR t/ckeditor5-link/186