From 40acb6e2e5f16ca318dddc3f5270a0da3f2494d7 Mon Sep 17 00:00:00 2001
From: Andrew Davis <1709934+Savid@users.noreply.github.com>
Date: Sat, 5 Apr 2025 23:58:25 +1000
Subject: [PATCH] cleanup icons
---
ui/src/components/MacroForm.tsx | 2 +-
ui/src/components/MacroStepCard.tsx | 74 ++++++++++---------
.../devices.$id.settings.macros.edit.tsx | 4 +-
ui/src/routes/devices.$id.settings.macros.tsx | 21 ++++--
4 files changed, 56 insertions(+), 45 deletions(-)
diff --git a/ui/src/components/MacroForm.tsx b/ui/src/components/MacroForm.tsx
index 06afd4e..135817c 100644
--- a/ui/src/components/MacroForm.tsx
+++ b/ui/src/components/MacroForm.tsx
@@ -181,7 +181,7 @@ export function MacroForm({
-
+
{macro.steps?.length || 0}/{MAX_STEPS_PER_MACRO} steps
diff --git a/ui/src/components/MacroStepCard.tsx b/ui/src/components/MacroStepCard.tsx
index 986eb38..1b944cf 100644
--- a/ui/src/components/MacroStepCard.tsx
+++ b/ui/src/components/MacroStepCard.tsx
@@ -1,4 +1,4 @@
-import { LuArrowUp, LuArrowDown, LuX, LuTrash } from "react-icons/lu";
+import { LuArrowUp, LuArrowDown, LuX, LuTrash2 } from "react-icons/lu";
import { Button } from "@/components/Button";
import { Combobox } from "@/components/Combobox";
@@ -94,6 +94,12 @@ export function MacroStepCard({
+
+ {stepIndex + 1}
+
+
+
+
-
-
{onDelete && (
)}
-
+
@@ -137,7 +138,7 @@ export function MacroStepCard({
{group}
-
+
{mods.map(option => (
-
- {ensureArray(step.keys).map((key, keyIndex) => (
-
-
- {keyDisplayMap[key] || key}
+ {ensureArray(step.keys) && step.keys.length > 0 && (
+
+ {step.keys.map((key, keyIndex) => (
+
+
+ {keyDisplayMap[key] || key}
+
+
-
+ ))}
+
+ )}
onKeySelect(value)}
+ onChange={(value: { value: string; label: string }) => {
+ onKeySelect(value);
+ onKeyQueryChange('');
+ }}
displayValue={() => keyQuery}
onInputChange={onKeyQueryChange}
options={getFilteredKeys}
@@ -204,7 +210,7 @@ export function MacroStepCard({
-
+
setShowDeleteConfirm(true)}
disabled={isDeleting}
/>
diff --git a/ui/src/routes/devices.$id.settings.macros.tsx b/ui/src/routes/devices.$id.settings.macros.tsx
index 744fd2a..5c4e352 100644
--- a/ui/src/routes/devices.$id.settings.macros.tsx
+++ b/ui/src/routes/devices.$id.settings.macros.tsx
@@ -1,6 +1,6 @@
import { useEffect, Fragment, useMemo, useState, useCallback } from "react";
import { useNavigate } from "react-router-dom";
-import { LuPenLine, LuLoader, LuCopy, LuMoveRight, LuCornerDownRight, LuArrowUp, LuArrowDown, LuTrash } from "react-icons/lu";
+import { LuPenLine, LuCopy, LuMoveRight, LuCornerDownRight, LuArrowUp, LuArrowDown, LuTrash2, LuCommand } from "react-icons/lu";
import { KeySequence, useMacrosStore, generateMacroId } from "@/hooks/stores";
import { SettingsPageHeader } from "@/components/SettingsPageheader";
@@ -11,6 +11,7 @@ import { MAX_TOTAL_MACROS, COPY_SUFFIX } from "@/constants/macros";
import { keyDisplayMap, modifierDisplayMap } from "@/keyboardMappings";
import notifications from "@/notifications";
import { ConfirmDialog } from "@/components/ConfirmDialog";
+import LoadingSpinner from "@/components/LoadingSpinner";
const normalizeSortOrders = (macros: KeySequence[]): KeySequence[] => {
return macros.map((macro, index) => ({
@@ -201,8 +202,9 @@ export default function SettingsMacrosRoute() {