diff --git a/CHANGELOG.md b/CHANGELOG.md index 54bab96543..2f285d9512 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,7 +86,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/ - Added support of [contentless activity in livestream](https://github.com/microsoft/BotFramework-WebChat/blob/main/docs/LIVESTREAMING.md#scenario-3-interim-activities-with-no-content), in PR [#5430](https://github.com/microsoft/BotFramework-WebChat/pull/5430), by [@compulim](https://github.com/compulim) - Added sliding dots typing indicator in Fluent theme, in PR [#5447](https://github.com/microsoft/BotFramework-WebChat/pull/5447) and PR [#5448](https://github.com/microsoft/BotFramework-WebChat/pull/5448), by [@compulim](https://github.com/compulim) - (Experimental) Add an ability to pass `completion` prop into Fluent send box and expose the component, in PR [#5466](https://github.com/microsoft/BotFramework-WebChat/pull/5466), by [@OEvgeny](https://github.com/OEvgeny) -- Added feedback form for like/dislike button when `feedbackActionsPlacement` is `"activity-actions"`, in PR [#5460](https://github.com/microsoft/BotFramework-WebChat/pull/5460), PR [#5469](https://github.com/microsoft/BotFramework-WebChat/pull/5469), and PR [5470](https://github.com/microsoft/BotFramework-WebChat/pull/5470) by [@lexi-taylor](https://github.com/lexi-taylor) and [@OEvgeny](https://github.com/OEvgeny) +- Added feedback form for like/dislike button when `feedbackActionsPlacement` is `"activity-actions"`, in PR [#5460](https://github.com/microsoft/BotFramework-WebChat/pull/5460), PR [#5469](https://github.com/microsoft/BotFramework-WebChat/pull/5469), PR [#5476](https://github.com/microsoft/BotFramework-WebChat/pull/5475) and PR [5470](https://github.com/microsoft/BotFramework-WebChat/pull/5470) by [@lexi-taylor](https://github.com/lexi-taylor) and [@OEvgeny](https://github.com/OEvgeny) - Added multi-dimensional grouping, `styleOptions.groupActivitiesBy`, and `useGroupActivitiesByName` hook, in PR [#5471](https://github.com/microsoft/BotFramework-WebChat/pull/5471), by [@compulim](https://github.com/compulim) - Existing behavior will be kept and activities will be grouped by `sender` followed by `status` - `useGroupActivitiesByName` is favored over the existing `useGroupActivities` hook for performance reason diff --git a/__tests__/html2/activity/feedback.noForm.html b/__tests__/html2/activity/feedback.noForm.html new file mode 100644 index 0000000000..3ac24cd7f9 --- /dev/null +++ b/__tests__/html2/activity/feedback.noForm.html @@ -0,0 +1,66 @@ + + +
+ + + + + + + + + + + + + diff --git a/__tests__/html2/activity/feedback.noForm.html.snap-1.png b/__tests__/html2/activity/feedback.noForm.html.snap-1.png new file mode 100644 index 0000000000..06eb5c3650 Binary files /dev/null and b/__tests__/html2/activity/feedback.noForm.html.snap-1.png differ diff --git a/packages/component/src/ActivityFeedback/providers/ActivityFeedbackComposer.tsx b/packages/component/src/ActivityFeedback/providers/ActivityFeedbackComposer.tsx index f1fc9ff4fc..04c93a091d 100644 --- a/packages/component/src/ActivityFeedback/providers/ActivityFeedbackComposer.tsx +++ b/packages/component/src/ActivityFeedback/providers/ActivityFeedbackComposer.tsx @@ -13,7 +13,7 @@ import dereferenceBlankNodes from '../../Utils/JSONLinkedData/dereferenceBlankNo import hasFeedbackLoop from '../private/hasFeedbackLoop'; import ActivityFeedbackContext, { type ActivityFeedbackContextType } from './private/ActivityFeedbackContext'; -const { usePonyfill, usePostActivity } = hooks; +const { usePonyfill, usePostActivity, useStyleOptions } = hooks; type ActivityFeedbackComposerProps = Readonly<{ activity: WebChatActivity; @@ -188,7 +188,9 @@ function ActivityFeedbackComposer({ children, activity: activityFromProps }: Act [actionsRef, actionStateRef, activityRef, postActivity, setActionStateWithRefresh] ); - const shouldShowFeedbackForm = hasFeedbackLoop(activity); + const [{ feedbackActionsPlacement }] = useStyleOptions(); + + const shouldShowFeedbackForm = hasFeedbackLoop(activity) && feedbackActionsPlacement === 'activity-actions'; const shouldShowFeedbackFormRef = useRefFrom(shouldShowFeedbackForm); const shouldShowFeedbackFormState = useMemo