feat(dashboard): navigation on a phone
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 8m6s
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 8m6s
Below 768 px the sidebar was moved off-screen and nothing replaced it: on a phone there was no way to reach another page. A top bar now carries a menu button and the wordmark; the menu slides the sidebar in over a backdrop and closes when a page is chosen or the backdrop is tapped. The notification bell sits in the bar. The wordmark is one component, shared by the sidebar and the bar. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
This commit is contained in:
1 parent
87078a25b2
commit
7d91db78a5
3 files changed
+129
-23
No files matched your search
@@ -4903,3 +4903,71 @@ tbody tr:last-child td {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Phone navigation: a top bar, the sidebar off-canvas ── */
|
||||
.mobile-bar,
|
||||
.mobile-backdrop {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.mobile-bar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 60;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
height: calc(52px + env(safe-area-inset-top, 0px));
|
||||
padding: env(safe-area-inset-top, 0px) 16px 0;
|
||||
background: var(--bg-secondary);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.mobile-menu-btn {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
background: var(--bg-card);
|
||||
color: var(--text-primary);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.mobile-bar-brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.mobile-backdrop {
|
||||
display: block;
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 69;
|
||||
background: rgb(15 18 37 / 0.45);
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
z-index: 70;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
padding-top: calc(68px + env(safe-area-inset-top, 0px));
|
||||
}
|
||||
|
||||
/* The bell sits in the top bar, above it. */
|
||||
.notification-bell-wrapper {
|
||||
top: calc(8px + env(safe-area-inset-top, 0px));
|
||||
right: 16px;
|
||||
z-index: 61;
|
||||
}
|
||||
|
||||
.notification-panel {
|
||||
width: min(380px, calc(100vw - 32px));
|
||||
}
|
||||
}
|
||||
@@ -99,36 +99,38 @@ pub fn Sidebar() -> Element {
|
||||
..
|
||||
} = use_context::<Signal<AuthInfo>>()();
|
||||
|
||||
let sidebar_class = if collapsed() {
|
||||
"sidebar collapsed"
|
||||
} else {
|
||||
"sidebar"
|
||||
// On a phone the sidebar is off-canvas: the top bar's menu button slides
|
||||
// it in, and choosing a page or the backdrop closes it.
|
||||
let mut mobile_open = use_signal(|| false);
|
||||
let sidebar_class = match (collapsed(), mobile_open()) {
|
||||
(true, _) => "sidebar collapsed",
|
||||
(false, true) => "sidebar open",
|
||||
(false, false) => "sidebar",
|
||||
};
|
||||
|
||||
rsx! {
|
||||
div { class: "mobile-bar",
|
||||
button {
|
||||
class: "mobile-menu-btn",
|
||||
"aria-label": if mobile_open() { nav::CLOSE_MENU.get(lang) } else { nav::MENU.get(lang) },
|
||||
"aria-expanded": if mobile_open() { "true" } else { "false" },
|
||||
onclick: move |_| mobile_open.set(!mobile_open()),
|
||||
if mobile_open() {
|
||||
Icon { icon: BsXLg, width: 18, height: 18 }
|
||||
} else {
|
||||
Icon { icon: BsList, width: 20, height: 20 }
|
||||
}
|
||||
}
|
||||
div { class: "mobile-bar-brand", Wordmark { with_name: true } }
|
||||
}
|
||||
if mobile_open() {
|
||||
div { class: "mobile-backdrop", onclick: move |_| mobile_open.set(false) }
|
||||
}
|
||||
nav { class: "{sidebar_class}",
|
||||
// The breakpilot brand, as the portal shows it; Prüfwerk is the
|
||||
// product within it.
|
||||
div { class: "sidebar-header",
|
||||
svg {
|
||||
class: "brand-chevron",
|
||||
view_box: "8.75 2.25 46.5 45",
|
||||
fill: "none",
|
||||
stroke_linecap: "round",
|
||||
stroke_linejoin: "round",
|
||||
"aria-hidden": "true",
|
||||
path { d: "M12 44 L32 20 L52 44", stroke: "var(--brand-chevron)", stroke_width: "6.5" }
|
||||
path { d: "M24 13 L32 5 L40 13", stroke: "var(--brand-chevron-top)", stroke_width: "5.5" }
|
||||
}
|
||||
if !collapsed() {
|
||||
div { class: "brand-text",
|
||||
span { class: "brand-name",
|
||||
"Break"
|
||||
span { class: "bp-pilot", "Pilot" }
|
||||
}
|
||||
span { class: "brand-sub", "Prüfwerk" }
|
||||
}
|
||||
}
|
||||
Wordmark { with_name: !collapsed() }
|
||||
}
|
||||
if !portal_url.is_empty() {
|
||||
a {
|
||||
@@ -186,6 +188,7 @@ pub fn Sidebar() -> Element {
|
||||
to: item.route.clone(),
|
||||
class: class,
|
||||
title: "{label}",
|
||||
onclick: move |_| mobile_open.set(false),
|
||||
{item.icon}
|
||||
if !collapsed() {
|
||||
span { "{label}" }
|
||||
@@ -262,3 +265,30 @@ pub fn Sidebar() -> Element {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The BreakPilot wordmark, as on breakpilot.com and the portal: the chevron,
|
||||
/// and unless `with_name` is off, "BreakPilot" with "Prüfwerk" beneath.
|
||||
#[component]
|
||||
fn Wordmark(with_name: bool) -> Element {
|
||||
rsx! {
|
||||
svg {
|
||||
class: "brand-chevron",
|
||||
view_box: "8.75 2.25 46.5 45",
|
||||
fill: "none",
|
||||
stroke_linecap: "round",
|
||||
stroke_linejoin: "round",
|
||||
"aria-hidden": "true",
|
||||
path { d: "M12 44 L32 20 L52 44", stroke: "var(--brand-chevron)", stroke_width: "6.5" }
|
||||
path { d: "M24 13 L32 5 L40 13", stroke: "var(--brand-chevron-top)", stroke_width: "5.5" }
|
||||
}
|
||||
if with_name {
|
||||
div { class: "brand-text",
|
||||
span { class: "brand-name",
|
||||
"Break"
|
||||
span { class: "bp-pilot", "Pilot" }
|
||||
}
|
||||
span { class: "brand-sub", "Prüfwerk" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,6 +115,14 @@ pub mod nav {
|
||||
de: "Dokumentation",
|
||||
en: "Docs",
|
||||
};
|
||||
pub const MENU: Text = Text {
|
||||
de: "Menü öffnen",
|
||||
en: "Open the menu",
|
||||
};
|
||||
pub const CLOSE_MENU: Text = Text {
|
||||
de: "Menü schließen",
|
||||
en: "Close the menu",
|
||||
};
|
||||
pub const NOT_AVAILABLE_SHORT: Text = Text {
|
||||
de: "n. v.",
|
||||
en: "n/a",
|
||||
|
||||
Reference in new issue
Block a user