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

Preserving custom colors feature #1795

Closed
jacekbogdanski opened this issue Mar 14, 2018 · 2 comments · Fixed by #3784
Closed

Preserving custom colors feature #1795

jacekbogdanski opened this issue Mar 14, 2018 · 2 comments · Fixed by #3784
Assignees
Labels
plugin:colorbutton The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. type:feature A feature request.
Milestone

Comments

@jacekbogdanski
Copy link
Member

jacekbogdanski commented Mar 14, 2018

Are you reporting a feature request or a bug?

Feature request

Provide detailed reproduction steps (if any)

  1. Open Sample.
  2. Click Text Color button.
  3. When dialog show up click More colors.
  4. Select custom color and click Ok.
  5. Click Text Color button again.

Expected result

New color should be added to color palette inside colorbutton dialog.

screen shot 2018-03-14 at 12 20 54

Actual result

User is not able to get back to previous selected color from colorbutton dialog.

screen shot 2018-03-14 at 12 22 15

Other details

We had some brain storm with @mlewand how to implement this feature and we find out with some idea:

  1. Scan editor content for elements containing color information on dialog open. It could be defined be default as span[color] or configured by user e.g. colorButton_backStyle, colorButton_foreStyle. We should find out the most performant way to scan editor content by keeping CSS selectors precise.
  2. Filter out default colors. We don't want to duplicate already #defined default colors.
  3. Sort colors by occurrence so we will be able to choose the most frequent ones.
  4. Limit custom colors to some value, 12 should be fine (two rows). With this limitation we will keep dialog relatively small so it won't grow too big if a user used many different colors inside editor.
  5. Append custom colors to dialog. A user will be able to reapply previously selected color without the need to memorise or use Copy Formatting feature.
@jacekbogdanski jacekbogdanski added type:feature A feature request. status:confirmed An issue confirmed by the development team. plugin:colorbutton The plugin which probably causes the issue. labels Mar 14, 2018
@Dumluregn Dumluregn self-assigned this Nov 29, 2019
@Dumluregn
Copy link
Contributor

Some further specs:

  1. Custom colors will be displayed between default palette and More colors button to avoid confusion (some padding should help in it too).
  2. Text and background colors should be handled separately.
  3. We want to track both colors used in document and those picked from colordialog. The latter have priority: they should be displayed first. After them if we didn't reach the limit (which will probably be set to 2 full rows) we also display colors from the document.
  4. Document colors should be updated on each panel show. This way we are able to catch custom colors in content pasted from Word etc.
  5. Colors from colordialog should be ordered from the most recently picked. Colors found in content should be ordered by number of occurrences, counted in <span> elements.
  6. For now we don't include config options to change the way of searching for colors in document.
  7. Feature should work both with and without colordialog. In the second version it should just collect colors from document.
  8. If color was added to custom palette, it shouldn't disappear even if it is no longer used. The only case we stop displaying it is if we have too many colors that are have higher priority (according to sorting rules described above).

@Dumluregn
Copy link
Contributor

As the feature for finding colors in the editor contents is basically a separate feature, I created a separate issue for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin:colorbutton The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. type:feature A feature request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants