diff --git a/src/components/Dashboard/Wrappers/Category/useCategoryActions.tsx b/src/components/Dashboard/Wrappers/Category/useCategoryActions.tsx index 0c9b68bb6..777bdabf3 100644 --- a/src/components/Dashboard/Wrappers/Category/useCategoryActions.tsx +++ b/src/components/Dashboard/Wrappers/Category/useCategoryActions.tsx @@ -46,13 +46,13 @@ export const useCategoryActions = (configName: string | undefined, category: Cat ...aboveCategories, category, // Move categories below down - ...belowCategories.map((x) => ({ ...x, position: x.position + 2 })), + ...belowCategories.map((x) => ({ ...x, position: x.position + 1 })), ], wrappers: [ ...aboveWrappers, newWrapper, // Move wrappers below down - ...belowWrappers.map((x) => ({ ...x, position: x.position + 2 })), + ...belowWrappers.map((x) => ({ ...x, position: x.position + 1 })), ], }; }, @@ -127,12 +127,12 @@ export const useCategoryActions = (configName: string | undefined, category: Cat const currentItem = previous.categories.find((x) => x.id === category.id); if (!currentItem) return previous; - const upperItem = previous.categories.find((x) => x.position === currentItem.position - 2); + const upperItem = previous.categories.find((x) => x.position === currentItem.position - 1); if (!upperItem) return previous; - currentItem.position -= 2; - upperItem.position += 2; + currentItem.position -= 1; + upperItem.position += 1; return { ...previous, @@ -156,12 +156,12 @@ export const useCategoryActions = (configName: string | undefined, category: Cat const currentItem = previous.categories.find((x) => x.id === category.id); if (!currentItem) return previous; - const belowItem = previous.categories.find((x) => x.position === currentItem.position + 2); + const belowItem = previous.categories.find((x) => x.position === currentItem.position + 1); if (!belowItem) return previous; - currentItem.position += 2; - belowItem.position -= 2; + currentItem.position += 1; + belowItem.position -= 1; return { ...previous, @@ -196,6 +196,15 @@ export const useCategoryActions = (configName: string | undefined, category: Cat x.area = { type: 'wrapper', properties: { id: mainWrapper?.id ?? 'default' } }; }); + const widgetsToMove = previous.widgets.filter( + (x) => x.area && x.area.type === 'category' && x.area.properties.id === currentItem.id + ); + + widgetsToMove.forEach((x) => { + // eslint-disable-next-line no-param-reassign + x.area = { type: 'wrapper', properties: { id: mainWrapper?.id ?? 'default' } }; + }); + return { ...previous, apps: previous.apps, diff --git a/src/widgets/torrentNetworkTraffic/TorrentNetworkTrafficTile.tsx b/src/widgets/torrentNetworkTraffic/TorrentNetworkTrafficTile.tsx index ce9f6a01b..59a5e3ca6 100644 --- a/src/widgets/torrentNetworkTraffic/TorrentNetworkTrafficTile.tsx +++ b/src/widgets/torrentNetworkTraffic/TorrentNetworkTrafficTile.tsx @@ -20,8 +20,8 @@ const definition = defineWidget({ options: {}, gridstack: { - minWidth: 6, - minHeight: 6, + minWidth: 2, + minHeight: 2, maxWidth: 12, maxHeight: 6, },