Skip to content

reincorporate thumb ratings to documentation pages #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

mmcallister
Copy link
Contributor

@mmcallister mmcallister commented Apr 5, 2025

Attempting to re-add the thumbs up/down option to docs so we can again capture those metrics, this time using Google Analytics since PostHog was deprecated. Testing out different methods, there may be a better way to do this in Docusaurus.

Copy link

github-actions bot commented Apr 5, 2025

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
thumb_ratings 6dd7410 10 ✅SUCCEED thumb-ratings 2025-05-02 21:29:15

@mmcallister mmcallister self-assigned this Apr 5, 2025
@mmcallister mmcallister added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 5, 2025
@mmcallister mmcallister requested a review from Copilot April 10, 2025 17:59
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • src/components/ThumbsFeedback.module.css: Language not supported

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • docs/get-started.mdx: Language not supported
  • src/components/ThumbsFeedback.module.css: Language not supported
Comments suppressed due to low confidence (1)

src/components/ThumbsFeedback.tsx:11

  • [nitpick] Consider providing an explicit return type for the ThumbsFeedback functional component (e.g., React.FC) to improve type clarity and consistency.
const ThumbsFeedback = () => {

@mmcallister mmcallister requested a review from Copilot May 3, 2025 02:41
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reincorporates the thumbs feedback rating feature to documentation pages in order to capture user metrics via Google Analytics.

  • Added a ThumbsFeedback component to MDX and DocItem layouts
  • Implemented the ThumbsFeedback component with Google Analytics event tracking for both thumbs up and thumbs down feedback

Reviewed Changes

Copilot reviewed 3 out of 7 changed files in this pull request and generated no comments.

File Description
src/theme/MDXComponents/index.tsx Imported and added the ThumbsFeedback component into MDX context
src/theme/DocItem/Layout/index.tsx Imported and rendered the ThumbsFeedback component in the documentation layout
src/components/ThumbsFeedback.tsx Created the ThumbsFeedback component with Google Analytics event triggering
Files not reviewed (4)
  • content/18.x: Language not supported
  • docs/get-started.mdx: Language not supported
  • docs/get-started_test_copy.mdx: Language not supported
  • src/components/ThumbsFeedback.module.css: Language not supported
Comments suppressed due to low confidence (2)

src/components/ThumbsFeedback.tsx:35

  • Consider adding an explicit type attribute to the button element (e.g., type="button") to prevent potential unintended behavior in forms.
<button onClick={() => handleFeedback('up')} aria-label="Thumbs up" className={styles.feedbackButton}>

src/components/ThumbsFeedback.tsx:43

  • Consider adding an explicit type attribute to this button element (e.g., type="button") to ensure it does not default to a submit behavior if nested in a form.
<button onClick={() => handleFeedback('down')} aria-label="Thumbs down" className={styles.feedbackButton}>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant