-
Notifications
You must be signed in to change notification settings - Fork 462
chore: Improve models screen [PART 1] #5441
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
Changes from all commits
0fe29e2
8139203
b4d0f2e
d98cb0f
5496cc8
33f1b0a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // Copyright (C) 2025-2026 Intel Corporation | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import { Flex, Text } from '@geti/ui'; | ||
|
|
||
| import { ReactComponent as ThumbsUp } from '../../../../../assets/icons/thumbs-up.svg'; | ||
| import { ModelBadge } from './model-badge.component'; | ||
|
|
||
| import classes from './model-row.module.scss'; | ||
|
|
||
| type ArchitectureColumnProps = { | ||
| architecture: string; | ||
| }; | ||
|
|
||
| export const ArchitectureColumn = ({ architecture }: ArchitectureColumnProps) => { | ||
| return ( | ||
| <Flex direction={'column'} gap={'size-100'}> | ||
| <Text UNSAFE_className={classes.smallText}>{architecture} (Apache 2.0)</Text> | ||
| {/* TODO: Speed is hardcoded for now, once the backend is update we need to update this */} | ||
| <ModelBadge id={'architecture-name'}> | ||
| <ThumbsUp /> | ||
| <Text>Speed</Text> | ||
| </ModelBadge> | ||
| </Flex> | ||
| ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| // Copyright (C) 2025-2026 Intel Corporation | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import { Flex, Text } from '@geti/ui'; | ||
| import { Image, Tag } from '@geti/ui/icons'; | ||
| import { useNumberFormatter } from 'react-aria'; | ||
|
|
||
| import type { DatasetRevision } from '../../../../../constants/shared-types'; | ||
| import { formatDatasetRevisionDate } from '../../utils/date-formatting'; | ||
| import { ModelBadge } from './model-badge.component'; | ||
|
|
||
| import styles from './model-row.module.scss'; | ||
|
|
||
| type DatasetColumnProps = { | ||
| datasetRevision: DatasetRevision | undefined; | ||
| labelsCount: number | undefined; | ||
| }; | ||
|
|
||
| export const DatasetColumn = ({ datasetRevision, labelsCount }: DatasetColumnProps) => { | ||
| const totalCount = datasetRevision?.item_counts?.total; | ||
| const formatter = useNumberFormatter(); | ||
|
|
||
| // Should never happen, but just in case | ||
| if (datasetRevision === undefined) { | ||
| return ( | ||
| <Flex alignItems={'center'} justifyContent={'center'}> | ||
| Unknown | ||
| </Flex> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <Flex direction={'column'} gap={'size-50'}> | ||
| <Text UNSAFE_className={styles.datasetRevisionName}>{datasetRevision.name}</Text> | ||
| <Text UNSAFE_className={styles.datasetRevisionDate}> | ||
| {formatDatasetRevisionDate(datasetRevision.created_at)} | ||
| </Text> | ||
| <Flex gap={'size-100'}> | ||
| {labelsCount !== undefined && ( | ||
| <ModelBadge id={'labels-count'}> | ||
| <Tag /> | ||
| <Text>{labelsCount}</Text> | ||
| </ModelBadge> | ||
| )} | ||
| {totalCount !== undefined && ( | ||
| <ModelBadge id={'dataset-count'}> | ||
| <Image /> | ||
| <Text>{formatter.format(totalCount)}</Text> | ||
| </ModelBadge> | ||
| )} | ||
| </Flex> | ||
| </Flex> | ||
| ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // Copyright (C) 2025-2026 Intel Corporation | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import { ReactNode } from 'react'; | ||
|
|
||
| import { Badge, Flex, Text } from '@geti/ui'; | ||
|
|
||
| import styles from './model-row.module.scss'; | ||
|
|
||
| type ModelBadgeProps = { | ||
| children: ReactNode; | ||
| id?: string; | ||
| }; | ||
|
|
||
| export const ModelBadge = ({ children, id }: ModelBadgeProps) => { | ||
| return ( | ||
| <Badge variant={'neutral'} UNSAFE_className={styles.modelBadge} data-testid={id}> | ||
jpggvilaca marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <Text> | ||
| <Flex alignItems={'center'} gap={'size-50'}> | ||
|
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. Why do we need these inside the badge? I thought it should support an icon and text out of the box.
Contributor
Author
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. We don't use spectrum icons and this causes icon scaling issues (icon is too small) |
||
| {children} | ||
| </Flex> | ||
| </Text> | ||
| </Badge> | ||
| ); | ||
| }; | ||
Uh oh!
There was an error while loading. Please reload this page.