From 1ae3ffc43bf6219a03e3153963f616db529efb31 Mon Sep 17 00:00:00 2001 From: Pas <74743263+Pasithea0@users.noreply.github.com> Date: Fri, 20 Feb 2026 16:50:11 -0700 Subject: [PATCH] collapsable custom source order --- src/assets/locales/en.json | 2 + src/pages/parts/settings/PreferencesPart.tsx | 45 +++++++++++++++++--- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json index 50758c74..38abaca0 100644 --- a/src/assets/locales/en.json +++ b/src/assets/locales/en.json @@ -1354,6 +1354,8 @@ "sourceOrder": "Reordering sources", "sourceOrderDescription": "Drag and drop to reorder sources. This will determine the order in which sources are checked for the media you are trying to watch. If a source is greyed out, it means the extension is required for that source.

(The default order is best for most users)", "sourceOrderEnableLabel": "Custom source order", + "showLess": "Show less", + "showMore": "Show more", "embedOrder": "Reordering embeds", "embedOrderDescription": "Drag and drop to reorder embeds. This will determine the order in which embeds are checked for the media you are trying to watch.

(The default order is best for most users)", "embedOrderEnableLabel": "Custom embed order", diff --git a/src/pages/parts/settings/PreferencesPart.tsx b/src/pages/parts/settings/PreferencesPart.tsx index e68a5bdc..36d34eb0 100644 --- a/src/pages/parts/settings/PreferencesPart.tsx +++ b/src/pages/parts/settings/PreferencesPart.tsx @@ -1,5 +1,5 @@ import classNames from "classnames"; -import { useMemo } from "react"; +import { useMemo, useState } from "react"; import { Trans, useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; @@ -9,6 +9,7 @@ import { Toggle } from "@/components/buttons/Toggle"; import { FlagIcon } from "@/components/FlagIcon"; import { Dropdown } from "@/components/form/Dropdown"; import { SortableList } from "@/components/form/SortableList"; +import { Icon, Icons } from "@/components/Icon"; import { Heading1 } from "@/components/utils/Text"; import { appLanguageOptions } from "@/setup/i18n"; import { useOverlayStack } from "@/stores/interface/overlayStack"; @@ -45,6 +46,7 @@ export function PreferencesPart(props: { }) { const { t } = useTranslation(); const { showModal } = useOverlayStack(); + const [isSourceListExpanded, setIsSourceListExpanded] = useState(false); const sorted = sortLangCodes(appLanguageOptions.map((item) => item.code)); const allowAutoplay = isAutoplayAllowed(); @@ -381,12 +383,41 @@ export function PreferencesPart(props: { {props.enableSourceOrder && (
- - props.setSourceOrder(items.map((item) => item.id)) - } - /> +
10 && !isSourceListExpanded + ? "max-h-[400px]" + : "max-h-none", + )} + > + + props.setSourceOrder(items.map((item) => item.id)) + } + /> +
+ {sourceItems.length > 10 && ( + + )}