FR: Autopopulate Stash-ID Search Box (#6447)

This commit is contained in:
Gykes 2026-01-04 22:34:43 -08:00 committed by GitHub
parent 45dc892a54
commit 81e8ccb5a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 7 additions and 1 deletions

View file

@ -681,6 +681,7 @@ export const PerformerEditPanel: React.FC<IPerformerDetails> = ({
onStashIDSelected(item);
setIsStashIDSearchOpen(false);
}}
initialQuery={performer.name ?? ""}
/>
)}

View file

@ -731,6 +731,7 @@ export const SceneEditPanel: React.FC<IProps> = ({
onStashIDSelected(item);
setIsStashIDSearchOpen(false);
}}
initialQuery={scene.title ?? ""}
/>
)}
<Form noValidate onSubmit={formik.handleSubmit}>

View file

@ -33,6 +33,7 @@ interface IProps {
stashBoxes: GQL.StashBox[];
excludedStashBoxEndpoints?: string[];
onSelectItem: (item?: GQL.StashIdInput) => void;
initialQuery?: string;
}
const CLASSNAME = "StashBoxIDSearchModal";
@ -289,6 +290,7 @@ export const StashBoxIDSearchModal: React.FC<IProps> = ({
stashBoxes,
excludedStashBoxEndpoints = [],
onSelectItem,
initialQuery = "",
}) => {
const intl = useIntl();
const Toast = useToast();
@ -297,7 +299,7 @@ export const StashBoxIDSearchModal: React.FC<IProps> = ({
const [selectedStashBox, setSelectedStashBox] = useState<GQL.StashBox | null>(
null
);
const [query, setQuery] = useState<string>("");
const [query, setQuery] = useState<string>(initialQuery);
const [results, setResults] = useState<SearchResultItem[] | undefined>(
undefined
);

View file

@ -200,6 +200,7 @@ export const StudioEditPanel: React.FC<IStudioEditPanel> = ({
onStashIDSelected(item);
setIsStashIDSearchOpen(false);
}}
initialQuery={studio.name ?? ""}
/>
)}

View file

@ -213,6 +213,7 @@ export const TagEditPanel: React.FC<ITagEditPanel> = ({
onStashIDSelected(item);
setIsStashIDSearchOpen(false);
}}
initialQuery={tag?.name ?? ""}
/>
)}