From c93865e187cff9822e1df9a5bc7b6ed16c0504f2 Mon Sep 17 00:00:00 2001 From: Ronni Baslund Date: Sun, 24 May 2026 16:52:07 +0200 Subject: [PATCH] refactor(operator): derive env badge from hostname, not from user choice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A toggle-able env badge is a sticker, not a safety signal. Move env to useEnv() which reads window.location.hostname: *.local / localhost → 'dev' *staging* → 'staging' everything else → 'prod' (safest default) - New composable: apps/operator/composables/useEnv.ts - Topbar reads useEnv() instead of useTweaks().env - useTweaks loses the env field; hydrate strips it from stale localStorage payloads so old entries don't break - TweaksPanel: env section removed (theme + density remain) - Settings: env section removed from Appearance; added a read-only Environment row to the Profile card showing the detected env + hostname source ("auto-detected from operator.dezky.local") --- apps/operator/components/OpTopbar.vue | 4 +-- apps/operator/components/TweaksPanel.vue | 20 +++--------- apps/operator/composables/useEnv.ts | 39 ++++++++++++++++++++++++ apps/operator/composables/useTweaks.ts | 20 +++++++----- apps/operator/pages/settings.vue | 28 +++++++++++------ 5 files changed, 76 insertions(+), 35 deletions(-) create mode 100644 apps/operator/composables/useEnv.ts diff --git a/apps/operator/components/OpTopbar.vue b/apps/operator/components/OpTopbar.vue index dffc900..60b7825 100644 --- a/apps/operator/components/OpTopbar.vue +++ b/apps/operator/components/OpTopbar.vue @@ -1,16 +1,14 @@