From 6dd387db2b5b9890f19d0c3505cf9cb770fd492f Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Tue, 13 Aug 2024 09:32:59 +0700 Subject: [PATCH] chore: minor ui improvement (#3352) --- .../components/DetailModelGroup.tsx | 6 +- .../components/HubScreenFilter/index.tsx | 16 ++--- .../components/HuggingFaceModelCard.tsx | 2 +- .../Advanced/components/DataMigration.tsx | 60 +++++++++++++------ web/screens/Settings/Appearance/index.tsx | 6 +- web/screens/Settings/EngineSetting/index.tsx | 2 - web/screens/Settings/Hotkeys/index.tsx | 4 +- .../Settings/MyModels/ModelItem/index.tsx | 2 +- web/screens/Settings/MyModels/index.tsx | 4 +- .../components/CopyOverInstruction.tsx | 2 +- .../AssistantSettingContainer/index.tsx | 4 +- 11 files changed, 63 insertions(+), 45 deletions(-) diff --git a/web/screens/HubScreen2/components/DetailModelGroup.tsx b/web/screens/HubScreen2/components/DetailModelGroup.tsx index 5fbc2d136..9c86ab1f6 100644 --- a/web/screens/HubScreen2/components/DetailModelGroup.tsx +++ b/web/screens/HubScreen2/components/DetailModelGroup.tsx @@ -85,7 +85,11 @@ const DetailModelGroup: React.FC = ({ category, onBackClicked }) => {
} - placeholder="Search" + placeholder={ + category === 'HuggingFace' + ? 'Search or paste Hugging Face URL' + : 'Search' + } value={filter} onChange={onFilterChange} /> diff --git a/web/screens/HubScreen2/components/HubScreenFilter/index.tsx b/web/screens/HubScreen2/components/HubScreenFilter/index.tsx index 0148bb01e..90a811c79 100644 --- a/web/screens/HubScreen2/components/HubScreenFilter/index.tsx +++ b/web/screens/HubScreen2/components/HubScreenFilter/index.tsx @@ -1,7 +1,5 @@ import { Fragment } from 'react' -import Image from 'next/image' - import BlankState from '@/containers/BlankState' import useModelHub from '@/hooks/useModelHub' @@ -24,11 +22,11 @@ const HubScreenFilter: React.FC = ({ queryText }) => { const huggingFaceModels = data.modelCategories.get('HuggingFace') ?? [] const remoteModels: HfModelEntry[] = [] - Object.entries(data.modelCategories).forEach(([key, value]) => { + for (const [key, value] of data.modelCategories) { if (key !== 'HuggingFace' && key !== 'BuiltInModels') { remoteModels.push(...value) } - }) + } const filteredBuiltInModels = builtInModels.filter((model) => { return model.name.toLowerCase().includes(queryText.toLowerCase()) @@ -57,19 +55,13 @@ const HubScreenFilter: React.FC = ({ queryText }) => {
) : ( -
+
{isOnDevice && (
- Built-In Models

On-Device Models

-
+
{filteredBuiltInModels.map((hfModelEntry) => ( ))} diff --git a/web/screens/HubScreen2/components/HuggingFaceModelCard.tsx b/web/screens/HubScreen2/components/HuggingFaceModelCard.tsx index fb9747889..87b16c840 100644 --- a/web/screens/HubScreen2/components/HuggingFaceModelCard.tsx +++ b/web/screens/HubScreen2/components/HuggingFaceModelCard.tsx @@ -55,7 +55,7 @@ const HuggingFaceModelCard: React.FC = ({
- + {addThousandSeparator(downloads)} diff --git a/web/screens/Settings/Advanced/components/DataMigration.tsx b/web/screens/Settings/Advanced/components/DataMigration.tsx index 1fdcc975a..1647074ed 100644 --- a/web/screens/Settings/Advanced/components/DataMigration.tsx +++ b/web/screens/Settings/Advanced/components/DataMigration.tsx @@ -40,27 +40,51 @@ const DataMigration: React.FC = () => { }, [threads, deleteThread]) return ( -
-
-
-
- Migrate data from old version of Jan app -
+ <> +
+
+
+
+ Data Migration from Older Versions +
+
+

+ From version 0.6, Jan uses Cortex as its core engine. Without + migration, your previous threads and models may be inaccessible. + Migrate your data to maintain access in the latest version. +

+
+
+
-

- Migrate multiple times can cause duplicate threads, please consider - using the remove threads button to clean up existing threads data -

-
- - +
+
+
+
Delete All Threads
+
+

+ Multiple migrations may create duplicate threads. Use this button to + clean up if needed. +

+
+
+ +
-
+ ) } diff --git a/web/screens/Settings/Appearance/index.tsx b/web/screens/Settings/Appearance/index.tsx index 22bb8d8be..a6571be99 100644 --- a/web/screens/Settings/Appearance/index.tsx +++ b/web/screens/Settings/Appearance/index.tsx @@ -52,7 +52,7 @@ export default function AppearanceOptions() {
Appearance

- Select a color theme + Select a color theme.