Feat: Add responsive workspace shell

This commit is contained in:
MangoPig
2026-06-17 10:52:14 +01:00
parent 5d86a5124b
commit 85bf971547
24 changed files with 1153 additions and 255 deletions
@@ -0,0 +1,108 @@
.mobileNav {
display: none;
}
@include respond-down(mobile) {
.mobileNav {
--mobile-nav-button-gap: var(--space-1);
--mobile-nav-button-padding-inline: var(--space-2);
--mobile-nav-button-padding-top: calc(var(--space-2) + (var(--space-1) / 2));
--mobile-nav-button-padding-bottom: var(--space-2);
position: fixed;
right: 0;
bottom: 0;
left: 0;
display: grid;
gap: var(--space-2);
padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
background:
linear-gradient(to top, color-mix(in srgb, var(--color-canvas) 98%, transparent), color-mix(in srgb, var(--color-canvas) 92%, transparent));
border-top: 1px solid color-mix(in srgb, var(--color-border-strong) 40%, transparent);
backdrop-filter: blur(var(--blur-overlay));
z-index: var(--z-sticky);
}
.contextBar {
display: flex;
align-items: center;
justify-content: center;
gap: var(--space-2);
min-width: 0;
color: var(--color-text-muted);
}
.contextServer,
.contextProject {
@include text-caption;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.contextServer {
max-width: 45vw;
}
.contextProject {
max-width: 30vw;
}
.contextDivider {
@include text-caption;
color: var(--color-text-subtle);
}
.navGrid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: var(--space-2);
}
.navButton {
min-width: 0;
display: grid;
justify-items: center;
gap: var(--mobile-nav-button-gap);
padding: var(--mobile-nav-button-padding-top) var(--mobile-nav-button-padding-inline) var(--mobile-nav-button-padding-bottom);
border: 1px solid transparent;
border-radius: var(--radius-xl);
background: transparent;
color: var(--color-text-muted);
transition:
background 160ms var(--easing-standard),
color 160ms var(--easing-standard),
border-color 160ms var(--easing-standard),
transform 180ms var(--easing-standard);
}
.navButton:hover,
.navButton:focus-visible {
color: var(--color-text);
background: color-mix(in srgb, var(--color-surface) 82%, transparent);
border-color: color-mix(in srgb, var(--color-border-strong) 28%, transparent);
}
.navButton:active {
transform: translateY(calc(var(--space-1) / 2));
}
.navButtonActive {
color: var(--color-text);
background: color-mix(in srgb, var(--color-surface) 90%, transparent);
border-color: color-mix(in srgb, var(--color-border-strong) 34%, transparent);
box-shadow: var(--shadow-soft);
}
.iconWrap {
display: inline-flex;
align-items: center;
justify-content: center;
}
.label {
@include text-caption;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
@@ -0,0 +1,63 @@
// Path: Frontend/src/components/shell/MobileBottomNav/MobileBottomNav.tsx
import { For, type JSX } from "solid-js";
import { activeProject, activeServer, mobileBottomNavItems, type MobileBottomNavItem } from "../data/shell.data";
import styles from "./MobileBottomNav.module.scss";
type MobileBottomNavProps = {
isBrowseOpen: boolean;
onBrowseToggle: VoidFunction;
};
const MobileNavEntry = (props: {
item: MobileBottomNavItem;
isActive: boolean;
onSelect?: VoidFunction;
}): JSX.Element => {
const Icon = props.item.icon;
return (
<button
type="button"
onClick={() => props.onSelect?.()}
classList={{
[styles.navButton]: true,
[styles.navButtonActive]: props.isActive,
}}
aria-current={props.isActive ? "page" : undefined}
aria-expanded={props.item.id === "browse" ? props.isActive : undefined}
aria-label={props.item.label}
title={props.item.label}
>
<span class={styles.iconWrap} aria-hidden="true">
<Icon size={18} strokeWidth={2} />
</span>
<span class={styles.label}>{props.item.label}</span>
</button>
);
};
export const MobileBottomNav = (props: MobileBottomNavProps): JSX.Element => {
return (
<nav class={styles.mobileNav} aria-label="Mobile workspace navigation">
<div class={styles.contextBar}>
<span class={styles.contextServer}>{activeServer.name}</span>
<span class={styles.contextDivider}>/</span>
<span class={styles.contextProject}>{activeProject.name}</span>
</div>
<div class={styles.navGrid}>
<For each={mobileBottomNavItems}>
{(item): JSX.Element => (
<MobileNavEntry
item={item}
isActive={item.id === "browse" ? props.isBrowseOpen : (item.active ?? false) && !props.isBrowseOpen}
onSelect={item.id === "browse" ? props.onBrowseToggle : undefined}
/>
)}
</For>
</div>
</nav>
);
};