diff --git a/gui/src/components/mainInput/Lump/BlockSettingsTopToolbar.tsx b/gui/src/components/mainInput/Lump/BlockSettingsTopToolbar.tsx index f6abe9e85..a561d2e1c 100644 --- a/gui/src/components/mainInput/Lump/BlockSettingsTopToolbar.tsx +++ b/gui/src/components/mainInput/Lump/BlockSettingsTopToolbar.tsx @@ -98,38 +98,38 @@ export function BlockSettingsTopToolbar(props: BlockSettingsTopToolbarProps) { }; return ( -
-
- -
-
- {sections.map((section) => ( - - props.setSelectedSection( - props.selectedSection === section.id ? null : section.id, - ) - } - /> - ))} +
+
+
+ +
+
+ {sections.map((section) => ( + + props.setSelectedSection( + props.selectedSection === section.id ? null : section.id, + ) + } + /> + ))} +
-
- -
+
); } diff --git a/gui/src/components/modelSelection/ModeSelect.tsx b/gui/src/components/modelSelection/ModeSelect.tsx index afc0588fa..efb670ae6 100644 --- a/gui/src/components/modelSelection/ModeSelect.tsx +++ b/gui/src/components/modelSelection/ModeSelect.tsx @@ -9,7 +9,7 @@ import { } from "@heroicons/react/24/outline"; import { MessageModes } from "core"; import { modelSupportsTools } from "core/llm/autodetect"; -import { useEffect } from "react"; +import { useEffect, useMemo } from "react"; import styled from "styled-components"; import { defaultBorderRadius, lightGray, vscInputBackground } from ".."; import { useAppDispatch, useAppSelector } from "../../redux/hooks"; @@ -25,6 +25,7 @@ import { getMetaKeyLabel, isJetBrains, } from "../../util"; +import Shortcut from "../gui/Shortcut"; const StyledListboxButton = styled(Listbox.Button)` font-family: inherit; @@ -81,7 +82,13 @@ function ModeSelect() { const mode = useAppSelector(selectCurrentMode); const selectedModel = useAppSelector(selectDefaultModel); const agentModeSupported = selectedModel && modelSupportsTools(selectedModel); - const jetbrains = isJetBrains(); + + const jetbrains = useMemo(() => { + return isJetBrains(); + }, []); + const metaKeyLabel = useMemo(() => { + return getMetaKeyLabel(); + }, []); const getModeIcon = (mode: MessageModes) => { switch (mode) { @@ -133,7 +140,9 @@ function ModeSelect() { className="flex items-center gap-1 rounded-full px-2 py-0.5 text-gray-400 transition-colors duration-200" > {getModeIcon(mode)} - {mode.charAt(0).toUpperCase() + mode.slice(1)} + + {mode.charAt(0).toUpperCase() + mode.slice(1)} +
diff --git a/gui/src/components/modelSelection/platform/AssistantSelect.tsx b/gui/src/components/modelSelection/platform/AssistantSelect.tsx index 43caa02a9..f5ed3105f 100644 --- a/gui/src/components/modelSelection/platform/AssistantSelect.tsx +++ b/gui/src/components/modelSelection/platform/AssistantSelect.tsx @@ -5,19 +5,24 @@ import { useContext, useEffect, useRef } from "react"; import { useAuth } from "../../../context/Auth"; import { IdeMessengerContext } from "../../../context/IdeMessenger"; import { cycleProfile } from "../../../redux"; -import { useAppDispatch } from "../../../redux/hooks"; +import { useAppDispatch, useAppSelector } from "../../../redux/hooks"; import { fontSize, isMetaEquivalentKeyPressed } from "../../../util"; import PopoverTransition from "../../mainInput/InputToolbar/bottom/PopoverTransition"; import AssistantIcon from "./AssistantIcon"; import { AssistantSelectOptions } from "./AssistantSelectOptions"; function AssistantSelectButton(props: { selectedProfile: ProfileDescription }) { + const isLumpToolbarExpanded = useAppSelector( + (state) => state.ui.isBlockSettingsToolbarExpanded, + ); return (
- +
- + {props.selectedProfile.title} Create your first assistant @@ -89,7 +94,14 @@ export default function AssistantSelect() { - + { if (buttonRef.current) { diff --git a/gui/src/pages/config/KeyboardShortcuts.tsx b/gui/src/pages/config/KeyboardShortcuts.tsx index 072223453..d393f43a8 100644 --- a/gui/src/pages/config/KeyboardShortcuts.tsx +++ b/gui/src/pages/config/KeyboardShortcuts.tsx @@ -1,3 +1,4 @@ +import { useMemo } from "react"; import styled from "styled-components"; import { defaultBorderRadius, @@ -7,16 +8,6 @@ import { import { ToolTip } from "../../components/gui/Tooltip"; import { getPlatform, isJetBrains } from "../../util"; -const GridDiv = styled.div` - display: grid; - grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); - grid-gap: 1rem; - padding: 1rem 0; - justify-items: center; - align-items: center; - overflow-x: hidden; -`; - const StyledKeyDiv = styled.div` border: 0.5px solid ${lightGray}; border-radius: ${defaultBorderRadius}; @@ -64,9 +55,9 @@ interface KeyboardShortcutProps { function KeyboardShortcut(props: KeyboardShortcutProps) { const shortcut = getPlatform() === "mac" ? props.mac : props.windows; return ( -
- {props.description} -
+
+ {props.description}: +
{shortcut.split(" ").map((key, i) => { return ; })} @@ -201,23 +192,25 @@ const jetbrainsShortcuts: KeyboardShortcutProps[] = [ ]; function KeyboardShortcuts() { + const shortcuts = useMemo(() => { + return isJetBrains() ? jetbrainsShortcuts : vscodeShortcuts; + }, []); + return ( -
+

Keyboard shortcuts

- - {(isJetBrains() ? jetbrainsShortcuts : vscodeShortcuts).map( - (shortcut, i) => { - return ( - - ); - }, - )} - +
+ {shortcuts.map((shortcut, i) => { + return ( + + ); + })} +
); } diff --git a/gui/src/pages/config/index.tsx b/gui/src/pages/config/index.tsx index a336cb69c..d4d50103e 100644 --- a/gui/src/pages/config/index.tsx +++ b/gui/src/pages/config/index.tsx @@ -32,30 +32,32 @@ function ConfigPage() { id: "settings", label: "Settings", component: , - icon: , + icon: , }, { id: "indexing", label: "Indexing", component: , - icon: , + icon: , }, { id: "help", label: "Help", component: , - icon: , + icon: ( + + ), }, { id: "shortcuts", label: "Shortcuts", component: , - icon: , + icon: , }, ]; return ( -
+
{/* Tab Headers */} -
+
{tabs.map((tab) => (
setActiveTab(tab.id)} @@ -85,7 +87,7 @@ function ConfigPage() {
{/* Tab Content */} -
+
{tabs.find((tab) => tab.id === activeTab)?.component}
diff --git a/gui/src/pages/gui/Chat.tsx b/gui/src/pages/gui/Chat.tsx index c75256813..653efcd3d 100644 --- a/gui/src/pages/gui/Chat.tsx +++ b/gui/src/pages/gui/Chat.tsx @@ -292,7 +292,7 @@ export function Chat() { 0 ? "flex-1" : ""}`} + className={`mt-[2px] overflow-y-scroll ${showPageHeader ? "" : "pt-[8px]"} ${showScrollbar ? "thin-scrollbar" : "no-scrollbar"} ${history.length > 0 ? "flex-1" : ""}`} > {highlights} {history.map((item, index: number) => (