Skip to main content
Version: ChatLead

Chat Window Design Reconfiguration

Author(s)

  • Alapan Das

Last Updated Date

2025-02-11


SRS References


Version History

VersionDateChangesAuthor
12025-02-11Initial draftAlapan Das
............

This documentation provides an overview of the chat window component, its structure, usage, and program workflow. The chat window is designed to facilitate real-time communication between users and operators.

Folder Structure

/ root folder

├── baseComponent.ts
├── bottomSection
│ ├── action-area.component.css
│ ├── action-area.component.html
│ ├── action-area.component.ts

├── chat-widget.component.css
├── chat-window5.component.ts
├── chat-window5.module.ts
├── customization
│ └── customization.ts

├── dailogs
│ ├── chatConfirmation.component.css
│ ├── chatConfirmation.component.html
│ ├── chatConfirmation.component.ts
│ ├── chatSwich.component.css
│ ├── chatSwich.component.html
│ ├── chatSwitch.component.ts
│ └── confirmationDialog.component.html
│ └── confirmationDialog.component.ts

├── middleSection
│ ├── choose-websms.component.css
│ ├── choose-websms.component.html
│ ├── choose-websms.component.ts
│ ├── conversation.component.css
│ ├── conversation.component.html
│ ├── conversation.component.ts
│ ├── form-in-chat
│ │ ├── form-in-chat.component.css
│ │ ├── form-in-chat.component.html
│ │ └── form-in-chat.component.ts
│ ├── survey.component.css
│ ├── survey.component.html
│ └── survey.component.ts

├── surveyFields
│ ├── checkBox.component.ts
│ ├── input.component.ts
│ ├── radio.component.ts
│ ├── rating.component.html
│ ├── rating.component.scss
│ ├── rating.component.ts
│ ├── select.component.ts
│ └── textArea.component.ts

└── topSection
├── header.component.css
├── header.component.html
├── header.component.ts
├── listOperatorInfo.component.css
├── listOperatorInfo.component.html
└── listOperatorInfo.component.ts

Components Overview

1. Base Component

  • File: baseComponent.ts
  • Usage: This is the base class for all components in the chat window. It manages subscriptions and UI updates.
  • Key Methods:
    • updateUI(): Updates the UI and handles change detection.
    • addSubscriptions(): Adds subscriptions to the component.
    • unSubscribeSubscriptions(): Unsubscribes from all subscriptions.

2. Action Area Component

  • File: action-area.component.ts
  • Usage: This component handles the user input area, including sending messages and managing chat controls.
  • Key Features:
    • Text area for user input.
    • Buttons for sending messages and managing chat options (e.g., video chat).
    • Displays error messages and typing indicators.

3. Chat Window Component

  • File: chat-window5.component.ts
  • Usage: The main component that encapsulates the chat window structure, including header, conversation, and action area.
  • Key Features:
    • Manages the layout of the chat window.
    • Controls visibility of different sections based on chat state.

4. Choose Web SMS Component

  • File: choose-websms.component.ts
  • Usage: Allows users to select a department for SMS communication.
  • Key Features:
    • Displays department options.
    • Handles user selection and proceeds to the next step.

5. Conversation Component

  • File: conversation.component.ts
  • Usage: Displays the chat messages and handles the display of operator and visitor messages.
  • Key Features:
    • Renders messages based on sender type.
    • Displays typing indicators and system messages.

6. Survey Component

  • File: survey.component.ts
  • Usage: Manages survey forms presented to users during or after the chat.
  • Key Features:
    • Displays various survey fields (text, radio, checkbox).
    • Handles submission and validation of survey responses.

7. Dialog Components

  • Files:
    • chatConfirmation.component.ts
    • chatSwitch.component.ts
    • confirmationDialog.component.ts
  • Usage: These components manage modal dialogs for chat confirmations and switches.
  • Key Features:
    • Displays confirmation messages and handles user responses.

8. Survey Fields Components

  • Files:
    • checkBox.component.ts
    • input.component.ts
    • radio.component.ts
    • rating.component.ts
    • select.component.ts
    • textArea.component.ts
  • Usage: These components represent individual survey fields.
  • Key Features:
    • Each component handles its own validation and state management.

9. Header Component

  • File: header.component.ts
  • Usage: Displays the header of the chat window, including operator information and controls.
  • Key Features:
    • Shows operator name and image.
    • Provides close and minimize buttons.

Program Workflow

  1. Initialization:

    • The ChatWindow5Component initializes the chat window and sets up the necessary subscriptions.
  2. User Interaction:

    • Users can type messages in the ActionAreaComponent.
    • Users can select departments in the ChooseWebsmsComponent.
  3. Message Handling:

    • Messages are displayed in the ConversationComponent.
    • The component differentiates between operator and visitor messages.
  4. Survey Handling:

    • Surveys are presented using the SurveyComponent after certain chat states.
    • Users can fill out surveys using various field components.
  5. Dialog Management:

    • Confirmation dialogs are managed by the dialog components, allowing users to confirm actions like ending a chat.
  6. UI Updates:

    • The BaseComponent handles UI updates and change detection across all components.
  7. Cleanup:

    • On component destruction, subscriptions are cleaned up to prevent memory leaks.

Overview

alt text

Estimation

Component NameModification TypeEstimated Time (Hours)BufferTotal Time (Hours)
bottomSection (Action-area Component)Apply HTML213
bottomSection (Action-area Component)Apply CSS and Integration with .ts File313
dailogs (Chat Confirmation Component)Apply CSS314
dailogs (Chat Confirmation Component)Apply HTML and Integration112
dailogs (Chat Switch Component)Apply CSS and HTML2.513.5
dailogs (Chat Switch Component)Apply Integration2.513.5
dailogs (Confirmation Dialog Component)Apply HTML and CSS213
form-in-chat (Form in Chat Component)Apply HTML and CSS213
form-in-chat (Form in Chat Component)Changes in the .ts File213
middleSection (choose-websms Component)Changes in the CSS File213
middleSection (choose-websms Component)Changes in the HTML and .TS File213
middleSection (conversation Component)Changes in the CSS File213
middleSection (conversation Component)Changes in the HTML and .TS File213
surveyField (Survey Component)Changes in the CSS File213
surveyField (Survey Component)Changes in the HTML and .ts File112
topSection (Header Component)Changes in the CSS File30.53.5
topSection (list-operator Component)Changes in the CSS File20.52.5
topSection (operator-info Component)Changes in the CSS File and HTML File2.50.53
chat-widget Component Changes in the CSS File and HTML File10.51.5
Overall Component Integration and TestingTesting for overall component and demo chat30.53.5
Total----161

Review & Approval

(Include a section for review and approval by stakeholders.)

  • Reviewer:
    Rupanjan Hari

  • Approval Date:
    2025-02-18

Conclusion

This documentation provides a comprehensive overview of the chat window component structure, usage, and workflow. Each component plays a crucial role in ensuring a smooth and interactive chat experience for users and operators.