Widget: match the chat bubble color to the rest of the widget
@sethr07 已經在處理了。
開始於 2026年11月23日。
評估
- 難度
- 2/5
- 預估耗時
- 半天
- 新手友好度
- 75/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- css, javascript, typescript
- 領域
- frontend
研究方向
從 public/widget.js 中的 createStyles 開始,其中 #cp-widget-bubble 規則硬編碼了靛藍色 #4f46e5 及其陰影 rgba(79,70,229,...)。將它們替換為 BUBBLE_SIZE 附近的一個具名顏色常數,值設為 #2563eb,並以相同的不透明度從該常數推導兩個陰影。接著在 tests/unit/ 中新增一個參照 widget-surface-hardening.test.ts 撰寫的測試,斷言新值且不再包含舊的靛藍色。當測試通過、pnpm test 與 pnpm build 皆通過,且焦點環在測試頁面上可見時,即完成。
由索引模型根據 Issue 內容生成。
描述
Copied from DeadantCo/answerLoops#58 · originally opened by sethr07 on 2026-11-20
Copied from https://github.com/answerLoops/answerLoops/issues/345 — originally opened by
@NathanTarberton 2026-10-08
Part of the chat widget work tracked in #333.
Problem
The round button that opens the chat widget is a hard-coded indigo (#4f46e5) with an indigo shadow, while everything inside the chat window uses the app's brand blue. A visitor sees two different colors for one product. The embed script is plain JavaScript injected into customer sites, so it cannot use the app's color tokens and carries its own copy of the color.
Scope
Change the default bubble color in public/widget.js so it matches the chat window.
- Background: from
#4f46e5to the app's brand blue,brand-600(#2563eb, defined inapp/globals.css). - Shadow: the resting shadow (
rgba(79,70,229,.4)) and the stronger hover shadow (rgba(79,70,229,.5)) are built from the same indigo. Rebuild both from the new blue at the same opacities, so no indigo is left anywhere in the script. - Keep the white icon. Check it still has enough contrast on the new blue.
- Keep the button's keyboard behavior: it must still show a visible focus ring when tabbed to. Confirm this by tabbing to it on a test page, and add a focus style if the browser default is not visible on the new color.
- Keep one named constant for the color near the top of the script, next to
BUBBLE_SIZE, so the workspace brand color from #348 can replace it in one place.
Not in this issue
Letting a workspace choose its own color (#348), the bubble's size, position or side (#344, #351, #352), the open and close behavior, and the colors inside the chat window.
Acceptance criteria
- The bubble background is
#2563eband matches the chat window's brand blue. - The resting and hover shadows use the same blue, and no
79,70,229or4f46e5remains inpublic/widget.js. - The icon contrast on the new background is at least 4.5:1, and the bubble still shows a visible focus ring from the keyboard.
- The color lives in one constant that #348 can later replace.
- Size, position, hover scale and open/close behavior are unchanged.
- Checked on a real embed in a test page at desktop width and at 375px.
- A test in
tests/unit/readspublic/widget.js(aswidget-surface-hardening.test.tsdoes) and asserts the new color and the absence of the old indigo values. -
pnpm testandpnpm buildpass.
Implementation starting points
public/widget.js(createStyles, the#cp-widget-bubblerules)app/globals.css(--color-brand-600)tests/unit/widget-surface-hardening.test.ts(example of testing the script's text)
Start here: new to the project? Read CONTRIBUTING.md first. It covers the ground rules, running answerLoops locally, and how to open a pull request.
- 主要語言
- TypeScript
- 星號
- 0
- 分支
- 0
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
DeadantCo/answerLoopsdev 的其他 Issue
-
Widget: make the chat window fit on small phones可能已有人在做 @sethr07 今天認領。 未關閉enhancement frontend good first issue help wanted
難度 2/5 1-3 小時 新手友好度 70/100
DeadantCo/answerLoopsdev#67 · 9 則留言 ·
-
Add 'select all' option to Slack channel picker in Settings可能已有人在做 @sethr07 今天認領。 未關閉frontend good first issue
難度 2/5 1-3 小時 新手友好度 68/100
DeadantCo/answerLoopsdev#22 · 5 則留言 ·
-
enhancement frontend help wanted
難度 4/5 3-5 天 新手友好度 45/100
DeadantCo/answerLoopsdev#141 ·
-
backend enhancement frontend help wanted
難度 4/5 3-5 天 新手友好度 45/100
DeadantCo/answerLoopsdev#140 ·
-
backend enhancement frontend help wanted notifications
難度 4/5 3-5 天 新手友好度 42/100
DeadantCo/answerLoopsdev#139 ·
查看 DeadantCo/answerLoopsdev 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
External sources always come back in English: `lc` isn't passed to `/api/v3/external_sources`可能已有人在做 @Anurag1428 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 65/100
openfoodfacts/openfoodfacts-explorer#2264 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 80/100
cloudflare/workers-sdk#17139 ·
維護者通常 1 天內回覆
-
area: editor P3 type: feature
難度 2/5 1-3 小時 新手友好度 74/100
halisonworks/mod-codeling#290 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
colinhacks/zod#6776 ·
維護者通常 1 天內回覆