Suggested questions as buttons in an empty chat
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
A new visitor opening the chat sees only the welcome message. A few suggested questions ("Compare plans", "Book a demo") help people start, and they're common in support widgets.
What to do
- Add
suggestions?: string[]toWidgetConfig. - When the conversation has no messages from the visitor yet, show them under the welcome message as a row of
<button type="button">s, wrapped in a container withrole="group"and anaria-labelfrom a new locale string (suggestionsLabel: 'Suggested questions'). - Clicking one sends its text as the visitor's message and removes the row.
- Don't show them while the pre-chat form is up, and don't show them when a saved conversation is restored.
- Document the option in
configuration.mdx. Nodata-*attribute for now, since a list doesn't fit well in one. - Later, the server will be able to send suggestions as a
suggestionspart. That's not part of this issue, but keep the rendering in its own small function so it can be reused.
Where to look
packages/widget/src/widget.ts(WidgetConfig,showChatView,handleSend)packages/widget/src/dom/messages.tspackages/widget/src/i18n.ts
Acceptance criteria
- Suggestions show in a new, empty chat, and not after the visitor sent something, over a restored conversation or with the pre-chat form open
- Clicking one sends it and removes the row
- They're real buttons in a labelled group
- Tests for each case
- Docs and a changeset for
@chatcops/widget(minor, it adds an option) -
pnpm test:coverage,pnpm lintandpnpm sizepass
The chat panel (dist/chatcops.panel.js) has a 14 kB gzip budget and about 800 B of it is left, shared by several open issues. Keep the change small, and check pnpm size before you open the PR.
- 主要语言
- TypeScript
- 星标
- 13
- 派生
- 7
- 平均合并
- 3 小时 29 分钟
- 30 天内合并 PR
- 215
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codercops/chatcops 的其他 Issue
-
New package: @chatcops/store-upstash-vector可能已有人在做 @srujankaleru2007 于 1 天前认领。 未关闭enhancement hacktoberfest help wanted
codercops/chatcops#362 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Announce each reply once instead of every streamed chunk可能已有人在做 @kachamsiddarth 于 2 天前认领。 未关闭accessibility enhancement hacktoberfest widget
codercops/chatcops#338 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Make the welcome bubble a real button可能已有人在做 @kachamsiddarth 于 2 天前认领。 未关闭accessibility enhancement good first issue hacktoberfest widget
codercops/chatcops#336 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
hacktoberfest
难度 1/5 1 小时以内 新手友好度 35/100
codercops/chatcops#73 · 7 条评论 ·
维护者通常 1 天内回复
-
Add built-in translations to the widget可能已有人在做 @piyusshhjangid 于 2 天前认领。 未关闭help wanted widget
难度 4/5 3-5 天 新手友好度 52/100
codercops/chatcops#55 · 23 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 codercops/chatcops 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
vekexasia/pi-extensible-workflows#374 ·
维护者通常 2 天内回复
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
help wanted linux
难度 2/5 1-3 小时 新手友好度 75/100
GiuseppeBellamacina/downtime#19 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
scaleway/ultraviolet#7089 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
Get-Concord-AI/concord-mcp#296 ·
维护者通常 1 天内回复