Skip to content

Add feedback component.#2852

Open
bgravenorst wants to merge 13 commits intomainfrom
add-feedback-widget
Open

Add feedback component.#2852
bgravenorst wants to merge 13 commits intomainfrom
add-feedback-widget

Conversation

@bgravenorst
Copy link
Copy Markdown
Contributor

@bgravenorst bgravenorst commented Apr 15, 2026

Description

Add feedback component.

Checklist

  • If this PR updates or adds documentation content that changes or adds technical meaning, it has received an approval from an engineer or DevRel from the relevant team.
  • If this PR updates or adds documentation content, it has received an approval from a technical writer.

Note

Medium Risk
Adds a new serverless API that accepts user input and writes to Google Sheets using service-account credentials, which introduces new external I/O and environment-secret handling. UI placement changes are localized but the endpoint/validation and deployment wiring are the main risk areas.

Overview
Adds a new in-page feedback collection flow: a FeedbackWidget UI is introduced and embedded into doc footers, MDX pages, and the Quickstart page to capture yes/no ratings plus an optional/required comment.

Introduces a new /api/docs-feedback Vercel function that validates/sanitizes submissions (page URL allowlist, reason required for negative feedback, truncation) and appends them to a Google Sheet (timestamp, URL, rating, reason, device type) using GOOGLE_SHEETS_CREDENTIALS/GOOGLE_SHEET_ID.

Updates build/config/deps to support this: adds Google Sheets/auth and Vercel runtime packages, pins TypeScript, and adds a Docusaurus webpack rule using null-loader to prevent api/*.ts from being bundled into the site build.

Reviewed by Cursor Bugbot for commit c822f5e. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 15, 2026

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

Project Deployment Actions Updated (UTC)
metamask-docs Ready Ready Preview, Comment Apr 29, 2026 6:09am

Request Review

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Apr 15, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​vercel/​node@​5.7.5801007797100
Added@​googleapis/​sheets@​13.0.11001008385100
Addedgoogleapis-common@​8.0.19910010083100
Addedgoogle-auth-library@​10.6.29110010088100

View full report

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Apr 15, 2026

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

  • @bytecodealliance/preview2-shim@0.17.6
  • @edge-runtime/format@2.2.1
  • @edge-runtime/node-utils@2.3.0
  • @edge-runtime/ponyfill@2.4.2
  • @edge-runtime/primitives@4.1.0
  • @edge-runtime/vm@3.2.0
  • @esbuild/aix-ppc64@0.27.0
  • @esbuild/android-arm@0.27.0
  • @esbuild/android-arm64@0.27.0
  • @esbuild/android-x64@0.27.0
  • @esbuild/darwin-arm64@0.27.0
  • @esbuild/darwin-x64@0.27.0
  • @esbuild/freebsd-arm64@0.27.0
  • @esbuild/freebsd-x64@0.27.0
  • @esbuild/linux-arm@0.27.0
  • @esbuild/linux-arm64@0.27.0
  • @esbuild/linux-ia32@0.27.0
  • @esbuild/linux-loong64@0.27.0
  • @esbuild/linux-mips64el@0.27.0
  • @esbuild/linux-ppc64@0.27.0
  • @esbuild/linux-riscv64@0.27.0
  • @esbuild/linux-s390x@0.27.0
  • @esbuild/linux-x64@0.27.0
  • @esbuild/netbsd-arm64@0.27.0
  • @esbuild/netbsd-x64@0.27.0
  • @esbuild/openbsd-arm64@0.27.0
  • @esbuild/openbsd-x64@0.27.0
  • @esbuild/openharmony-arm64@0.27.0
  • @esbuild/sunos-x64@0.27.0
  • @esbuild/win32-arm64@0.27.0
  • @esbuild/win32-ia32@0.27.0
  • @esbuild/win32-x64@0.27.0
  • @fastify/busboy@2.1.1
  • @googleapis/sheets@13.0.1
  • @isaacs/balanced-match@4.0.1
  • @isaacs/brace-expansion@5.0.1
  • @isaacs/fs-minipass@4.0.1
  • @mapbox/node-pre-gyp@2.0.3
  • @renovatebot/pep440@4.2.1
  • @rollup/pluginutils@5.3.0
  • @ts-morph/common@0.11.1
  • @vercel/build-utils@13.15.0
  • @vercel/error-utils@2.0.3
  • @vercel/nft@1.5.0
  • @vercel/node@5.7.5
  • @vercel/python-analysis@0.11.0
  • @vercel/static-config@3.2.0
  • abbrev@3.0.1
  • async-listen@3.0.0
  • async-listen@3.0.1
  • async-sema@3.1.1
  • bindings@1.5.0
  • cjs-module-lexer@1.2.3
  • code-block-writer@10.1.1
  • convert-hrtime@3.0.0
  • data-uri-to-buffer@4.0.1
  • edge-runtime@2.5.9
  • esbuild@0.27.0
  • fetch-blob@3.2.0
  • file-uri-to-path@1.0.0
  • formdata-polyfill@4.0.10
  • gaxios@7.1.4
  • gcp-metadata@8.1.2
  • get-tsconfig@4.13.8
  • google-auth-library@10.6.2
  • google-logging-utils@1.1.3
  • googleapis-common@8.0.1
  • json-bigint@1.0.0
  • json-schema-to-ts@1.6.4
  • minipass@7.1.3
  • minizlib@3.1.0
  • mri@1.2.0
  • node-domexception@1.0.0
  • nopt@8.1.0
  • parse-ms@2.1.0
  • path-scurry@2.0.2
  • pretty-ms@7.0.1
  • resolve-pkg-maps@1.0.0
  • smol-toml@1.5.2
  • tar@7.5.13
  • time-span@4.0.0
  • ts-morph@12.0.0
  • ts-toolbelt@6.15.5
  • tsx@4.21.0
  • undici@5.28.4
  • url-template@2.0.8
  • web-streams-polyfill@3.3.3
  • zod@3.22.4
  • brace-expansion@5.0.5
  • minimatch@10.2.5
  • minimatch@10.1.1
  • ajv@8.6.3
  • @types/node@20.11.0
  • balanced-match@4.0.4
  • lru-cache@11.3.5
  • yallist@5.0.0
  • chownr@3.0.0
  • fs-extra@11.1.1
  • detect-libc@2.1.2
  • es-module-lexer@1.5.0
  • es-module-lexer@1.4.1
  • estree-walker@2.0.2
  • path-to-regexp@6.3.0
  • glob@13.0.6
  • jwa@2.0.1
  • jws@4.0.1
  • node-fetch@2.6.9
  • node-fetch@3.3.2
  • picocolors@1.0.0
  • signal-exit@4.0.2
  • typescript@5.9.3
  • undici-types@5.26.5

View full report

@bgravenorst
Copy link
Copy Markdown
Contributor Author

@SocketSecurity ignore-all

@bgravenorst bgravenorst marked this pull request as ready for review April 15, 2026 03:38
@bgravenorst bgravenorst requested review from a team as code owners April 15, 2026 03:38
Comment thread api/docs-feedback.ts
Comment thread src/theme/DocItem/Footer/index.jsx
Comment thread api/docs-feedback.ts Outdated
Comment thread package-lock.json Outdated
Comment thread src/components/FeedbackWidget/index.tsx Outdated
Comment thread src/components/FeedbackWidget/index.tsx Outdated
Copy link
Copy Markdown
Contributor

@alexandratran alexandratran left a comment

Choose a reason for hiding this comment

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

Looks good! However, it currently doesn't work on mobile for me.

Also, minor nits:

  1. It would look better to fully left-align the component on the quickstart pages:
    Image
  2. In dark mode, the button text would be more readable if it was black:
    Image

Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Comment thread src/components/FeedbackWidget/index.tsx
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Comment thread api/docs-feedback.ts Outdated
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Comment thread src/components/FeedbackWidget/index.tsx Outdated
Comment thread api/docs-feedback.ts
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Comment thread src/components/FeedbackWidget/index.tsx Outdated
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Comment thread api/docs-feedback.ts
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b86c68d. Configure here.

.textarea:focus {
outline: none;
border-color: var(--ifm-color-primary) !important;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unused .textarea CSS class in FeedbackWidget styles

Low Severity

The .textarea, .textarea::placeholder, and .textarea:focus CSS classes are defined but never referenced anywhere in the FeedbackWidget component. The component only uses .inlineTextarea for its textarea element. A grep for styles.textarea in the component returned zero matches, confirming this is dead CSS code that adds maintenance burden.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b86c68d. Configure here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants