Skip to content

Commit

Permalink
fix(chat): fix slider overload and keyboard arrows navigation (Issue #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Kezik authored Dec 21, 2024
1 parent 2fa32d6 commit d941e1c
Show file tree
Hide file tree
Showing 3 changed files with 500 additions and 399 deletions.
22 changes: 5 additions & 17 deletions apps/chat/src/components/Chat/TalkTo/TalkToCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
isExecutableApp,
} from '@/src/utils/app/application';
import { getRootId } from '@/src/utils/app/id';
import { isEntityIdPublic } from '@/src/utils/app/publications';
import { PseudoModel, isPseudoModel } from '@/src/utils/server/api';

import {
Expand Down Expand Up @@ -53,8 +52,7 @@ import { ApplicationTopic } from '@/src/components/Marketplace/ApplicationTopic'
import { FunctionStatusIndicator } from '@/src/components/Marketplace/FunctionStatusIndicator';

import LoaderIcon from '@/public/images/icons/loader.svg';
import UnpublishIcon from '@/public/images/icons/unpublish.svg';
import { Feature, PublishActions } from '@epam/ai-dial-shared';
import { Feature } from '@epam/ai-dial-shared';

const DESKTOP_ICON_SIZE = 80;
const TABLET_ICON_SIZE = 48;
Expand Down Expand Up @@ -82,7 +80,7 @@ interface ApplicationCardProps {
disabled: boolean;
isUnavailableModel: boolean;
onClick: (entity: DialAIEntityModel) => void;
onPublish: (entity: DialAIEntityModel, action: PublishActions) => void;
onPublish: (entity: DialAIEntityModel) => void;
onDelete: (entity: DialAIEntityModel) => void;
onEdit: (entity: DialAIEntityModel) => void;
onSelectVersion: (entity: DialAIEntityModel) => void;
Expand Down Expand Up @@ -159,7 +157,7 @@ export const TalkToCard = ({

const handleSelectVersion = useCallback(
(model: DialAIEntityModel) => {
onSelectVersion?.(model);
onSelectVersion(model);
},
[onSelectVersion],
);
Expand Down Expand Up @@ -215,17 +213,7 @@ export const TalkToCard = ({
Icon: IconWorldShare,
onClick: (e: React.MouseEvent) => {
e.stopPropagation();
onPublish?.(entity, PublishActions.ADD);
},
},
{
name: t('Unpublish'),
dataQa: 'unpublish',
display: isEntityIdPublic(entity) && !!onPublish,
Icon: UnpublishIcon,
onClick: (e: React.MouseEvent) => {
e.stopPropagation();
onPublish?.(entity, PublishActions.DELETE);
onPublish(entity);
},
},
{
Expand Down Expand Up @@ -326,7 +314,7 @@ export const TalkToCard = ({
<ModelIcon entityId={entity.id} entity={entity} size={iconSize} />
)}
</div>
<div className="flex grow flex-col justify-center gap-2 overflow-hidden leading-4">
<div className="flex grow flex-col justify-center overflow-hidden leading-4">
{!!versionsToSelect.length && (
<div className="flex items-center">
<p className="mr-1 text-xs text-secondary">{t('Version')}: </p>
Expand Down
Loading

0 comments on commit d941e1c

Please sign in to comment.