feat(ux): complete 5-task suite (category filter, real total count, mobile wiki, blog mobile UX, chatbot typewriter)
Deploy Canina / deploy (push) Successful in 2m12s

This commit is contained in:
devops committed 2026-10-17 10:59:21 +00:00
1 parent 3d45b618ab
commit 092933860a
4 files changed
+182 -79

No files matched your search

@@ -160,9 +160,35 @@ export default function SupportChat() {
// safe fallback kept
}
if (!controller.signal.aborted && token() === current) {
setRows((r) => { const next = [...r]; const i = next.length - 1; if (i >= 0 && next[i].question === question && next[i].answer === 'در حال بررسی…') next[i] = { question, answer }; return next; });
// Typewriting animation for smooth AI assistant response streaming feel
const fullAnswer = answer;
const stepSize = Math.max(2, Math.floor(fullAnswer.length / 40));
let currentIdx = 0;
const typeInterval = setInterval(() => {
currentIdx += stepSize;
if (currentIdx >= fullAnswer.length || controller.signal.aborted) {
clearInterval(typeInterval);
setRows((r) => {
const next = [...r];
const i = next.length - 1;
if (i >= 0 && next[i].question === question) next[i] = { question, answer: fullAnswer };
return next;
});
if (pending.current === controller) setBusy(false);
} else {
const partial = fullAnswer.slice(0, currentIdx) + " ▍";
setRows((r) => {
const next = [...r];
const i = next.length - 1;
if (i >= 0 && next[i].question === question) next[i] = { question, answer: partial };
return next;
});
}
}, 18);
} else {
if (pending.current === controller) setBusy(false);
}
if (pending.current === controller) setBusy(false);
}
if (!config?.enabled) return configError ? <span role="status" className="sr-only">تنظیمات پشتیبان هوشمند در دسترس نیست.</span> : null;