-
Notifications
You must be signed in to change notification settings - Fork 1
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
Highlight own vaadin-messages from others #30
Comments
The same feature could also be used to distinguish “system messages” from messages from end users. |
Agreed. I think this could be called something like "source" or "origin". We should still separate "me" and "system" so that they can be handled separately, as both can have separate visuals and separate features (delete, edit..) Thoughts on how this could be implemented. Names can be debated:
|
I can write the CSS for that on Wednesday. Semi-related: we have a PR for 'system' messages here: Just CSS though. |
My initial thought was to add support for setting a And apparently Jonte had a similar idea, since me already wrote the CSS like that. |
We're indeed planning to implement this with the theme variant mechanism, which enables users to provide also custom attributes for custom theming per message. One challenge there is that the Flow's The theme variant for own messages would be called Steps:
At this point the developers can target own messages for styling.
collaborationMessageList.setMessageConfigurator((item, user) -> {
item.removeThemeNames("outbound");
if (!user.equals(localUser)) {
item.addThemeNames("inbound");
}
});
|
the first step towards highlighting your own messages: vaadin/collaboration-kit#30
the first step towards highlighting your own messages: vaadin/collaboration-kit#30
Only with strings at this point, since no theme variants have been implemented so far. This enables developers to apply custom theming per each message in a MessageList. Related issue: vaadin/collaboration-kit#30
Only with strings at this point, since no theme variants have been implemented so far. This enables developers to apply custom theming per each message in a MessageList. Related issue: vaadin/collaboration-kit#30
We concluded with @anezthes that we should not set any theme variant to own messages by default. Highlighting your own messages looks good only with a theme that has "bubbles" around the content, like in the screenshot in this ticket. Our message components are similar to Slack and Discord, where there's also no highlight for own messages. Any custom theme variant can still be added to own messages with the new message configurator API: collaborationMessageList.setMessageConfigurator((message, user) -> {
if (user.equals(localUser)) {
message.addThemeNames("outbound");
}
}); |
The issue is resolved with the following PRs:
|
I opened a new ticket for providing Lumo theme variants out of the box: vaadin/web-components#1994 |
Is your feature request related to a use case? Please describe.
In vaadin-message-list, I would like to be able to style my own messages to be different from other messages.
Describe the solution you'd like
There should be an easy way to apply custom styling to certain messages. This could be done by introducing an attribute to vaadin-message.
Additional context
The text was updated successfully, but these errors were encountered: