-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interactive checkboxes (a.k.a. GitHub TODO check list in Markdown) #1434
Comments
I think it would be great enhancement. |
Hi! Thanks for letting us know that you'd welcome this kind of feature. Anyway, what would you expect to see in your data? What the list items would look in Markdown and HTML when checked and unchecked? cc @scofalik: What sort of engine problems do you reckon this feature would have to face? (e.g. do we need inline widgets for that?). |
i think it would be great to have
|
|
Well, previously I didn't necessarily view this to be connected to list at all and thought it might exist completely inline/separate as well. But on a second thought it's not clear to me what are the use cases outside of the list. As for the HTML, I think about something like this:
Not sure if there should be a label or not since the LI can be pretty long and it's not obvious what should be inside the label and what outside. Also I can see a problem where the checkbox should be editable in the CKEditor itself, but should be probably disabled/effectively readonly in the HTML output, but again it's not clear to me how to do this. For the UI questions - yeah, that's not obvious either. Maybe again thinking of this checkbox as totally separate insertable inline element (independent from list) could simplify this? So it would be just another item on the toolbar which would just insert input checkbox at the caret? |
@Reinmar You may want to take a look at this proposal. |
We already tried to do something like this during a hackathon a year or two years ago. It was actually based on list feature implementation and it was even possible to make nested todo lists. I remember there were some problems with selection handling near checkboxes as those were created as UI elements. Anyway, this should be doable, given that the PoC took a very little time and it was working nicely. |
Do you think that we should implement todo lists as a separate attribute of a list or as a new list What's the difference?
GitHub may not be the most representative and worth following examples (we should rather check what proper rich-text editors offer), but I checked that this:
Will get you this (no numbering):
However again, while for the user the above looks lidentical to this:
The markup produced by GitHub is different (there's The answer isn't that simple because it depends on the styling. GitHub hides the bullets and numbers, so both types of lists looks alike. Should we also hide them? The answer isn't that simple to me again. For one, we should check existing rich-text editors. However, I see a value in having numbered todo lists and bulleted todo lists. There's a difference between "buy these 4 things" and "do these 4 things in the right order". |
@Reinmar I think you're overthinking the functionality here. Keeping them as a seperate list type makes more sense because a TODO-list is a seperate list. It has seperate use cases, with distinctively different goals and visual comprehension.
Furthermore, a TODO-List can be specified as ordered or not depending on the context. For example: Ingredients
versusRecipe
Both can be expressed easily in a TODO-list without bullets or numbers. Both are understood to either be ordered or unordered depending on the context. |
As long as I can remember, I’ve always been using such marks on my paper notes. Hence, this kind of checkboxes is a must-have in any note-taking app for me. Some apps (like Zim, e.g.) go even a step further than GitHub by proposing 3 states for such a ToDo list:
That method does keep the record of any dead ends in the course of a project, at least. |
So, here is the design proposal: Regarding animations: I'm not a big fan of static UI elements. That's why you can see an animated strike as Markup proposal (we can use checkbox as <ul class="ck ck-todolist">
<li class="ck-todolist__item">
<span class="ck-todolist__item-checkbox"></span>
<span class="ck-todolist__item-content">Create a strong device passcode</span>
</li>
</ul> Features: IMHO for the MVP, we should start with two states (but I need to admit 3rd state (discarded) sounds cool). There is also an idea to make single list item draggable. Rectangle checkboxesCircle checkboxesCircle checkboxes look modern and fresh, but to be honest, rectangles fit better to the CKEditor UI. |
@dkonopka, really cool animations. From the visual perspective, I don't have much to say. But, regarding the output (and styling) we've got to talk about two things – the editor output and the editor content (data and editing views). We can make them different or identical, but have to consider similar aspects in both of those cases:
Regarding the styling itself:
|
Agree.
I think that it should be supported from the beginning. You should be able to nest ordered, unordered and todo list any way you wants.
I think we should focus on unordered todo lists, for now. We should make it simple, provide 3 types of list type: ordered, unordered and unordered todo list. From the IU point of view, I think it should look like a third type of list (so you will have 3 buttons to choose the type of list). However, for the technical point of view (model representation and data returned by
I leave it to you, guys. However, when I use OneNote I very often use the keyboard to switch checkbox (checked/unchecked), so I think that some keyboard shortcut would be nice to have.
I just realized that we also need an icon for that. |
I agree that's why we should use <ul class="ck ck-todolist">
<li>
<input type="checkbox" checked>
<span> ... </span>
</li>
</ul> This
I tried, to make them smaller, but then icon inside checkbox is not similar to the checkmark. But we will be working on that during implementation.
👍 |
Regarding ordered/unordered list types - question is how does one differentiate the type? GH choice doesn't make sense to me, as the list type is inaccessible to sighted users. So I'd say starting with unordered seems to be reasonable. In case users miss ordered todo lists we'll get a proper feedback down the line.
Regarding accessibility if we need to use spans for visuals, we can do that 👍 We'll just have to add extra Proposed designs look really nice, I'd lean more toward rectangle boxes. As @dkonopka mentioned it looks more consistent with the v5 UI. |
@dkonopka A slight "halo" around each checkbox on vide https://ckeditor.com/docs/ckeditor5/latest/features/table.html |
Another thing is the contrast (a11y). Make sure there's enough contrast between the white checkmark and the background. Could be the darker shade of green makes more sense. |
I think it would be better to have some shortcut for checking this checkbox whenever the selection is in the list item. It would both simpler to use and to implement. Note that usually [Tab] is used to move the selection between items, and in lists [Tab] is also used to indent the item, so an intuitive flow might be complicated. The question is: is there any common shortcut to check an item in the todo list? If no we can use some combination with the Enter key (for instance Ctrl+Shift+Enter)? |
What do you think about using this in the data output ( <ul>
<li>
<label>
<input type="checkbox" checked>
Foo
</label>
</li>
</ul> I nested We can also ignore <ul>
<li>
<input type="checkbox" checked>
Foo
</li>
</ul> Or add a span mentioned by @dkonopka to make it easier for developers to style the output. As for the editing view (what we will use in the editor), it does not matter that much. We may have there a custom |
I was looking for such a shortcut and was not able to find any common solution, so I think we should propose our own and make sure it will have no conflict with other common applications shortcuts. |
I second to that the keystroke/hotkey would be a great productivity booster when using todo lists. Unfortunately I'm not familiar with any app that do this, so I'd say we should research if there is some commonly used keystroke in these apps. If there is no standard keystroke, we should find a key that is:
As such |
After a second thought, I think we should not use So I think, we should keep the data output simple: <ul>
<li>
<input type="checkbox" checked>
Foo
</li>
</ul>
Sounds good. It is fine on Mac ( |
What if we allow selecting the checkbox with the selection? Like an unremovable inline widget? Then, we could use simple Space. |
I prosed it 2 days ago and disagreed with myself. Let's stick to
I was thinking a little more about it and none of the solutions I know works this way, so since it is more tricky to implement I think that we should start from the solution where these items are transparent for the selection. |
So... The summary of the TODO list feature:UI:See UI proposal will be provided by @dkonopka: https://codepen.io/k0n0pka/pen/MNWjpO Features:
Representation:In data:<ul class="todo-list">
<li>
<label class="todo-list__label [todo-list__label_checked]">
<input class="todo-list__label__checkmark" type="checkbox" disabled checked />
<span class="todo-list__label__description">Foo</span>
</label>
</li>
</ul> For nested lists: <ul class="todo-list">
<li>
<label class="todo-list__label [todo-list__label_checked]">
<input class="todo-list__label__checkmark" type="checkbox" disabled checked />
<span class="todo-list__label__description">Foo</span>
</label>
<ul class="todo-list">
<li>
<label class="todo-list__label [todo-list__label_checked]">
<input class="todo-list__label__checkmark" type="checkbox" disabled checked />
<span class="todo-list__label__description">Bar</span>
</label>
</li>
</ul>
</li>
</ul> In the editor:We may use any additional markup needed for styling. In the editing view:Checkboxes will be represented as UI elements, transparent for the selection. In the model:
Todo lists will be define in model as a separate list type: <listItem listType="todo" todoListChecked="true">foo</listItem>
<listItem listType="todo">bar</listItem> Note that, it does not prevent us from implementing "orderedTodo" type in the future if we will implement such lists. We will be also able to provide any UI on top of it if needed. Other:
|
That span without any class look bad to me – how will you be styling it or processing in any other way? I think it should have a class and this class should be following BEM. Possibly, the same applies to the input. To avoid styling it via |
Can you propose something? |
Already updated. |
From a11y perspective it's just a worse solution. If we're going to use <ul class="todo-list">
<li>
<input type="checkbox" disabled checked aria-labelledby="checkbox-label1">
<span id="checkbox-label1">Foo</span>
</li>
</ul> Alternatively we can disable |
Re: #1434 (comment)
cc @oleq. Edit: In the next comment I proposed some classes but I need someone verifying this. |
Data viewI'd like to understand one thing – why can't, in the data, the whole input be nested inside a <ul class="todo-list">
<li>
<label>
<input type="checkbox" disabled checked class="todo-list__checkmark">
<span class="todo-list__label">Foo</span>
</label>
</li>
</ul> We've got the label for a11y. We don't need ids. We have spans for styling. And we have classes for easier and more precise targetting from stylesheets and other forms of processing. Editing viewIn the editing view I think we don't need a |
With this markup, we will need an extra Other than that it should work properly. You can see it here: https://codepen.io/k0n0pka/pen/MNWjpO |
Perhaps |
It could look as follows: <ul class="todo-list">
<li>
<label class="todo-list__item">
<input class="todo-list__item__checkmark" type="checkbox" />
<span class="todo-list__item__label">Set up a mobile carrier PIN </span>
</label>
</li>
<li>
<label class="todo-list__item todo-list__item_checked">
<input class="todo-list__item__checkmark" type="checkbox" checked />
<span class="todo-list__item__label">Freeze your credit (US)</span>
</label>
</li>
</ul> Although it's pretty weird seeing Edit: This made me think the markup is wrong. If you can't name it so it makes sense, something else is wrong. Maybe <label class="todo-list__label [todo-list__label_checked]">
<input class="todo-list__label__checkmark" type="checkbox" />
<span class="todo-list__label__description">Set up a mobile carrier PIN </span>
</label> ? |
As I already mentioned some time ago:
Such label also means that the return data works differently than the one you have in the editor. In the editor you need to click on the checkbox to change the value. Outside the editor, you can also click on the label. It could be misleading if the integration allows you to dynamically switch between the editor and the content. I am also not sure if it will be correct for nested lists: <ul class="todo-list">
<li>
<label>
<input type="checkbox" disabled checked class="todo-list__checkmark">
<span class="todo-list__label">Foo</span>
<ul class="todo-list">
<li>
<label>
<input type="checkbox" disabled checked class="todo-list__checkmark">
<span class="todo-list__label">Bar</span>
</label>
</li>
</ul>
</label>
</li>
</ul> For such case we would need to transform it to: <ul class="todo-list">
<li>
<label>
<input type="checkbox" disabled checked class="todo-list__checkmark">
<span class="todo-list__label">Foo</span>
</label>
<ul class="todo-list">
<li>
<label>
<input type="checkbox" disabled checked class="todo-list__checkmark">
<span class="todo-list__label">Bar</span>
</label>
</li>
</ul>
</li>
</ul> What might be tricky to implement. |
I think that we can handle a11y for todo lists later. |
So to sum up the design topic: you will find here https://codepen.io/k0n0pka/pen/MNWjpO a finished proposal with an icon of the to-do list. |
@wwalc said that |
Docs: Docs for to-do list feature. Part of ckeditor/ckeditor5#1434.
EDIT: You can find the demo of to-do lists here: https://ckeditor.com/docs/ckeditor5/latest/features/todo-lists.html I am pleased to inform you that to-do lists, developed by @oskarwrobel just landed on the master branch and will be available in the next public release! |
Feature: Introduced to-do lists. Closes ckeditor/ckeditor5#1434.
Should add a progress with badge too |
Is this a bug report or feature request? (choose one)
🆕 Feature request
💻 Version of CKEditor
CKEditor 11.2.0
It's sometimes useful to be able to create an interactive checkbox for e.g. task lists etc. By that I mean you would be able to insert checkbox at the desired position by e.g. clicking on the toolbar and then you can check it and uncheck it in the editor.
The text was updated successfully, but these errors were encountered: