From c0624c0a62a3774558e7f5661199708e6b352804 Mon Sep 17 00:00:00 2001 From: karim Date: Sat, 6 Jun 2026 15:14:29 +0200 Subject: [PATCH] Tools + Elements: smaller tiles, display-mode dropdown, dark pill look MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Tiles shrunk (minHeight 46/38/30 per mode, tighter padding, smaller icons) - Add display-mode dropdown (Symbol / Text / Symbol+Text) at top of each panel; choice persists in localStorage under 'dossier_tile_mode' and is shared between both panels - Grid column min-width adapts per mode (icon 40 / text 66 / both 58) - Restore dark pill look: --bg-input background + border-light, full border-radius — tiles read as distinct chips again - Icon-only mode shows a small corner chevron on dropdown tiles (Treppe/Stuetze/Traeger) so the right-click menu stays discoverable --- src/ElementeApp.jsx | 140 +++++++++++++++++++++++++++++--------------- src/ToolsApp.jsx | 80 ++++++++++++++++++------- 2 files changed, 152 insertions(+), 68 deletions(-) diff --git a/src/ElementeApp.jsx b/src/ElementeApp.jsx index a09f096..14d4be8 100644 --- a/src/ElementeApp.jsx +++ b/src/ElementeApp.jsx @@ -21,6 +21,32 @@ const labelXs = { letterSpacing: '0.06em', textTransform: 'uppercase', } +// Anzeige-Modus der Kacheln, geteilt mit Werkzeuge-Panel via localStorage. +const TILE_MODE_KEY = 'dossier_tile_mode' // 'both' | 'icon' | 'text' +function readTileMode() { + try { return localStorage.getItem(TILE_MODE_KEY) || 'both' } catch { return 'both' } +} +function writeTileMode(m) { + try { localStorage.setItem(TILE_MODE_KEY, m) } catch { /* WebView ohne Storage */ } +} +const TILE_MIN_COL = { icon: 40, text: 66, both: 58 } +const TILE_MIN_H = { icon: 38, text: 30, both: 46 } + +function TileModeDropdown({ mode, onChange }) { + return ( + + ) +} + function fmtNum(v) { if (v == null || v === '') return '' const n = Number(v) @@ -51,8 +77,11 @@ function ReferenzSelector({ value, onChange }) { // Raster-Kachel — Icon oben, Label darunter, einheitliche Zellgroesse. // hasMenu zeigt ein kleines Chevron neben dem Label (Rechtsklick = Untertypen). +// mode: 'both' (Icon+Text) | 'icon' (nur Symbol) | 'text' (nur Text) function PillButton({ icon, label, hint, onClick, onContextMenu, disabled, - hasMenu, badge }) { + hasMenu, badge, mode = 'both' }) { + const showIcon = mode !== 'text' + const showLabel = mode !== 'icon' return ( ) } -function GridSection({ label, children }) { +function GridSection({ label, mode, children }) { return ( -
+
{children}
@@ -112,11 +130,28 @@ function GridSection({ label, children }) { ) } +function TileModeDropdown({ mode, onChange }) { + return ( + + ) +} + // --------------------------------------------------------------------------- export default function WerkzeugeApp() { + const [mode, setMode] = useState(readTileMode) useEffect(() => { notifyReady() }, []) + const changeMode = (m) => { setMode(m); writeTileMode(m) } const groups = Object.entries(TOOLS) return ( @@ -129,10 +164,13 @@ export default function WerkzeugeApp() { boxSizing: 'border-box', overflowY: 'auto', overflowX: 'hidden', }}> +
+ +
{groups.map(([title, items]) => ( - + {items.map(([icon, label, cmd, tip]) => ( - + ))} ))}