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

vaadin-message theme variants #1994

Open
pekam opened this issue May 25, 2021 · 0 comments
Open

vaadin-message theme variants #1994

pekam opened this issue May 25, 2021 · 0 comments
Labels
enhancement New feature or request vaadin-messages

Comments

@pekam
Copy link
Contributor

pekam commented May 25, 2021

As of resolving issue vaadin/collaboration-engine#30, users of the <vaadin-message-list>/MessageList component can provide theme attributes for individual message items for customizing e.g. how the user's own messages look compared to others.

So far we don't provide any theme variants for Lumo or Material. The default theme of <vaadin-message-list> is similar to Slack and Discord. Another common design in chats can be seen in e.g. WhatsApp and FB Messenger: the text content is inside a bubble, own messages are highlighted and aligned to the right side.

The following picture shows designs for the mentioned theme features by @anezthes. It shows also alternative positions of user name and time, which are maybe not as important, but can be also considered as theme variants.

image

This is open for discussion, but as a starting point I'd propose the following steps to resolve the ticket:

  • Implement the following theme variants for <vaadin-message> in Lumo:
    • filled: content has grey background
    • outbound: the user's own messages, like filled with primary background color
    • endaligned: aligned to the right side in LTR, or left in RTL
  • Support theme attribute on <vaadin-message-list>/MessageList component, which would be propagated to all the child messages. This would enable the user to set e.g. filled only once to the message list, and then customizing only own messages with the outbound variant.
  • Add type-safe Flow APIs for setting these variants to MessageList and MessageListItem:
messageList.addThemeVariants(MessageVariant.LUMO_FILLED);

messageListItem.addThemeVariants(MessageVariant.LUMO_OUTBOUND);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vaadin-messages
Projects
None yet
Development

No branches or pull requests

2 participants