Show user feedback history in account

This commit is contained in:
2569718930@qq.com
2026-06-06 23:15:55 +08:00
parent f7625218ae
commit 555d3fa68f
7 changed files with 196 additions and 1 deletions
@@ -6,12 +6,12 @@ import type { UserFeedbackEntry, UserFeedbackPayload } from "@/types/ops";
import {
buildFeedbackNotificationKey,
countUnseenFeedbackUpdates,
FEEDBACK_STATUS_POLL_MS,
feedbackStatusLabel,
feedbackStatusTone,
} from "./feedback-status";
const FEEDBACK_STATUS_SEEN_KEY = "polyweather_feedback_status_seen_v1";
const FEEDBACK_STATUS_POLL_MS = 60_000;
function loadSeenKeys() {
if (typeof window === "undefined") return new Set<string>();
@@ -1,6 +1,7 @@
import {
buildFeedbackNotificationKey,
countUnseenFeedbackUpdates,
FEEDBACK_STATUS_POLL_MS,
feedbackStatusLabel,
} from "@/components/dashboard/scan-terminal/feedback-status";
@@ -9,6 +10,7 @@ function assert(condition: unknown, message: string): asserts condition {
}
export function runTests() {
assert(FEEDBACK_STATUS_POLL_MS === 600_000, "feedback bell background polling should run every 10 minutes");
assert(feedbackStatusLabel("open", false) === "已收到", "open feedback should read as received to users");
assert(feedbackStatusLabel("triaged", false) === "已确认", "triaged feedback should read as confirmed to users");
assert(feedbackStatusLabel("investigating", false) === "处理中", "investigating feedback should read as in progress");
@@ -1,5 +1,7 @@
import type { UserFeedbackEntry } from "@/types/ops";
export const FEEDBACK_STATUS_POLL_MS = 10 * 60 * 1000;
export function feedbackStatusLabel(status: string | undefined, isEn: boolean) {
const key = String(status || "open").toLowerCase();
if (key === "triaged") return isEn ? "Confirmed" : "已确认";