From a8cb423078d5b2cd51f98a51feb4976e6ebbb1b6 Mon Sep 17 00:00:00 2001 From: David <33458145+davidmcpowell@users.noreply.github.com> Date: Fri, 21 Jun 2024 09:39:50 +0100 Subject: [PATCH] Merge pull request #19030 from overleaf/dp-presentation-mode-flag Add separate feature flag for presentation mode GitOrigin-RevId: a996fa313c101dd822ad83109ba77fa95f99f644 --- .../web/app/src/Features/Project/ProjectController.js | 1 + .../pdf-preview/components/pdf-zoom-dropdown.tsx | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/services/web/app/src/Features/Project/ProjectController.js b/services/web/app/src/Features/Project/ProjectController.js index ae80482b68..f05acef55f 100644 --- a/services/web/app/src/Features/Project/ProjectController.js +++ b/services/web/app/src/Features/Project/ProjectController.js @@ -327,6 +327,7 @@ const _ProjectController = { 'pdf-caching-prefetch-large', 'pdf-caching-prefetching', 'pdf-controls', + 'pdf-presentation-mode', 'pdfjs-40', 'personal-access-token', 'revert-file', diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-zoom-dropdown.tsx b/services/web/frontend/js/features/pdf-preview/components/pdf-zoom-dropdown.tsx index 8d31e5e718..5efc14aaf3 100644 --- a/services/web/frontend/js/features/pdf-preview/components/pdf-zoom-dropdown.tsx +++ b/services/web/frontend/js/features/pdf-preview/components/pdf-zoom-dropdown.tsx @@ -3,6 +3,7 @@ import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import ControlledDropdown from '@/shared/components/controlled-dropdown' import classNames from 'classnames' +import { useFeatureFlag } from '@/shared/context/split-test-context' const isMac = /Mac/.test(window.navigator?.platform) @@ -37,6 +38,8 @@ function PdfZoomDropdown({ }: PdfZoomDropdownProps) { const { t } = useTranslation() + const enablePresentationMode = useFeatureFlag('pdf-presentation-mode') + const [customZoomValue, setCustomZoomValue] = useState( rawScaleToPercentage(rawScale) ) @@ -45,6 +48,8 @@ function PdfZoomDropdown({ setCustomZoomValue(rawScaleToPercentage(rawScale)) }, [rawScale]) + const showPresentOption = enablePresentationMode && document.fullscreenEnabled + return ( {t('fit_to_height')} - {document.fullscreenEnabled && } - {document.fullscreenEnabled && ( + {showPresentOption && } + {showPresentOption && ( {t('presentation_mode')}