-
Notifications
You must be signed in to change notification settings - Fork 852
feat(inspect): dataset list virtualization #3191
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
camiloHimura
merged 5 commits into
open-edge-platform:feature/geti-inspect
from
camiloHimura:ccolora11/dataset-vitualization
Dec 8, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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
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
13 changes: 13 additions & 0 deletions
13
.../features/inspect/dataset/dataset-item-placeholder/dataset-item-placeholder.component.tsx
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 |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { Image } from '@geti-inspect/icons'; | ||
| import { Flex } from '@geti/ui'; | ||
| import { clsx } from 'clsx'; | ||
|
|
||
| import styles from './dataset-item-placeholder.module.scss'; | ||
|
|
||
| export const DatasetItemPlaceholder = () => { | ||
| return ( | ||
| <Flex justifyContent={'center'} alignItems={'center'} UNSAFE_className={clsx(styles.datasetItemPlaceholder)}> | ||
| <Image /> | ||
| </Flex> | ||
| ); | ||
| }; |
7 changes: 7 additions & 0 deletions
7
...rc/features/inspect/dataset/dataset-item-placeholder/dataset-item-placeholder.module.scss
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 |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| .datasetItemPlaceholder { | ||
| width: 100%; | ||
| height: 100%; | ||
| aspect-ratio: auto; | ||
| border: 1px dashed var(--spectrum-global-color-gray-700); | ||
| background-color: var(--spectrum-global-color-gray-200); | ||
| } |
19 changes: 19 additions & 0 deletions
19
application/ui/src/features/inspect/dataset/dataset-item-placeholder/util.tsx
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 |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { MediaItem } from '../types'; | ||
|
|
||
| const PLACEHOLDER_FILENAME = 'placeholder'; | ||
|
|
||
| export const isPlaceholderItem = (name: string): boolean => { | ||
| return name.includes(PLACEHOLDER_FILENAME); | ||
| }; | ||
|
|
||
| export const getPlaceholderItem = (index: number): MediaItem => { | ||
| return { | ||
| id: `${PLACEHOLDER_FILENAME}-${index}`, | ||
| filename: PLACEHOLDER_FILENAME, | ||
| project_id: '', | ||
| size: 0, | ||
| is_anomalous: false, | ||
| width: 0, | ||
| height: 0, | ||
| }; | ||
| }; |
19 changes: 0 additions & 19 deletions
19
...ation/ui/src/features/inspect/dataset/dataset-item/dataset-item-placeholder.component.tsx
This file was deleted.
Oops, something went wrong.
49 changes: 0 additions & 49 deletions
49
application/ui/src/features/inspect/dataset/dataset-item/dataset-item.component.tsx
This file was deleted.
Oops, something went wrong.
52 changes: 0 additions & 52 deletions
52
application/ui/src/features/inspect/dataset/dataset-item/dataset-item.module.scss
This file was deleted.
Oops, something went wrong.
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
39 changes: 39 additions & 0 deletions
39
application/ui/src/features/inspect/dataset/hooks/use-get-media-items.hook.tsx
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 |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { $api } from '@geti-inspect/api'; | ||
| import { useProjectIdentifier } from '@geti-inspect/hooks'; | ||
|
|
||
| const mediaItemsLimit = 20; | ||
|
|
||
| export const useGetMediaItems = () => { | ||
| const { projectId } = useProjectIdentifier(); | ||
|
|
||
| const { data, isLoading, fetchNextPage, hasNextPage, isFetchingNextPage } = $api.useInfiniteQuery( | ||
| 'get', | ||
| '/api/projects/{project_id}/images', | ||
| { | ||
| params: { | ||
| query: { offset: 0, limit: mediaItemsLimit }, | ||
| path: { project_id: projectId }, | ||
| }, | ||
| }, | ||
| { | ||
| pageParamName: 'offset', | ||
| getNextPageParam: ({ | ||
| pagination, | ||
| }: { | ||
| pagination: { offset: number; limit: number; count: number; total: number }; | ||
| }) => { | ||
| const total = pagination.offset + pagination.count; | ||
|
|
||
| if (total >= pagination.total) { | ||
| return undefined; | ||
| } | ||
|
|
||
| return pagination.offset + mediaItemsLimit; | ||
| }, | ||
| } | ||
| ); | ||
|
|
||
| const mediaItems = data?.pages.flatMap((page) => page.media) ?? []; | ||
|
|
||
| return { mediaItems, isLoading, fetchNextPage, hasNextPage, isFetchingNextPage }; | ||
| }; |
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
Oops, something went wrong.
Oops, something went wrong.
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.