Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore: files changed app/src/components/feedback/FeedbackStatusBadge.tsx

Steven Enamakele7995d957573
diff --git a/app/src/components/feedback/FeedbackStatusBadge.tsx b/app/src/components/feedback/FeedbackStatusBadge.tsx
index 3d1bfaaa34..ab0d2b4024 100644
--- a/app/src/components/feedback/FeedbackStatusBadge.tsx
+++ b/app/src/components/feedback/FeedbackStatusBadge.tsx
@@ -16,14 +16,33 @@ const STATUS_LABEL_KEYS: Record<FeedbackStatus, string> = {
closed: 'feedback.status.closed',
};
+/**
+ * Style for a status this build does not know about. Neutral on purpose — an
+ * unrecognised status should not borrow the visual weight of "completed".
+ */
+const UNKNOWN_STATUS_STYLE = { pill: 'bg-content-muted/10 text-content-muted', dot: 'bg-content-faint' };
+
export default function FeedbackStatusBadge({ status }: { status: FeedbackStatus }) {
const { t } = useT();
- const style = STATUS_STYLES[status];
+
+ // Both lookups are guarded even though `FeedbackStatus` is a four-value
+ // union, because that union is a claim about the *server's* data and nothing
+ // validates it at the boundary: `feedbackApi` casts the JSON into these types.
+ // A status the backend adds (or an item saved before one was renamed) arrives
+ // as a string outside the union, `STATUS_STYLES[status]` is undefined, and
+ // reading `.pill` off it threw — taking the whole feedback page down over one
+ // row's badge. Falling back renders that row plainly instead.
+ const style = STATUS_STYLES[status] ?? UNKNOWN_STATUS_STYLE;
+ const labelKey = STATUS_LABEL_KEYS[status];
+
return (
<span
className={`inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium ${style.pill}`}>
<span className={`h-1.5 w-1.5 rounded-full ${style.dot}`} />
- {t(STATUS_LABEL_KEYS[status])}
+ {/* Show the raw value when there is no translation for it: a badge
+ reading "in_review" is worse than the label but far better than a
+ blank pill, and it names the unhandled value for whoever debugs it. */}
+ {labelKey ? t(labelKey) : String(status ?? '')}
</span>
);
}