Skip to content

Feedback buttons should not squash other buttons#5480

Merged
compulim merged 31 commits intomicrosoft:mainfrom
compulim:fix-feedback-form-with-copy-button
May 19, 2025
Merged

Feedback buttons should not squash other buttons#5480
compulim merged 31 commits intomicrosoft:mainfrom
compulim:fix-feedback-form-with-copy-button

Conversation

@compulim
Copy link
Copy Markdown
Contributor

@compulim compulim commented May 16, 2025

Fixes #5479.

Changelog Entry

Fixed

  • Fixed #5479. Fixed feedback form buttons should not squash other buttons, in PR #5480, by @compulim
    • Migrated to radio button for like/dislike where form submission is required

Description

UI issue

When the feedback form is enabled, the feedback buttons are grouped in a flex container and its width is set to 100%, forcing other component to squash.

Form

A <form> is now put around the like/dislike button and the feedback form. It will handle all kind of like/dislike and form submissions.

Button vs. radio button

  • If no feedback form, the like/dislike button is an action, thus, they are <input type="button"> and submitted (almost) immediately
    • Press ESC will do nothing as the selection has already submitted
  • If feedback form is available, the like/dislike is <input type="radio">
    • Press ESC will cancel the selection of like/dislike

Design

Moving from channelData to entities

Today, due to limitation on Copilot Studio backend, we have to use channelData.feedbackLoop as a temporary solution to indicate feedback that would have review feedback.

{
  "channelData": {
    "feedbackLoop": {
      "disclaimer": "...", // optional
      "type": "default"
    }
  },
  "entities": [
    {
      "@id": "",
      "@type": "Message"
      "potentialAction": [
        {
          "@type": "LikeAction"
        },
        {
          "@type": "DislikeAction"
        }
      ]
    }
  ],
  "text": "...",
  "type": "message"
}

In this PR, we are leveraging the Schema.org standard:

{
  "entities": [
    {
      "@id": "",
      "@type": "Message"
      "potentialAction": [
        {
          "@type": "LikeAction",
          "result": {
            "@type": "UserReview",
            "reviewAspect": "..." // optional
          }
        },
        {
          "@type": "DislikeAction",
          "result": {
            "@type": "UserReview",
            "reviewAspect": "..." // optional
          }
        }
      ]
    }
  ],
  "text": "...",
  "type": "message"
}

The LikeAction literally means: "the user liked this message and that action resulted in a user review." The review content (feedback text) will become UserReview.reviewBody in latter PR.

We will maintain the backcompat code that migrate channelData.feedbackLoop to entities[@id=""].potentialAction.result until Copilot Studio fully onboarded the standard payload.

Specific Changes

  • Updated feedback form to do the grouping differently
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@compulim compulim marked this pull request as ready for review May 17, 2025 02:06
import root from './root';

// TODO: Test harness and page objects should move to TypeScript.
// TODO: We should use @testing-library/dom instead.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The perf of RTL is what concerns me...

OEvgeny
OEvgeny previously approved these changes May 18, 2025
@compulim compulim merged commit d1cd51a into microsoft:main May 19, 2025
25 checks passed
@compulim compulim deleted the fix-feedback-form-with-copy-button branch May 19, 2025 22:49
@OEvgeny OEvgeny mentioned this pull request Jun 17, 2025
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feedback form buttons should not squash other buttons

2 participants