Skip to content

UI Polish #6318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .continue/rules/css-units.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
globs: "gui/**/*.tsx"
---

You should try to use the `rem` CSS unit whenever possible for scalability instead of `px`.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ class GetTheme {
val findMatchSelectedBackground = namedColor("SearchMatch.selectedBackground") ?:
editorScheme.getAttributes(EditorColors.SEARCH_RESULT_ATTRIBUTES)?.backgroundColor

// Use editor background with slight tint for code blocks
val textCodeBlockBackground = slightChange(editorBackground, 3) ?: editorBackground

// These should match the keys in GUI's theme.ts
val theme = mapOf(
"background" to background,
Expand Down Expand Up @@ -197,6 +200,7 @@ class GetTheme {
"warning" to warningColor,
"error" to errorColor,
"link" to link,
"textCodeBlockBackground" to textCodeBlockBackground,
"accent" to accentColor,
"find-match" to findMatchBackground,
"find-match-selected" to findMatchSelectedBackground,
Expand Down
3 changes: 1 addition & 2 deletions gui/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { OnboardingModes } from "core/protocol/core";
import { useContext, useEffect } from "react";
import { Outlet, useLocation, useNavigate } from "react-router-dom";
import styled from "styled-components";
import { CustomScrollbarDiv, defaultBorderRadius } from ".";
import { CustomScrollbarDiv } from ".";
import { AuthProvider } from "../context/Auth";
import { IdeMessengerContext } from "../context/IdeMessenger";
import { LocalStorageProvider } from "../context/LocalStorage";
Expand Down Expand Up @@ -30,7 +30,6 @@ import PostHogPageView from "./PosthogPageView";

const LayoutTopDiv = styled(CustomScrollbarDiv)`
height: 100%;
border-radius: ${defaultBorderRadius};
position: relative;
overflow-x: hidden;
`;
Expand Down
3 changes: 1 addition & 2 deletions gui/src/components/StyledMarkdownPreview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,14 @@ const StyledMarkdown = styled.div<{
display: none;
}
word-wrap: break-word;
border-radius: ${defaultBorderRadius};
border-radius: 0.3125rem;
background-color: ${vscEditorBackground};
font-size: ${getFontSize() - 2}px;
font-family: var(--vscode-editor-font-family);
}

code:not(pre > code) {
font-family: var(--vscode-editor-font-family);
color: var(--vscode-input-placeholderForeground);
}

background-color: ${(props) => props.bgColor};
Expand Down
5 changes: 4 additions & 1 deletion gui/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from "styled-components";
import { varWithFallback } from "../styles/theme";

export const defaultBorderRadius = "5px";
export const defaultBorderRadius = "0.5rem";
export const lightGray = "#999998";
export const greenButtonColor = "#189e72";

Expand All @@ -12,6 +12,9 @@ export const vscForeground = varWithFallback("foreground");
export const vscButtonBackground = varWithFallback("primary-background");
export const vscButtonForeground = varWithFallback("primary-foreground");
export const vscEditorBackground = varWithFallback("editor-background");
export const vscTextCodeBlockBackground = varWithFallback(
"textCodeBlockBackground",
);
export const vscListActiveBackground = varWithFallback("list-active");
export const vscFocusBorder = varWithFallback("border-focus");
export const vscListActiveForeground = varWithFallback(
Expand Down
40 changes: 2 additions & 38 deletions gui/src/components/mainInput/ContinueInputBox.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Editor, JSONContent } from "@tiptap/react";
import { ContextItemWithId, InputModifiers, RuleWithSource } from "core";
import { useMemo } from "react";
import styled, { keyframes } from "styled-components";
import { defaultBorderRadius, vscBackground } from "..";
import { useAppSelector } from "../../redux/hooks";
import { selectSlashCommandComboBoxInputs } from "../../redux/selectors";
import { ContextItemsPeek } from "./belowMainInput/ContextItemsPeek";
import { RulesPeek } from "./belowMainInput/RulesPeek";
import { GradientBorder } from "./GradientBorder";
import { ToolbarOptions } from "./InputToolbar";
import { Lump } from "./Lump";
import { TipTapEditor } from "./TipTapEditor";
Expand Down Expand Up @@ -38,43 +38,6 @@ const EDIT_DISALLOWED_CONTEXT_PROVIDERS = [
"repo-map",
];

const gradient = keyframes`
0% {
background-position: 0px 0;
}
100% {
background-position: 100em 0;
}
`;

const GradientBorder = styled.div<{
borderRadius?: string;
borderColor?: string;
loading: 0 | 1;
}>`
border-radius: ${(props) => props.borderRadius || "0"};
padding: 1px;
background: ${(props) =>
props.borderColor
? props.borderColor
: `repeating-linear-gradient(
101.79deg,
#1BBE84 0%,
#331BBE 16%,
#BE1B55 33%,
#A6BE1B 55%,
#BE1B55 67%,
#331BBE 85%,
#1BBE84 99%
)`};
animation: ${(props) => (props.loading ? gradient : "")} 6s linear infinite;
background-size: 200% 200%;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
`;

function ContinueInputBox(props: ContinueInputBoxProps) {
const isStreaming = useAppSelector((state) => state.session.isStreaming);
const availableSlashCommands = useAppSelector(
Expand Down Expand Up @@ -146,6 +109,7 @@ function ContinueInputBox(props: ContinueInputBoxProps) {
/>
</GradientBorder>
</div>

{(appliedRules.length > 0 || contextItems.length > 0) && (
<div className="mt-2 flex flex-col">
<RulesPeek appliedRules={props.appliedRules} />
Expand Down
38 changes: 38 additions & 0 deletions gui/src/components/mainInput/GradientBorder.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import styled, { keyframes } from "styled-components";

const gradient = keyframes`
0% {
background-position: 0px 0;
}
100% {
background-position: 100em 0;
}
`;

export const GradientBorder = styled.div<{
borderRadius?: string;
borderColor?: string;
loading: 0 | 1;
}>`
border-radius: ${(props) => props.borderRadius || "0"};
padding: 1px;
background: ${(props) =>
props.borderColor
? props.borderColor
: `repeating-linear-gradient(
101.79deg,
#1BBE84 0%,
#331BBE 16%,
#BE1B55 33%,
#A6BE1B 55%,
#BE1B55 67%,
#331BBE 85%,
#1BBE84 99%
)`};
animation: ${(props) => (props.loading ? gradient : "")} 6s linear infinite;
background-size: 200% 200%;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
`;
3 changes: 1 addition & 2 deletions gui/src/components/mainInput/InputToolbar/EnterButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import styled from "styled-components";
import {
defaultBorderRadius,
lightGray,
vscButtonBackground,
vscButtonForeground,
Expand All @@ -18,7 +17,7 @@ export const EnterButton = styled.button<{ isPrimary?: boolean }>`
!props.disabled && props.isPrimary
? vscButtonBackground
: lightGray + "33"};
border-radius: ${defaultBorderRadius};
border-radius: 0.3125rem;
color: ${(props) =>
!props.disabled && props.isPrimary ? vscButtonForeground : vscForeground};
cursor: pointer;
Expand Down
4 changes: 2 additions & 2 deletions gui/src/components/mainInput/Lump/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { SelectedSection } from "./sections/SelectedSection";

const LumpDiv = styled.div`
background-color: ${vscInputBackground};
margin-left: 4px;
margin-right: 4px;
margin-left: 6px;
margin-right: 6px;
border-radius: ${defaultBorderRadius} ${defaultBorderRadius} 0 0;
border-top: 1px solid ${vscCommandCenterInactiveBorder};
border-left: 1px solid ${vscCommandCenterInactiveBorder};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ export function TipTapEditor(props: TipTapEditorProps) {
onBlur={handleBlur}
onKeyDown={handleKeyDown}
onKeyUp={handleKeyUp}
className={shouldHideToolbar ? "cursor-default" : "cursor-text"}
className={
!props.isMainInput && shouldHideToolbar
? "cursor-pointer hover:brightness-105"
: "cursor-text"
}
onClick={() => {
editor?.commands.focus();
}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import styled from "styled-components";
import {
defaultBorderRadius,
lightGray,
vscBadgeBackground,
vscCommandCenterActiveBorder,
Expand All @@ -14,7 +13,7 @@ import { getFontSize } from "../../../../util";
export const InputBoxDiv = styled.div<{}>`
resize: none;
font-family: inherit;
border-radius: ${defaultBorderRadius};
border-radius: 0.5rem;
padding-bottom: 1px;
margin: 0;
height: auto;
Expand Down
4 changes: 4 additions & 0 deletions gui/src/styles/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ export const THEME_COLORS = {
vars: ["--vscode-textLink-foreground"],
default: "#5c9ce6", // medium blue
},
textCodeBlockBackground: {
vars: ["--vscode-textCodeBlock-background"],
default: "#1e1e1e", // same as editor-background
},
accent: {
vars: ["--vscode-tab-activeBorderTop", "--vscode-focusBorder"],
default: "#4d8bf0", // bright blue
Expand Down
2 changes: 1 addition & 1 deletion gui/tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = {
"spin-slow": "spin 6s linear infinite",
},
borderRadius: {
default: "5px",
default: "0.5rem",
},
colors: {
background: varWithFallback("background"),
Expand Down
Loading