You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HLD updates for new Spright chat capabilities: welcome and disclaimer (#2799)
# Pull Request
## 🤨 Rationale
We would like to unify as much of the chat implementation as practical
across Angular and Blazor. These are two components that have Blazor
implementations in an application codebase that we want in an Angular
codebase too, so we want to introduce them to Spright: a welcome screen
and a disclaimer at the bottom of the conversation.
(Older Figma designs for illustration only)
**Welcome**
<img width="380" height="624" alt="chat-welcome-login"
src="https://github.com/user-attachments/assets/c67b88eb-0afd-4996-85fa-5fa941758258"
/>
**Disclaimer**
<img width="557" height="24" alt="chat-disclaimer"
src="https://github.com/user-attachments/assets/2d44e960-4915-48a2-bdd4-eb418e57ea24"
/>
## 👩💻 Implementation
Update the chat component HLD with an implementation proposal for these
components.
## 🧪 Testing
N/A
## ✅ 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). -->
- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.
@@ -195,6 +230,7 @@ Message components will be created with the following names:
195
230
- `spright-chat-message-inbound`
196
231
- `spright-chat-message-outbound`
197
232
- `spright-chat-message-system`
233
+
- `spright-chat-message-welcome`
198
234
199
235
##### Messages common API
200
236
@@ -209,10 +245,8 @@ All message types will share the following API:
209
245
- A message will grow its height to fit its content, with no maximum height.
210
246
- Clients could override this behavior but we don't anticipate use cases for doing so when the message is used within a conversation
211
247
- _Slots_
212
-
- `footer-actions`
213
-
- Action buttons to display after the main content.
214
248
- `end`
215
-
- Buttons with text that are displayed at the bottom after any action buttons.
249
+
- Buttons with text that are displayed at the bottom after any other content.
216
250
- `(default)`
217
251
- arbitrary content can be added to the default slot to be displayed within the message
218
252
@@ -221,8 +255,15 @@ All message types will share the following API:
221
255
- _Slots_
222
256
- `footer-actions`
223
257
- Action buttons to display after the main content.
224
-
- `end`
225
-
- Buttons with text that are displayed at the bottom after any action buttons.
258
+
259
+
##### Welcome message additional API
260
+
261
+
- _Props/Attrs_
262
+
- `title` - string attribute for the primary welcome message
263
+
- `subtitle` - string attribute for a secondary welcome message. Naming is aligned with `nimble-dialog`
264
+
- _Slots_
265
+
- `brand-icon` slot can be used to customize the brand image. By default it will display a new icon `spright-icon-nigel-chat` which is a theme-aware custom icon (a custom element that derives from `IconSvg`)
266
+
- default slot can be used to provide content below the icon, title, and subtitle. For example, a login button or suggested outbound messages.
226
267
227
268
#### Conversation
228
269
@@ -242,6 +283,7 @@ All message types will share the following API:
242
283
- chat messages are added to the default slot. The DOM order of the messages controls their screen order within the conversation (earlier DOM order => earlier message => top of the conversation)
243
284
- a single chat input can optionally be added to the `input` slot. It will be placed below the messages
244
285
- a toolbar can optionally be added to the `toolbar` slot. The toolbar will be displayed above the messages. The toolbar content can be buttons or menus used for actions like starting a new conversation, copying all messages, or other conversation-level operations.
286
+
- chat disclaimer content can optionally be added to the `end` slot. It will be placed below the input. The slot will apply color and font size styles to text and anchor content to match the visual design spec. See [the existing Blazor implementation](https://dev.azure.com/ni/DevCentral/_git/ASW?path=/Source/MeasurementServices/AiAssistants/Controls/Components/ChatbotViewFooter.razor) for reference.
245
287
246
288
#### Input
247
289
@@ -309,6 +351,12 @@ A message is simply a `div` which will styled with background / border / rounded
309
351
</template>
310
352
```
311
353
354
+
##### Welcome message
355
+
356
+
The template will include an `svg` element to render the image. The image requires different svg contents for dark and light themes (they use different gradient parameters). The gradient content will be specified in a new design token.
357
+
358
+
We can use [the existing Blazor implementation](https://dev.azure.com/ni/DevCentral/_git/ASW?path=/Source/MeasurementServices/AiAssistants/Controls/Components/StartPage.razor) and [images](https://dev.azure.com/ni/DevCentral/_git/ASW?path=/Source/MeasurementServices/AiAssistants/NigelLocalService/wwwroot/Images/two-chat-sparkle_green_DarkUI_48x48.svg) for reference.
359
+
312
360
#### Conversation
313
361
314
362
Other than setting a background, a conversation has no appearance of its own and simply contains the default slot for messages and the input slot for the chat input, along with wrapper `div`s for layout purposes.
@@ -434,7 +482,7 @@ On mobile, typing a newline in the input will be difficult as most on-screen key
434
482
435
483
### Globalization
436
484
437
-
Most content is provided by applications so they are responsible for localization. For the input component "Send" and "Stop" button titles and accessible labels we will add label provider strings. These supply default labels which applications can localize or replace with custom labels. These will be added to a new Spright chat label provider.
485
+
Most content is provided by applications so they are responsible for localization. For components with user-visible text we will add label provider strings. These supply default labels which applications can localize or replace with custom labels. These will be added to a new Spright chat label provider.
438
486
439
487
Defining the behavior for RTL languages is initially out of scope. But the API can easily be extended to support changing the layout for an RTL language when that is desired.
0 commit comments