admin: groups link moves up to the header
The footer held the groups where no one would look,
so the link climbs to the header, one step past the name.
The footer keeps the build, the flag, and setup,
the facts that no search can turn up.
Assisted-by: Claude Opus 5 via Claude Code
diff --git a/lib/pro_tacts/admin/layout.rb b/lib/pro_tacts/admin/layout.rb
index 20d4c89..76df395 100644
--- a/lib/pro_tacts/admin/layout.rb
+++ b/lib/pro_tacts/admin/layout.rb
@@ -69,7 +69,13 @@ module ProTacts
end
body do
header(class: "admin-header") do
- a(href: "/") { "pro-tacts" }
+ # The groups list rides beside the name because it is
+ # where a group is created, and creating one is a thing
+ # to reach from anywhere; search still finds one by name.
+ nav do
+ a(href: "/") { "pro-tacts" }
+ a(href: "/groups") { "groups" }
+ end
# Every screen's chrome, not the dashboard's alone: the
# input keeps the query it carries — a results page has
# somewhere to be besides the input — and focuses only
@@ -108,13 +114,10 @@ module ProTacts
# Device setup belongs here because the dashboard is a
# search over contacts and /setup is not a contact — a
# header link would put it beside the search on every
- # screen, at the weight the app's own name has. The groups
- # list is here for the same weight: search finds a group by
- # name, and this is where one is created.
+ # screen, at the weight the app's own name has.
footer(class: "admin-footer") do
span(class: "type-label") { ProTacts.config.version || "dev server" }
span(class: "type-label") { "+debug" } if ProTacts.config.debug?
- a(href: "/groups", class: "type-label") { "groups" }
a(href: "/setup", class: "type-label") { "device setup" }
end
# A server-rendered toast, Gloss's [role=status] contract:
diff --git a/public/admin.css b/public/admin.css
index 56c68bc..e118714 100644
--- a/public/admin.css
+++ b/public/admin.css
@@ -333,6 +333,17 @@ textarea:focus {
color: var(--gl-color-text-primary);
text-decoration: none;
}
+/* The name and the groups link as one group on the left, so the
+ header's space-between still splits two things. The link after the
+ name steps down a shade: it is a destination, not the app's name. */
+.admin-header nav {
+ display: flex;
+ align-items: baseline;
+ gap: var(--gl-space-s);
+}
+.admin-header nav a + a {
+ color: var(--gl-color-text-secondary);
+}
/* The page's other chrome bar, built off the header's rule: the same
block and inline padding, and the hairline on the opposite edge, so
diff --git a/test/pro_tacts/admin/test_groups_pages.rb b/test/pro_tacts/admin/test_groups_pages.rb
index 5839566..10575a4 100644
--- a/test/pro_tacts/admin/test_groups_pages.rb
+++ b/test/pro_tacts/admin/test_groups_pages.rb
@@ -59,11 +59,12 @@ class AdminGroupsPagesTest < Minitest::Test
end
end
- def test_the_footer_leads_to_the_groups
+ def test_the_header_leads_to_the_groups
with_contacts({}) do
get "/"
- assert_includes last_response.body, %(<a href="/groups" class="type-label">groups</a>)
+ assert_includes last_response.body, %(<a href="/">pro-tacts</a><a href="/groups">groups</a>)
+ refute_includes last_response.body, %(<a href="/groups" class="type-label">)
end
end