Elffuss BraidHub

kikocis/continue public

Merge pull request #6318 from continuedev/nate/diff-tool

UI Polish
Changeset1b82fee9b1defbbe5ab328b560f7b36c2caca337e5d3950a57fb92971c2b5bae
AuthorNate Sesti <33237525+sestinj@users.noreply.github.com> · 2025-07-03 18:12 -07:00
CommitterGitHub <noreply@github.com> · 2025-07-03 18:12 -07:00
Parents9d00fb246880, f377ad524836

Browse the files at this changeset

13 files changed

added .continue/rules/css-units.md +5 −0
@@ -0,0 +1,5 @@
1+---
2+globs: "gui/**/*.tsx"
3+---
4+
5+You should try to use the `rem` CSS unit whenever possible for scalability instead of `px`.
modified extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/GetTheme.kt +4 −0
@@ -166,6 +166,9 @@
166166 val findMatchSelectedBackground = namedColor("SearchMatch.selectedBackground") ?:
167167 editorScheme.getAttributes(EditorColors.SEARCH_RESULT_ATTRIBUTES)?.backgroundColor
168168
169+ // Use editor background with slight tint for code blocks
170+ val textCodeBlockBackground = slightChange(editorBackground, 3) ?: editorBackground
171+
169172 // These should match the keys in GUI's theme.ts
170173 val theme = mapOf(
171174 "background" to background,
@@ -197,6 +200,7 @@
197200 "warning" to warningColor,
198201 "error" to errorColor,
199202 "link" to link,
203+ "textCodeBlockBackground" to textCodeBlockBackground,
200204 "accent" to accentColor,
201205 "find-match" to findMatchBackground,
202206 "find-match-selected" to findMatchSelectedBackground,
modified gui/src/components/Layout.tsx +1 −2
@@ -2,7 +2,7 @@
22 import { useContext, useEffect } from "react";
33 import { Outlet, useLocation, useNavigate } from "react-router-dom";
44 import styled from "styled-components";
5-import { CustomScrollbarDiv, defaultBorderRadius } from ".";
5+import { CustomScrollbarDiv } from ".";
66 import { AuthProvider } from "../context/Auth";
77 import { IdeMessengerContext } from "../context/IdeMessenger";
88 import { LocalStorageProvider } from "../context/LocalStorage";
@@ -31,7 +31,6 @@
3131
3232 const LayoutTopDiv = styled(CustomScrollbarDiv)`
3333 height: 100%;
34- border-radius: ${defaultBorderRadius};
3534 position: relative;
3635 overflow-x: hidden;
3736 `;
modified gui/src/components/StyledMarkdownPreview/index.tsx +1 −2
@@ -76,7 +76,7 @@
7676 display: none;
7777 }
7878 word-wrap: break-word;
79- border-radius: ${defaultBorderRadius};
79+ border-radius: 0.3125rem;
8080 background-color: ${vscEditorBackground};
8181 font-size: ${getFontSize() - 2}px;
8282 font-family: var(--vscode-editor-font-family);
@@ -84,7 +84,6 @@
8484
8585 code:not(pre > code) {
8686 font-family: var(--vscode-editor-font-family);
87- color: var(--vscode-input-placeholderForeground);
8887 }
8988
9089 background-color: ${(props) => props.bgColor};
modified gui/src/components/index.ts +4 −1
@@ -1,7 +1,7 @@
11 import styled, { keyframes } from "styled-components";
22 import { varWithFallback } from "../styles/theme";
33
4-export const defaultBorderRadius = "5px";
4+export const defaultBorderRadius = "0.5rem";
55 export const lightGray = "#999998";
66 export const greenButtonColor = "#189e72";
77
@@ -12,6 +12,9 @@
1212 export const vscButtonBackground = varWithFallback("primary-background");
1313 export const vscButtonForeground = varWithFallback("primary-foreground");
1414 export const vscEditorBackground = varWithFallback("editor-background");
15+export const vscTextCodeBlockBackground = varWithFallback(
16+ "textCodeBlockBackground",
17+);
1518 export const vscListActiveBackground = varWithFallback("list-active");
1619 export const vscFocusBorder = varWithFallback("border-focus");
1720 export const vscListActiveForeground = varWithFallback(
modified gui/src/components/mainInput/ContinueInputBox.tsx +2 −38
@@ -1,12 +1,12 @@
11 import { Editor, JSONContent } from "@tiptap/react";
22 import { ContextItemWithId, InputModifiers, RuleWithSource } from "core";
33 import { useMemo } from "react";
4-import styled, { keyframes } from "styled-components";
54 import { defaultBorderRadius, vscBackground } from "..";
65 import { useAppSelector } from "../../redux/hooks";
76 import { selectSlashCommandComboBoxInputs } from "../../redux/selectors";
87 import { ContextItemsPeek } from "./belowMainInput/ContextItemsPeek";
98 import { RulesPeek } from "./belowMainInput/RulesPeek";
9+import { GradientBorder } from "./GradientBorder";
1010 import { ToolbarOptions } from "./InputToolbar";
1111 import { Lump } from "./Lump";
1212 import { TipTapEditor } from "./TipTapEditor";
@@ -38,43 +38,6 @@
3838 "repo-map",
3939 ];
4040
41-const gradient = keyframes`
42- 0% {
43- background-position: 0px 0;
44- }
45- 100% {
46- background-position: 100em 0;
47- }
48-`;
49-
50-const GradientBorder = styled.div<{
51- borderRadius?: string;
52- borderColor?: string;
53- loading: 0 | 1;
54-}>`
55- border-radius: ${(props) => props.borderRadius || "0"};
56- padding: 1px;
57- background: ${(props) =>
58- props.borderColor
59- ? props.borderColor
60- : `repeating-linear-gradient(
61- 101.79deg,
62- #1BBE84 0%,
63- #331BBE 16%,
64- #BE1B55 33%,
65- #A6BE1B 55%,
66- #BE1B55 67%,
67- #331BBE 85%,
68- #1BBE84 99%
69- )`};
70- animation: ${(props) => (props.loading ? gradient : "")} 6s linear infinite;
71- background-size: 200% 200%;
72- width: 100%;
73- display: flex;
74- flex-direction: row;
75- align-items: center;
76-`;
77-
7841 function ContinueInputBox(props: ContinueInputBoxProps) {
7942 const isStreaming = useAppSelector((state) => state.session.isStreaming);
8043 const availableSlashCommands = useAppSelector(
@@ -146,6 +109,7 @@
146109 />
147110 </GradientBorder>
148111 </div>
112+
149113 {(appliedRules.length > 0 || contextItems.length > 0) && (
150114 <div className="mt-2 flex flex-col">
151115 <RulesPeek appliedRules={props.appliedRules} />
added gui/src/components/mainInput/GradientBorder.tsx +38 −0
@@ -0,0 +1,38 @@
1+import styled, { keyframes } from "styled-components";
2+
3+const gradient = keyframes`
4+ 0% {
5+ background-position: 0px 0;
6+ }
7+ 100% {
8+ background-position: 100em 0;
9+ }
10+`;
11+
12+export const GradientBorder = styled.div<{
13+ borderRadius?: string;
14+ borderColor?: string;
15+ loading: 0 | 1;
16+}>`
17+ border-radius: ${(props) => props.borderRadius || "0"};
18+ padding: 1px;
19+ background: ${(props) =>
20+ props.borderColor
21+ ? props.borderColor
22+ : `repeating-linear-gradient(
23+ 101.79deg,
24+ #1BBE84 0%,
25+ #331BBE 16%,
26+ #BE1B55 33%,
27+ #A6BE1B 55%,
28+ #BE1B55 67%,
29+ #331BBE 85%,
30+ #1BBE84 99%
31+ )`};
32+ animation: ${(props) => (props.loading ? gradient : "")} 6s linear infinite;
33+ background-size: 200% 200%;
34+ width: 100%;
35+ display: flex;
36+ flex-direction: row;
37+ align-items: center;
38+`;
modified gui/src/components/mainInput/InputToolbar/EnterButton.tsx +1 −2
@@ -1,6 +1,5 @@
11 import styled from "styled-components";
22 import {
3- defaultBorderRadius,
43 lightGray,
54 vscButtonBackground,
65 vscButtonForeground,
@@ -18,7 +17,7 @@
1817 !props.disabled && props.isPrimary
1918 ? vscButtonBackground
2019 : lightGray + "33"};
21- border-radius: ${defaultBorderRadius};
20+ border-radius: 0.3125rem;
2221 color: ${(props) =>
2322 !props.disabled && props.isPrimary ? vscButtonForeground : vscForeground};
2423 cursor: pointer;
modified gui/src/components/mainInput/Lump/index.tsx +2 −2
@@ -10,8 +10,8 @@
1010
1111 const LumpDiv = styled.div`
1212 background-color: ${vscInputBackground};
13- margin-left: 4px;
14- margin-right: 4px;
13+ margin-left: 6px;
14+ margin-right: 6px;
1515 border-radius: ${defaultBorderRadius} ${defaultBorderRadius} 0 0;
1616 border-top: 1px solid ${vscCommandCenterInactiveBorder};
1717 border-left: 1px solid ${vscCommandCenterInactiveBorder};
modified gui/src/components/mainInput/TipTapEditor/TipTapEditor.tsx +5 −1
@@ -179,7 +179,11 @@
179179 onBlur={handleBlur}
180180 onKeyDown={handleKeyDown}
181181 onKeyUp={handleKeyUp}
182- className={shouldHideToolbar ? "cursor-default" : "cursor-text"}
182+ className={
183+ !props.isMainInput && shouldHideToolbar
184+ ? "cursor-pointer hover:brightness-105"
185+ : "cursor-text"
186+ }
183187 onClick={() => {
184188 editor?.commands.focus();
185189 }}
modified gui/src/components/mainInput/TipTapEditor/components/StyledComponents.ts +1 −2
@@ -1,6 +1,5 @@
11 import styled from "styled-components";
22 import {
3- defaultBorderRadius,
43 lightGray,
54 vscBadgeBackground,
65 vscCommandCenterActiveBorder,
@@ -14,7 +13,7 @@
1413 export const InputBoxDiv = styled.div<{}>`
1514 resize: none;
1615 font-family: inherit;
17- border-radius: ${defaultBorderRadius};
16+ border-radius: 0.5rem;
1817 padding-bottom: 1px;
1918 margin: 0;
2019 height: auto;
modified gui/src/styles/theme.ts +4 −0
@@ -140,6 +140,10 @@
140140 vars: ["--vscode-textLink-foreground"],
141141 default: "#5c9ce6", // medium blue
142142 },
143+ textCodeBlockBackground: {
144+ vars: ["--vscode-textCodeBlock-background"],
145+ default: "#1e1e1e", // same as editor-background
146+ },
143147 accent: {
144148 vars: ["--vscode-tab-activeBorderTop", "--vscode-focusBorder"],
145149 default: "#4d8bf0", // bright blue
modified gui/tailwind.config.cjs +1 −1
@@ -27,7 +27,7 @@
2727 "spin-slow": "spin 6s linear infinite",
2828 },
2929 borderRadius: {
30- default: "5px",
30+ default: "0.5rem",
3131 },
3232 colors: {
3333 background: varWithFallback("background"),