+ {isToggled && !!showIfToggled && showIfToggled}
6) {
- hexColor = hexColor.slice(0, 6);
- }
-
- const r = parseInt(hexColor.substring(0, 2), 16);
- const g = parseInt(hexColor.substring(2, 4), 16);
- const b = parseInt(hexColor.substring(4, 6), 16);
-
- return { r, g, b };
-}
-
-export function parseColorForHex(colorVar: string): string {
- const value = getComputedStyle(document.documentElement).getPropertyValue(
- colorVar,
- );
- if (value.startsWith("#")) {
- return value.slice(0, 7);
- }
-
- // Parse rgb/rgba
- const rgbValues = value
- .slice(value.startsWith("rgba") ? 5 : 4, -1)
- .split(",")
- .map((x) => x.trim())
- .filter((_, i) => i < 3) // Only take the first 3 values (RGB, ignore alpha)
- .map((x) => parseInt(x, 10));
-
- let hex =
- "#" +
- rgbValues
- .map((x) => x.toString(16))
- .map((x) => (x.length === 1 ? "0" + x : x))
- .join("");
-
- return hex;
-}
+export const vscInputBackground = varWithFallback("input-background");
+export const vscQuickInputBackground = varWithFallback("input-background");
+export const vscBackground = varWithFallback("background");
+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 vscListActiveBackground = varWithFallback("list-active");
+export const vscFocusBorder = varWithFallback("border-focus");
+export const vscListActiveForeground = varWithFallback(
+ "list-active-foreground",
+);
+export const vscInputBorder = varWithFallback("input-border");
+export const vscInputBorderFocus = varWithFallback("border-focus");
+export const vscBadgeBackground = varWithFallback("badge-background");
+export const vscBadgeForeground = varWithFallback("badge-foreground");
+export const vscCommandCenterActiveBorder = varWithFallback(
+ "command-border-focus",
+);
+export const vscCommandCenterInactiveBorder = varWithFallback("command-border");
export const Button = styled.button`
padding: 6px 12px;
@@ -158,7 +75,7 @@ export const GhostButton = styled.button`
border: none;
color: ${vscForeground};
- background-color: rgba(255, 255, 255, 0.08);
+ background-color: rgba(128, 128, 128, 0.4);
&:disabled {
color: gray;
pointer-events: none;
@@ -226,10 +143,6 @@ export const Input = styled.input`
}
`;
-export const Label = styled.label<{ fontSize?: number }>`
- font-size: ${(props) => props.fontSize || getFontSize()}px;
-`;
-
export const HeaderButton = styled.button<{
inverted: boolean | undefined;
backgroundColor?: string;
diff --git a/gui/src/components/mainInput/CodeToEditCard.tsx b/gui/src/components/mainInput/CodeToEditCard.tsx
index ae31bb684..1c22f5ddf 100644
--- a/gui/src/components/mainInput/CodeToEditCard.tsx
+++ b/gui/src/components/mainInput/CodeToEditCard.tsx
@@ -1,5 +1,5 @@
import { ChevronRightIcon, XMarkIcon } from "@heroicons/react/24/outline";
-import { CodeToEdit } from "core";
+import { SetCodeToEditPayload } from "core";
import { getMarkdownLanguageTagForFile } from "core/util";
import { getUriPathBasename } from "core/util/uri";
import { useContext, useMemo, useState } from "react";
@@ -26,7 +26,7 @@ const NoPaddingWrapper = styled.div`
`;
interface CodeToEditItemProps {
- code: CodeToEdit;
+ code: SetCodeToEditPayload;
}
function CodeToEditItem({ code }: CodeToEditItemProps) {
@@ -143,6 +143,7 @@ function CodeToEditItem({ code }: CodeToEditItemProps) {
);
}
+
export default function CodeToEditCard() {
// Array from previous multi-file edit
const codeToEditArray = useAppSelector(
diff --git a/gui/src/components/mainInput/ContinueInputBox.tsx b/gui/src/components/mainInput/ContinueInputBox.tsx
index c9a151079..f3880249e 100644
--- a/gui/src/components/mainInput/ContinueInputBox.tsx
+++ b/gui/src/components/mainInput/ContinueInputBox.tsx
@@ -1,11 +1,12 @@
import { Editor, JSONContent } from "@tiptap/react";
-import { ContextItemWithId, InputModifiers } from "core";
+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 { ToolbarOptions } from "./InputToolbar";
import { Lump } from "./Lump";
import { TipTapEditor } from "./TipTapEditor";
@@ -20,6 +21,7 @@ interface ContinueInputBoxProps {
) => void;
editorState?: JSONContent;
contextItems?: ContextItemWithId[];
+ appliedRules?: RuleWithSource[];
hidden?: boolean;
inputId: string; // used to keep track of things per input in redux
}
@@ -116,6 +118,8 @@ function ContinueInputBox(props: ContinueInputBoxProps) {
}
: {};
+ const { appliedRules = [], contextItems = [] } = props;
+
return (