Skip to content
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

Show allowed heading options only #2426

Closed
fredck opened this issue Oct 18, 2016 · 7 comments
Closed

Show allowed heading options only #2426

fredck opened this issue Oct 18, 2016 · 7 comments
Labels
package:heading resolution:expired This issue was closed due to lack of feedback. squad:core Issue to be handled by the Core team. status:stale type:improvement This issue reports a possible enhancement of an existing feature.

Comments

@fredck
Copy link
Contributor

fredck commented Oct 18, 2016

We have implemented the heading feature just like anyone else out there. We just show a dumb list of options and let the user select any of them. We need more awesomeness in this feature.

I would propose showing in the list just the options that the user can use, based on the context:

  • If no headers were user before the current block: Heading 1
  • Heading 1 used before: Heading 1, Heading 2
  • Heading 2 used before: Heading 1, Heading 2, Heading 3
  • Heading 3 used before: Heading 1, Heading 2, Heading 3, Heading 4
  • ... and so on

In other words, we just list the previews levels plus the next level. In this way we help users creating better content by not even allowing them creating improper heading nesting.

Additionally, we could provide some visual clue, like an icon for every option in the list. For example:

  • H··, : Previous levels
  • H: Current level
  • ·H: Next level
  • : Paragraph
@Reinmar
Copy link
Member

Reinmar commented Oct 18, 2016

Interesting ideas. There's some danger in limiting the user to the "perfect usage" scenario, tough. First of all, you'll always be able to create a heading in one place and move it to the other place. Second, you might've just written a long piece of text and you want to start formatting it. First, you find subsections and add H2 to them, then the main title... but you won't be able to do that now. You'll have to first set H1 and only then you'll be able to set H2s.

So, this could be a quite frustrating feature. I'm really unsure whether it makes sense.

@fredck
Copy link
Contributor Author

fredck commented Oct 18, 2016

First of all, you'll always be able to create a heading in one place and move it to the other place.

Yes, we'll not be able to guarantee that the user will not mess things up. We can just help.

Second, you might've just written a long piece of text and you want to start formatting it. First, you find subsections and add H2 to them, then the main title... but you won't be able to do that now. You'll have to first set H1 and only then you'll be able to set H2s.

Kind of a weird way of thinking, so I would not make it a common case. Anyway, it may happen and it may cause frustration in such situation.

Another idea could be so using the visual clues only then. We could still list all heading options, but use the icons to let the user know what options fit best. We can then show ⚠ in the options that don't fit in the current document structure.

@Reinmar
Copy link
Member

Reinmar commented Oct 18, 2016

Kind of a weird way of thinking, so I would not make it a common case.

Well, that's how I'm writing articles very often. I don't see anything weird in that :|.

@fredck
Copy link
Contributor Author

fredck commented Oct 18, 2016

Maybe I see the case now... you say that "Title" is a heading, which in the CKEditor common use cases is not true. In those cases the title is a separate thing.

@Reinmar
Copy link
Member

Reinmar commented Oct 18, 2016

Yep, wrong wording. I meant a higher level heading than what I've just set.

But, in fact, it may be common that you'd like to have a post title directly in the editor. This happens if you're editing the whole document in the editor (like in Google Docs). For such cases, <h1> should be the first block which you can create in the editor, but you shouldn't be able to create more <h1> later on, so you'd have a special rule for that I guess.

Anyway, my point is that when creating limits we may, by mistake, block some valid use cases. So I like the idea with some indicators of recommended headings more :).

@mlewand mlewand transferred this issue from ckeditor/ckeditor5-heading Oct 9, 2019
@mlewand mlewand added this to the backlog milestone Oct 9, 2019
@mlewand mlewand added type:improvement This issue reports a possible enhancement of an existing feature. package:heading labels Oct 9, 2019
@Reinmar Reinmar added the squad:core Issue to be handled by the Core team. label Sep 21, 2020
@Reinmar Reinmar changed the title Show allowed options only Show allowed heading options only Oct 8, 2020
@pomek pomek removed this from the backlog milestone Feb 21, 2022
@CKEditorBot
Copy link
Collaborator

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

@CKEditorBot
Copy link
Collaborator

We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).

@CKEditorBot CKEditorBot added the resolution:expired This issue was closed due to lack of feedback. label Nov 2, 2023
@CKEditorBot CKEditorBot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:heading resolution:expired This issue was closed due to lack of feedback. squad:core Issue to be handled by the Core team. status:stale type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

No branches or pull requests

5 participants