From 6685ae1321c1c75df58f238e7b1f2fdc01d22a91 Mon Sep 17 00:00:00 2001 From: doubleface Date: Tue, 23 Jun 2026 11:00:05 +0200 Subject: [PATCH 1/3] refactor: Rename promoteDesktop config to promoteApp It was misleading since it also handles promoting mobile application I also set this config to true again --- src/components/pushClient/Button.jsx | 8 ++------ src/config/config.json | 4 ++-- src/modules/viewer/CallToAction.jsx | 4 ++-- src/modules/viewer/CallToAction.spec.jsx | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/components/pushClient/Button.jsx b/src/components/pushClient/Button.jsx index 3ce53c2c88..e753317687 100644 --- a/src/components/pushClient/Button.jsx +++ b/src/components/pushClient/Button.jsx @@ -26,7 +26,7 @@ const ButtonClient = ({ client, t }) => { useEffect(() => { const checkShouldShowButton = async () => { - if (Config.promoteDesktop.isActivated !== true || isFlagshipApp()) return + if (Config.promoteApp.isActivated !== true || isFlagshipApp()) return const hasBannerBeenClosed = (await localforage.getItem(DESKTOP_BANNER)) || false @@ -54,11 +54,7 @@ const ButtonClient = ({ client, t }) => { localforage.setItem(DESKTOP_SMALL_BANNER, true) } - if ( - Config.promoteDesktop.isActivated !== true || - !mustShow || - isFlagshipApp() - ) + if (Config.promoteApp.isActivated !== true || !mustShow || isFlagshipApp()) return null const link = getDesktopAppDownloadLink({ t }) diff --git a/src/config/config.json b/src/config/config.json index 7ce46666ef..5fb4c00120 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -1,5 +1,5 @@ { - "promoteDesktop": { - "isActivated": false + "promoteApp": { + "isActivated": true } } diff --git a/src/modules/viewer/CallToAction.jsx b/src/modules/viewer/CallToAction.jsx index 33482fc3cf..c46ad914f4 100644 --- a/src/modules/viewer/CallToAction.jsx +++ b/src/modules/viewer/CallToAction.jsx @@ -20,7 +20,7 @@ class CallToAction extends Component { } async componentDidMount() { - if (Config.promoteDesktop.isActivated !== true) return + if (Config.promoteApp.isActivated !== true) return const seen = (await localforage.getItem(NOVIEWER_DESKTOP_CTA)) || false if (!seen) { try { @@ -40,7 +40,7 @@ class CallToAction extends Component { } render() { - if (!this.state.mustShow || Config.promoteDesktop.isActivated !== true) + if (!this.state.mustShow || Config.promoteApp.isActivated !== true) return null const { t } = this.props diff --git a/src/modules/viewer/CallToAction.spec.jsx b/src/modules/viewer/CallToAction.spec.jsx index 5dca123cf7..14c5648edb 100644 --- a/src/modules/viewer/CallToAction.spec.jsx +++ b/src/modules/viewer/CallToAction.spec.jsx @@ -8,7 +8,7 @@ import { NOVIEWER_DESKTOP_CTA } from '@/components/pushClient' jest.mock('localforage') jest.mock('config/config.json', () => ({ - promoteDesktop: { isActivated: true } + promoteApp: { isActivated: true } })) jest.mock('components/pushClient', () => ({ getDesktopAppDownloadLink: jest.fn().mockReturnValue('https://twake.app'), From cb41a2506789f9a255278eeba15eb95647daff98 Mon Sep 17 00:00:00 2001 From: doubleface Date: Tue, 23 Jun 2026 11:01:33 +0200 Subject: [PATCH 2/3] feat: Add drive.pushBanner-hide-mobile.enabled and drive.pushBanner-hide-desktop.enabled To be able to hide one banner or another as we want in production --- src/components/pushClient/Banner.jsx | 6 +++++- src/lib/flags.js | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/pushClient/Banner.jsx b/src/components/pushClient/Banner.jsx index 205966e2da..c2c4b862c9 100644 --- a/src/components/pushClient/Banner.jsx +++ b/src/components/pushClient/Banner.jsx @@ -6,6 +6,7 @@ import flow from 'lodash/flow' import React, { Component } from 'react' import { withClient } from 'cozy-client' +import flag from 'cozy-flags' import Alert from 'cozy-ui/transpiled/react/Alert' import Button from 'cozy-ui/transpiled/react/Buttons' import Icon from 'cozy-ui/transpiled/react/Icon' @@ -53,12 +54,15 @@ class BannerClient extends Component { } render() { - if (Config.promoteDesktop.isActivated !== true || !this.state.mustShow) + if (Config.promoteApp.isActivated !== true || !this.state.mustShow) return null const { t } = this.props const isMobile = isIOS() || isAndroid() + if (isMobile && flag('drive.pushBanner-hide-mobile.enabled')) return null + if (!isMobile && flag('drive.pushBanner-hide-desktop.enabled')) return null + const text = isMobile ? 'Nav.btn-client-mobile' : 'Nav.banner-txt-client' const link = isMobile ? getMobileAppDownloadLink({ t }) diff --git a/src/lib/flags.js b/src/lib/flags.js index a4b10180bf..6a4433532e 100644 --- a/src/lib/flags.js +++ b/src/lib/flags.js @@ -24,6 +24,8 @@ const flagsList = () => { flag('drive.onlyoffice.editorToolbarHeight') // flagName should use kebab case flag('drive.logger') flag('drive.dacc-files-size-by-slug') + flag('drive.pushBanner-hide-mobile.enabled') + flag('drive.pushBanner-hide-desktop.enabled') flag('drive.breadcrumb.showCompleteBreadcrumbOnPublicPage') // flagName should use kebab case flag('drive.hide-nextcloud-dev') flag('drive.excalidraw.enabled') From edaeea5da6e9ec1d5a9fc610204ed7e647cf2daf Mon Sep 17 00:00:00 2001 From: doubleface Date: Tue, 23 Jun 2026 12:16:44 +0200 Subject: [PATCH 3/3] feat: Hide the mobile application banner by default --- src/lib/flags.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/flags.js b/src/lib/flags.js index 6a4433532e..931fa287e1 100644 --- a/src/lib/flags.js +++ b/src/lib/flags.js @@ -24,7 +24,7 @@ const flagsList = () => { flag('drive.onlyoffice.editorToolbarHeight') // flagName should use kebab case flag('drive.logger') flag('drive.dacc-files-size-by-slug') - flag('drive.pushBanner-hide-mobile.enabled') + flag('drive.pushBanner-hide-mobile.enabled', true) flag('drive.pushBanner-hide-desktop.enabled') flag('drive.breadcrumb.showCompleteBreadcrumbOnPublicPage') // flagName should use kebab case flag('drive.hide-nextcloud-dev')