Contents Menu Expand Light mode Dark mode Auto light/dark mode
Openverse documentation
Light Logo Dark Logo
  • Django API
    • Guides
      • Quickstart guide
      • Testing guide
      • Deployment runbook
      • Local HTTPS testing
    • Reference
      • Made with Openverse
      • Search Algorithm
      • Authentication and Throttling
      • Django Healthcheck
  • Automations
    • Guides
      • Quickstart Guide
    • Reference
      • Python Scripts
  • Airflow Catalog
    • Guides
      • Deployment runbook
  • Changelogs
    • API changelogs
      • 2023.09.04.19.52.19
      • 2023.08.28.20.43.01
      • 2023.08.22.04.57.04
      • 2023.08.14.16.35.15
      • 2023.08.08.22.22.02
      • 2023.07.24.20.47.04
      • 2023.07.17.21.05.23
      • 2023.07.10.08.44.19
      • 2023.07.03.17.52.00
      • 2023.06.28.19.49.58
      • 2023.06.28.02.17.04
      • 2023.06.26.20.33.46
      • 2023.06.19.17.48.39
      • 2023.06.13.00.21.51
      • 2023.06.05.15.04.02
      • 2023.06.01.01.50.43
      • 2023.05.30.17.57.04
      • 2023.05.30.12.02.04
      • 2023.05.19.22.08.07
      • 2023.05.19.18.58.25
      • 2023.05.19.17.16.50
      • 2023.05.15.21.51.49
      • 2023.05.02.21.26.28
      • 2023.04.27.07.29.23
      • 2023.04.23.23.22.14
      • 2023.04.19.00.01.39
      • 2023.04.18.15.27.15
      • 2023.04.12.23.29.59
    • Catalog changelogs
      • 2023.08.30.17.30.22
      • 2023.07.20.15.07.11
      • 2023.06.19.17.21.41
      • 2023.06.08.16.52.36
      • 2023.05.16.22.14.49
      • 2023.04.27.02.43.13
    • Frontend changelogs
      • 2023.09.05.17.09.13
      • 2023.09.04.20.20.34
      • 2023.08.28.19.38.22
      • 2023.08.22.06.04.39
      • 2023.08.14.16.26.44
      • 2023.08.08.21.19.44
      • 2023.07.28.23.42.26
      • 2023.07.24.21.23.45
      • 2023.07.20.17.25.42
      • 2023.07.19.19.15.39
      • 2023.07.17.21.49.20
      • 2023.07.10.08.29.25
      • 2023.07.06.14.52.49
      • 2023.07.05.17.56.39
      • 2023.07.03.18.19.32
      • 2023.06.26.20.22.48
      • 2023.06.19.17.31.24
      • 2023.06.13.00.28.40
      • 2023.06.05.14.48.06
      • 2023.05.23.17.02.26
      • 2023.05.22.15.55.57
      • 2023.05.15.22.13.27
      • 2023.05.02.19.17.32
      • 2023.04.23.23.07.51
    • Ingestion server changelogs
      • 2023.09.05.18.56.18
      • 2023.08.29.17.36.35
      • 2023.07.21.20.19.21
      • 2023.07.05.17.46.34
      • 2023.06.13.00.25.04
      • 2023.06.07.17.56.30
      • 2023.05.17.22.57.37
      • 2023.05.03.22.29.52
  • Nuxt frontend
    • Guides
      • Quickstart guide
      • Deployment runbook
      • Running frontend tests
      • Analytics
      • SVG Icon Sprites in Openverse Frontend
      • Translate
    • Reference
      • Internationalization
      • Feature flags
      • Testing Guidelines
      • Playwright tests
      • Storybook tests
      • Miscellaneous notes on the frontend
      • Nuxt Healthcheck
  • General development guidelines
    • Welcome
    • General setup guide
    • Quickstart guide
    • Run
    • Test
    • Publish
    • Zero Downtime and Database Management
    • Deployments
    • Logging
    • Testing HTTPS
  • Ingestion server
    • Guides
      • Quickstart guide
      • Configuration
      • Mapping database tables to Elasticsearch
      • Testing guide
      • Deployment runbook
    • Reference
      • Elasticsearch and Indexing
      • Safety and Security Considerations
      • Notifications
      • Data Refresh Limit
  • Managing the Openverse
    • GitHub contribution practices
    • Development workflow
    • Regular maintainer tasks
    • CI + CD workflow
      • Actions
      • Jobs
        • Preparation jobs
        • Frontend jobs
        • Packages jobs
        • Docker jobs
        • Catalog jobs
        • Ingestion server jobs
        • API jobs
        • Documentation jobs
        • Deployment jobs
        • Notification jobs
      • Flow
      • Proof-of-functionality
      • Artifacts
    • Openverse Decision-Making Process
      • Process description
      • How to follow the process in different settings
      • Additional practices
    • Documentation
      • Quickstart guide
      • Documentation Guidelines
      • Sphinx extensions
      • Documentation proofreading and review
    • Monitoring the Openverse
      • Traffic Management
        • Identifying and Blocking Traffic Anomalies in Cloudflare
      • Log querying
      • Runbooks
        • Run Book: Unhealthy hosts for ECS service
    • Communication aliases
    • Codespell Configuration : spellcheck pre-commit hook
    • Media Properties
  • Node.js packages
    • @openverse/eslint-plugin
      • analytics-configuration
      • no-unexplained-disabled-test
  • Projects
    • Project Planning
    • Implementation Plan Template
    • Project directory index.md template
    • Project Proposal Template
    • 3D Model Support
      • 2022-02-21 Project Proposal: 3D model support
    • Additional Search Views
      • 2023-04-24 Project Proposal: Additional search views
      • 2023-07-20 Implementation Plan: Additional Search Views
    • Analytics
      • 2022-10-06 Implementation Plan: Frontend event tracking
      • 2023-03-07 Implementation Plan: Analytics backend and visualisation service
    • Core User Interface Improvements
      • 2023-03-14 Project Proposal: Core UI Improvement
    • Document all media properties
      • 2023-03-07 Project proposal for Document all media properties
      • 2023-04-26 Implementation Plan: Document all media properties in the catalog
      • Samples
        • Openverse Media Properties
        • sample_media_properties.md
        • sample_postamble.md
        • sample_preamble.md
    • Samples
      • Openverse Media Properties
      • sample_media_properties.md
      • sample_postamble.md
      • sample_preamble.md
    • Feature Flags
      • 2022-03-09 Project Proposal: Feature flags
    • Frontend UI State Cookie
      • 2022-02-18 Project Propsal: Frontend UI State Cookie
    • Monitoring
      • 2022-03-07 Project Proposal: Monitoring
      • 2023-06-06 Implementation Plan: Baseline Alarms for ECS Services
        • Stable Run Book Sample
        • Unstable Run Book Sample
    • Monorepo
      • 2022-11-24 Project Proposal: Monorepo
    • Nuxt 3 Migration
      • 2023-06-02 Project Proposal
    • Popularity Calculation Optimizations
      • 2023-04-06 Project Proposal: Popularity Calculation Optimizations
      • Implementation Plan: Decoupling Popularity Calculations from the Data Refresh
    • Providing and maintaining an Openverse image dataset
      • 2023-07-06 Project Proposal: Providing and maintaining an Openverse image dataset
    • Search Relevancy Sandbox
      • 2023-03-31 Project Proposal: Search relevancy sandbox
      • 2023-04-06 Implementation Plan: Update Staging Database
      • 2023-05-18 Implementation Plan: Rapid iteration of ingestion server index configuration
      • 2023-06-08 Implementation Plan: Staging Elasticsearch Reindex DAGs
    • Sensitive Content Report Moderation Initial Practices
      • 2023-04-11 Project Proposal: Sensitive content report moderation: initial practices
      • 2023-05-17 Implementation Plan: Copy updates mature -> sensitive
    • Detecting and Blurring Sensitive Textual Content
      • 2023-03-09 Implementation Plan: Sensitive Terms List
      • 2023-03-09 Project Proposal: Detecting sensitive textual content and blurring all sensitive results
      • 2023-03-30 Implementation Plan: Filtering and designating results with sensitive textual content
      • 2023-05-06 Implementation Plan: Fetching, blurring sensitive results
    • Trust and Safety
      • 2023-01-09 Initial Overview and User Stories
      • Sensitive Content Report Moderation Initial Practices
        • 2023-04-11 Project Proposal: Sensitive content report moderation: initial practices
        • 2023-05-17 Implementation Plan: Copy updates mature -> sensitive
      • Detecting and Blurring Sensitive Textual Content
        • 2023-03-09 Implementation Plan: Sensitive Terms List
        • 2023-03-09 Project Proposal: Detecting sensitive textual content and blurring all sensitive results
        • 2023-03-30 Implementation Plan: Filtering and designating results with sensitive textual content
        • 2023-05-06 Implementation Plan: Fetching, blurring sensitive results
    • Visual Regression Testing
      • 2022-02-17 Implementation Plan: Visual regression testing
    • Pinia Conversion
      • 2022-02-23 Project Proposal: Vuex to Pinia conversion
  • Openverse API Terms of Service

External links

  • Openverse
  • GitHub
Back to top
Edit this page

2022-02-18 Project Propsal: Frontend UI State Cookie#

Author: @sarayourfriend

  • [x] @obulat

  • [x] @zackkrida

Milestone

Rationale#

We removed all the cookies from the application. That’s a good thing generally. But we can use cookies without a banner and still be GDPR compliant as long as the cookies are necessary for providing a smoother user experience.

Doing this would fix problems like the UI pop in/out in this video.

GDPR rules#

To quote from https://gdpr.eu/cookies:

Strictly necessary cookies — These cookies are essential for you to browse the website and use its features, such as accessing secure areas of the site. Cookies that allow web shops to hold your items in your cart while you are shopping online are an example of strictly necessary cookies. These cookies will generally be first-party session cookies. While it is not required to obtain consent for these cookies, what they do and why they are necessary should be explained to the user.

I believe the cookie I am proposing we add in this RFC falls under this and we would not need a consent banner for it.

We should however add an explanatory page for our cookie usage; potentially this could just be a general “Privacy” page that links out to the WP.org privacy policy and explains Openverse specific things.

Cookie shape#

Let’s introduce one “ui state” cookie that encodes the following:

interface UIStateCookie {
  /**
   * Whether the filter sidebar was open during the last page load
   * @defaultValue false
   */
  filterSidebarOpen: boolean;
  /**
   * Record of translation banners that have been dismissed.
   * For increased privacy through obsurity, only actually dismissed
   * locales are present, that way there isn't a running record
   * of all the locales the client has visited.
   */
  translationBannerDismissed: { [slug: WPLocaleSlug]?: true };
  /**
   * The breakpoint of the most recent page load.
   * We do not store the exact screen width because we don't need it
   * and it could inadvertently be used for fingerprinting.
   *
   * The default value will be `md` for non-mobile UAs or when a UA is
   * unavailable. For mobile UAs it will default to `mob`.
   */
  breakpoint: 'xl' | 'lg' | 'md' | 'sm' | 'mob';
}

Implementation plan#

  • [ ] useUiStateCookie() -> Returns an existing cookie or creates a new one and saves it. It should be a reactive object with custom set handlers to update the stored cookie value. Creating a new one should sniff the UA for the correct default value for breakpoint.

    • Additionally: useSyncUiStateCookieBreakpoint() -> Called by useUiStateCookie to sync the breakpoint upon resizing.

  • [ ] Update useMediaQuery to use the ui state cookie to deduce a default for shouldPassInSSR based on the breakpoint value.

  • [ ] Update the translation banner dismissal to set the cookie property and read from it to determine whether to show.

  • [ ] Update filter sidebar opening to set the cookie property and read from it to determine whether to show.

  • [ ] Add new Privacy page that explains our use of cookies and links to WP.org’s Privacy policy. Replace the page menu privacy link to use the internal one.

Next
Monitoring
Previous
Frontend UI State Cookie
Made with Sphinx and @pradyunsg's Furo
On this page
  • 2022-02-18 Project Propsal: Frontend UI State Cookie
    • Rationale
    • GDPR rules
    • Cookie shape
    • Implementation plan