Skip to content

feat(condo): [DOMA-13311, DOMA-13308] - hide paid content and pc specific layout behind feature flags#7684

Merged
toplenboren merged 5 commits into
mainfrom
toplenboren-hide-user-page-behind-ff
Jun 7, 2026
Merged

feat(condo): [DOMA-13311, DOMA-13308] - hide paid content and pc specific layout behind feature flags#7684
toplenboren merged 5 commits into
mainfrom
toplenboren-hide-user-page-behind-ff

Conversation

@toplenboren

@toplenboren toplenboren commented May 28, 2026

Copy link
Copy Markdown
Member

This PR adds ability to set new feature flags:

  1. ui-hide-layout-sideMenu hides side menu if true
  2. ui-hide-layout-header hides header
  3. ui-hide-user-links hides links to /user page

Summary by CodeRabbit

  • New Features

    • UI regions (header, side navigation, user links, paid-related sections) can be toggled via feature flags across desktop and mobile.
  • Improvements

    • Footer always rendered; legal/privacy links shown only when enabled.
    • Cookie agreement and menu items now respect feature flags.
    • Subscription UIs, modals, tooltips and payment-related flows can be hidden when paid features are disabled.
  • Localization

    • Updated contact modal copy and added "access denied/unavailable" messages in EN/ES/RU.

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds UI visibility feature flags and applies them across layout, header, menus, subscription UI, modals, analytics, billing, settings, and app wiring to conditionally hide header, side menu, user links, legal/cookie UI, and paid-feature surfaces; includes small localization edits.

Changes

Feature-flag UI visibility system

Layer / File(s) Summary
Feature flag constants
apps/condo/domains/common/constants/featureflags.js
Defines and exports new UI visibility flags including UI_HIDE_USER_LINKS, UI_HIDE_LAYOUT_HEADER, UI_HIDE_LAYOUT_SIDE_MENU, and UI_HIDE_PAID_FEATURES.
Layout header and side menu visibility
apps/condo/domains/common/components/containers/BaseLayout/BaseLayout.tsx
BaseLayout reads layout-hide flags and computes isHeaderHidden/isSideMenuHidden, rendering Header and SideNav conditionally.
User links / UserMenu visibility
apps/condo/domains/common/components/containers/BaseLayout/Header.tsx, apps/condo/domains/common/components/containers/BaseLayout/components/TopMenuItems.tsx, apps/condo/domains/common/hooks/useGlobalHints.tsx
Header, TopMenuItems, and global hints read UI_HIDE_USER_LINKS to conditionally render UserMenu and the “In profile” link.
Footer and CookieAgreement gating
apps/condo/domains/common/components/containers/BaseLayout/Footer.tsx, apps/condo/pages/_app.tsx
Footer always renders Layout.Footer while internal legal/privacy rows are gated by UI_LEGAL_INFO; MyApp gates CookieAgreement on the same flag.
App menu & miniapp paid-feature gating
apps/condo/pages/_app.tsx
MenuItems reads UI_HIDE_PAID_FEATURES to suppress SubscriptionFeatureProgress, disable feature tooltips, and avoid rendering unavailable miniapp entries.
Analytics & Billing gating
apps/condo/domains/analytics/components/charts/payment/PaymentTotalChart.tsx, apps/condo/domains/billing/components/BillingPageContent/BlockedB2BAppTab.tsx
PaymentTotalChart and B2B blocked tab respect UI_HIDE_PAID_FEATURES to hide marketplace/subscription charts and show an unavailable blocked tab variant.
Subscription UI components
apps/condo/domains/subscription/components/*
Multiple subscription components (tooltips, blockers, days indicator, feature modal, feature progress, settings content, upgrade button) read UI_HIDE_PAID_FEATURES and short-circuit rendering or adjust button/container presence.
Subscription hooks & modals
apps/condo/domains/subscription/hooks/*
Linked-cards, payment-history, and subscription-payment hooks return null or become no-ops when UI_HIDE_PAID_FEATURES is enabled; returned booleans updated accordingly.
Settings page
apps/condo/pages/settings/index.tsx
Settings tabs and content exclude the Subscriptions tab when UI_HIDE_PAID_FEATURES is enabled; memo deps updated.
Localization edits
apps/condo/lang/en/en.json, apps/condo/lang/es/es.json, apps/condo/lang/ru/ru.json
English copy edits for address-not-found modal and new subscription accessGuard “unavailable” i18n strings; Spanish and Russian translations added.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

✋🙂 Review please

Suggested reviewers

  • nomerdvadcatpyat
  • Alexander-Turkin
  • Alllex202
  • AleX83Xpert

Poem

🐰 I nibble flags behind the scene,
Hiding menus, quiet and clean,
Cookies wait for lawful nod,
Paid features take a gentle nod,
I hop through code and leave it lean.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.
Title check ✅ Passed The title accurately reflects the main changes: it mentions hiding paid content and layout behind feature flags, which aligns with the comprehensive set of feature flag additions across layout, user links, and subscription components.

✏️ 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 toplenboren-hide-user-page-behind-ff

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 and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 36e7cbe719

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

<Layout
className={classnames(
styles.subLayout,
isCollapsed ? styles.subLayoutCollapsed : styles.subLayoutExpanded

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove side-menu offset when the side menu is hidden

When UI_HIDE_LAYOUT_SIDE_MENU is enabled on desktop, the SideNav is not rendered, but this class still applies either styles.subLayoutExpanded or styles.subLayoutCollapsed; in BaseLayout.module.css those add a left margin equal to the side-menu width/collapsed width. As a result, embedded pages with the side menu hidden still render shifted to the right with a blank gutter, so the layout is not actually full-width.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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.

Inline comments:
In `@apps/condo/domains/common/components/containers/BaseLayout/BaseLayout.tsx`:
- Around line 9-10: The import order violates repo lint rules: move the
`@open-condo` import (useFeatureFlags from
'`@open-condo/featureflags/FeatureFlagsContext`') above the internal `@condo`
imports (UI_HIDE_LAYOUT_HEADER, UI_HIDE_LAYOUT_SIDE_MENU) and ensure there is a
blank line between the `@open-condo` group and the `@condo` group in BaseLayout.tsx
so the groups follow builtin → external → `@open-condo` → internal ordering.

In `@apps/condo/domains/common/hooks/useGlobalHints.tsx`:
- Around line 143-147: The memo that returns the user link JSX (created with
useMemo in useGlobalHints.tsx) omits isUserLinksHidden from its dependency
array, causing the Link visibility to become stale; update the dependencies for
that useMemo to include isUserLinksHidden (alongside existing deps like
InProfileMessage or any others) so the memo recomputes when the hidden-flag
changes and the conditional rendering inside the memo reflects the current flag.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: da30329d-3edf-4355-bea5-14a46fa4b9c0

📥 Commits

Reviewing files that changed from the base of the PR and between 108db6a and 36e7cbe.

📒 Files selected for processing (8)
  • apps/condo/domains/common/components/containers/BaseLayout/BaseLayout.tsx
  • apps/condo/domains/common/components/containers/BaseLayout/Footer.tsx
  • apps/condo/domains/common/components/containers/BaseLayout/Header.tsx
  • apps/condo/domains/common/components/containers/BaseLayout/components/TopMenuItems.tsx
  • apps/condo/domains/common/constants/featureflags.js
  • apps/condo/domains/common/hooks/useGlobalHints.tsx
  • apps/condo/lang/en/en.json
  • apps/condo/pages/_app.tsx

Comment thread apps/condo/domains/common/components/containers/BaseLayout/BaseLayout.tsx Outdated
Comment thread apps/condo/domains/common/hooks/useGlobalHints.tsx
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Actionable comments posted: 0

@Alllex202 Alllex202 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good

import { colors } from '@open-condo/ui/colors'

import { UI_HIDE_USER_LINKS } from '@condo/domains/common/constants/featureflags'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change

two spaces are enough

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@apps/condo/domains/subscription/components/SubscriptionAccessGuard.tsx`:
- Line 209: The current guard condition in SubscriptionAccessGuard.tsx using "if
(hidePaidFeatures && !hasSubscription)" is too narrow and causes non-functional
buttons for users who do have a subscription; change the condition to check only
"hidePaidFeatures" (remove the "&& !hasSubscription" part) so the
unavailable/blocked UI is shown whenever hidePaidFeatures is true and the route
is blocked; ensure the primaryButton logic and modal flow still rely on
openPaymentModal/useSubscriptionPaymentModal and that PaymentModal usage is
compatible (so buttons won't attempt to open a modal or navigate to
/settings?tab=subscription when hidePaidFeatures prevents those actions).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fd93878b-de83-41e4-af2d-67fae3e9d5d5

📥 Commits

Reviewing files that changed from the base of the PR and between 9eef122 and 9f93db4.

📒 Files selected for processing (19)
  • apps/condo/domains/analytics/components/charts/payment/PaymentTotalChart.tsx
  • apps/condo/domains/billing/components/BillingPageContent/BlockedB2BAppTab.tsx
  • apps/condo/domains/common/constants/featureflags.js
  • apps/condo/domains/subscription/components/NoSubscriptionTooltip.tsx
  • apps/condo/domains/subscription/components/SubscriptionAccessGuard.tsx
  • apps/condo/domains/subscription/components/SubscriptionBlockedContent.tsx
  • apps/condo/domains/subscription/components/SubscriptionDaysIndicator.tsx
  • apps/condo/domains/subscription/components/SubscriptionFeatureModal.tsx
  • apps/condo/domains/subscription/components/SubscriptionFeatureProgress.tsx
  • apps/condo/domains/subscription/components/SubscriptionSettingsContent/SubscriptionSettingsContent.tsx
  • apps/condo/domains/subscription/components/UpgradePlanButton.tsx
  • apps/condo/domains/subscription/hooks/useLinkedCardsModal.tsx
  • apps/condo/domains/subscription/hooks/usePaymentHistoryModal.tsx
  • apps/condo/domains/subscription/hooks/useSubscriptionPaymentModal.tsx
  • apps/condo/lang/en/en.json
  • apps/condo/lang/es/es.json
  • apps/condo/lang/ru/ru.json
  • apps/condo/pages/_app.tsx
  • apps/condo/pages/settings/index.tsx
✅ Files skipped from review due to trivial changes (2)
  • apps/condo/lang/ru/ru.json
  • apps/condo/lang/es/es.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/condo/lang/en/en.json
  • apps/condo/domains/common/constants/featureflags.js

: null

if (isBlocked) {
if (hidePaidFeatures && !hasSubscription) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Critical: Logic flaw in feature-flag condition creates non-functional buttons.

The condition hidePaidFeatures && !hasSubscription is too restrictive. When a user has a subscription but hidePaidFeatures=true and they are blocked on a specific feature (e.g., Lines 167-173: miniapp not enabled or required feature not available), the code falls through to the normal blocked screen (Lines 227-273).

In that screen:

  • Line 239: primaryButton becomes "Buy Feature" → calls openPaymentModal
  • Line 256: PaymentModal is null when hidePaidFeatures=true
  • Line 53 of useSubscriptionPaymentModal: openModal returns early, so modal never opens
  • Alternatively, Line 229: primaryButton is "Go to Plans" → routes to /settings?tab=subscription
  • But settings/index.tsx Line 95 hides that tab when hidePaidFeatures=true

Both buttons would be visible but non-functional, breaking the UX.

🔒 Proposed fix

Remove the && !hasSubscription condition so the unavailable screen is shown whenever hidePaidFeatures is enabled and the route is blocked, regardless of subscription status:

-        if (hidePaidFeatures && !hasSubscription) {
+        if (hidePaidFeatures) {
             return (
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (hidePaidFeatures && !hasSubscription) {
if (hidePaidFeatures) {
🤖 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 `@apps/condo/domains/subscription/components/SubscriptionAccessGuard.tsx` at
line 209, The current guard condition in SubscriptionAccessGuard.tsx using "if
(hidePaidFeatures && !hasSubscription)" is too narrow and causes non-functional
buttons for users who do have a subscription; change the condition to check only
"hidePaidFeatures" (remove the "&& !hasSubscription" part) so the
unavailable/blocked UI is shown whenever hidePaidFeatures is true and the route
is blocked; ensure the primaryButton logic and modal flow still rely on
openPaymentModal/useSubscriptionPaymentModal and that PaymentModal usage is
compatible (so buttons won't attempt to open a modal or navigate to
/settings?tab=subscription when hidePaidFeatures prevents those actions).

@sonarqubecloud

sonarqubecloud Bot commented Jun 7, 2026

Copy link
Copy Markdown

@toplenboren toplenboren changed the title feat(condo): [DOMA-13311] - hide layout for embedded apps feat(condo): [DOMA-13311, DOMA-13308] - hide paid content and pc specific layout behind feature flags Jun 7, 2026
@toplenboren toplenboren merged commit ce537bc into main Jun 7, 2026
44 checks passed
@toplenboren toplenboren deleted the toplenboren-hide-user-page-behind-ff branch June 7, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants