feat(condo): [DOMA-13311, DOMA-13308] - hide paid content and pc specific layout behind feature flags#7684
Conversation
📝 WalkthroughWalkthroughAdds 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. ChangesFeature-flag UI visibility system
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 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 |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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
📒 Files selected for processing (8)
apps/condo/domains/common/components/containers/BaseLayout/BaseLayout.tsxapps/condo/domains/common/components/containers/BaseLayout/Footer.tsxapps/condo/domains/common/components/containers/BaseLayout/Header.tsxapps/condo/domains/common/components/containers/BaseLayout/components/TopMenuItems.tsxapps/condo/domains/common/constants/featureflags.jsapps/condo/domains/common/hooks/useGlobalHints.tsxapps/condo/lang/en/en.jsonapps/condo/pages/_app.tsx
|
Actionable comments posted: 0 |
| import { colors } from '@open-condo/ui/colors' | ||
|
|
||
| import { UI_HIDE_USER_LINKS } from '@condo/domains/common/constants/featureflags' | ||
|
|
There was a problem hiding this comment.
two spaces are enough
There was a problem hiding this comment.
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
📒 Files selected for processing (19)
apps/condo/domains/analytics/components/charts/payment/PaymentTotalChart.tsxapps/condo/domains/billing/components/BillingPageContent/BlockedB2BAppTab.tsxapps/condo/domains/common/constants/featureflags.jsapps/condo/domains/subscription/components/NoSubscriptionTooltip.tsxapps/condo/domains/subscription/components/SubscriptionAccessGuard.tsxapps/condo/domains/subscription/components/SubscriptionBlockedContent.tsxapps/condo/domains/subscription/components/SubscriptionDaysIndicator.tsxapps/condo/domains/subscription/components/SubscriptionFeatureModal.tsxapps/condo/domains/subscription/components/SubscriptionFeatureProgress.tsxapps/condo/domains/subscription/components/SubscriptionSettingsContent/SubscriptionSettingsContent.tsxapps/condo/domains/subscription/components/UpgradePlanButton.tsxapps/condo/domains/subscription/hooks/useLinkedCardsModal.tsxapps/condo/domains/subscription/hooks/usePaymentHistoryModal.tsxapps/condo/domains/subscription/hooks/useSubscriptionPaymentModal.tsxapps/condo/lang/en/en.jsonapps/condo/lang/es/es.jsonapps/condo/lang/ru/ru.jsonapps/condo/pages/_app.tsxapps/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) { |
There was a problem hiding this comment.
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:
primaryButtonbecomes "Buy Feature" → callsopenPaymentModal - Line 256:
PaymentModalisnullwhenhidePaidFeatures=true - Line 53 of
useSubscriptionPaymentModal:openModalreturns early, so modal never opens - Alternatively, Line 229:
primaryButtonis "Go to Plans" → routes to/settings?tab=subscription - But
settings/index.tsxLine 95 hides that tab whenhidePaidFeatures=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.
| 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).
|



This PR adds ability to set new feature flags:
Summary by CodeRabbit
New Features
Improvements
Localization