Starter dùng CommonlyAskedSection: ở hub Home và ngay dưới welcome bubble khi thread còn trống.
Mỗi starter là một row cao tối thiểu 32px, bo --radius-pill, chữ button-label.
Starter đã được trả lời bị loại khỏi danh sách; không còn starter thì không render section.
Starter có answer của merchant trả lời bằng copy đó; không có answer thì gửi như một lượt hỏi AI.
On this page
Use when / Avoid
Dùng cho lúc khách chưa gửi tin nào: lời chào của merchant cộng với các câu hỏi gợi ý. Câu hỏi gợi ý sau một câu trả lời thuộc về pattern Suggested questions. Classic không có implementation tương ứng trong source nên không nằm trong trang này.
Use instead
Component
Use when
CommonlyAskedSection
Starter ở hub Home theo cấu hình sectionsOrder.
CommonlyAskedSection
Starter dưới welcome bubble khi thread còn ở trạng thái mở đầu.
Entry points
Surface
Owner
AI Mode
CommonlyAskedSection do HomePage ghép khi suggestionFAQs có phần tử.
AI Mode
CommonlyAskedSection do ChatThread ghép sau welcome bubble khi isOpening.
Flow
Surface
Step
Trigger
UI shown
Component
Copy + i18n key
Timing
AI Mode
Hub Home
Panel mở, suggestionFAQs không rỗng
Label Commonly Asked và các row starter
CommonlyAskedSection
Commonly Asked / Commonly Asked
Theo vòng render của caller
AI Mode
Thread mở đầu
Có welcome bubble và isOpening
Welcome bubble rồi các row starter
CommonlyAskedSection
Commonly Asked / Commonly Asked
Theo vòng render của caller
AI Mode
Khách chưa có thông tin liên hệ
preForm?.mode là guest
Pre-chat nudge, câu hỏi giữ trong quickReply
CommonlyAskedSection
Not available
Khi click
AI Mode
Starter có answer
Click, answer có giá trị
Copy của merchant được trả qua answerQuickReply
CommonlyAskedSection
Copy do merchant viết
Khi click
AI Mode
Starter không có answer
Click, answer trống
Gửi như lượt hỏi AI qua deliverTurn
CommonlyAskedSection
Copy do merchant viết
Khi click
Edge cases
Surface
Case
Behaviour
AI Mode
Không có starter
Hub Home không render section khi suggestionFAQs rỗng
AI Mode
Mọi starter đã trả lời
Section trả về null sau khi lọc excludeQuestions
AI Mode
Click khi lượt trước còn chạy
Bị bỏ qua và không tracking, row không có trạng thái disabled
AI Mode
Entry cũ không có answer
Rơi về lượt hỏi AI thay vì đọc FAQ
Live preview
Hub Home, merchant answer, AI answer và pre-chat guest đều dùng fixture local; có thể tiếp tục bằng email hoặc Chat anonymously, không gọi API.
AI Mode: SignIn, EmailContinue, Reset và Bag ở header: N/A trong preview.
Standard
Current
AI Mode
Standard
LightDarkDesktopMobile
Widget thread Standard; tương tác bằng dữ liệu fixture.
Show codechatty-pattern-welcome-first-open.element.jsWrap code linesCopy
`CommonlyAskedSection` thật với 3 starter cố định; dữ liệu cục bộ, không gọi mạng.
Show codeCommonlyAskedSection.jsxWrap code linesCopy
import {useContext} from 'react';
/**
* Conversation starters, minus the ones already answered in this thread — classic filters the
* same list on conversation.excludeQuestions so a clicked starter stops being offered.
* @param {Array<{questionId: string, question: string, answer: string}>} faqs
*/
export function CommonlyAskedSection({faqs}) {
const {excludeQuestions} = useChatStore(['excludeQuestions']);
const remaining = faqs.filter(faq => !excludeQuestions?.includes(faq.questionId));
// The onboarding preview starts from the composer, so it offers no starter list.
if (!remaining.length || getRuntimeHost()?.hideConversationStarters) return null;
return (
<div className="chatty-section chatty-suggested-section">
<div className="chatty-label">{t('Commonly Asked')}</div>
{remaining.map(faq => (
<ListRow
key={faq.questionId}
questionId={faq.questionId}
text={faq.question}
answer={faq.answer}
/>
))}
</div>
);
}
/**
* A Commonly Asked chip — classic's conversation starter; the merchant writes the answer next to the question, so clicking replies with that copy rather than asking the AI, and entries with no answer fall back to a normal AI turn.
* @param {string} questionId
* @param {string} text
* @param {string} answer merchant-authored answer copy, absent on older entries
*/
function ListRow({questionId, text, answer}) {
const navigate = useChatNavigate();
const surface = useContext(ChatSurfaceContext);
const ask = async () => {
let {preForm} = chatStore.getState();
if (!preForm) {
if (!canSendMessage(chatStore.getState())) return;
await chatActions.showPreChatGate();
({preForm} = chatStore.getState());
}
if (preForm?.mode === 'guest') {
chatStore.setState({
preForm: {...preForm, quickReply: {questionId, question: text, answer}, navigate}
});
return chatActions.nudgePreForm({navigate, surface});
}
// This row has no disabled state, so a click during a streaming turn is silently dropped —
// tracking first would credit the chip with a turn that never left.
if (!canSendMessage(chatStore.getState())) return;
markLauncherEngaged();
trackEndCustomerEvent('quick_reply_click', {
chip_type: 'conversation_starter',
question_id: questionId,
question: text
});
// Only the answered branch is a FAQ read; the other becomes an AI turn and would inflate the report.
// The chip's own copy, not the shopper's words, so it stays out of send_message like classic's starters.
if (!answer)
return chatActions.deliverTurn(text, {entryPoint: EVENT_ENTRY_POINT.QUICK_REPLY, navigate});
return chatActions.answerQuickReply({questionId, question: text, answer, navigate});
};
return (
<button
type="button"
className="chatty-list-row chatty-suggested-question"
data-query={text}
onClick={ask}
>
<span>{text}</span>
</button>
);
}
Current (React), being replaced
LightDarkDesktopMobile
`ChatThread` thật ở trạng thái mở đầu: welcome bubble rồi các starter.