mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 23:03:09 +00:00
feat(feedback): adopt 0–10 recommendation scale (#2438)
* feat(feedback): adopt 10-point recommendation scale * docs(feedback): keep OSS scale contract self-contained
This commit is contained in:
@@ -180,9 +180,9 @@ export const StudioFeedbackBar = memo(function StudioFeedbackBar() {
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<span className="text-neutral-500 flex-shrink-0">How's the Studio experience?</span>
|
||||
<span className="text-neutral-500 flex-shrink-0">Recommend HyperFrames?</span>
|
||||
<div className="flex items-center gap-0.5">
|
||||
{[1, 2, 3, 4, 5].map((n) => (
|
||||
{Array.from({ length: 11 }, (_, n) => n).map((n) => (
|
||||
<button
|
||||
key={n}
|
||||
onClick={() => handleRating(n)}
|
||||
|
||||
@@ -12,6 +12,7 @@ const {
|
||||
trackStudioRenderStart,
|
||||
trackStudioRazorSplit,
|
||||
trackStudioExpandedClipEdit,
|
||||
trackStudioFeedback,
|
||||
} = await import("./events");
|
||||
|
||||
describe("studio telemetry events", () => {
|
||||
@@ -69,4 +70,13 @@ describe("studio telemetry events", () => {
|
||||
trackStudioExpandedClipEdit({ action: "resize" });
|
||||
expect(trackEvent).toHaveBeenCalledWith("studio_expanded_clip_edit", { action: "resize" });
|
||||
});
|
||||
|
||||
it.each([0, 10])("trackStudioFeedback preserves NPS boundary %i and its scale", (rating) => {
|
||||
trackStudioFeedback({ rating });
|
||||
|
||||
expect(trackEvent).toHaveBeenCalledWith(
|
||||
"survey sent",
|
||||
expect.objectContaining({ $survey_response: rating, rating_scale: 10 }),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -67,6 +67,7 @@ export function trackStudioFeedback(props: { rating: number; comment?: string })
|
||||
trackEvent("survey sent", {
|
||||
$survey_id: "studio_experience",
|
||||
$survey_response: props.rating,
|
||||
rating_scale: 10,
|
||||
...(props.comment ? { $survey_response_2: props.comment } : {}),
|
||||
doctor_summary: getBrowserDoctorSummary(),
|
||||
source: "studio",
|
||||
|
||||
Reference in New Issue
Block a user