From 00855b9f0091936110b8cc3f6d911f7b0d1c3389 Mon Sep 17 00:00:00 2001 From: Hampton Lintorn-Catlin Date: Thu, 23 Jul 2026 10:40:02 -0400 Subject: [PATCH 01/11] Mark non-production environments with a logo ring, not a badge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The env badge added text next to the brand, so dev and staging never reproduced production's nav layout — exactly where responsive breakage was going unnoticed. A colored ring on the logo (favicon palette) plus a tooltip carries the same signal without moving anything. Amp-Thread-ID: https://ampcode.com/threads/T-019f8f55-7cc9-73a3-a9cb-1f3e0faa0cb3 Co-authored-by: Amp --- .../assets/stylesheets/coplan/application.css | 25 +++++++++---------- .../app/helpers/coplan/application_helper.rb | 16 +++++++++--- .../views/layouts/coplan/application.html.erb | 5 ++-- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/engine/app/assets/stylesheets/coplan/application.css b/engine/app/assets/stylesheets/coplan/application.css index 47d6028..0970b4c 100644 --- a/engine/app/assets/stylesheets/coplan/application.css +++ b/engine/app/assets/stylesheets/coplan/application.css @@ -363,15 +363,15 @@ img, svg { border-radius: 6px; } -.env-badge { - font-size: 10px; - font-weight: 600; - color: var(--color-text-inverse); - padding: 1px 6px; - border-radius: 4px; - text-transform: uppercase; - letter-spacing: 0.5px; - line-height: 1.4; +/* Non-production environment marker: a colored ring on the logo (favicon + palette) — layout-neutral, so dev and staging reproduce production's + nav spacing exactly. */ +.site-nav__logo--development { + box-shadow: 0 0 0 2px #10b981; +} + +.site-nav__logo--staging { + box-shadow: 0 0 0 2px #f59e0b; } .site-nav__brand:hover { @@ -5271,11 +5271,10 @@ img.avatar { gap: var(--space-sm); } - /* Icons over labels: brand text, env badge, search placeholder, the - "/" hint, the settings gear, and the sign-out link all yield to the - things a phone visit is actually for. */ + /* Icons over labels: brand text, search placeholder, the "/" hint, + the settings gear, and the sign-out link all yield to the things a + phone visit is actually for. */ .site-nav__brand-text, - .env-badge, .site-nav__search-label, .site-nav__search-kbd, .site-nav__icon-link, diff --git a/engine/app/helpers/coplan/application_helper.rb b/engine/app/helpers/coplan/application_helper.rb index be653b2..6553691 100644 --- a/engine/app/helpers/coplan/application_helper.rb +++ b/engine/app/helpers/coplan/application_helper.rb @@ -66,12 +66,20 @@ def user_avatar(user, size: "sm") end end - def coplan_environment_badge + # Non-production environments mark the nav logo instead of adding a + # badge next to the brand — a badge changes the nav's layout, so dev + # and staging would never reproduce production's spacing. The logo + # gets a colored ring (same palette as the favicon) and a tooltip. + def coplan_environment_logo_modifier + return "" if Rails.env.production? + + " site-nav__logo--#{Rails.env}" + end + + def coplan_environment_logo_title return if Rails.env.production? - label = Rails.env.capitalize - colors = FAVICON_COLORS.fetch(Rails.env, FAVICON_COLORS["development"]) - tag.span(label, class: "env-badge", style: "background: #{colors[:start]};") + "#{Rails.env.capitalize} environment" end end end diff --git a/engine/app/views/layouts/coplan/application.html.erb b/engine/app/views/layouts/coplan/application.html.erb index ede01f2..69e4635 100644 --- a/engine/app/views/layouts/coplan/application.html.erb +++ b/engine/app/views/layouts/coplan/application.html.erb @@ -25,9 +25,10 @@