From eea77f30da35386ef189b43e26efed6aa42dd425 Mon Sep 17 00:00:00 2001 From: Dicken Date: Fri, 5 Jun 2026 01:22:31 +0200 Subject: [PATCH] DevTools Mobile: Scroll-Fades abgerundet, links-Fade dynamisch bei Scroll-Position --- frontend/src/tools/devtools.jsx | 47 ++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/frontend/src/tools/devtools.jsx b/frontend/src/tools/devtools.jsx index fa03a91..3a163c6 100644 --- a/frontend/src/tools/devtools.jsx +++ b/frontend/src/tools/devtools.jsx @@ -3092,6 +3092,17 @@ const TOOL_DEFS = [ export default function DevTools({ toast, mobile }) { const [activeTool, setActiveTool] = useState('cron'); const [activeTab, setActiveTab] = useState('explain'); + const chipScrollRef = useRef(null); + const [chipScroll, setChipScroll] = useState({ left: false, right: true }); + + const onChipScroll = () => { + const el = chipScrollRef.current; + if (!el) return; + setChipScroll({ + left: el.scrollLeft > 4, + right: el.scrollLeft < el.scrollWidth - el.clientWidth - 4, + }); + }; const active = TOOL_DEFS.find(t=>t.id===activeTool); const ActiveComp = active?.tabs ? active.components[activeTab] : active?.component; @@ -3109,9 +3120,10 @@ export default function DevTools({ toast, mobile }) { {/* Tool-Auswahl: Mobile = horizontal scroll mit Fade-Hint, Desktop = 2-Spalten-Grid */} {mobile ? (
-
+
{TOOL_DEFS.map(t=>( ))} - {/* Abstandshalter rechts damit letzter Chip nicht unter Fade liegt */} -
+
- {/* Fade-Overlay rechts → signalisiert weiteren Inhalt ohne Chips abzuschneiden */} -
- {/* Scroll-Pfeil */} -
+ {/* Links-Fade — erscheint wenn nach rechts gescrollt */} + {chipScroll.left && ( +
+ )} + {/* Rechts-Fade — verschwindet wenn am Ende */} + {chipScroll.right && ( +
+ )}
) : (