Widget: a "New reply" button when the visitor has scrolled up
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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
- Vorherrschende Sprache
- TypeScript
- Sterne
- 13
- Forks
- 7
- Ø Merge
- 3 Std. 15 Min.
- Gemergte PRs (30 T.)
- 329
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus codercops/chatcops
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 25/100
codercops/chatcops#546 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 64/100
codercops/chatcops#542 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Server: validate `rateLimit.windowMs` before creating the limiterEvtl. vergeben @ashutoshpalhare hat das vor 4 Tagen übernommen. Offen
codercops/chatcops#452 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
chatcops test: --url to test a deployed serverEvtl. vergeben @srujankaleru2007 hat das vor 5 Tagen übernommen. Offenenhancement testing
codercops/chatcops#419 · 3 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
chatcops test: GitHub Actions reporterEvtl. vergeben @mohithreddydonala37 hat das vor 5 Tagen übernommen. Offenenhancement testing
codercops/chatcops#417 · 3 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in codercops/chatcops
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
oxidecomputer/skepsis#102 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
voidzero-dev/void#677 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
kunchenguid/gh-axi#247 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
lidge-jun/opencodex#8101 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag