Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Suggested questions as buttons in an empty chat

已关闭
#343 2 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@srujankaleru2007 已经在做这个了。

开始于 2026年10月26日。

  • #348 来自 @srujankaleru2007 —— 已合并

评估

这个 Issue 还没有评估数据。

描述

enhancement hacktoberfest widget

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[] to WidgetConfig.
  • 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 with role="group" and an aria-label from 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. No data-* attribute for now, since a list doesn't fit well in one.
  • Later, the server will be able to send suggestions as a suggestions part. 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.ts
  • packages/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 lint and pnpm size pass

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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

codercops/chatcops 的其他 Issue

查看 codercops/chatcops 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。