Skip to content

feat: add in-page docs feedback widget#314

Open
rachaelrenk wants to merge 3 commits into
mainfrom
rrenk/docs-feedback-widget
Open

feat: add in-page docs feedback widget#314
rachaelrenk wants to merge 3 commits into
mainfrom
rrenk/docs-feedback-widget

Conversation

@rachaelrenk

Copy link
Copy Markdown
Contributor

Summary

Adds a two-layer in-page feedback widget to the bottom of every docs page, replacing the placeholder FeedbackFooter.astro with a functional component. On submit, a docs_feedback_submitted RudderStack event fires — no new backend required.

Changes

src/components/DocsFeedback.tsx (new)

  • Layer 1: "Was this page useful?" prompt with thumbs-up Yes / thumbs-down No buttons
  • Layer 2: rating-specific category form (radio buttons with label + sub-description), optional freeform textarea, and a Send button
  • Positive categories: Accurate, Solved my problem, Easy to understand, Another reason
  • Negative categories: Inaccurate, Missing information, Hard to understand, Outdated, Another reason
  • Fires rudderanalytics.track('docs_feedback_submitted', { page_url, page_slug, page_title, rating, category?, comment? }) on Send
  • Success state with aria-live announcement; widget stays visible and read-only for the session
  • Mounted with client:idle so it doesn't block initial page load

src/components/DocsFeedback.css (new)

  • BEM-style stylesheet using Warp design tokens (--sl-color-*, --sl-radius-*, --sl-text-*)
  • Supports dark (default) and light themes
  • Keyboard-navigable with focus-visible outlines; meets 4.5:1 contrast

src/components/FeedbackFooter.astro (updated)

  • Imports and mounts <DocsFeedback client:idle /> above <Pagination />
  • Passes pageSlug (from starlightRoute.id) and pageTitle (from starlightRoute.entry.data.title) as props

Additional context

Co-Authored-By: Oz oz-agent@warp.dev

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>
@cla-bot cla-bot Bot added the cla-signed label Jul 9, 2026
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Building Building Preview, Comment Jul 10, 2026 5:49pm

Request Review

@oz-for-oss

oz-for-oss Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@rachaelrenk

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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 [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.

Suggested change
page_url: window.location.href,
page_url: window.location.origin + window.location.pathname,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant