Skip to content

feat: pushBanner flags per platform#3955

Merged
doubleface merged 3 commits into
masterfrom
feat/pushBannerAppFlag
Jun 23, 2026
Merged

feat: pushBanner flags per platform#3955
doubleface merged 3 commits into
masterfrom
feat/pushBannerAppFlag

Conversation

@doubleface

@doubleface doubleface commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

What

Rename promoteDesktop config to promoteApp and add per-platform feature flags (drive.pushBanner-hide-mobile.enabled / drive.pushBanner-hide-desktop.enabled) to control which push-to-install banner is shown.
And hide mobile application push banner by defaut

Why

The promoteDesktop config name was misleading — it actually controls both desktop and mobile app promotion banners in the push client. The rename makes the intent clearer.

Additionally, we wanted the ability to independently toggle the mobile vs desktop push banner in production without a deploy, hence the new cozy-flags.

Summary by CodeRabbit

Summary

  • New Features

    • Added independent feature flags to hide the push banner on mobile vs. desktop.
    • Push banner, promo button, and viewer CTA now use the same app-level promotion activation setting, with additional platform-specific visibility controlled by the new hide flags.
  • Chores

    • Updated promotion configuration to use the new app activation flag.
    • Updated banner/button/CTA visibility logic and refreshed tests to match the new configuration.

It was misleading since it also handles promoting mobile application
I also set this config to true again
codescene-delta-analysis[bot]

This comment was marked as outdated.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eb7f9361-a7c5-4834-bef2-0063542f6343

📥 Commits

Reviewing files that changed from the base of the PR and between aa8d075 and edaeea5.

📒 Files selected for processing (2)
  • src/components/pushClient/Banner.jsx
  • src/lib/flags.js

Walkthrough

The PR renames the configuration key promoteDesktop to promoteApp in config.json and updates all components that reference it (Banner.jsx, Button.jsx, CallToAction.jsx) to use Config.promoteApp.isActivated. Additionally, two new feature flags — drive.pushBanner-hide-mobile.enabled and drive.pushBanner-hide-desktop.enabled — are registered in flags.js. Banner.jsx gains a cozy-flags import and uses these new flags to add per-platform early-null returns in render(). The Jest mock in CallToAction.spec.jsx is updated to match the renamed config key.

Possibly related PRs

  • linagora/twake-drive#3790: Modifies Banner.jsx render logic, directly overlapping with this PR's changes to the same component and render path.
  • linagora/twake-drive#3903: Modifies promotion config in the same config.json file, directly interacting with the activation logic being renamed here.

Suggested reviewers

  • JF-Cozy
  • rezk2ll
  • lethemanh
  • codescene-delta-analysis
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: pushBanner flags per platform' accurately describes the main objective of adding per-platform feature flags for controlling the push banner display on different platforms.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/pushBannerAppFlag

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bundlemon

bundlemon Bot commented Jun 23, 2026

Copy link
Copy Markdown

BundleMon

Files updated (1)
Status Path Size Limits
static/js/main.(hash).js
48.87KB (+26B +0.05%) -
Unchanged files (19)
Status Path Size Limits
static/js/cozy.(hash).js
928.36KB -
static/resource/(hash).js
336.09KB -
services/qualificationMigration.js
283.39KB -
services/dacc.js
263.13KB -
static/js/lib-react.(hash).js
43.88KB -
static/css/cozy.(hash).css
30.13KB -
static/js/lib-polyfill.(hash).js
22.77KB -
static/js/lib-router.(hash).js
21.86KB -
static/js/public.(hash).js
19.77KB -
static/css/main.(hash).css
13.57KB -
static/js/intents.(hash).js
8.99KB -
static/js/(chunkId).(hash).js
8.6KB -
static/js/async/(chunkId).(hash).js
7.5KB -
manifest.webapp
3.09KB -
static/css/public.(hash).css
2.34KB -
index.html
771B -
public/index.html
705B -
intents/index.html
642B -
assets/manifest.json
185B -

Total files change +23B 0%

Groups updated (1)
Status Path Size Limits
**/*.js
5.98MB (+55B 0%) -
Unchanged groups (2)
Status Path Size Limits
**/*.{png,svg,ico}
2.16MB -
**/*.css
77.43KB -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@doubleface doubleface marked this pull request as draft June 23, 2026 09:14
@doubleface doubleface changed the title refactor: Rename promoteDesktop config to promoteApp feat: pushBanner flags per platform Jun 23, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/flags.js (1)

3-17: 🎯 Functional Correctness | 🔴 Critical

Production activation path for new banner flags is broken.

In production, initFlags() only calls flagsList() if activateFlags is true (lines 15–17). However, activateFlags is false by default in production unless the switcher flag is already explicitly set or the ?flags URL parameter is provided. This creates a bootstrap problem: the new flags at lines 27–28 are never initialized unless switcher is pre-enabled externally or a developer appends ?flags to the URL.

The flag('switcher', true) call at line 22 is unreachable in the common case, leaving no way for the switcher to be activated without external intervention. For runtime control of the push banner feature without deployment, ensure the switcher flag is initialized from the server, or update the bootstrap logic to call flagsList() unconditionally on first load.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/flags.js` around lines 3 - 17, The `initFlags()` function only calls
`flagsList()` when `activateFlags` is true, but in production `activateFlags`
defaults to false unless the switcher flag is already set or the ?flags URL
parameter is provided. This creates a bootstrap problem where the flags are
never initialized. To fix this, ensure that `flagsList()` is called
unconditionally on first load to initialize all flags regardless of the
`activateFlags` condition, or alternatively ensure the switcher flag is
pre-initialized from the server before `initFlags()` executes. Update the
conditional logic at the end of `initFlags()` to guarantee `flagsList()` is
invoked to properly bootstrap the flag system.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/lib/flags.js`:
- Around line 3-17: The `initFlags()` function only calls `flagsList()` when
`activateFlags` is true, but in production `activateFlags` defaults to false
unless the switcher flag is already set or the ?flags URL parameter is provided.
This creates a bootstrap problem where the flags are never initialized. To fix
this, ensure that `flagsList()` is called unconditionally on first load to
initialize all flags regardless of the `activateFlags` condition, or
alternatively ensure the switcher flag is pre-initialized from the server before
`initFlags()` executes. Update the conditional logic at the end of `initFlags()`
to guarantee `flagsList()` is invoked to properly bootstrap the flag system.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3407bfaf-04fb-40ee-be70-e8ef81b209d1

📥 Commits

Reviewing files that changed from the base of the PR and between cc6e23d and 85f67f6.

📒 Files selected for processing (6)
  • src/components/pushClient/Banner.jsx
  • src/components/pushClient/Button.jsx
  • src/config/config.json
  • src/lib/flags.js
  • src/modules/viewer/CallToAction.jsx
  • src/modules/viewer/CallToAction.spec.jsx

@doubleface doubleface force-pushed the feat/pushBannerAppFlag branch from 85f67f6 to 195b6dd Compare June 23, 2026 09:18
codescene-delta-analysis[bot]

This comment was marked as outdated.

@doubleface doubleface marked this pull request as ready for review June 23, 2026 09:19
codescene-delta-analysis[bot]

This comment was marked as outdated.

Comment thread src/components/pushClient/Banner.jsx Outdated
…ide-desktop.enabled

To be able to hide one banner or another as we want in production
@doubleface doubleface force-pushed the feat/pushBannerAppFlag branch from aa8d075 to edaeea5 Compare June 23, 2026 16:12

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our agent can fix these. Install it.

Gates Passed
3 Quality Gates Passed

Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@doubleface doubleface merged commit f98114a into master Jun 23, 2026
6 of 7 checks passed
@doubleface doubleface deleted the feat/pushBannerAppFlag branch June 23, 2026 16:16
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