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

Ouverte Adaptée aux débutants
#68 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

@sethr07 y travaille déjà.

Depuis le 23/11/2026.

Évaluation

Difficulté
2/5
Temps estimé
Une demi-journée
Accessibilité débutants
75/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
css, javascript, typescript
Domaine
frontend

Piste de recherche

Commence dans createStyles dans public/widget.js, où les règles #cp-widget-bubble codent en dur l'indigo #4f46e5 et ses ombres rgba(79,70,229,...). Remplace-les par une constante de couleur nommée près de BUBBLE_SIZE, définie à #2563eb, et dérive les deux ombres de cette couleur avec les mêmes opacités. Ajoute ensuite un test dans tests/unit/ calqué sur widget-surface-hardening.test.ts, qui vérifie la nouvelle valeur et l'absence de l'ancien indigo. C'est terminé lorsque le test passe, que pnpm test et pnpm build réussissent, et que l'anneau de focus est visible sur une page de test.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
TypeScript
Étoiles
0
Forks
0
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de DeadantCo/answerLoopsdev

Toutes les issues de DeadantCo/answerLoopsdev

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.