Suggested questions as buttons in an empty chat
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 13
- Fork
- 7
- Merge medio
- 3h 39m
- PR unite (30g)
- 275
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di codercops/chatcops
-
Widget: fetch signed-in visitor tokens when a session is requestedForse già presa @piyusshhjangid l’ha presa oggi. Apertaenhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 63/100
codercops/chatcops#461 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Widget: support CSP nonces for injected stylesForse già presa @piyusshhjangid l’ha presa oggi. Apertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
codercops/chatcops#460 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Server: validate `rateLimit.windowMs` before creating the limiterForse già presa @ashutoshpalhare l’ha presa oggi. Aperta
codercops/chatcops#452 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Widget: a "New reply" button when the visitor has scrolled upForse già presa @srujankaleru2007 l’ha presa 1 giorno fa. Apertaenhancement hacktoberfest widget
codercops/chatcops#420 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
chatcops test: --url to test a deployed serverForse già presa @srujankaleru2007 l’ha presa 1 giorno fa. Apertaenhancement hacktoberfest testing
codercops/chatcops#419 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di codercops/chatcops
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
area:desktop area:ui bug platform:macos
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
anthropics/claude-code#106183 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
reproduced
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
anomalyco/opencode#60558 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno