diff --git a/web/containers/Layout/TopPanel/index.tsx b/web/containers/Layout/TopPanel/index.tsx index aff616973..9ba393e09 100644 --- a/web/containers/Layout/TopPanel/index.tsx +++ b/web/containers/Layout/TopPanel/index.tsx @@ -144,7 +144,7 @@ const TopPanel = () => { theme="icon" onClick={() => { setMainViewState(MainViewState.Settings) - setSelectedSetting('Appearance') + setSelectedSetting('Preferences') }} > diff --git a/web/helpers/atoms/Setting.atom.ts b/web/helpers/atoms/Setting.atom.ts index 663dc2231..905c88d0f 100644 --- a/web/helpers/atoms/Setting.atom.ts +++ b/web/helpers/atoms/Setting.atom.ts @@ -16,6 +16,7 @@ export const PRODUCT_ANALYTIC_PROMPT = 'productAnalyticPrompt' export const THEME_DATA = 'themeData' export const THEME_OPTIONS = 'themeOptions' export const THEME_PATH = 'themePath' +export const CHAT_WIDTH = 'chatWidth' export const themesOptionsAtom = atomWithStorage< { name: string; value: string }[] >(THEME_OPTIONS, [], undefined, { getOnInit: true }) @@ -61,3 +62,9 @@ export const productAnalyticPromptAtom = atomWithStorage( undefined, { getOnInit: true } ) +export const chatWidthAtom = atomWithStorage( + CHAT_WIDTH, + 'full', + undefined, + { getOnInit: true } +) diff --git a/web/public/images/compact-width.png b/web/public/images/compact-width.png new file mode 100644 index 000000000..d3335f407 Binary files /dev/null and b/web/public/images/compact-width.png differ diff --git a/web/public/images/full-width.png b/web/public/images/full-width.png new file mode 100644 index 000000000..8ceb105bf Binary files /dev/null and b/web/public/images/full-width.png differ diff --git a/web/screens/Settings/Appearance/index.tsx b/web/screens/Settings/Appearance/index.tsx index 2dd7d96a2..06ce36407 100644 --- a/web/screens/Settings/Appearance/index.tsx +++ b/web/screens/Settings/Appearance/index.tsx @@ -7,6 +7,7 @@ import { Button, Select, Switch } from '@janhq/joi' import { useAtom, useAtomValue } from 'jotai' import { + chatWidthAtom, janThemesPathAtom, reduceTransparentAtom, selectedThemeIdAtom, @@ -25,6 +26,16 @@ export default function AppearanceOptions() { reduceTransparentAtom ) const [spellCheck, setSpellCheck] = useAtom(spellCheckAtom) + const [chatWidth, setChatWidth] = useAtom(chatWidthAtom) + + const chatWidthOption = [ + { name: 'Full Width', value: 'full', img: 'images/full-width.png' }, + { + name: 'Compact Width', + value: 'compact', + img: 'images/compact-width.png', + }, + ] const handleClickTheme = useCallback( async (e: string) => { @@ -91,6 +102,54 @@ export default function AppearanceOptions() { )} +
+
+
+
Chat Width
+
+

+ Choose the width of the chat area to customize your conversation + view +

+
+
+
+ {chatWidthOption.map((option) => { + return ( +
+ +
+ ) + })} +
+
+
diff --git a/web/screens/Settings/SettingDetail/index.tsx b/web/screens/Settings/SettingDetail/index.tsx index 84ef240cd..993303955 100644 --- a/web/screens/Settings/SettingDetail/index.tsx +++ b/web/screens/Settings/SettingDetail/index.tsx @@ -17,7 +17,7 @@ const SettingDetail = () => { case 'Extensions': return - case 'Appearance': + case 'Preferences': return case 'Keyboard Shortcuts': diff --git a/web/screens/Settings/index.tsx b/web/screens/Settings/index.tsx index e39239dbd..5003babcd 100644 --- a/web/screens/Settings/index.tsx +++ b/web/screens/Settings/index.tsx @@ -13,7 +13,7 @@ import { selectedSettingAtom } from '@/helpers/atoms/Setting.atom' export const SettingScreenList = [ 'My Models', - 'Appearance', + 'Preferences', 'Keyboard Shortcuts', 'Privacy', 'Advanced Settings', diff --git a/web/screens/Thread/ThreadCenterPanel/TextMessage/index.tsx b/web/screens/Thread/ThreadCenterPanel/TextMessage/index.tsx index bcb539bb1..fe42ef2e1 100644 --- a/web/screens/Thread/ThreadCenterPanel/TextMessage/index.tsx +++ b/web/screens/Thread/ThreadCenterPanel/TextMessage/index.tsx @@ -23,6 +23,8 @@ import { tokenSpeedAtom, } from '@/helpers/atoms/ChatMessage.atom' +import { chatWidthAtom } from '@/helpers/atoms/Setting.atom' + const MessageContainer: React.FC< ThreadMessage & { isCurrentMessage: boolean } > = (props) => { @@ -31,6 +33,7 @@ const MessageContainer: React.FC< const editMessage = useAtomValue(editMessageAtom) const activeAssistant = useAtomValue(activeAssistantAtom) const tokenSpeed = useAtomValue(tokenSpeedAtom) + const chatWidth = useAtomValue(chatWidthAtom) const text = useMemo( () => @@ -47,7 +50,12 @@ const MessageContainer: React.FC< const attachedFile = useMemo(() => 'attachments' in props, [props]) return ( -
+