Skip to content

feat(ui): add button to go to model manager next to all model combobox #7904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d8a9b36
feat(ui): accept callback to override navigate to model manager funct…
psychedelicious Apr 9, 2025
e3007d6
fix(ui): useModelCombobox should use `null` for no value instead of `…
psychedelicious Apr 9, 2025
601be5d
feat(ui): abstract out workflow editor model combobox, ensure consist…
psychedelicious Apr 9, 2025
f61d80a
feat(ui): add `<NavigateToModelManagerButton />` to model comboboxes …
psychedelicious Apr 9, 2025
e86d808
feat(ui): remove go to mm button from node fields
psychedelicious Apr 10, 2025
c904f04
chore(ui): bump cmdk to latest
psychedelicious Apr 14, 2025
2344a0a
feat(ui): reworked model selection ui (WIP)
psychedelicious Apr 14, 2025
e0160ed
feat(ui): reworked model selection ui (WIP)
psychedelicious Apr 14, 2025
c7d9434
feat(ui): reworked model selection ui (WIP)
psychedelicious Apr 14, 2025
09021df
feat(ui): just make the damn thing myself
psychedelicious Apr 14, 2025
19068e9
feat(ui): just make the damn thing myself
psychedelicious Apr 14, 2025
85da8cc
feat(ui): toast on select for demo purposes
psychedelicious Apr 14, 2025
1042195
feat(ui): iterate on model combobox (wip)
psychedelicious Apr 15, 2025
ca1bc21
feat(ui): add useStateImperative
psychedelicious Apr 15, 2025
0bede82
feat(ui): iterate on model combobox (wip)
psychedelicious Apr 15, 2025
ecfee9a
feat(ui): iterate on model combobox (wip)
psychedelicious Apr 15, 2025
e778de7
feat(ui): simplify ScrollableContent
psychedelicious Apr 15, 2025
abf7185
feat(ui): iterate on model combobox (wip)
psychedelicious Apr 15, 2025
7fcb3b7
feat(ui): iterate on model combobox (wip)
psychedelicious Apr 15, 2025
aa9b047
feat(ui): iterate on model combobox (wip)
psychedelicious Apr 15, 2025
66ddebb
feat(ui): iterate on model combobox (wip)
psychedelicious Apr 15, 2025
1701d97
feat(ui): iterate on model combobox (wip)
psychedelicious Apr 15, 2025
0092c6c
feat(ui): iterate on model combobox (wip)
psychedelicious Apr 15, 2025
08d2b4f
feat(ui): iterate on model combobox (wip)
psychedelicious Apr 15, 2025
ccec6c5
feat(ui): iterate on model combobox (wip)
psychedelicious Apr 15, 2025
b2b1d4d
feat(ui): iterate on model combobox (wip)
psychedelicious Apr 15, 2025
65f2c96
feat(ui): iterate on model combobox (wip)
psychedelicious Apr 15, 2025
bd1d920
feat(ui): iterate on model combobox (wip)
psychedelicious Apr 15, 2025
3b2930c
feat(ui): iterate on model combobox (wip)
psychedelicious Apr 15, 2025
5bac73c
feat(ui): render picker in portal
psychedelicious Apr 16, 2025
db46cb4
feat(ui): use context for stable picker state
psychedelicious Apr 16, 2025
8d83af7
feat(ui): onSelectId -> onSelectById
psychedelicious Apr 16, 2025
3b33984
feat(ui): genericizing picker
psychedelicious Apr 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion invokeai/frontend/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@xyflow/react": "^12.5.3",
"async-mutex": "^0.5.0",
"chakra-react-select": "^4.9.2",
"cmdk": "^1.0.0",
"cmdk": "^1.1.1",
"compare-versions": "^6.1.1",
"filesize": "^10.1.6",
"fracturedjsonjs": "^4.0.2",
Expand Down
285 changes: 169 additions & 116 deletions invokeai/frontend/web/pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion invokeai/frontend/web/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,8 @@
"installingXModels_one": "Installing {{count}} model",
"installingXModels_other": "Installing {{count}} models",
"skippingXDuplicates_one": ", skipping {{count}} duplicate",
"skippingXDuplicates_other": ", skipping {{count}} duplicates"
"skippingXDuplicates_other": ", skipping {{count}} duplicates",
"manageModels": "Manage Models"
},
"models": {
"addLora": "Add LoRA",
Expand Down
16 changes: 16 additions & 0 deletions invokeai/frontend/web/src/app/components/InvokeAIUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type { CustomStarUi } from 'app/store/nanostores/customStarUI';
import { $customStarUI } from 'app/store/nanostores/customStarUI';
import { $isDebugging } from 'app/store/nanostores/isDebugging';
import { $logo } from 'app/store/nanostores/logo';
import { $onClickGoToModelManager } from 'app/store/nanostores/onClickGoToModelManager';
import { $openAPISchemaUrl } from 'app/store/nanostores/openAPISchemaUrl';
import { $projectId, $projectName, $projectUrl } from 'app/store/nanostores/projectId';
import { $queueId, DEFAULT_QUEUE_ID } from 'app/store/nanostores/queueId';
Expand Down Expand Up @@ -59,6 +60,10 @@ interface Props extends PropsWithChildren {
workflowTagCategories?: WorkflowTagCategory[];
workflowSortOptions?: WorkflowSortOption[];
loggingOverrides?: LoggingOverrides;
/**
* If provided, overrides in-app navigation to the model manager
*/
onClickGoToModelManager?: () => void;
}

const InvokeAIUI = ({
Expand All @@ -81,6 +86,7 @@ const InvokeAIUI = ({
workflowTagCategories,
workflowSortOptions,
loggingOverrides,
onClickGoToModelManager,
}: Props) => {
useLayoutEffect(() => {
/*
Expand Down Expand Up @@ -205,6 +211,16 @@ const InvokeAIUI = ({
};
}, [logo]);

useEffect(() => {
if (onClickGoToModelManager) {
$onClickGoToModelManager.set(onClickGoToModelManager);
}

return () => {
$onClickGoToModelManager.set(undefined);
};
}, [onClickGoToModelManager]);

useEffect(() => {
if (workflowCategories) {
$workflowLibraryCategoriesOptions.set(workflowCategories);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { atom } from 'nanostores';

export const $onClickGoToModelManager = atom<(() => void) | undefined>(undefined);
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getOverlayScrollbarsParams } from 'common/components/OverlayScrollbars/
import type { OverlayScrollbarsComponentRef } from 'overlayscrollbars-react';
import { OverlayScrollbarsComponent } from 'overlayscrollbars-react';
import type { CSSProperties, PropsWithChildren } from 'react';
import { memo, useEffect, useMemo, useState } from 'react';
import { memo, useEffect, useMemo, useRef } from 'react';

type Props = PropsWithChildren & {
maxHeight?: ChakraProps['maxHeight'];
Expand All @@ -22,9 +22,9 @@ const ScrollableContent = ({ children, maxHeight, overflowX = 'hidden', overflow
() => getOverlayScrollbarsParams({ overflowX, overflowY }).options,
[overflowX, overflowY]
);
const [os, osRef] = useState<OverlayScrollbarsComponentRef | null>(null);
const os = useRef<OverlayScrollbarsComponentRef>(null);
useEffect(() => {
const osInstance = os?.osInstance();
const osInstance = os.current?.osInstance();

if (!osInstance) {
return;
Expand All @@ -46,7 +46,7 @@ const ScrollableContent = ({ children, maxHeight, overflowX = 'hidden', overflow
return (
<Flex w="full" h="full" maxHeight={maxHeight} position="relative">
<Box position="absolute" top={0} left={0} right={0} bottom={0}>
<OverlayScrollbarsComponent ref={osRef} style={styles} options={overlayscrollbarsOptions}>
<OverlayScrollbarsComponent ref={os} style={styles} options={overlayscrollbarsOptions} defer>
{children}
</OverlayScrollbarsComponent>
</Box>
Expand Down
Loading
Loading