From c57a13b35080c8fb29c24b6f082664cedda01cea Mon Sep 17 00:00:00 2001 From: James Wampler Date: Thu, 11 Jun 2026 11:26:19 -0700 Subject: [PATCH] Persist and restore selected project and environment across page reloads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add refreshOrganization/refreshProject/refreshEnvironment to context store — update value and localStorage without clearing child selections - OrgSelector: use refreshOrganization when same org is already stored, preventing the chain that was clearing project and environment - ProjectSelector: watch org ID (not object ref) so refresh doesn't retrigger; add autoSelectProject to restore stored project or auto-select single project - EnvironmentTabBar: watch project ID; skip env-clear on initial mount; add autoSelectEnvironment to restore stored env or fall back to first - Fix test fixtures missing isPrimary field; update EnvironmentTabBar tests to match v-select implementation; add tests for restore behavior --- .../src/components/features/FeatureDetail.vue | 2 +- .../src/components/features/TagsChipInput.vue | 13 ++++- .../src/components/nav/EnvironmentTabBar.vue | 26 ++++++--- src/admin/src/components/nav/OrgSelector.vue | 2 +- .../src/components/nav/ProjectSelector.vue | 25 +++++++-- src/admin/src/stores/context.ts | 18 ++++++ .../unit/components/EnvironmentTabBar.spec.ts | 55 ++++++++++++++----- .../tests/unit/components/OrgSelector.spec.ts | 6 +- .../unit/components/ProjectSelector.spec.ts | 52 +++++++++++++++++- .../components/features/FeatureDetail.spec.ts | 2 +- .../components/features/FeatureDialog.spec.ts | 2 +- .../components/features/TagsChipInput.spec.ts | 2 +- .../identities/IdentityDetail.spec.ts | 2 +- .../components/segments/SegmentEditor.spec.ts | 2 +- src/admin/tests/unit/stores/context.spec.ts | 53 +++++++++++++++++- .../tests/unit/views/AuditLogsView.spec.ts | 18 +++--- .../tests/unit/views/FeaturesView.spec.ts | 8 +-- .../tests/unit/views/IdentitiesView.spec.ts | 12 ++-- .../tests/unit/views/ProfileView.spec.ts | 2 +- .../tests/unit/views/SegmentsView.spec.ts | 18 +++--- .../tests/unit/views/SettingsView.spec.ts | 2 +- src/api/MicCheck.Api/Organizations/.gitkeep | 0 22 files changed, 251 insertions(+), 71 deletions(-) delete mode 100755 src/api/MicCheck.Api/Organizations/.gitkeep diff --git a/src/admin/src/components/features/FeatureDetail.vue b/src/admin/src/components/features/FeatureDetail.vue index 131d14c..d7fdae9 100755 --- a/src/admin/src/components/features/FeatureDetail.vue +++ b/src/admin/src/components/features/FeatureDetail.vue @@ -29,7 +29,7 @@ - + diff --git a/src/admin/src/components/features/TagsChipInput.vue b/src/admin/src/components/features/TagsChipInput.vue index db9f3e9..7846e1f 100755 --- a/src/admin/src/components/features/TagsChipInput.vue +++ b/src/admin/src/components/features/TagsChipInput.vue @@ -33,6 +33,7 @@