Widget: match the chat bubble color to the rest of the widget

オープン 初心者向け
#68 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

@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 の本文から書いたものです。

説明

enhancement frontend help wanted

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 @NathanTarbert on 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 #4f46e5 to the app's brand blue, brand-600 (#2563eb, defined in app/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 #2563eb and matches the chat window's brand blue.
  • The resting and hover shadows use the same blue, and no 79,70,229 or 4f46e5 remains in public/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/ reads public/widget.js (as widget-surface-hardening.test.ts does) and asserts the new color and the absence of the old indigo values.
  • pnpm test and pnpm build pass.

Implementation starting points

  • public/widget.js (createStyles, the #cp-widget-bubble rules)
  • 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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DeadantCo/answerLoopsdev のほかの issue

DeadantCo/answerLoopsdev の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。