From 9c43dcb93c0b11a1a33beba5c6f635cfae35318e Mon Sep 17 00:00:00 2001
From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Date: Fri, 30 Oct 2026 22:11:51 -0400
Subject: [PATCH 1/4] fix(dashboard): declare --sp-* spacing ramp on :root
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
---
changelog.d/fixed-sp-tokens-root.md | 1 +
.../dashboard/sp_tokens_root_15920_test.go | 23 +++++++++++++++++++
src/pkg/dashboard/static-src/css/base.css | 2 ++
.../static-src/css/config-dialog.css | 2 --
src/pkg/dashboard/static/index.html | 4 ++--
5 files changed, 28 insertions(+), 4 deletions(-)
create mode 100644 changelog.d/fixed-sp-tokens-root.md
create mode 100644 src/pkg/dashboard/sp_tokens_root_15920_test.go
diff --git a/changelog.d/fixed-sp-tokens-root.md b/changelog.d/fixed-sp-tokens-root.md
new file mode 100644
index 0000000000..4afeed114d
--- /dev/null
+++ b/changelog.d/fixed-sp-tokens-root.md
@@ -0,0 +1 @@
+- Dashboard `--sp-*` spacing tokens are now declared on `:root` instead of only `.config-modal`, so spacing outside the modal no longer resolves to invalid values (#15920)
diff --git a/src/pkg/dashboard/sp_tokens_root_15920_test.go b/src/pkg/dashboard/sp_tokens_root_15920_test.go
new file mode 100644
index 0000000000..36a6cdc391
--- /dev/null
+++ b/src/pkg/dashboard/sp_tokens_root_15920_test.go
@@ -0,0 +1,23 @@
+package dashboard
+
+import (
+ "regexp"
+ "strings"
+ "testing"
+)
+
+// The --sp-* ramp must live on :root: ~300 var(--sp-*) usages (and --modal-gap
+// on :root itself) sit outside .config-modal and resolve to invalid otherwise.
+func TestSpacingRampDeclaredOnRoot(t *testing.T) {
+ html := indexHTML(t)
+ root := regexp.MustCompile(`(?s):root\s*\{[^}]*--sp-8:\s*24px`)
+ if !root.MatchString(html) {
+ t.Fatal("--sp-* ramp is not declared inside a :root rule")
+ }
+ if i := strings.Index(html, ".config-modal {"); i >= 0 {
+ end := strings.Index(html[i:], "}")
+ if strings.Contains(html[i:i+end], "--sp-0:") {
+ t.Fatal("--sp-* ramp is still duplicated inside .config-modal")
+ }
+ }
+}
diff --git a/src/pkg/dashboard/static-src/css/base.css b/src/pkg/dashboard/static-src/css/base.css
index 2458e913e4..f2f909c491 100644
--- a/src/pkg/dashboard/static-src/css/base.css
+++ b/src/pkg/dashboard/static-src/css/base.css
@@ -18,6 +18,8 @@
/* Radii / shadows / fonts — defined in Phase 0, applied in later phases. */
--radius-sm: var(--r-sm); --radius: var(--r); --radius-lg: var(--r-lg);
--shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.5);
+ --sp-0: 0; --sp-1: 2px; --sp-2: 4px; --sp-3: 6px; --sp-4: 8px;
+ --sp-5: 12px; --sp-6: 16px; --sp-7: 20px; --sp-8: 24px; --sp-9: 32px;
--modal-gap: var(--sp-8);
--modal-scrim: rgba(0, 0, 0, 0.55);
--modal-scrim-strong: rgba(0, 0, 0, 0.78);
diff --git a/src/pkg/dashboard/static-src/css/config-dialog.css b/src/pkg/dashboard/static-src/css/config-dialog.css
index da47b61ca2..9c4ca16800 100644
--- a/src/pkg/dashboard/static-src/css/config-dialog.css
+++ b/src/pkg/dashboard/static-src/css/config-dialog.css
@@ -67,8 +67,6 @@
--font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
--fs-2xs: .6rem; --fs-xs: .68rem; --fs-sm: .75rem; --fs-base: .82rem;
--fs-md: .92rem; --fs-lg: 1.05rem; --fs-xl: 1.25rem; --fs-2xl: 1.5rem; --fs-3xl: 2rem;
- --sp-0: 0; --sp-1: 2px; --sp-2: 4px; --sp-3: 6px; --sp-4: 8px;
- --sp-5: 12px; --sp-6: 16px; --sp-7: 20px; --sp-8: 24px; --sp-9: 32px;
--r-sm: 4px; --r: 6px; --r-lg: 12px; --r-pill: 999px;
--radius-sm: var(--r-sm); --radius: var(--r); --radius-lg: var(--r-lg);
} /* modal panel recipe */
diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html
index a059968191..c2b4b023b8 100644
--- a/src/pkg/dashboard/static/index.html
+++ b/src/pkg/dashboard/static/index.html
@@ -34,6 +34,8 @@
/* Radii / shadows / fonts — defined in Phase 0, applied in later phases. */
--radius-sm: var(--r-sm); --radius: var(--r); --radius-lg: var(--r-lg);
--shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.5);
+ --sp-0: 0; --sp-1: 2px; --sp-2: 4px; --sp-3: 6px; --sp-4: 8px;
+ --sp-5: 12px; --sp-6: 16px; --sp-7: 20px; --sp-8: 24px; --sp-9: 32px;
--modal-gap: var(--sp-8);
--modal-scrim: rgba(0, 0, 0, 0.55);
--modal-scrim-strong: rgba(0, 0, 0, 0.78);
@@ -4050,8 +4052,6 @@
--font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
--fs-2xs: .6rem; --fs-xs: .68rem; --fs-sm: .75rem; --fs-base: .82rem;
--fs-md: .92rem; --fs-lg: 1.05rem; --fs-xl: 1.25rem; --fs-2xl: 1.5rem; --fs-3xl: 2rem;
- --sp-0: 0; --sp-1: 2px; --sp-2: 4px; --sp-3: 6px; --sp-4: 8px;
- --sp-5: 12px; --sp-6: 16px; --sp-7: 20px; --sp-8: 24px; --sp-9: 32px;
--r-sm: 4px; --r: 6px; --r-lg: 12px; --r-pill: 999px;
--radius-sm: var(--r-sm); --radius: var(--r); --radius-lg: var(--r-lg);
} /* modal panel recipe */
From 623436df9ec7fda026fd8cd5883921d290ad91ba Mon Sep 17 00:00:00 2001
From: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Date: Fri, 30 Oct 2026 22:29:59 -0400
Subject: [PATCH 2/4] test(dashboard): stop pinning --sp-7 inside .config-modal
The --sp-* spacing ramp now lives on :root (TestSpacingRampDeclaredOnRoot),
so TestAppearanceThemeHoverCannotResizeSettingsModal must no longer require
it inside the .config-modal block.
Hive-Fix-Attempt: 1/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
---
src/pkg/dashboard/theme_ui_test.go | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/pkg/dashboard/theme_ui_test.go b/src/pkg/dashboard/theme_ui_test.go
index 48484d7046..32d7580394 100644
--- a/src/pkg/dashboard/theme_ui_test.go
+++ b/src/pkg/dashboard/theme_ui_test.go
@@ -165,7 +165,6 @@ func TestAppearanceThemeHoverCannotResizeSettingsModal(t *testing.T) {
"--font-ui: Inter, ui-sans-serif",
"--font-mono: 'SF Mono'",
"--fs-base: .82rem;",
- "--sp-7: 20px;",
"--r: 6px;",
"--radius: var(--r);",
} {
From 12efd1da8e977a6b382eeb5b82a91b9f851a2e55 Mon Sep 17 00:00:00 2001
From: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Date: Sat, 31 Oct 2026 00:23:43 -0400
Subject: [PATCH 3/4] test(dashboard): re-scope #15920 to a tokens.css
regression test
tokens.css already declares --sp-0..9 on :root and head.html links it
before the inline stylesheet, so the ramp was never modal-only. Restore
the .config-modal pin (and its --sp-7 assertion) that keeps a hovered
theme preview from resizing the settings modal, drop the duplicate
:root ramp from base.css, and replace the new test with one that pins
the real invariant: tokens.css supplies the ramp globally, it loads
first, and .config-modal keeps its local pin.
Hive-Fix-Attempt: 2/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
---
changelog.d/fixed-sp-tokens-root.md | 1 -
.../dashboard/sp_tokens_root_15920_test.go | 47 ++++++++++++++-----
src/pkg/dashboard/static-src/css/base.css | 2 -
.../static-src/css/config-dialog.css | 2 +
src/pkg/dashboard/static/index.html | 4 +-
src/pkg/dashboard/theme_ui_test.go | 1 +
6 files changed, 41 insertions(+), 16 deletions(-)
delete mode 100644 changelog.d/fixed-sp-tokens-root.md
diff --git a/changelog.d/fixed-sp-tokens-root.md b/changelog.d/fixed-sp-tokens-root.md
deleted file mode 100644
index 4afeed114d..0000000000
--- a/changelog.d/fixed-sp-tokens-root.md
+++ /dev/null
@@ -1 +0,0 @@
-- Dashboard `--sp-*` spacing tokens are now declared on `:root` instead of only `.config-modal`, so spacing outside the modal no longer resolves to invalid values (#15920)
diff --git a/src/pkg/dashboard/sp_tokens_root_15920_test.go b/src/pkg/dashboard/sp_tokens_root_15920_test.go
index 36a6cdc391..e0abda11b6 100644
--- a/src/pkg/dashboard/sp_tokens_root_15920_test.go
+++ b/src/pkg/dashboard/sp_tokens_root_15920_test.go
@@ -6,18 +6,43 @@ import (
"testing"
)
-// The --sp-* ramp must live on :root: ~300 var(--sp-*) usages (and --modal-gap
-// on :root itself) sit outside .config-modal and resolve to invalid otherwise.
-func TestSpacingRampDeclaredOnRoot(t *testing.T) {
- html := indexHTML(t)
- root := regexp.MustCompile(`(?s):root\s*\{[^}]*--sp-8:\s*24px`)
- if !root.MatchString(html) {
- t.Fatal("--sp-* ramp is not declared inside a :root rule")
+// The --sp-* ramp is supplied globally by tokens.css (:root), which head.html
+// links before the inline stylesheet, so the ~300 var(--sp-*) usages outside
+// .config-modal resolve. The copy inside .config-modal is a deliberate pin so a
+// hovered theme preview cannot resize the settings modal (#15920 was filed on
+// the false premise that the ramp was modal-only).
+func TestSpacingRampSuppliedByTokensOnRoot(t *testing.T) {
+ tb, err := staticFS.ReadFile("static/tokens.css")
+ if err != nil {
+ t.Fatalf("read tokens.css: %v", err)
+ }
+ rootRule := regexp.MustCompile(`(?s):root\s*\{(.*?)\n\}`).FindStringSubmatch(string(tb))
+ if rootRule == nil {
+ t.Fatal("tokens.css has no :root rule")
}
- if i := strings.Index(html, ".config-modal {"); i >= 0 {
- end := strings.Index(html[i:], "}")
- if strings.Contains(html[i:i+end], "--sp-0:") {
- t.Fatal("--sp-* ramp is still duplicated inside .config-modal")
+ for _, want := range []string{
+ "--sp-0: 0;", "--sp-1: 2px;", "--sp-2: 4px;", "--sp-3: 6px;", "--sp-4: 8px;",
+ "--sp-5: 12px;", "--sp-6: 16px;", "--sp-7: 20px;", "--sp-8: 24px;", "--sp-9: 32px;",
+ } {
+ if !strings.Contains(rootRule[1], want) {
+ t.Errorf("tokens.css :root lacks %s", want)
}
}
+
+ html := indexHTML(t)
+ link := strings.Index(html, ``)
+ style := strings.Index(html, "