[Draft] Add Spright Chat Message Welcome to Chat Component#2891
[Draft] Add Spright Chat Message Welcome to Chat Component#2891hellovolcano wants to merge 4 commits intomainfrom
Conversation
| > = (context, definition) => html<ChatMessageWelcome>` | ||
| <div class="container"> | ||
| <div class="brand-icon"> | ||
| <slot name="brand-icon"></slot> |
There was a problem hiding this comment.
The spec suggested we should have a default here, but I'm not sure that exists yet?
There was a problem hiding this comment.
It does not. I was envisioning that we'd lift the icon contents from the existing Blazor implementation and put it in a new theme-aware Spright icon component that follows the patterns of the new Spright icons added in #2861.
|
@jattasNI -- I have a draft of the message content, but I'm still working on the wrappers. I'm OOO Mar 9-13, so I won't make much progress on this until the following week, but wanted you to be aware (and you're welcome to do a first pass review if you have time). |
| 'A slot to optionally include content (such as banners) which will be displayed below the toolbar and above the messages.', | ||
| table: { category: apiCategory.slots } | ||
| }, | ||
| welcome: { |
There was a problem hiding this comment.
This makes it look like the conversation has a dedicated slot for the welcome message, which is not the case. I think we can just delete this entry and clients will hopefully understand that the welcome message is just another message type.
| <section class="message-content"> | ||
| <slot></slot> | ||
| </section> | ||
| ${endSlotTemplate(context, definition)} |
There was a problem hiding this comment.
Do we need the end slot for this message type? I didn't include it in the spec but if there's a need I'm not opposed to it. If we don't need it, let's remove it from here, the component index.ts, the component styles, and storybook docs.
| */ | ||
| export class ChatMessageWelcome extends FoundationElement { | ||
| @attr({ attribute: 'title' }) | ||
| public welcomeTitle?: string; |
There was a problem hiding this comment.
I'm guessing this isn't called title because it conflicts with a native element property? I hadn't registered that would be a problem. If that's the case then I think we should move away from that conflict completely and change the attribute name too: we don't want confusion between the native attributes and our own.
I guess welcome-title is a good enough name for the attribute. We can't copy the banner for precedent because it's able to use title since it's the name of a slot, which doesn't conflict with anything.
# Pull Request https://dev.azure.com/ni/DevCentral/_workitems/edit/3786413 Continuation of #2891 ## 🤨 Rationale Adding welcome message for Spright Chat Component, as defined in [Chat components]https://github.com/ni/nimble/blob/main/packages/spright-components/src/chat/specs/README.md) <!--- Provide some background and a description of your work. What problem does this change solve? Include links to issues, work items, or other discussions. --> ## 👩💻 Implementation - Added new spright-chat-message-welcome component and framework wrapper. - Added new story for the welcome message. ## 🧪 Testing Manual testing and added tests ## ✅ Checklist <!--- Review the list and put an x in the boxes that apply or ~~strike through~~ around items that don't (along with an explanation). --> - [ ] I have updated the project documentation to reflect my changes or determined no changes are needed. --------- Co-authored-by: Valerie Gleason <5265744+hellovolcano@users.noreply.github.com> Co-authored-by: Jesse Attas <jattasNI@users.noreply.github.com>
Pull Request
🤨 Rationale
Adding welcome message for Spright Chat Component, as defined in Chat components.
👩💻 Implementation
🧪 Testing
✅ Checklist