Skip to content

feat: youtube banner#7514

Open
gmorador-tribu wants to merge 3 commits intomainfrom
feature/lms-youtube-gdpr-banner
Open

feat: youtube banner#7514
gmorador-tribu wants to merge 3 commits intomainfrom
feature/lms-youtube-gdpr-banner

Conversation

@gmorador-tribu
Copy link

Summary

  • YouTube disclaimer banner (LMS): When the LMS sends youtubeAssignment: true in the config (requestConfig RPC), the sidebar shows a dismissible banner below the top bar.

  • Banner content: Explains that the activity includes embedded YouTube videos, that Hypothesis does not control YouTube ads or data collection (e.g. IP, device), and that the institution may disable the YouTube integration. Includes a Dismiss button.

  • Persistence with H backend: Dismiss is persisted via the existing H profile API: the client sends show_youtube_gdpr_banner: false on PATCH profile; the banner is shown only when the profile has show_youtube_gdpr_banner: true (user has not dismissed).

  • Client changes:

    • New YouTubeDisclaimerBanner component and tests.
    • SessionService.dismissYoutubeDisclaimer() calls profile.update with show_youtube_gdpr_banner: false.
    • shouldShowYoutubeDisclaimer(settings, profile) helper and tests.
    • Profile type updated with show_youtube_gdpr_banner in preferences.
    • Banner rendered in HypothesisApp when youtubeAssignment === true and the user has not dismissed.

Copy link

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

Adds a YouTube GDPR/disclaimer banner to the sidebar for LMS YouTube assignments, with dismissal persisted via the existing profile preferences API.

Changes:

  • Extend embedder config (youtubeAssignment) and profile preferences (show_youtube_gdpr_banner) types.
  • Add shouldShowYoutubeDisclaimer(settings, profile) helper + tests and wire banner rendering into HypothesisApp.
  • Add YouTubeDisclaimerBanner component + tests and a SessionService.dismissYoutubeDisclaimer() method (persisting dismissal via profile update).

Reviewed changes

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

Show a summary per file
File Description
src/types/config.ts Adds youtubeAssignment flag to embedder-provided config.
src/types/api.ts Adds show_youtube_gdpr_banner preference to the Profile type.
src/sidebar/services/session.ts Adds dismissYoutubeDisclaimer() to persist dismissal via profile update.
src/sidebar/services/test/session-test.js Adds unit tests for dismissYoutubeDisclaimer().
src/sidebar/helpers/session.ts Adds shouldShowYoutubeDisclaimer() helper.
src/sidebar/helpers/test/session-test.js Adds unit tests for shouldShowYoutubeDisclaimer().
src/sidebar/components/YouTubeDisclaimerBanner.tsx New dismissible banner component.
src/sidebar/components/test/YouTubeDisclaimerBanner-test.js Adds component tests for banner text/button and click behavior.
src/sidebar/components/HypothesisApp.tsx Renders the banner under the top bar when helper indicates it should show.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.60%. Comparing base (b07c1b8) to head (702a95f).

Files with missing lines Patch % Lines
src/sidebar/components/HypothesisApp.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7514      +/-   ##
==========================================
- Coverage   99.61%   99.60%   -0.01%     
==========================================
  Files         283      284       +1     
  Lines       11877    11890      +13     
  Branches     2898     2901       +3     
==========================================
+ Hits        11831    11843      +12     
- Misses         46       47       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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