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

Abierto Apto para principiantes
#68 3 comentarios 0 reacciones 0 asignados Ver en GitHub

@sethr07 ya está trabajando en esto.

Desde el 23/11/2026.

Evaluación

Dificultad
2/5
Tiempo estimado
Medio día
Aptitud para principiantes
75/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
css, javascript, typescript
Área
frontend

Línea de trabajo

Empieza en createStyles en public/widget.js, donde las reglas de #cp-widget-bubble fijan el índigo #4f46e5 y sus sombras rgba(79,70,229,...). Reemplázalas por una constante de color con nombre cerca de BUBBLE_SIZE, con el valor #2563eb, y deriva ambas sombras de ella con las mismas opacidades. Luego añade una prueba en tests/unit/ basada en widget-surface-hardening.test.ts que verifique el nuevo valor y la ausencia del índigo anterior. Terminado cuando la prueba pase, pnpm test y pnpm build pasen, y el anillo de foco sea visible en una página de prueba.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
0
Forks
0
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de DeadantCo/answerLoopsdev

Todos los issues de DeadantCo/answerLoopsdev

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.