From 0c0b51916747eb120944fc206ae4457707654d40 Mon Sep 17 00:00:00 2001 From: Sophie Turner Date: Mon, 23 Sep 2024 13:41:14 +0500 Subject: [PATCH 01/14] fix(sid-bar): search text clears after click colllapsed button --- src/components/App/SideBar/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/App/SideBar/index.tsx b/src/components/App/SideBar/index.tsx index 5c756ad9a..6faa5ecb0 100644 --- a/src/components/App/SideBar/index.tsx +++ b/src/components/App/SideBar/index.tsx @@ -20,7 +20,7 @@ type ContentProp = { // eslint-disable-next-line react/display-name const Content = forwardRef(({ subViewOpen }, ref) => { - const { setSidebarOpen } = useAppStore((s) => s) + const { setSidebarOpen, currentSearch: searchTerm, setSearchFormValue } = useAppStore((s) => s) const hasAiChats = useHasAiChats() @@ -32,6 +32,7 @@ const Content = forwardRef(({ subViewOpen }, ref) = { setSidebarOpen(false) + setSearchFormValue(searchTerm || '') }} > From c7964ab527304f48a9f9748e3c63dbfed82016ee Mon Sep 17 00:00:00 2001 From: Sophie Turner Date: Sun, 29 Sep 2024 01:16:27 +0500 Subject: [PATCH 02/14] fix(filter-search): duplicate Scroll Bar appears --- src/components/App/SideBar/FilterSearch/index.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/App/SideBar/FilterSearch/index.tsx b/src/components/App/SideBar/FilterSearch/index.tsx index 71c4bc4fd..3bda4585e 100644 --- a/src/components/App/SideBar/FilterSearch/index.tsx +++ b/src/components/App/SideBar/FilterSearch/index.tsx @@ -247,8 +247,6 @@ const SchemaTypeWrapper = styled(Flex).attrs({ })` flex-wrap: wrap; gap: 10px; - max-height: 400px; - overflow-y: auto; padding-right: 10px; margin-right: calc(0px - 16px); ` From edb0ae5ceeebb0fb275aaf8bdd751ec23fa4dd7e Mon Sep 17 00:00:00 2001 From: saithsab877 Date: Thu, 3 Oct 2024 23:50:31 +0500 Subject: [PATCH 03/14] fix(edit-node): labels First Letter Should Be Capitalized --- .../ModalsContainer/EditNodeNameModal/Title/index.tsx | 3 ++- .../EditNodeNameModal/utils/__tests__/index.ts | 11 ++++++++++- .../ModalsContainer/EditNodeNameModal/utils/index.ts | 7 +++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/components/ModalsContainer/EditNodeNameModal/Title/index.tsx b/src/components/ModalsContainer/EditNodeNameModal/Title/index.tsx index 75c704a69..e0aa63cb8 100644 --- a/src/components/ModalsContainer/EditNodeNameModal/Title/index.tsx +++ b/src/components/ModalsContainer/EditNodeNameModal/Title/index.tsx @@ -10,6 +10,7 @@ import { useFeatureFlagStore } from '~/stores/useFeatureFlagStore' import { useSelectedNode } from '~/stores/useGraphStore' import { useModal } from '~/stores/useModalStore' import { colors } from '~/utils' +import { formatLabel } from '../utils' export const TitleEditor = () => { const { open: openAddItemNodeModal } = useModal('changeNodeType') @@ -66,7 +67,7 @@ export const TitleEditor = () => { marginBottom: 8, }} > - {key} + {formatLabel(key)} { it('should return true for valid image URLs', () => { @@ -31,3 +31,12 @@ describe('validateImageInputType function', () => { expect(validateImageInputType('pbs.twimg.com/profile_images/1729542498006294529/AjwhArl6_normal.svg')).toBe(false) }) }) + +describe('formatLabel function', () => { + it('should format labels correctly', () => { + expect(formatLabel('name')).toBe('Name') + expect(formatLabel('image_url')).toBe('Image Url') + expect(formatLabel('twitter_handle')).toBe('Twitter Handle') + expect(formatLabel('date')).toBe('Date') + }) +}) diff --git a/src/components/ModalsContainer/EditNodeNameModal/utils/index.ts b/src/components/ModalsContainer/EditNodeNameModal/utils/index.ts index c971a2a83..4a96a31f9 100644 --- a/src/components/ModalsContainer/EditNodeNameModal/utils/index.ts +++ b/src/components/ModalsContainer/EditNodeNameModal/utils/index.ts @@ -7,3 +7,10 @@ export function validateImageInputType(url: string): boolean { return false } + +export function formatLabel(label: string): string { + return label + .split('_') + .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) + .join(' ') +} From 59c2189bc8e2aaa5f7e6ef0cf1fdccb970536eba Mon Sep 17 00:00:00 2001 From: saithsab877 Date: Wed, 9 Oct 2024 21:18:31 +0500 Subject: [PATCH 04/14] fix(tldr-modal): background allows clicks behind modals and stats bar --- src/components/App/AppBar/index.tsx | 2 +- src/components/App/MainToolbar/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/App/AppBar/index.tsx b/src/components/App/AppBar/index.tsx index 99bb6abe5..f579997ee 100644 --- a/src/components/App/AppBar/index.tsx +++ b/src/components/App/AppBar/index.tsx @@ -57,7 +57,7 @@ const Header = styled(Flex).attrs({ left: 64px; right: 32px; transition: opacity 1s; - z-index: 99; + z-index: 1; padding: 20px 23px; ` diff --git a/src/components/App/MainToolbar/index.tsx b/src/components/App/MainToolbar/index.tsx index 93bc08256..6677dbca6 100644 --- a/src/components/App/MainToolbar/index.tsx +++ b/src/components/App/MainToolbar/index.tsx @@ -114,7 +114,7 @@ const Wrapper = styled(Flex).attrs({ justify: 'flex-start', })` flex: 0 0 64px; - z-index: 31; + z-index: 1; transition: opacity 1s; background: ${colors.BG2}; position: relative; From a224948f46e052fe119ba64431436b7ecfed859a Mon Sep 17 00:00:00 2001 From: Shoaibdev7 Date: Wed, 9 Oct 2024 22:18:04 +0500 Subject: [PATCH 05/14] fix(source-table): delete icon color is not danger --- .../SourcesTableModal/SourcesView/Sources/Table/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/SourcesTableModal/SourcesView/Sources/Table/index.tsx b/src/components/SourcesTableModal/SourcesView/Sources/Table/index.tsx index 58bf71c71..320eaf6f5 100644 --- a/src/components/SourcesTableModal/SourcesView/Sources/Table/index.tsx +++ b/src/components/SourcesTableModal/SourcesView/Sources/Table/index.tsx @@ -251,6 +251,7 @@ const IconWrapper = styled(Flex)` display: flex; &.centered { margin: 0 auto; + color: ${colors.secondaryRed}; } & + & { From a54b039deb9137c61914e0fc59f8f67c217acbcf Mon Sep 17 00:00:00 2001 From: Sophie Turner Date: Fri, 18 Oct 2024 00:40:16 +0500 Subject: [PATCH 06/14] fix(sid-bar): search text clears after click colllapsed button --- src/components/App/SideBar/__tests__/index.tsx | 6 ++++-- src/components/App/SideBar/index.tsx | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/App/SideBar/__tests__/index.tsx b/src/components/App/SideBar/__tests__/index.tsx index a4ba3b318..ae2c6ff15 100644 --- a/src/components/App/SideBar/__tests__/index.tsx +++ b/src/components/App/SideBar/__tests__/index.tsx @@ -3,8 +3,8 @@ import { ThemeProvider } from '@mui/material' import '@testing-library/jest-dom' import { fireEvent, render, screen, waitFor } from '@testing-library/react' import React from 'react' -import { ThemeProvider as StyleThemeProvider } from 'styled-components' import { MemoryRouter } from 'react-router-dom' +import { ThemeProvider as StyleThemeProvider } from 'styled-components' import { SideBar } from '..' import { api } from '../../../../network/api' import { AppStore, useAppStore } from '../../../../stores/useAppStore' @@ -101,7 +101,9 @@ describe('Test SideBar', () => { , ) - expect(container.querySelector('#sidebar-wrapper')).not.toBeInTheDocument() + waitFor(() => { + expect(container.querySelector('#sidebar-wrapper')).not.toBeInTheDocument() + }) }) it('Verify that the sidebar is visible when sidebarIsOpen is true.', () => { diff --git a/src/components/App/SideBar/index.tsx b/src/components/App/SideBar/index.tsx index 6faa5ecb0..fa207294d 100644 --- a/src/components/App/SideBar/index.tsx +++ b/src/components/App/SideBar/index.tsx @@ -20,7 +20,7 @@ type ContentProp = { // eslint-disable-next-line react/display-name const Content = forwardRef(({ subViewOpen }, ref) => { - const { setSidebarOpen, currentSearch: searchTerm, setSearchFormValue } = useAppStore((s) => s) + const { setSidebarOpen } = useAppStore((s) => s) const hasAiChats = useHasAiChats() @@ -32,7 +32,6 @@ const Content = forwardRef(({ subViewOpen }, ref) = { setSidebarOpen(false) - setSearchFormValue(searchTerm || '') }} > @@ -67,7 +66,7 @@ export const SideBar = () => { return ( <> - + From 21880ecf08f6509e0abbd7e9cc59b7a779441948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B0=D1=81=D1=83=D0=BB?= Date: Fri, 1 Nov 2024 10:50:26 +0300 Subject: [PATCH 07/14] feat: updated icon and color for label --- src/components/Universe/Graph/index.tsx | 2 +- src/components/common/TypeBadge/index.tsx | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/components/Universe/Graph/index.tsx b/src/components/Universe/Graph/index.tsx index a9ca224d6..8f1025002 100644 --- a/src/components/Universe/Graph/index.tsx +++ b/src/components/Universe/Graph/index.tsx @@ -139,7 +139,7 @@ export const Graph = () => { material.color = new Color(lineColor) material.transparent = true - material.opacity = 1 + material.opacity = 0.5 } }) } diff --git a/src/components/common/TypeBadge/index.tsx b/src/components/common/TypeBadge/index.tsx index 510c57397..7e2a96587 100644 --- a/src/components/common/TypeBadge/index.tsx +++ b/src/components/common/TypeBadge/index.tsx @@ -16,7 +16,7 @@ type BadgeProps = { export const TypeBadge = ({ type }: Props) => { let badgeProps: Omit const [normalizedSchemasByType] = useSchemaStore((s) => [s.normalizedSchemasByType]) - const nodeType = type.toLowerCase() + const nodeType = type const primaryColor = normalizedSchemasByType[type]?.primary_color const primaryIcon = normalizedSchemasByType[type]?.icon @@ -93,14 +93,6 @@ export const TypeBadge = ({ type }: Props) => { break - case 'topic': - badgeProps = { - iconStart: icon ?? 'topic_badge.svg', - color: primaryColor ?? colors.TOPIC, - } - - break - default: badgeProps = { iconStart: icon ?? 'thing_badge.svg', @@ -114,7 +106,7 @@ export const TypeBadge = ({ type }: Props) => { } const Badge = ({ iconStart, color, label }: BadgeProps) => ( - + {label}
{label}
@@ -122,7 +114,7 @@ const Badge = ({ iconStart, color, label }: BadgeProps) => ( const EpisodeWrapper = styled(Flex).attrs({ direction: 'row', -})<{ color: string; label: string }>` +})<{ color: string }>` cursor: pointer; background: ${({ color }) => color}; border-radius: 3px; @@ -139,7 +131,7 @@ const EpisodeWrapper = styled(Flex).attrs({ } .badge__label { - color: ${({ label }) => (label.toLowerCase() === 'topic' ? colors.black : colors.white)}; + color: ${colors.white}; font-family: Barlow; font-size: 8px; font-style: normal; From 2c8911b1266db897bb26afc826e9cdd72690bf68 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Fri, 1 Nov 2024 13:02:43 +0500 Subject: [PATCH 08/14] fix(setting-modal): save changes button position should be consistent on all tabs --- src/components/SettingsModal/SettingsView/General/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SettingsModal/SettingsView/General/index.tsx b/src/components/SettingsModal/SettingsView/General/index.tsx index 66b898426..9a149f665 100644 --- a/src/components/SettingsModal/SettingsView/General/index.tsx +++ b/src/components/SettingsModal/SettingsView/General/index.tsx @@ -89,7 +89,7 @@ export const General: FC = ({ initialValues, onClose }) => { - +