Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into buc-3227-dogfooding-dont-require-satisfactio…
…n-score-when-asking-for
  • Loading branch information
laander committed Sep 9, 2025
commit ab464b6d296205e34ce0dfa24cde8bb3824207dd
2 changes: 1 addition & 1 deletion packages/browser-sdk/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</style>
<div id="start-huddle" style="display: none">
<button
onClick="bucket.requestFeedback({featureKey, requireSatisfactionScore: false, position: {type: 'POPOVER', anchor: event.currentTarget}})"
onClick="bucket.requestFeedback({flagKey, requireSatisfactionScore: false, position: {type: 'POPOVER', anchor: event.currentTarget}})"
>
Give feedback!
</button>
Expand Down
15 changes: 5 additions & 10 deletions packages/browser-sdk/src/feedback/ui/FeedbackForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const ANIMATION_SPEED = 400;

function getFeedbackDataFromForm(el: HTMLFormElement) {
const formData = new FormData(el);
console.log("comment", (formData.get("comment")?.toString() || "").trim());
return {
score: Number(formData.get("score")?.toString()),
comment: (formData.get("comment")?.toString() || "").trim(),
Expand Down Expand Up @@ -67,11 +66,9 @@ export const FeedbackForm: FunctionComponent<FeedbackFormProps> = ({
// Validation logic
if (requireSatisfactionScore) {
if (!data.score) return;
} else {
if (!data.comment) {
setError("Comment is required");
return;
}
} else if (!data.comment) {
setError("Comment is required");
return;
}
setError("");
try {
Expand All @@ -96,8 +93,6 @@ export const FeedbackForm: FunctionComponent<FeedbackFormProps> = ({
const expandedContentRef = useRef<HTMLDivElement>(null);
const submittedRef = useRef<HTMLDivElement>(null);

console.log("formRef", formRef.current);

const transitionToDefault = useCallback(() => {
if (containerRef.current === null) return;
if (headerRef.current === null) return;
Expand Down Expand Up @@ -181,7 +176,7 @@ export const FeedbackForm: FunctionComponent<FeedbackFormProps> = ({
onFocusCapture={onInteraction}
onSubmit={handleSubmit}
>
<div class="title" id="bucket-feedback-score-label">
<div class="title" id="reflag-feedback-score-label">
{question}
</div>
<div ref={expandedContentRef} class="form-expanded-content">
Expand All @@ -196,7 +191,7 @@ export const FeedbackForm: FunctionComponent<FeedbackFormProps> = ({
</div>
<div
ref={headerRef}
aria-labelledby="bucket-feedback-score-label"
aria-labelledby="reflag-feedback-score-label"
class="form-control"
role="group"
>
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.