From 8345ed9f89a8493952e4f5ab52ae6c546f844fea Mon Sep 17 00:00:00 2001 From: suu <46421931+0suu@users.noreply.github.com> Date: Mon, 29 Dec 2025 23:48:17 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B0=97=E5=8C=96=E5=BC=8F=E5=8A=A0?= =?UTF-8?q?=E6=B9=BF=E5=99=A8=E3=81=AE=E3=83=81=E3=83=A3=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=83=89=E3=83=AD=E3=83=83=E3=82=AF=E3=83=9C=E3=82=BF=E3=83=B3?= =?UTF-8?q?=E3=81=AF=E8=A9=B3=E7=B4=B0=E7=94=BB=E9=9D=A2=E3=81=AB=E3=81=A0?= =?UTF-8?q?=E3=81=91=E8=A1=A8=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/components/DeviceControls.tsx | 4 +++- src/renderer/src/components/DeviceDetailScreen.tsx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/components/DeviceControls.tsx b/src/renderer/src/components/DeviceControls.tsx index 197951f..a89f695 100644 --- a/src/renderer/src/components/DeviceControls.tsx +++ b/src/renderer/src/components/DeviceControls.tsx @@ -42,6 +42,7 @@ interface DeviceControlsProps { dense?: boolean; showCustomCommands?: boolean; showNightLightInstruction?: boolean; + showChildLockControls?: boolean; } const clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value)); @@ -62,6 +63,7 @@ export const DeviceControls: React.FC = ({ dense = false, showCustomCommands = true, showNightLightInstruction = true, + showChildLockControls = false, }) => { const dispatch: AppDispatch = useDispatch(); const isSending = useSelector((state: RootState) => selectIsCommandSendingForDevice(state, device.deviceId)); @@ -969,7 +971,7 @@ export const DeviceControls: React.FC = ({ )} - {isEvaporativeHumidifier && ( + {isEvaporativeHumidifier && showChildLockControls && ( - ); }; diff --git a/src/renderer/src/components/DeviceControls.tsx b/src/renderer/src/components/DeviceControls.tsx index a89f695..88480ff 100644 --- a/src/renderer/src/components/DeviceControls.tsx +++ b/src/renderer/src/components/DeviceControls.tsx @@ -233,6 +233,14 @@ export const DeviceControls: React.FC = ({ const sliderLabel = (value: number) => `${value}`; const sectionLabelSx = { fontWeight: 700, color: "text.secondary", mt: dense ? 0.25 : 1 }; + const renderSectionLabel = (label: React.ReactNode) => { + if (dense) return null; + return ( + + {label} + + ); + }; const gridColumns = dense ? 2 : 3; const maxControlWidth = dense ? 360 : 520; const buttonGridSx = { @@ -380,9 +388,7 @@ export const DeviceControls: React.FC = ({ if (cmds.length === 0 || isHiddenByDefinition) return null; return ( - - Controls - + {renderSectionLabel("Controls")} {cmds.map((cmd) => ( @@ -409,9 +415,11 @@ export const DeviceControls: React.FC = ({ {isSending && } {deviceError && {deviceError}} - - {t("Virtual Remote")} - {remoteTypeLabel || t("Infrared device")} - + {renderSectionLabel( + <> + {t("Virtual Remote")} - {remoteTypeLabel || t("Infrared device")} + + )} {remoteSupportsDefaultCommands && ( @@ -626,7 +634,7 @@ export const DeviceControls: React.FC = ({ {isBot && ( <> - Bot + {renderSectionLabel("Bot")} {botModeType !== "unknown" && ( @@ -668,7 +676,7 @@ export const DeviceControls: React.FC = ({ {isPlug && ( <> - Plug + {renderSectionLabel("Plug")} @@ -723,7 +731,7 @@ export const DeviceControls: React.FC = ({ {isLight && ( <> - Lighting + {renderSectionLabel("Lighting")}