From 1c71f8e83e3ff8f99c3d4ea42d3fde9c57262a03 Mon Sep 17 00:00:00 2001 From: sdarbinyan Date: Fri, 17 Jul 2026 17:55:08 +0400 Subject: [PATCH] fix(features): keep featureFlags and userExperience enabled flags in sync for wishlist/compare FeatureConfigService gates wishlist/compare visibility on BOTH featureFlags. and userExperience..enabled, but the features editor only exposed one toggle wired to featureFlags. Both default to true so this was silent, but a config with userExperience.wishlist.enabled (or compare) explicitly false would show the editor toggle as checked with no way to actually turn the feature back on from this screen. toggleFeatureAndUserExperience() now updates both flags from the single toggle, in one updateBootstrap call. Co-Authored-By: Claude Sonnet 5 --- .../sections/features-section.component.html | 4 ++-- .../sections/features-section.component.ts | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/app/features/project-editor/sections/features-section.component.html b/src/app/features/project-editor/sections/features-section.component.html index 53e87fd..ff3feb2 100644 --- a/src/app/features/project-editor/sections/features-section.component.html +++ b/src/app/features/project-editor/sections/features-section.component.html @@ -1,8 +1,8 @@ @if (bootstrap(); as bootstrap) {
- - + + diff --git a/src/app/features/project-editor/sections/features-section.component.ts b/src/app/features/project-editor/sections/features-section.component.ts index e0c25ab..254d8c2 100644 --- a/src/app/features/project-editor/sections/features-section.component.ts +++ b/src/app/features/project-editor/sections/features-section.component.ts @@ -45,6 +45,25 @@ export class ProjectEditorFeaturesSectionComponent { this.facade.updateBootstrap(current => ({ ...current, featureFlags: { ...current.featureFlags, [key]: checked } })); } + /** + * Wishlist/compare visibility is gated by featureFlags AND + * userExperience..enabled at runtime (see FeatureConfigService). + * The editor only exposes one toggle per feature, so it must keep both + * flags in sync - otherwise a stray userExperience..enabled=false + * (e.g. from an older export) leaves the toggle looking "on" with no way + * to fix it from this screen. + */ + toggleFeatureAndUserExperience(key: 'wishlist' | 'compare', checked: boolean): void { + this.facade.updateBootstrap(current => ({ + ...current, + featureFlags: { ...current.featureFlags, [key]: checked }, + userExperience: { + ...current.userExperience, + [key]: { ...current.userExperience?.[key], enabled: checked } + } + })); + } + toggleUserExperience(path: 'recentlyViewed' | 'wishlist' | 'compare', checked: boolean): void { this.facade.updateBootstrap(current => ({ ...current,