Widget: `data-welcome-bubble-delay="3s"` becomes a 3 ms delay
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
Which part?
@chatcops/widget
Package version
dev
What happened?
data-welcome-bubble-delay is read with parseInt(value, 10) in packages/widget/src/script-config.ts (line 44), and the loader uses it as bubble.delay ?? DEFAULT_BUBBLE_DELAY (packages/widget/src/loader/loader.ts, line 226). So a value that isn't plain milliseconds doesn't fall back to the 3000 ms default:
data-welcome-bubble-delay |
delay used |
|---|---|
"3000" |
3000 ms |
"3s" |
3 ms |
"1.5s" |
1 ms |
"soon" |
NaN, and ?? keeps it, so the bubble shows at once |
The other numeric attributes in the same file (data-auto-open, data-history-ttl-days) only accept /^\d+$/ and give undefined otherwise, so they fall back to their defaults.
What did you expect?
The same check as the other attributes: digits only become the delay, anything else is undefined and the 3000 ms default applies. The docs say the value is in ms.
How can we reproduce it?
<script src=".../chatcops.min.js" data-api-url="/api/chat" data-welcome-bubble="Need help?" data-welcome-bubble-delay="3s"></script>
The bubble shows almost immediately instead of after 3 seconds. parseInt("3s", 10) is 3.
Environment
Read from the code on dev and checked the parsing in Node 22
- 主要言語
- TypeScript
- スター
- 13
- フォーク
- 7
- 平均マージ
- 3時間 39分
- マージ済み PR(30日)
- 275
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codercops/chatcops のほかの issue
-
Widget: fetch signed-in visitor tokens when a session is requested対応中かも @piyusshhjangid が今日担当しました。 オープンenhancement
難易度 3/5 1〜2日 初心者へのやさしさ 63/100
codercops/chatcops#461 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Widget: support CSP nonces for injected styles対応中かも @piyusshhjangid が今日担当しました。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
codercops/chatcops#460 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Server: validate `rateLimit.windowMs` before creating the limiter対応中かも @ashutoshpalhare が今日担当しました。 オープン
codercops/chatcops#452 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Widget: a "New reply" button when the visitor has scrolled up対応中かも @srujankaleru2007 が 1 日前に担当しました。 オープンenhancement hacktoberfest widget
codercops/chatcops#420 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
chatcops test: --url to test a deployed server対応中かも @srujankaleru2007 が 1 日前に担当しました。 オープンenhancement hacktoberfest testing
codercops/chatcops#419 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
codercops/chatcops の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
CopilotKit/openmuse#215 ·
メンテナーはふだん 3 日以内に返信
-
b:minor bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
software-mansion/argent#1698 ·
メンテナーはふだん 1 日以内に返信
-
e2e-failure ready-to-code
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
redhat-developer/rhdh-plugin-export-overlays#4624 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信