feat: add in-page docs feedback widget#314
Conversation
Adds a two-layer feedback widget to the bottom of every docs page.
- Layer 1: "Was this page useful?" with thumbs-up Yes / thumbs-down No
buttons
- Layer 2: rating-specific category form (radio + description) plus an
optional freeform textarea and a Send button
- On submit, fires a rudderanalytics.track('docs_feedback_submitted')
event with page_url, page_slug, page_title, rating, category, and
optional comment
- Success state shown after submission; widget stays visible and becomes
read-only for the session
- Styled with Warp CSS design tokens; supports dark and light themes
- Mounted via client:idle in FeedbackFooter.astro so it doesn't block
initial page load
Co-Authored-By: Oz <oz-agent@warp.dev>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds a client-side in-page docs feedback widget, mounts it in the Starlight footer, and sends feedback submissions through the existing RudderStack analytics path. No approved repository spec context was available for implementation-vs-spec validation.
Concerns
- The feedback event currently sends the full browser URL, including query strings and fragments, into analytics. This should be narrowed to the canonical page URL or explicitly allowlisted parameters.
Security
- The inline suggestion avoids collecting potentially sensitive or high-cardinality URL parameters in a public telemetry event.
Verdict
Found: 0 critical, 0 important, 1 suggestions
Approve with nits
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
|
||
| const handleSend = () => { | ||
| const payload: Record<string, string> = { | ||
| page_url: window.location.href, |
There was a problem hiding this comment.
💡 [SUGGESTION] [SECURITY] Avoid sending query strings or fragments in this telemetry URL; match the existing docs_404 event pattern and report only the canonical page path.
| page_url: window.location.href, | |
| page_url: window.location.origin + window.location.pathname, |
Summary
Adds a two-layer in-page feedback widget to the bottom of every docs page, replacing the placeholder
FeedbackFooter.astrowith a functional component. On submit, adocs_feedback_submittedRudderStack event fires — no new backend required.Changes
src/components/DocsFeedback.tsx(new)rudderanalytics.track('docs_feedback_submitted', { page_url, page_slug, page_title, rating, category?, comment? })on Sendaria-liveannouncement; widget stays visible and read-only for the sessionclient:idleso it doesn't block initial page loadsrc/components/DocsFeedback.css(new)--sl-color-*,--sl-radius-*,--sl-text-*)focus-visibleoutlines; meets 4.5:1 contrastsrc/components/FeedbackFooter.astro(updated)<DocsFeedback client:idle />above<Pagination />pageSlug(fromstarlightRoute.id) andpageTitle(fromstarlightRoute.entry.data.title) as propsAdditional context
Co-Authored-By: Oz oz-agent@warp.dev