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

[Rich text editor] Add list formatting buttons to the rich text editor #7887

Merged
merged 5 commits into from
Jan 5, 2023

Conversation

jonnyandrew
Copy link
Contributor

@jonnyandrew jonnyandrew commented Jan 4, 2023

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Add list formatting buttons to the rich text editor.

Motivation and context

PSU-1058

Screenshots / GIFs

lists.webm

Toggling list types

switching-list-types.webm

Tests

Note that the feature is still a little unstable so expect some quirks while testing manually.

  • Enable rich text editor in labs
  • Start composing a message
  • Tap the 'bullet list' button
  • Note the text becomes a bullet list
  • Tap the 'numbered list' button
  • Note the text becomes a numbered list

Tested devices

  • Physical
  • Emulator
  • OS version(s): Android 13

Checklist

@jonnyandrew jonnyandrew changed the title Integrate lists to the rich text editor [Rich text editor] Add list formatting buttons to the rich text editor Jan 4, 2023
@ElementBot
Copy link

Warnings
⚠️

Please add a changelog. See instructions here

Generated by 🚫 dangerJS against 80fd02d

@jonnyandrew jonnyandrew marked this pull request as ready for review January 4, 2023 13:43
@jonnyandrew jonnyandrew requested review from a team and mnaturel and removed request for a team January 4, 2023 13:44
Copy link
Contributor

@mnaturel mnaturel left a comment

Choose a reason for hiding this comment

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

I have only small remarks. When testing it I also found that it is not obvious we can have more options by scrolling horizontally. Maybe we should not fade out the scrollbar, what do you think?

@@ -0,0 +1 @@
Add your info here
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we should update the changelog entry with the real entry?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -240,6 +240,12 @@ internal class RichTextComposerLayout @JvmOverloads constructor(
}
}
}
addRichTextMenuItem(R.drawable.ic_composer_bullet_list, R.string.rich_text_editor_bullet_list, ComposerAction.UNORDERED_LIST) {
views.richTextComposerEditText.toggleList(false)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it would be more clear to use named parameter?

Suggested change
views.richTextComposerEditText.toggleList(false)
views.richTextComposerEditText.toggleList(ordered = false)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

views.richTextComposerEditText.toggleList(false)
}
addRichTextMenuItem(R.drawable.ic_composer_numbered_list, R.string.rich_text_editor_numbered_list, ComposerAction.ORDERED_LIST) {
views.richTextComposerEditText.toggleList(true)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
views.richTextComposerEditText.toggleList(true)
views.richTextComposerEditText.toggleList(ordered = true)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jonnyandrew
Copy link
Contributor Author

jonnyandrew commented Jan 5, 2023

When testing it I also found that it is not obvious we can have more options by scrolling horizontally. Maybe we should not fade out the scrollbar, what do you think?

I agree and actually in the designs we have a 'faded edge' to indicate that the buttons can be scrolled horizontally. I've added this in f0bf4d6.

Here's what it looks like:

fading-edge.webm

@sonarcloud
Copy link

sonarcloud bot commented Jan 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@mnaturel mnaturel left a comment

Choose a reason for hiding this comment

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

Thanks for the updates. LGTM!

@jonnyandrew jonnyandrew merged commit bbb0036 into develop Jan 5, 2023
@jonnyandrew jonnyandrew deleted the feat/PSU-1058-editor-lists branch January 5, 2023 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants