Open
Conversation
There was a problem hiding this comment.
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 intoHypothesisApp. - Add
YouTubeDisclaimerBannercomponent + tests and aSessionService.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 Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
YouTube disclaimer banner (LMS): When the LMS sends
youtubeAssignment: truein 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: falseon PATCH profile; the banner is shown only when the profile hasshow_youtube_gdpr_banner: true(user has not dismissed).Client changes:
YouTubeDisclaimerBannercomponent and tests.SessionService.dismissYoutubeDisclaimer()calls profile.update withshow_youtube_gdpr_banner: false.shouldShowYoutubeDisclaimer(settings, profile)helper and tests.show_youtube_gdpr_bannerin preferences.HypothesisAppwhenyoutubeAssignment === trueand the user has not dismissed.