Skip to main content

data-attribute for AI message response state (typing... or completed)

would love a way to know (like data attribute) when a message is in draft (typing) state or completed.

currently, based on a lot of research, it seems that messages with "typing effect" show one dom element, then get replaced/removed when its completed with another element. could be a framework level thing if not intentional.

that pointer to the draft message goes stale when complete.

i use the following query check to determine whether something is in draft (typing) state or if it's completed, which sucks

const isOriginalMsgItemFinalized = msg.matches(`[data-element-id="response-block"]:has([d="${verticalMoreIconPath}"])`);const getIsMsgAtIdxFinalized = () => {  if (isOriginalMsgItemFinalized) return true;  // already came finalized  // same as a draft, so we can check if its gone  const isOrphaned = !msg.parentElement?.parentElement;  return isOrphaned;};

Log in to comment and vote

No comments yet

Be the first to share your thoughts.