diff --git a/backend/chainlit/socket.py b/backend/chainlit/socket.py index b3075cccf7..702124305a 100644 --- a/backend/chainlit/socket.py +++ b/backend/chainlit/socket.py @@ -151,7 +151,7 @@ def ask_user_fn(data, timeout): data_layer.create_user_session( id=session_id, started_at=datetime.utcnow().isoformat(), - anon_user_id=anon_user_identifier, + anon_user_id=anon_user_identifier if not user else None, user_id=user.identifier if user else None, ) ) diff --git a/cypress/e2e/action/spec.cy.ts b/cypress/e2e/action/spec.cy.ts index f7db198384..e10d4a7afb 100644 --- a/cypress/e2e/action/spec.cy.ts +++ b/cypress/e2e/action/spec.cy.ts @@ -7,7 +7,7 @@ describe('Action', () => { it('should correctly execute and display actions', () => { // Click on "first action" - cy.get('#first-action').should('be.visible'); + cy.get('#first-action').should('exist'); cy.get('#first-action').click(); cy.get('.step').should('have.length', 3); cy.get('.step') @@ -15,7 +15,7 @@ describe('Action', () => { .should('contain', 'Thanks for pressing: first-action'); // Click on "test action" - cy.get("[id='test-action']").should('be.visible'); + cy.get("[id='test-action']").should('exist'); cy.get("[id='test-action']").click(); cy.get('.step').should('have.length', 4); cy.get('.step').eq(3).should('contain', 'Executed test action!'); @@ -24,7 +24,7 @@ describe('Action', () => { cy.wait(100); // Click on "removable action" - cy.get("[id='removable-action']").should('be.visible'); + cy.get("[id='removable-action']").should('exist'); cy.get("[id='removable-action']").click(); cy.get('.step').should('have.length', 5); cy.get('.step').eq(4).should('contain', 'Executed removable action!'); @@ -33,13 +33,13 @@ describe('Action', () => { cy.wait(100); // Click on "multiple action one" in the action drawer, should remove the correct action button - cy.get("[id='actions-drawer-button']").should('be.visible'); + cy.get("[id='actions-drawer-button']").should('exist'); cy.get("[id='actions-drawer-button']").click(); cy.get('.step').should('have.length', 5); cy.wait(100); - cy.get("[id='multiple-action-one']").should('be.visible'); + cy.get("[id='multiple-action-one']").should('exist'); cy.get("[id='multiple-action-one']").click(); cy.get('.step') .eq(5) @@ -51,7 +51,7 @@ describe('Action', () => { // Click on "multiple action two", should remove the correct action button cy.get('.step').should('have.length', 6); cy.get("[id='actions-drawer-button']").click(); - cy.get("[id='multiple-action-two']").should('be.visible'); + cy.get("[id='multiple-action-two']").should('exist'); cy.get("[id='multiple-action-two']").click(); cy.get('.step') .eq(6) @@ -61,7 +61,7 @@ describe('Action', () => { cy.wait(100); // Click on "all actions removed", should remove all buttons - cy.get("[id='all-actions-removed']").should('be.visible'); + cy.get("[id='all-actions-removed']").should('exist'); cy.get("[id='all-actions-removed']").click(); cy.get('.step').eq(7).should('contain', 'All actions have been removed!'); cy.get("[id='all-actions-removed']").should('not.exist'); diff --git a/cypress/e2e/avatar/spec.cy.ts b/cypress/e2e/avatar/spec.cy.ts index 5585f3c8ac..41041559cd 100644 --- a/cypress/e2e/avatar/spec.cy.ts +++ b/cypress/e2e/avatar/spec.cy.ts @@ -8,11 +8,11 @@ describe('Avatar', () => { it('should be able to display avatars', () => { cy.get('.step').should('have.length', 5); - cy.get('.step').eq(0).find('.message-avatar').should('have.length', 0); - cy.get('.step').eq(1).find('.message-avatar').should('have.length', 1); - cy.get('.step').eq(2).find('.message-avatar').should('have.length', 0); - cy.get('.step').eq(3).find('.message-avatar').should('have.length', 1); - cy.get('.step').eq(4).find('.message-avatar').should('have.length', 1); + cy.get('.step').eq(0).find('img').should('have.length', 0); + cy.get('.step').eq(1).find('img').should('have.length', 1); + cy.get('.step').eq(2).find('img').should('have.length', 0); + cy.get('.step').eq(3).find('img').should('have.length', 1); + cy.get('.step').eq(4).find('img').should('have.length', 1); cy.get('.element-link').should('have.length', 0); }); diff --git a/frontend/src/assets/chevronLeft.tsx b/frontend/src/assets/chevronLeft.tsx new file mode 100644 index 0000000000..1e90b49bb4 --- /dev/null +++ b/frontend/src/assets/chevronLeft.tsx @@ -0,0 +1,22 @@ +import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; + +const ChevronLeftIcon = (props: SvgIconProps) => { + return ( + + + + + + + ); +}; + +export default ChevronLeftIcon; diff --git a/frontend/src/assets/chevronRight.tsx b/frontend/src/assets/chevronRight.tsx new file mode 100644 index 0000000000..2d8fdde81e --- /dev/null +++ b/frontend/src/assets/chevronRight.tsx @@ -0,0 +1,22 @@ +import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; + +const ChevronRightIcon = (props: SvgIconProps) => { + return ( + + + + + + + ); +}; + +export default ChevronRightIcon; diff --git a/frontend/src/assets/chevronUp.tsx b/frontend/src/assets/chevronUp.tsx new file mode 100644 index 0000000000..31eea42b75 --- /dev/null +++ b/frontend/src/assets/chevronUp.tsx @@ -0,0 +1,22 @@ +import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; + +const ChevronUpIcon = (props: SvgIconProps) => { + return ( + + + + + + + ); +}; + +export default ChevronUpIcon; diff --git a/frontend/src/assets/user.tsx b/frontend/src/assets/user.tsx new file mode 100644 index 0000000000..e7b031bfcd --- /dev/null +++ b/frontend/src/assets/user.tsx @@ -0,0 +1,22 @@ +import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; + +const UserIcon = (props: SvgIconProps) => { + return ( + + + + + + + ); +}; + +export default UserIcon; diff --git a/frontend/src/components/atoms/buttons/userButton/avatar.tsx b/frontend/src/components/atoms/buttons/userButton/avatar.tsx index 50dacffe0b..2de275f29a 100644 --- a/frontend/src/components/atoms/buttons/userButton/avatar.tsx +++ b/frontend/src/components/atoms/buttons/userButton/avatar.tsx @@ -2,6 +2,8 @@ import { useAuth } from 'api/auth'; import { Avatar, Box } from '@mui/material'; +import UserIcon from 'assets/user'; + export default function UserAvatar() { const { user } = useAuth(); @@ -16,7 +18,7 @@ export default function UserAvatar() { }} src={user.metadata?.image || undefined} > - {user.identifier?.[0]} + {user.identifier?.[0]?.toUpperCase()} ); } else { @@ -29,7 +31,9 @@ export default function UserAvatar() { bgcolor: 'primary.main', color: 'primary.contrastText' }} - /> + > + + ); } diff --git a/frontend/src/components/organisms/chat/history/index.tsx b/frontend/src/components/organisms/chat/history/index.tsx index 27a2ebd252..e347d81fc5 100644 --- a/frontend/src/components/organisms/chat/history/index.tsx +++ b/frontend/src/components/organisms/chat/history/index.tsx @@ -4,7 +4,6 @@ import { useRef, useState } from 'react'; import { useRecoilState } from 'recoil'; import AutoDelete from '@mui/icons-material/AutoDelete'; -import KeyboardDoubleArrowUpIcon from '@mui/icons-material/KeyboardDoubleArrowUp'; import { IconButton, Menu, @@ -17,6 +16,8 @@ import { import { UserInput } from '@chainlit/react-client'; import { grey } from '@chainlit/react-components/theme'; +import ChevronUpIcon from 'assets/chevronUp'; + import { inputHistoryState } from 'state/userInputHistory'; interface Props { @@ -247,7 +248,7 @@ export default function InputHistoryButton({ disabled, onClick }: Props) { onClick={() => toggleChatHistoryMenu(!inputHistory.open)} ref={ref} > - + diff --git a/frontend/src/components/organisms/header.tsx b/frontend/src/components/organisms/header.tsx index 5b34258873..4701ddfd09 100644 --- a/frontend/src/components/organisms/header.tsx +++ b/frontend/src/components/organisms/header.tsx @@ -154,7 +154,7 @@ const Header = memo( borderBottomColor: (theme) => theme.palette.divider }} > - + {!matches ? : null}