From c0c32475fdab9ce838ff525ede4d5f05b95207b4 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 09:53:09 +0000 Subject: [PATCH 1/3] feat: Updated interface/src/components/BackgroundS --- .../src/components/BackgroundSelector.tsx | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/interface/src/components/BackgroundSelector.tsx b/interface/src/components/BackgroundSelector.tsx index a11a5629..1f9a2c66 100644 --- a/interface/src/components/BackgroundSelector.tsx +++ b/interface/src/components/BackgroundSelector.tsx @@ -87,7 +87,14 @@ export default function BackgroundSelector({ selectedType, setSelectedType, isEd store.delete(fileId); setBackgrounds(prev => prev.filter(bg => bg.id !== fileId)); - // Check if the background being deleted is currently selected + swatch + + ))} + {backgrounds.concat(presetBackgrounds as Background[]).filter(bg => bg.type === 'image' && bg.isPreset && !bg.isDownloaded && !downloadedPresetIds.includes(bg.id)).map(bg => ( if (fileId === selectedBackground) { selectNoBackground(); // Disable the current background } @@ -123,16 +130,24 @@ export default function BackgroundSelector({ selectedType, setSelectedType, isEd {backgrounds.filter(bg => bg.type === 'image').map(bg => ( -
selectBackground(bg.id)} - className={`relative w-16 h-16 cursor-pointer rounded-xl transition ring dark:ring-white ring-zinc-300 ${isEditMode ? 'animate-shake' : ''} ${selectedBackground === bg.id && selectedType === "background" ? 'dark:ring-2 ring-4' : 'ring-0'}`}> + className={`relative w-16 h-16 cursor-pointer rounded-xl transition ring dark:ring-white ring-zinc-300 ${isEditMode ? 'animate-shake' : ''} ${selectedBackground === bg.id && selectedType === "background" ? 'dark:ring-2 ring-4' : 'ring-0'}`} + > {isEditMode && ( -
deleteBackground(bg.id)}> +
deleteBackground(bg.id)} + >
)} - swatch + swatch
))} {backgrounds.concat(presetBackgrounds as Background[]).filter(bg => bg.type === 'image' && bg.isPreset && !bg.isDownloaded && !downloadedPresetIds.includes(bg.id)).map(bg => ( From fcd6618ea1ff23b5f318675fd5a7eb9527832a0a Mon Sep 17 00:00:00 2001 From: SethBurkart123 Date: Thu, 16 Nov 2023 06:33:21 +1100 Subject: [PATCH 2/3] Refactor Sweep rules in sweep.yaml --- sweep.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/sweep.yaml b/sweep.yaml index eec2a7c5..a1af2e61 100644 --- a/sweep.yaml +++ b/sweep.yaml @@ -4,9 +4,6 @@ # This setting contains a list of rules that Sweep will check for. If any of these rules are broken in a new commit, Sweep will create an pull request to fix the broken rule. rules: - "All docstrings and comments should be up to date." - - "Ensure consistent indentation and spacing throughout the code." - - "Use meaningful variable and function names that accurately describe their purpose." - - "Avoid using magic numbers or hard-coded values. Instead, use constants or variables to improve code readability and maintainability." - "Remove commented-out code and unused imports to keep the codebase clean and organized." - "Follow a consistent naming convention for files, functions, and variables to improve code readability and maintainability." From 959f58f2ff31a862e4947708bf2f5b3e1fc470a6 Mon Sep 17 00:00:00 2001 From: SethBurkart123 Date: Thu, 16 Nov 2023 06:33:58 +1100 Subject: [PATCH 3/3] Added new rules to sweep.yaml --- sweep.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sweep.yaml b/sweep.yaml index a1af2e61..eec2a7c5 100644 --- a/sweep.yaml +++ b/sweep.yaml @@ -4,6 +4,9 @@ # This setting contains a list of rules that Sweep will check for. If any of these rules are broken in a new commit, Sweep will create an pull request to fix the broken rule. rules: - "All docstrings and comments should be up to date." + - "Ensure consistent indentation and spacing throughout the code." + - "Use meaningful variable and function names that accurately describe their purpose." + - "Avoid using magic numbers or hard-coded values. Instead, use constants or variables to improve code readability and maintainability." - "Remove commented-out code and unused imports to keep the codebase clean and organized." - "Follow a consistent naming convention for files, functions, and variables to improve code readability and maintainability."