Docs: the events page and the CSS variables table don't match the widget
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 78/100
- Issue-Typ
- Dokumentation
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- markdown, typescript
- Bereich
- documentation
Rechercherichtung
Beginne mit dem Lesen von website/src/content/docs/widget/events.mdx (Zeilen 59-87) zusammen mit packages/widget/src/widget.ts an den genannten Bereichen (804-809, 916-940, 988-994, 1001-1023) und packages/widget/src/api/client.ts (205, 239-273, 280-291), um zu bestätigen, wann message und error ausgelöst werden und die vollständige Liste der error.message-Werte; prüfe MessageData in packages/widget/src/dom/messages.ts (Zeilen 10-19) auf sources. Ersetze dann die CSS-Tabelle in website/src/content/docs/widget/configuration.mdx (Zeilen 388-408) durch einen Link auf die Token-Tabelle in theming.mdx (Zeilen 49-71). Fertig bedeutet, dass beide Seiten mit dem Code übereinstimmen, pnpm docs:check durchläuft und du die Events mit packages/widget/dev.html verifiziert hast, nachdem du die Pakete gebaut und pnpm dev in website/ ausgeführt hast.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Two widget docs pages describe behavior the code doesn't have.
The events page (website/src/content/docs/widget/events.mdx)
The message section (lines 59 to 75) says the payload is { id, role, content, status?, errorType? }, with status one of 'streaming' | 'complete' | 'error' and four error types. In the code, message fires for a visitor's message when it's sent (deliver() in packages/widget/src/widget.ts, lines 804 to 809) and for a reply once it has finished (lines 988 to 994). It never fires while a reply streams, and it never fires for a failed reply, which fires error only (lines 916 to 940 and 1001 to 1023). So status is undefined on the visitor's message and 'complete' on a reply, and errorType never appears. A reply also carries sources, the pages the answer came from (see MessageData in packages/widget/src/dom/messages.ts, lines 10 to 19). The page leaves that out, though it's handy for analytics.
The error section (lines 77 to 87) only says the payload is an Error. Its message is the kind of failure, built at widget.ts line 937 from what packages/widget/src/api/client.ts yields: errorChunk() maps the server's codes to rate_limit, timeout, budget, budget_daily, unavailable or provider_error (lines 280 to 291), and the stream itself gives cut_off, network or timeout (lines 239 to 273). A server error without a code gives HTTP <status> (line 205). Pressing Stop doesn't fire error (widget.ts line 917). A site needs this list to tell a rate limit from an outage in its own analytics.
The CSS custom properties table (website/src/content/docs/widget/configuration.mdx, lines 388 to 408)
Its "Default" column has the dark theme's values, such as --cc-bg: #0a0a0a, --cc-text: #ffffff and --cc-accent: #6366f1. Light is the default (packages/widget/src/styles/launcher.css, lines 2 to 28). --cc-font and --cc-shadow are also wrong, and six tokens are missing: --cc-on-accent, --cc-accent-contrast, --cc-surface-raised, --cc-danger, --cc-code-bg and --cc-pre-bg. The theming page already has a correct table with both modes (website/src/content/docs/widget/theming.mdx, lines 49 to 71).
What to do
- Rewrite the
messageanderrorsections of the events page from the code: when each one fires, what the payload has, and the list oferror.messagevalues. A short example that sendserror.messageto analytics would help. - Replace the CSS table on the configuration page with a sentence that links to the theming page's token table, so there's only one list to keep current.
Acceptance criteria
- Everything the events page says about
messageanderrormatcheswidget.tsandclient.ts(link the lines in the PR description) - The configuration page links to the theming table instead of repeating it
-
pnpm docs:checkpasses (it type-checks the TypeScript samples) - No changeset (docs only)
How to test
Build the packages (pnpm --filter "./packages/*" build), then run pnpm dev in website/ and read both pages. To watch the events, use packages/widget/dev.html, which already logs message and error to the console. With no backend running, sending a message logs an error whose message is network.
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #611. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 13
- Forks
- 7
- Ø Merge
- 1 T. 14 Std.
- Gemergte PRs (30 T.)
- 46
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 · 6 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
help wanted widget
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
codercops/chatcops#55 · 42 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in codercops/chatcops
Ähnliche Issues
-
clawsweeper:intake:bug clawsweeper:intake:needs-environment
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
openclaw/openclaw#212827 · 1 Kommentar · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Use one constant for the 10,000-character input limitEvtl. vergeben @NginxL hat das heute übernommen. Offengood first issue refactor
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
aniru-dh21/snap-validate#51 ·
Maintainer antworten meist innerhalb von 1 Tag
-
dependencies effort: small good first issue priority: low
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
TMHSDigital/screencast-mcp#509 ·
Maintainer antworten meist innerhalb von 1 Tag
-
from-review tech-debt testing
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
blamechris/chroxy#9520 ·
Maintainer antworten meist innerhalb von 1 Tag