diff --git a/companion/src/pages/settings/Settings.module.css b/companion/src/pages/settings/Settings.module.css index 1c4ba99..a9519e7 100644 --- a/companion/src/pages/settings/Settings.module.css +++ b/companion/src/pages/settings/Settings.module.css @@ -140,6 +140,8 @@ .settings-page__sidebar { border-right: 0; border-bottom: 1px solid var(--border-subtle); + overflow-x: scroll; + overflow-y: hidden; } .settings-page__nav { @@ -147,6 +149,37 @@ overflow-x: auto; } + /* Subtle, stable horizontal scrollbar for small screens */ + .settings-page__nav { + scrollbar-width: thin; + scrollbar-color: rgba(100, 100, 100, 0.35) transparent; + } + + .settings-page__sidebar::-webkit-scrollbar, + .settings-page__nav::-webkit-scrollbar { + height: 10px; + background: transparent; + } + + .settings-page__sidebar::-webkit-scrollbar-track, + .settings-page__nav::-webkit-scrollbar-track { + background: transparent; + } + + .settings-page__sidebar::-webkit-scrollbar-thumb, + .settings-page__nav::-webkit-scrollbar-thumb { + background-color: rgba(100, 100, 100, 0.35); + border-radius: 999px; + border: 2px solid transparent; + background-clip: padding-box; + min-height: 24px; + } + + .settings-page__sidebar::-webkit-scrollbar-thumb:hover, + .settings-page__nav::-webkit-scrollbar-thumb:hover { + background-color: rgba(100, 100, 100, 0.5); + } + .settings-page__item { white-space: nowrap; } diff --git a/companion/src/pages/settings/Settings.tsx b/companion/src/pages/settings/Settings.tsx index 49cff21..59ce8ac 100644 --- a/companion/src/pages/settings/Settings.tsx +++ b/companion/src/pages/settings/Settings.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import { useState, useRef, useEffect } from 'react'; import { IconActivity, IconAccessible, @@ -26,11 +26,30 @@ type SettingsPageProps = { export default function SettingsPage({ settings, onSettingsChange, onCheckForUpdates, isCheckingForUpdate }: Readonly) { const [activeSection, setActiveSection] = useState('general'); + const navRef = useRef(null); + + useEffect(() => { + const el = navRef.current; + if (!el) return; + + const shouldHandle = () => window.matchMedia('(max-width: 820px)').matches; + + const onWheel = (e: WheelEvent) => { + if (!shouldHandle()) return; + if (el.scrollWidth <= el.clientWidth) return; + if (e.deltaY === 0) return; + e.preventDefault(); + el.scrollLeft += e.deltaY; + }; + + el.addEventListener('wheel', onWheel, { passive: false }); + return () => el.removeEventListener('wheel', onWheel as EventListener); + }, []); return (