Class ChatFormComponent

java.lang.Object
ai.mindconnect.adminui.ui.component.ChatFormComponent
All Implemented Interfaces:
UiComponent

public final class ChatFormComponent extends Object implements UiComponent
The chat-input form at the bottom of a ChatPage — a single textarea plus a context-sensitive Send / Stop button.

The component has two visual states:

  • idle — textarea is editable, button is a primary "Send" that posts to the streaming chat endpoint.
  • streaming — textarea is read-only, button is a danger "Stop" that cancels the in-flight turn via DELETE on the chat endpoint.

The form id is stable across both states so a REPLACE patch can morph the body without losing the surrounding DOM context; the textarea's id is also stable so ignoreActiveValue on the morpher preserves anything the user has already typed.

  • Constructor Summary

    Constructors
    Constructor
    Description
    ChatFormComponent(UUID sessionId, UUID agentId)
     
    ChatFormComponent(UUID sessionId, UUID agentId, boolean streaming)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    id()
    The DOM id this component renders with.
    ai.mindconnect.ui.model.UiNode
    Renders the composer in whichever state matches the live stream registry.
    ai.mindconnect.ui.model.UiPatch.Operation
    REPLACE that resets the form to its idle state (Send button, editable textarea, no buffered text).
    ai.mindconnect.ui.model.UiPatch.Operation
    Alias for reset(), named after the visual state for callers that prefer the idle/streaming vocabulary.
    ai.mindconnect.ui.model.UiPatch.Operation
    REPLACE that swaps the Send button for a Stop button and locks the textarea as read-only.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ChatFormComponent

      public ChatFormComponent(UUID sessionId, UUID agentId)
    • ChatFormComponent

      public ChatFormComponent(UUID sessionId, UUID agentId, boolean streaming)
  • Method Details

    • id

      public String id()
      Description copied from interface: UiComponent
      The DOM id this component renders with. Patch operations targeting this component (REPLACE / CLEAR / REMOVE) use this id, so it must match the id on the root UiNode returned by UiComponent.render().
      Specified by:
      id in interface UiComponent
    • render

      public ai.mindconnect.ui.model.UiNode render()
      Renders the composer in whichever state matches the live stream registry.
      Specified by:
      render in interface UiComponent
    • reset

      public ai.mindconnect.ui.model.UiPatch.Operation reset()
      REPLACE that resets the form to its idle state (Send button, editable textarea, no buffered text). Used after a turn completes — both on the streaming and the non-streaming path.
    • toStreaming

      public ai.mindconnect.ui.model.UiPatch.Operation toStreaming()
      REPLACE that swaps the Send button for a Stop button and locks the textarea as read-only. Used at the start of a streaming turn.
    • toIdle

      public ai.mindconnect.ui.model.UiPatch.Operation toIdle()
      Alias for reset(), named after the visual state for callers that prefer the idle/streaming vocabulary.