Skip to content

BUG: [ai-widget] accept and reject buttons do not appear after regenerate #82

@luizzappa

Description

@luizzappa

There is a bug in the ai-widget.

Scenario:

  1. The first response from the chat function call returns with status: "error".
  2. The user clicks Regenerate, and the new response returns with status: "success".
  3. Expected behavior: the accept and reject buttons should appear.
  4. Actual behavior: the buttons do not appear.
Image

Workaround

If it's a success response from LLM API calling, do this:

  const acceptBtn = document?.querySelector(
    'button#cm-ai-prompt-btn-accept'
  ) as HTMLButtonElement;
  if (acceptBtn) {
    acceptBtn.style.display = 'initial';
  }

  const discardBtn = document?.querySelector(
    'button#cm-ai-prompt-btn-discard'
  ) as HTMLButtonElement;
  if (discardBtn) {
    discardBtn.style.display = 'initial';
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions