Widget: a "New reply" button when the visitor has scrolled up
Les mainteneurs répondent en général sous 1 jour
Évaluation
Cette issue n'a pas encore été évaluée.
Description
A streaming reply no longer pulls the chat log down while the visitor reads an earlier message (#402): the log only follows new text when it's within 48px of the bottom. A visitor who scrolled up doesn't see that a reply is arriving below, though. This adds a small "New reply" pill, from the widget design, that shows in that case and takes them down.
What it should do
- When text arrives for a reply, or a new message is added, while the log is scrolled up (not
nearBottom()), show a pill at the bottom of the log: "New reply ↓". - Clicking it scrolls to the bottom (smoothly, unless
prefers-reduced-motion) and hides it. Scrolling to the bottom by hand hides it too. - It's a real
<button>with a visible focus ring (--cc-focus-ring). It isn't announced by itself; the live region from #410 already reads the finished reply. - The text is a new locale string,
newReply, with an English default. Other languages fall back to English until #55 adds it.
Where
packages/widget/src/dom/messages.ts:nearBottom()(line 170) is the check, and the stream render andaddMessageare where it's used.scrollToBottom()is at line 285.- Styles in
packages/widget/src/styles/widget.css. Use the theme tokens so it works in light and dark, and logical properties for RTL. - The panel has about 900 B left of its 17 kB budget (
pnpm size), so keep it small.
Acceptance criteria
- Unit tests: shown when text arrives while scrolled up, hidden when scrolled down by hand, and click scrolls and hides (see the scroll test in
packages/widget/tests/dom/stream.test.ts, which fakesscrollHeightandclientHeight) - Not shown while the log is at the bottom
- The existing e2e test
new text doesn't pull the log down(e2e/tests/stream-render.spec.ts) still passes, and a line there checks that the pill is visible - A changeset for
@chatcops/widget(minor) -
pnpm test:coverage,pnpm lintandpnpm sizepass
- Langage dominant
- TypeScript
- Étoiles
- 13
- Forks
- 7
- Merge moyen
- 3 h 15 min
- PR mergées (30 j)
- 329
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de codercops/chatcops
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 25/100
codercops/chatcops#546 · 4 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 64/100
codercops/chatcops#542 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Server: validate `rateLimit.windowMs` before creating the limiterPeut-être pris @ashutoshpalhare l’a pris il y a 3 jours. Ouverte
codercops/chatcops#452 · 1 commentaire · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
chatcops test: --url to test a deployed serverPeut-être pris @srujankaleru2007 l’a pris il y a 4 jours. Ouverteenhancement testing
codercops/chatcops#419 · 3 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
chatcops test: GitHub Actions reporterPeut-être pris @mohithreddydonala37 l’a pris il y a 4 jours. Ouverteenhancement testing
codercops/chatcops#417 · 3 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de codercops/chatcops
Issues similaires
-
Add: Class TV ModaOuvertecheck:passed streams:add
Difficulté 1/5 Moins d'une heure Accessibilité débutants 65/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
GiganticMinecraft/seichi-playguide#183 ·
Les mainteneurs répondent en général sous 1 jour
-
area: core complexity: easy impact: medium
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
ueberdosis/tiptap#8668 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
longbridge/nsh#804 ·
Les mainteneurs répondent en général sous 1 jour