diff --git a/electron/package.json b/electron/package.json index 82b569495..dc6585da9 100644 --- a/electron/package.json +++ b/electron/package.json @@ -81,7 +81,7 @@ "electron-store": "^8.1.0", "electron-updater": "^6.1.7", "fs-extra": "^11.2.0", - "node-fetch": "2", + "node-fetch": "^3.3.2", "pacote": "^17.0.4", "request": "^2.88.2", "request-progress": "^3.0.0", diff --git a/web/containers/Layout/TopBar/index.tsx b/web/containers/Layout/TopBar/index.tsx index 005348ba7..208ca4bdb 100644 --- a/web/containers/Layout/TopBar/index.tsx +++ b/web/containers/Layout/TopBar/index.tsx @@ -125,9 +125,14 @@ const TopBar = () => { -
+
- + {titleScreen(mainViewState)}
diff --git a/web/containers/ShortcutModal/index.tsx b/web/containers/ShortcutModal/index.tsx new file mode 100644 index 000000000..638df02d8 --- /dev/null +++ b/web/containers/ShortcutModal/index.tsx @@ -0,0 +1,99 @@ +import React from 'react' + +import { + Modal, + ModalTrigger, + Button, + ModalContent, + ModalHeader, + ModalTitle, +} from '@janhq/uikit' + +const availableShortcuts = [ + { + combination: 'E', + modifierKeys: [isMac ? '⌘' : 'Ctrl'], + description: 'Show list your models', + }, + { + combination: 'K', + modifierKeys: [isMac ? '⌘' : 'Ctrl'], + description: 'Show list navigation pages', + }, + { + combination: 'B', + modifierKeys: [isMac ? '⌘' : 'Ctrl'], + description: 'Toggle collapsible left panel', + }, + { + combination: ',', + modifierKeys: [isMac ? '⌘' : 'Ctrl'], + description: 'Navigate to setting page', + }, + { + combination: 'Enter', + description: 'Send a message', + }, + { + combination: 'Shift + Enter', + description: 'Insert new line in input box', + }, + { + combination: 'Arrow Up', + description: 'Navigate to previous option (within search dialog)', + }, + { + combination: 'Arrow Down', + description: 'Navigate to next option (within search dialog)', + }, +] + +const ShortcutModal: React.FC = () => ( + + + + + + + Keyboard Shortcuts + +
+
+
+
Combination
+
+
+
Description
+
+
+ {availableShortcuts.map((shortcut, index) => { + return ( +
+
+
+

{`${shortcut.modifierKeys?.[0] ?? ''} ${ + shortcut.combination + }`}

+
+
+
+

{shortcut.description}

+
+
+ ) + })} +
+
+
+) + +export default ShortcutModal diff --git a/web/screens/Settings/Advanced/index.tsx b/web/screens/Settings/Advanced/index.tsx index 9a25b0f35..03b840f0b 100644 --- a/web/screens/Settings/Advanced/index.tsx +++ b/web/screens/Settings/Advanced/index.tsx @@ -4,24 +4,16 @@ import { useContext, useEffect, useState } from 'react' import { fs } from '@janhq/core' -import { - Switch, - Button, - Modal, - ModalContent, - ModalHeader, - ModalTitle, - ModalTrigger, -} from '@janhq/uikit' +import { Switch, Button } from '@janhq/uikit' import { atom, useAtom } from 'jotai' -import ShortCut from '@/containers/Shortcut' +import ShortcutModal from '@/containers/ShortcutModal' +import { toaster } from '@/containers/Toast' import { FeatureToggleContext } from '@/context/FeatureToggle' import { useSettings } from '@/hooks/useSettings' -import { toaster } from '@/containers/Toast' const serverEnabledAtom = atom(false) @@ -173,136 +165,7 @@ const Advanced = () => { Shortcuts that you might find useful in Jan app.

- - - - - - - Keyboard Shortcuts - -
-
-
-
-
Combination
-
-
-
-
-
Description
-
-
-
-
-
-
- -
-
-
-
-

Show list your models

-
-
-
-
-
-
- -
-
-
-
-

Show list navigation pages

-
-
-
-
-
-
- -
-
-
-
-

Toggle collapsible left panel

-
-
-
-
-
-
- -
-
-
-
-

Navigate to setting page

-
-
-
-
-
-
-
-

Enter

-
-
-
-
-
-

Send a message

-
-
-
-
-
-
-
-

Shift + Enter

-
-
-
-
-
-

Insert new line in input box

-
-
-
-
-
-
-
-

Arrow Up

-
-
-
-
-
-

Navigate to previous option (within search dialog)

-
-
-
-
-
-
-
-

Arrow Down

-
-
-
-
-
-

Navigate to next option (within search dialog)

-
-
-
-
-
-
+
)