Skip to content

Show optimistic user messages immediately in playground - #389

Open
SaravanakumarR2018 wants to merge 3 commits into
mainfrom
codex/fix-question-visibility-delay-in-playground
Open

Show optimistic user messages immediately in playground#389
SaravanakumarR2018 wants to merge 3 commits into
mainfrom
codex/fix-question-visibility-delay-in-playground

Conversation

@SaravanakumarR2018

Copy link
Copy Markdown
Owner

Motivation

  • Users reported that their typed question in the playground was not visible until the server response completed, creating a jarring delay; the goal is to make the input appear immediately.
  • Provide optimistic UI for user messages so the chat feels responsive while the flow is being built and executed.

Description

  • Insert optimistic user messages before the build runs by adding a temporary message in IOModal's sendMessage flow (file src/frontend/src/modals/IOModal/playground-modal.tsx) using ShortUniqueId and useMessagesStore.addMessage with a properties.optimistic flag.
  • Update message reconciliation in useMessagesStore.addMessage (file src/frontend/src/stores/messagesStore.ts) to replace an existing optimistic message with the authoritative server message when it arrives by matching flow_id, session_id, text, and sender, preventing duplicate entries.

Testing

  • No automated tests were executed as part of this change (not run).

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant