diff --git a/ui/v2.5/src/components/Settings/SettingsInterfacePanel/SettingsInterfacePanel.tsx b/ui/v2.5/src/components/Settings/SettingsInterfacePanel/SettingsInterfacePanel.tsx index 4336e1a7f..50576baae 100644 --- a/ui/v2.5/src/components/Settings/SettingsInterfacePanel/SettingsInterfacePanel.tsx +++ b/ui/v2.5/src/components/Settings/SettingsInterfacePanel/SettingsInterfacePanel.tsx @@ -35,6 +35,7 @@ import { ratingSystemIntlMap, RatingSystemType, } from "src/utils/rating"; +import { defaultMaxOptionsShown } from "src/core/config"; const allMenuItems = [ { id: "scenes", headingID: "scenes" }, @@ -486,6 +487,12 @@ export const SettingsInterfacePanel: React.FC = () => { } /> + saveUI({ maxOptionsShown: v })} + /> ) => const LimitedSelectMenu = ( props: MenuListProps> ) => { - const maxOptionsShown = 200; + const { configuration } = React.useContext(ConfigurationContext); + const maxOptionsShown = + (configuration?.ui as IUIConfig).maxOptionsShown ?? defaultMaxOptionsShown; + const [hiddenCount, setHiddenCount] = useState(0); const hiddenCountStyle = { padding: "8px 12px", @@ -166,7 +170,7 @@ const LimitedSelectMenu = ( } setHiddenCount(0); return props.children; - }, [props.children]); + }, [props.children, maxOptionsShown]); return ( {menuChildren} diff --git a/ui/v2.5/src/core/config.ts b/ui/v2.5/src/core/config.ts index 93bac87f9..0d10b9cf2 100644 --- a/ui/v2.5/src/core/config.ts +++ b/ui/v2.5/src/core/config.ts @@ -26,6 +26,8 @@ export interface ICustomFilter extends ITypename { export type FrontPageContent = ISavedFilterRow | ICustomFilter; +export const defaultMaxOptionsShown = 200; + export interface IUIConfig { frontPageContent?: FrontPageContent[]; @@ -45,6 +47,10 @@ export interface IUIConfig { // before the play count is incremented minimumPlayPercent?: number; + // maximum number of items to shown in the dropdown list - defaults to 200 + // upper limit of 1000 + maxOptionsShown?: number; + lastNoteSeen?: number; } diff --git a/ui/v2.5/src/docs/en/Changelog/v0200.md b/ui/v2.5/src/docs/en/Changelog/v0200.md index fda0c0cd0..520e26333 100644 --- a/ui/v2.5/src/docs/en/Changelog/v0200.md +++ b/ui/v2.5/src/docs/en/Changelog/v0200.md @@ -1,7 +1,8 @@ ##### 💥 Note: The cache directory is now required if using HLS streaming. Please set the cache directory in the System Settings page. ### ✨ New Features -* Add configuration option to perform generation operations sequentially after scanning a new video file. ([#3378](https://github.com/stashapp/stash/pull/3378)) +* Added configuration option for the maximum number of items in selector drop-downs. ([#3277](https://github.com/stashapp/stash/pull/3277)) +* Added configuration option to perform generation operations sequentially after scanning a new video file. ([#3378](https://github.com/stashapp/stash/pull/3378)) * Optionally show range in generated funscript heatmaps. ([#3373](https://github.com/stashapp/stash/pull/3373)) * Show funscript heatmaps in scene player scrubber. ([#3374](https://github.com/stashapp/stash/pull/3374)) * Support customising the filename regex used for determining the gallery cover image. ([#3391](https://github.com/stashapp/stash/pull/3391)) diff --git a/ui/v2.5/src/locales/en-GB.json b/ui/v2.5/src/locales/en-GB.json index 559af9e7b..c2bdbce98 100644 --- a/ui/v2.5/src/locales/en-GB.json +++ b/ui/v2.5/src/locales/en-GB.json @@ -503,6 +503,9 @@ "description": "Remove the ability to create new objects from the dropdown selectors", "heading": "Disable dropdown create" }, + "max_options_shown": { + "label": "Maximum number of items to show in select dropdowns" + }, "rating_system": { "type": { "label": "Rating System Type",