Files
sencho/frontend/src/components/sidebar/sidebar-styles.ts
T
Anso e8f271f5f6 feat(ui): make the core stack flow usable on mobile (#1327)
* feat(ui): make the core stack flow usable on mobile

Below the md breakpoint the app collapses to a single full-width column:
the stack list is full-screen, tapping a stack opens a full-screen detail
with a Health / Logs / Compose segmented control (Logs first) and a back
button, and a bottom tab bar switches Stacks, Fleet, Schedules, and
Settings. Compose is read-only on a phone with a prompt to edit on desktop.

Desktop (md and up) is unchanged: the mobile shell is gated behind a
useIsMobile hook plus max-md/md variants, and the stack-detail blocks are
shared with the desktop two-pane view so it renders identically.

Also generalizes the unsaved-changes guard so leaving a dirty editor (back,
tab bar, hamburger) prompts before discarding; adds 44px touch targets on
list rows, filter chips, and actions; makes log and shell modals full-screen
on mobile; and offsets toasts and the deploy pill above the bottom tab bar.

* fix(ui): keep mobile nav in sync when opening views from outside the bottom bar

On a phone the sidebar activity actions, the node switcher's Manage Nodes, the
profile Settings entry, and the dashboard configuration links set the active
view without flipping the mobile surface to content, so the user stayed on the
stack list and never saw the destination. Route these through the mobile-aware
navigation and settings helpers (a no-op on desktop).
2026-06-07 01:03:13 -04:00

33 lines
1.2 KiB
TypeScript

import { cn } from '@/lib/utils';
export const sidebarRowBase = cn(
'relative flex items-center gap-2 w-full px-2 py-1.5 rounded-md mb-0.5',
// 44px tap target on touch viewports without changing desktop density.
'max-md:min-h-11 max-md:py-2.5',
'font-mono text-[13px] text-muted-foreground',
'hover:bg-glass-highlight hover:text-foreground',
'transition-colors group cursor-pointer',
);
export const sidebarRowActive = cn(
'bg-accent/[0.07] text-stat-value',
'after:content-[""] after:absolute after:left-[-12px] after:top-1 after:bottom-1',
'after:w-[3px] after:rounded-sm after:bg-brand',
'after:shadow-[0_0_6px_var(--brand)]',
);
export const sidebarGroupHeader = cn(
'flex items-center justify-between w-full px-2 pt-3 pb-1',
'text-[9px] leading-3 tracking-[0.22em] uppercase text-stat-subtitle',
'cursor-pointer select-none',
);
export const sidebarRowCheckboxSlot = 'shrink-0 w-4 h-4 opacity-0 pointer-events-none flex-shrink-0';
export const sidebarPinnedGroupRail = cn(
'relative before:absolute before:left-0 before:top-0 before:bottom-0',
'before:w-[3px] before:rounded-sm before:bg-brand',
'before:shadow-[0_0_6px_var(--brand)]',
'pl-[13px]',
);