`
- padding: 6px 12px;
-
- min-width: 0px;
-
- ${({ isDisabled, isSelected }) =>
- !isDisabled &&
- `
- cursor: pointer;
-
- &:hover {
- background: ${lightGray}33;
- }
-
- ${
- isSelected &&
- `
- background: ${lightGray}22;
- `
- }
- `}
-
- ${({ isDisabled }) =>
- isDisabled &&
- `
- opacity: 0.5;
- `}
-`;
-
-export const MAX_HEIGHT_PX = 300;
-
-export const Divider = styled.div`
- height: 0.5px;
- background-color: ${lightGray};
-`;
-
-interface ModelOptionProps {
- children: React.ReactNode;
- idx: number;
- disabled: boolean;
- selected: boolean;
- showConfigure: boolean;
- onOpenConfig: () => void;
- onClick: () => void;
- errors?: ConfigValidationError[];
- onClickError?: (e: any) => void;
-}
-
-const IconBase = styled.div<{ $hovered: boolean }>`
- width: 1.2em;
- height: 1.2em;
- cursor: pointer;
- padding: 4px;
- border-radius: ${defaultBorderRadius};
- opacity: ${(props) => (props.$hovered ? 0.75 : 0)};
- visibility: ${(props) => (props.$hovered ? "visible" : "hidden")};
-
- &:hover {
- opacity: 1;
- background-color: ${lightGray}33;
- }
-`;
-
-const StyledCog6ToothIcon = styled(IconBase).attrs({ as: Cog6ToothIcon })``;
-const StyledArrowTopRightOnSquareIcon = styled(IconBase).attrs({
- as: ArrowTopRightOnSquareIcon,
-})``;
-const StyledExclamationTriangleIcon = styled(IconBase).attrs({
- as: ExclamationTriangleIcon,
-})``;
-
-export function Option({
- children,
- idx,
- disabled,
- onClick,
- showConfigure,
- selected,
- errors,
- onClickError,
- onOpenConfig,
-}: ModelOptionProps) {
- const [hovered, setHovered] = useState(false);
-
- function handleOptionClick(e: any) {
- if (disabled) {
- e.preventDefault();
- e.stopPropagation();
- }
- onClick();
- }
-
- return (
-
setHovered(true)}
- onMouseLeave={() => setHovered(false)}
- isSelected={selected}
- onClick={!disabled ? handleOptionClick : undefined}
- >
-
-
- {children}
-
- {!errors?.length ? (
- showConfigure ? (
-
{
- e.stopPropagation();
- e.preventDefault();
- onOpenConfig();
- }}
- />
- ) : (
- {
- e.stopPropagation();
- e.preventDefault();
- onOpenConfig();
- }}
- />
- )
- ) : (
- <>
-
-
- Errors
- {JSON.stringify(errors, null, 2)}
-
- >
- )}
-
-
-
-
- );
-}
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) => (