-
Notifications
You must be signed in to change notification settings - Fork 433
Design: Model management #7190
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
Merged
Merged
Design: Model management #7190
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4236b1b
design: Standardize buttons for import
DrJKL a74ec9e
style: Cover for card images.
DrJKL 56b1753
feat: Recent by default
DrJKL 233f584
cleanup: inline utility classes
DrJKL 27cddd5
fix: Don't show import on Load Image, don't show the only option as a…
DrJKL b112073
test: Remove change detector test
DrJKL 2da4f05
a11y: disable button when it's not functioning as a button
DrJKL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,18 @@ | ||
| <template> | ||
| <div :class="containerClasses" data-component-id="asset-filter-bar"> | ||
| <div :class="leftSideClasses" data-component-id="asset-filter-bar-left"> | ||
| <div | ||
| class="flex gap-4 items-center justify-between px-6 pt-2 pb-6" | ||
| data-component-id="asset-filter-bar" | ||
| > | ||
| <div | ||
| class="flex gap-4 items-center" | ||
| data-component-id="asset-filter-bar-left" | ||
| > | ||
| <MultiSelect | ||
| v-if="availableFileFormats.length > 0" | ||
| v-model="fileFormats" | ||
| :label="$t('assetBrowser.fileFormats')" | ||
| :options="availableFileFormats" | ||
| :class="selectClasses" | ||
| class="min-w-32" | ||
| data-component-id="asset-filter-file-formats" | ||
| @update:model-value="handleFilterChange" | ||
| /> | ||
|
|
@@ -16,18 +22,18 @@ | |
| v-model="baseModels" | ||
| :label="$t('assetBrowser.baseModels')" | ||
| :options="availableBaseModels" | ||
| :class="selectClasses" | ||
| class="min-w-32" | ||
| data-component-id="asset-filter-base-models" | ||
| @update:model-value="handleFilterChange" | ||
| /> | ||
| </div> | ||
|
|
||
| <div :class="rightSideClasses" data-component-id="asset-filter-bar-right"> | ||
| <div class="flex items-center" data-component-id="asset-filter-bar-right"> | ||
| <SingleSelect | ||
| v-model="sortBy" | ||
| :label="$t('assetBrowser.sortBy')" | ||
| :options="sortOptions" | ||
| :class="selectClasses" | ||
| class="min-w-32" | ||
| data-component-id="asset-filter-sort" | ||
| @update:model-value="handleFilterChange" | ||
| > | ||
|
|
@@ -48,43 +54,38 @@ import type { SelectOption } from '@/components/input/types' | |
| import { t } from '@/i18n' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not related to this PR, but it's definitely a mistake that we are using Another thing we could add a linter rule for ("prefer reactive translations in component setup functions"). |
||
| import { useAssetFilterOptions } from '@/platform/assets/composables/useAssetFilterOptions' | ||
| import type { AssetItem } from '@/platform/assets/schemas/assetSchema' | ||
| import { cn } from '@/utils/tailwindUtil' | ||
| export interface FilterState { | ||
| fileFormats: string[] | ||
| baseModels: string[] | ||
| sortBy: string | ||
| } | ||
| const SORT_OPTIONS = [ | ||
| { name: t('assetBrowser.sortRecent'), value: 'recent' }, | ||
| { name: t('assetBrowser.sortAZ'), value: 'name-asc' }, | ||
| { name: t('assetBrowser.sortZA'), value: 'name-desc' } | ||
| ] as const | ||
| type SortOption = (typeof SORT_OPTIONS)[number]['value'] | ||
| const sortOptions = [...SORT_OPTIONS] | ||
| const { assets = [] } = defineProps<{ | ||
| assets?: AssetItem[] | ||
| }>() | ||
| const fileFormats = ref<SelectOption[]>([]) | ||
| const baseModels = ref<SelectOption[]>([]) | ||
| const sortBy = ref('name-asc') | ||
| const sortBy = ref<SortOption>('recent') | ||
| const { availableFileFormats, availableBaseModels } = | ||
| useAssetFilterOptions(assets) | ||
| const sortOptions = [ | ||
| { name: t('assetBrowser.sortAZ'), value: 'name-asc' }, | ||
| { name: t('assetBrowser.sortZA'), value: 'name-desc' }, | ||
| { name: t('assetBrowser.sortRecent'), value: 'recent' } | ||
| ] | ||
| const emit = defineEmits<{ | ||
| filterChange: [filters: FilterState] | ||
| }>() | ||
| const containerClasses = cn( | ||
| 'flex gap-4 items-center justify-between', | ||
| 'px-6 pt-2 pb-6' | ||
| ) | ||
| const leftSideClasses = cn('flex gap-4 items-center') | ||
| const rightSideClasses = cn('flex items-center') | ||
| const selectClasses = cn('min-w-32') | ||
| function handleFilterChange() { | ||
| emit('filterChange', { | ||
| fileFormats: fileFormats.value.map((option: SelectOption) => option.value), | ||
|
|
||
27 changes: 17 additions & 10 deletions
27
src/renderer/extensions/vueNodes/widgets/components/form/dropdown/FormDropdownMenuFilter.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.