UXInteract / task_022 /instruction.md
DojiSum's picture
Publish the current 141-task UXInteract release
ef987bb verified
|
Raw History Blame Contribute Delete
1.55 kB

Floating draft composer

In the supplied root index.html, turn the floating prompt area into the composer for an unsent message. Move the existing editable control into it rather than making a second editor; remove the floating copy of sent content. Keep the page offline.

Interaction and style

Retain data-testid="floating-prompt-area" and data-testid="reusable-prompt-input". Keep the floating area fixed, visible within the viewport and stable during scrolling. Add an identifiable Send button with data-testid="send-button". While editing, keep draft text only in the composer. Sending nonblank text appends one user message bubble containing the submitted text in the chat history and clears the composer. Whitespace-only input does not append anything. Mark user bubbles with the existing user-message class or data-testid="chat-message-user".

Expose window.__setComposerCorners(mode) with "square" and "rounded". The square state has computed radius 0 and the rounded state has positive radius. Switching modes or scrolling must not replace the input, lose its draft or inadvertently reset its corners.

Acceptance Checklist

  • The offline page presents one reusable editor within a fixed, in-viewport composer. It stays put during scrolling and does not duplicate unsent drafts or display old sent-message text there.
  • Send appends exactly one separate bubble with the entered text, clears the input and ignores blank text.
  • Both corner styles take effect on the same composer and preserve the current draft.