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

Document the pre-chat form

未关闭 适合新手
#70 3 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@masyarakatai 已经在做这个了。

开始于 2026年10月16日。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
88/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
documentation

调研方向

阅读 packages/widget/src/widget.ts 和 packages/widget/src/dom/prechat-form.ts 以了解配置和行为,然后检查 packages/widget/dev.html 作为示例。添加 website/src/content/docs/widget/pre-chat-form.mdx,并更新 website/src/content/docs/widget/configuration.mdx 以及 website/astro.config.mjs 中的侧边栏;当列出的选项、行为、事件和回调都已记录在文档中,且 pnpm --filter @chatcops/website build 成功时,即完成。

由索引模型根据 Issue 内容生成。

描述

documentation good first issue hacktoberfest widget

The widget now has a configurable pre-chat form that collects details like name and email before the conversation starts. It shipped in @chatcops/widget 0.4.0, but the docs site only mentions it in the request schema on the Server Setup page. The WidgetConfig reference on the Configuration page also leaves out preChatForm, onLeadCaptured and onPreChatSubmit.

Where to look

  • packages/widget/src/widget.ts (PreChatField, PreChatFormConfig, WidgetConfig, handlePreChatSubmit, showChatView)
  • packages/widget/src/dom/prechat-form.ts (field types and validation)
  • packages/widget/dev.html (a working example config)
  • website/src/content/docs/widget/configuration.mdx
  • website/astro.config.mjs (sidebar)

Acceptance criteria

  • New page website/src/content/docs/widget/pre-chat-form.mdx, added to the Widget section of the sidebar
  • Documents enabled, title, subtitle, submitLabel, and each field option: name, type (text, email, select or textarea), label, placeholder, required, options
  • Explains how the form behaves:
    • it only shows when there is no saved conversation and it hasn't been submitted in this browser session
    • required fields and email format are validated
    • a field named name personalizes the welcome message
    • a field named message is sent as the first chat message
    • answers go to the server as userData (up to 50 fields, names up to 100 characters, each value up to 500 characters) with the next chat request, are re-sent if that request fails, and the server adds them to the system prompt for that request
  • Documents onPreChatSubmit and the preChatSubmit event
  • Notes that the form can only be configured from JavaScript (there are no data-* attributes for it)
  • WidgetConfig in configuration.mdx includes preChatForm, onLeadCaptured and onPreChatSubmit
  • pnpm --filter @chatcops/website build succeeds
  • Docs only, no changeset needed

Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.

主要语言
TypeScript
星标
13
派生
7
平均合并
4 小时 11 分钟
30 天内合并 PR
122

环境准备

从这里开始

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

codercops/chatcops 的其他 Issue

查看 codercops/chatcops 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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