Docs: the events page and the CSS variables table don't match the widget
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- markdown, typescript
調査の方向性
まず website/src/content/docs/widget/events.mdx(59-87 行)を、引用した範囲(804-809、916-940、988-994、1001-1023)の packages/widget/src/widget.ts および packages/widget/src/api/client.ts(205、239-273、280-291)と併せて読み、message と error がいつ発火するか、および error.message 値の完全な一覧を確認してください。次に MessageData を packages/widget/src/dom/messages.ts(10-19 行)で sources について確認してください。その後、website/src/content/docs/widget/configuration.mdx(388-408 行)の CSS テーブルを、theming.mdx(49-71 行)のトークンテーブルへのリンクに置き換えてください。完了とは、両方のページがコードと一致し、pnpm docs:check が通り、パッケージをビルドして website/ で pnpm dev を実行した後に packages/widget/dev.html でイベントを検証済みであることです。
索引モデルが issue の本文から書いたものです。
説明
Two widget docs pages describe behavior the code doesn't have.
The events page (website/src/content/docs/widget/events.mdx)
The message section (lines 59 to 75) says the payload is { id, role, content, status?, errorType? }, with status one of 'streaming' | 'complete' | 'error' and four error types. In the code, message fires for a visitor's message when it's sent (deliver() in packages/widget/src/widget.ts, lines 804 to 809) and for a reply once it has finished (lines 988 to 994). It never fires while a reply streams, and it never fires for a failed reply, which fires error only (lines 916 to 940 and 1001 to 1023). So status is undefined on the visitor's message and 'complete' on a reply, and errorType never appears. A reply also carries sources, the pages the answer came from (see MessageData in packages/widget/src/dom/messages.ts, lines 10 to 19). The page leaves that out, though it's handy for analytics.
The error section (lines 77 to 87) only says the payload is an Error. Its message is the kind of failure, built at widget.ts line 937 from what packages/widget/src/api/client.ts yields: errorChunk() maps the server's codes to rate_limit, timeout, budget, budget_daily, unavailable or provider_error (lines 280 to 291), and the stream itself gives cut_off, network or timeout (lines 239 to 273). A server error without a code gives HTTP <status> (line 205). Pressing Stop doesn't fire error (widget.ts line 917). A site needs this list to tell a rate limit from an outage in its own analytics.
The CSS custom properties table (website/src/content/docs/widget/configuration.mdx, lines 388 to 408)
Its "Default" column has the dark theme's values, such as --cc-bg: #0a0a0a, --cc-text: #ffffff and --cc-accent: #6366f1. Light is the default (packages/widget/src/styles/launcher.css, lines 2 to 28). --cc-font and --cc-shadow are also wrong, and six tokens are missing: --cc-on-accent, --cc-accent-contrast, --cc-surface-raised, --cc-danger, --cc-code-bg and --cc-pre-bg. The theming page already has a correct table with both modes (website/src/content/docs/widget/theming.mdx, lines 49 to 71).
What to do
- Rewrite the
messageanderrorsections of the events page from the code: when each one fires, what the payload has, and the list oferror.messagevalues. A short example that sendserror.messageto analytics would help. - Replace the CSS table on the configuration page with a sentence that links to the theming page's token table, so there's only one list to keep current.
Acceptance criteria
- Everything the events page says about
messageanderrormatcheswidget.tsandclient.ts(link the lines in the PR description) - The configuration page links to the theming table instead of repeating it
-
pnpm docs:checkpasses (it type-checks the TypeScript samples) - No changeset (docs only)
How to test
Build the packages (pnpm --filter "./packages/*" build), then run pnpm dev in website/ and read both pages. To watch the events, use packages/widget/dev.html, which already logs message and error to the console. With no backend running, sending a message logs an error whose message is network.
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 #611. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.
- 主要言語
- TypeScript
- スター
- 13
- フォーク
- 7
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 46
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codercops/chatcops のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 25/100
codercops/chatcops#546 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
-
help wanted widget
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
codercops/chatcops#55 · コメント 42 件 ·
メンテナーはふだん 1 日以内に返信
codercops/chatcops の issue をすべて見る
似ている issue
-
dependencies effort: small good first issue priority: low
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
TMHSDigital/screencast-mcp#509 ·
メンテナーはふだん 1 日以内に返信
-
from-review tech-debt testing
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
blamechris/chroxy#9520 ·
メンテナーはふだん 1 日以内に返信
-
area:web complexity:S priority:P2 type:chore
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
nahuelcostac/agent-hub#104 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
snaglet-org/snaglet#78 ·
メンテナーはふだん 1 日以内に返信
-
agent/guide documentation help wanted stage/010-actionable
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
kubestellar/console-marketplace#1101 ·
メンテナーはふだん 1 日以内に返信