diff --git a/client/src/components/dashboard/SettingsButton.jsx b/client/src/components/dashboard/SettingsButton.jsx index 6139ca0..13a9577 100644 --- a/client/src/components/dashboard/SettingsButton.jsx +++ b/client/src/components/dashboard/SettingsButton.jsx @@ -13,10 +13,16 @@ import { useRecipe, useSlotRecipe } from "@chakra-ui/react"; -import {Settings, Plus, LayoutGrid, Move, Save, X} from 'lucide-react'; +import {Settings, LayoutGrid, Move, Save, X} from 'lucide-react'; import {useDashboardStore} from "../../store/useDashboardStore.jsx"; import {WIDGET_REGISTRY} from "../../constants/widgetRegistry.jsx"; +// 🚨 NEW: Tiny helper to convert size keys into abbreviations +const getSizeAbbreviation = (key) => { + const mapping = { small: "S", medium: "M", large: "L", xlarge: "XL" }; + return mapping[key.toLowerCase()] || key.charAt(0).toUpperCase(); +}; + export function SettingsButton() { // 1. ☁Store connections const isEditing = useDashboardStore(state => state.isEditing); @@ -192,7 +198,7 @@ export function SettingsButton() { pt={3}> - Add to Grid: + Add to Dashboard: {Object.keys(widget.allowedSizes).map(sizeKey => ( @@ -203,8 +209,24 @@ export function SettingsButton() { onClick={() => handleAddWidget(widget.id, sizeKey)} color={{base: "blue.600", _dark: "blue.300"}} > - - {sizeKey.charAt(0).toUpperCase() + sizeKey.slice(1)} + {/* 🚨 THE ABBREVIATION ICON: Always visible */} + + {getSizeAbbreviation(sizeKey)} + + + {/* 🚨 THE EXPANDED TEXT: Only visible on hover */} + Add Widget ))} @@ -216,9 +238,7 @@ export function SettingsButton() { ))} - +