feat: streaming input w/ history to rule dialog
This commit is contained in:
parent
a2adf2fe98
commit
44094aa163
10 changed files with 368 additions and 94 deletions
|
|
@ -12,7 +12,7 @@ export interface FeedbackButtonsProps {
|
|||
item: ChatHistoryItem;
|
||||
}
|
||||
|
||||
export default function FeedbackButtons({ item }: FeedbackButtonsProps) {
|
||||
export function FeedbackButtons({ item }: FeedbackButtonsProps) {
|
||||
const [feedback, setFeedback] = useState<boolean | undefined>(undefined);
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
const sessionId = useAppSelector((store) => store.session.id);
|
||||
|
|
@ -41,7 +41,7 @@ export default function FeedbackButtons({ item }: FeedbackButtonsProps) {
|
|||
onClick={() => sendFeedback(true)}
|
||||
>
|
||||
<HandThumbUpIcon
|
||||
className={`mx-0.5 h-3.5 w-3.5 ${feedback === true ? "text-green-400" : "text-gray-500"}`}
|
||||
className={`mx-0.5 h-3.5 w-3.5 ${feedback === true ? "text-success" : "text-description-muted"}`}
|
||||
/>
|
||||
</HeaderButtonWithToolTip>
|
||||
<HeaderButtonWithToolTip
|
||||
|
|
@ -50,7 +50,7 @@ export default function FeedbackButtons({ item }: FeedbackButtonsProps) {
|
|||
onClick={() => sendFeedback(false)}
|
||||
>
|
||||
<HandThumbDownIcon
|
||||
className={`h-3.5 w-3.5 ${feedback === false ? "text-red-400" : "text-gray-500"}`}
|
||||
className={`h-3.5 w-3.5 ${feedback === false ? "text-error" : "text-description-muted"}`}
|
||||
/>
|
||||
</HeaderButtonWithToolTip>
|
||||
</>
|
||||
|
|
|
|||
95
gui/src/components/GenerateRuleDialog/GenerationScreen.tsx
Normal file
95
gui/src/components/GenerateRuleDialog/GenerationScreen.tsx
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
import { useEffect, useRef, useState } from "react";
|
||||
import Spinner from "../gui/Spinner";
|
||||
import { Button } from "../ui";
|
||||
|
||||
interface GenerationScreenProps {
|
||||
generatedContent: string;
|
||||
isGenerating: boolean;
|
||||
error: string | null;
|
||||
onBack: () => void;
|
||||
onContinue: () => void;
|
||||
}
|
||||
|
||||
export function GenerationScreen({
|
||||
generatedContent,
|
||||
isGenerating,
|
||||
error,
|
||||
onBack,
|
||||
onContinue,
|
||||
}: GenerationScreenProps) {
|
||||
const [editableContent, setEditableContent] = useState("");
|
||||
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
||||
|
||||
// Update editable content when generation completes
|
||||
useEffect(() => {
|
||||
if (!isGenerating && generatedContent) {
|
||||
setEditableContent(generatedContent);
|
||||
}
|
||||
}, [isGenerating, generatedContent]);
|
||||
|
||||
// Auto-scroll textarea as content streams in
|
||||
useEffect(() => {
|
||||
if (textareaRef.current && isGenerating) {
|
||||
textareaRef.current.scrollTop = textareaRef.current.scrollHeight;
|
||||
}
|
||||
}, [generatedContent, isGenerating]);
|
||||
|
||||
const displayContent = isGenerating ? generatedContent : editableContent;
|
||||
const showSpinner = isGenerating && !generatedContent;
|
||||
|
||||
return (
|
||||
<div className="px-2 pb-2 pt-4 sm:px-4">
|
||||
<div>
|
||||
<div className="text-center">
|
||||
<h2 className="mb-0">Your rule</h2>
|
||||
<p className="text-description m-0 mt-2 p-0">
|
||||
Review and edit your generated rule below
|
||||
</p>
|
||||
</div>
|
||||
<div className="mt-5">
|
||||
<div className="flex flex-col gap-4">
|
||||
<div className="relative">
|
||||
<textarea
|
||||
ref={textareaRef}
|
||||
className="border-input-border bg-input text-input-foreground placeholder:text-input-placeholder focus:border-border-focus box-border w-full resize-none rounded border p-2 text-xs focus:outline-none"
|
||||
rows={10}
|
||||
value={displayContent}
|
||||
onChange={(e) => setEditableContent(e.target.value)}
|
||||
disabled={isGenerating}
|
||||
placeholder={
|
||||
showSpinner ? "" : "Your generated rule will appear here..."
|
||||
}
|
||||
/>
|
||||
{showSpinner && (
|
||||
<div className="absolute left-2 top-2">
|
||||
<Spinner />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{error && <p className="text-sm text-red-500">{error}</p>}
|
||||
|
||||
<div className="flex flex-row justify-center gap-5">
|
||||
<Button
|
||||
type="button"
|
||||
className="min-w-16"
|
||||
onClick={onBack}
|
||||
variant="outline"
|
||||
disabled={isGenerating}
|
||||
>
|
||||
Back
|
||||
</Button>
|
||||
<Button
|
||||
className="min-w-16"
|
||||
onClick={onContinue}
|
||||
disabled={isGenerating || (!generatedContent && !error)}
|
||||
>
|
||||
Continue
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
81
gui/src/components/GenerateRuleDialog/InputScreen.tsx
Normal file
81
gui/src/components/GenerateRuleDialog/InputScreen.tsx
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
import React from "react";
|
||||
import { Button } from "../ui";
|
||||
import { RuleTemplateChip } from "./RuleTemplateChip";
|
||||
import { RuleTemplate, ruleTemplates } from "./ruleTemplates";
|
||||
|
||||
interface InputScreenProps {
|
||||
inputPrompt: string;
|
||||
setInputPrompt: (value: string) => void;
|
||||
onGenerate: (prompt: string) => void;
|
||||
onCancel: () => void;
|
||||
onRuleTemplateClick: (template: RuleTemplate) => void;
|
||||
}
|
||||
|
||||
export function InputScreen({
|
||||
inputPrompt,
|
||||
setInputPrompt,
|
||||
onGenerate,
|
||||
onCancel,
|
||||
onRuleTemplateClick,
|
||||
}: InputScreenProps) {
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
|
||||
if (!inputPrompt.trim()) {
|
||||
return;
|
||||
}
|
||||
|
||||
onGenerate(inputPrompt);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="px-2 pb-2 pt-4 sm:px-4">
|
||||
<div>
|
||||
<div className="text-center">
|
||||
<h2 className="mb-0">Generate Rule</h2>
|
||||
<p className="text-description m-0 mt-2 p-0">
|
||||
This will generate a new rule using the content of your chat history
|
||||
</p>
|
||||
</div>
|
||||
<div className="mt-5">
|
||||
<form onSubmit={handleSubmit} className="flex flex-col gap-1">
|
||||
<div className="flex flex-col gap-2">
|
||||
<textarea
|
||||
className="border-input-border bg-input text-input-foreground placeholder:text-input-placeholder focus:border-border-focus box-border w-full resize-none rounded border p-2 text-xs focus:outline-none"
|
||||
placeholder="Describe your rule..."
|
||||
rows={5}
|
||||
value={inputPrompt}
|
||||
onChange={(e) => setInputPrompt(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-2 flex flex-wrap items-center justify-center gap-2">
|
||||
{ruleTemplates.map((template, index) => (
|
||||
<RuleTemplateChip
|
||||
key={index}
|
||||
icon={template.icon}
|
||||
text={template.title}
|
||||
onClick={() => onRuleTemplateClick(template)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="mt-4 flex flex-row justify-center gap-5">
|
||||
<Button
|
||||
type="button"
|
||||
className="min-w-16"
|
||||
onClick={onCancel}
|
||||
variant="outline"
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button className="min-w-16" disabled={!inputPrompt.trim()}>
|
||||
Generate
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,84 +1,86 @@
|
|||
import { useContext, useState } from "react";
|
||||
import { useContext, useEffect, useState } from "react";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { useAppSelector } from "../../redux/hooks";
|
||||
import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice";
|
||||
import { Button } from "../ui";
|
||||
import { RuleTemplateChip } from "./RuleTemplateChip";
|
||||
import { RuleTemplate, ruleTemplates } from "./ruleTemplates";
|
||||
import { GenerationScreen } from "./GenerationScreen";
|
||||
import { InputScreen } from "./InputScreen";
|
||||
import { RuleTemplate } from "./ruleTemplates";
|
||||
import { useRuleGeneration } from "./useRuleGeneration";
|
||||
|
||||
function GenerateRuleDialog() {
|
||||
type Screen = "input" | "generation";
|
||||
|
||||
export function GenerateRuleDialog() {
|
||||
const dispatch = useDispatch();
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
const [textareaValue, setTextareaValue] = useState("");
|
||||
const [screen, setScreen] = useState<Screen>("input");
|
||||
const [inputPrompt, setInputPrompt] = useState("");
|
||||
|
||||
const { generateRule, generatedContent, isGenerating, error, reset } =
|
||||
useRuleGeneration();
|
||||
|
||||
const showDialog = useAppSelector((state) => state.ui.showDialog);
|
||||
|
||||
const lastChatMessage = useAppSelector(
|
||||
(state) => state.session.history[state.session.history.length - 1],
|
||||
);
|
||||
|
||||
// Reset dialog state when it closes (handles outside clicks and X button)
|
||||
useEffect(() => {
|
||||
if (!showDialog) {
|
||||
reset();
|
||||
setScreen("input");
|
||||
setInputPrompt("");
|
||||
}
|
||||
}, [showDialog, reset]);
|
||||
|
||||
const closeDialog = () => {
|
||||
reset();
|
||||
setScreen("input");
|
||||
setInputPrompt("");
|
||||
dispatch(setDialogMessage(undefined));
|
||||
dispatch(setShowDialog(false));
|
||||
};
|
||||
|
||||
function onSubmit(e: any) {
|
||||
e.preventDefault();
|
||||
// Logic to generate rule will go here
|
||||
closeDialog();
|
||||
}
|
||||
const handleGenerate = async (prompt: string) => {
|
||||
setInputPrompt(prompt);
|
||||
setScreen("generation");
|
||||
await generateRule(prompt);
|
||||
};
|
||||
|
||||
function handleRuleTemplateClick(ruleTemplate: RuleTemplate) {
|
||||
setTextareaValue(ruleTemplate.template);
|
||||
const handleBack = () => {
|
||||
reset();
|
||||
setScreen("input");
|
||||
};
|
||||
|
||||
const handleContinue = () => {
|
||||
// TODO: This will handle saving the generated rule
|
||||
closeDialog();
|
||||
};
|
||||
|
||||
const handleRuleTemplateClick = (ruleTemplate: RuleTemplate) => {
|
||||
setInputPrompt(ruleTemplate.template);
|
||||
};
|
||||
|
||||
if (screen === "input") {
|
||||
return (
|
||||
<InputScreen
|
||||
inputPrompt={inputPrompt}
|
||||
setInputPrompt={setInputPrompt}
|
||||
onGenerate={handleGenerate}
|
||||
onCancel={closeDialog}
|
||||
onRuleTemplateClick={handleRuleTemplateClick}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="px-2 pb-2 pt-4 sm:px-4">
|
||||
<div>
|
||||
<div className="text-center">
|
||||
<h2 className="mb-0">Generate Rule</h2>
|
||||
<p className="text-description m-0 mt-2 p-0">
|
||||
This will generate a new rule using the content of your chat history
|
||||
</p>
|
||||
</div>
|
||||
<div className="mt-5">
|
||||
<form onSubmit={onSubmit} className="flex flex-col gap-1">
|
||||
<div className="flex flex-col gap-2">
|
||||
<textarea
|
||||
className="border-input-border bg-input text-input-foreground placeholder:text-input-placeholder focus:border-border-focus min-w-0 max-w-full resize-none rounded border p-2 text-sm text-xs focus:outline-none"
|
||||
placeholder="Describe your rule..."
|
||||
rows={4}
|
||||
value={textareaValue}
|
||||
onChange={(e) => setTextareaValue(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-4 flex flex-wrap items-center justify-center gap-2">
|
||||
{ruleTemplates.map((template, index) => (
|
||||
<RuleTemplateChip
|
||||
key={index}
|
||||
icon={template.icon}
|
||||
text={template.title}
|
||||
onClick={() => handleRuleTemplateClick(template)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="mt-4 flex flex-row justify-center gap-5">
|
||||
<Button
|
||||
type="button"
|
||||
className="min-w-16"
|
||||
onClick={closeDialog}
|
||||
variant="outline"
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button className="min-w-16">Generate</Button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<GenerationScreen
|
||||
generatedContent={generatedContent}
|
||||
isGenerating={isGenerating}
|
||||
error={error}
|
||||
onBack={handleBack}
|
||||
onContinue={handleContinue}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default GenerateRuleDialog;
|
||||
|
|
|
|||
96
gui/src/components/GenerateRuleDialog/useRuleGeneration.ts
Normal file
96
gui/src/components/GenerateRuleDialog/useRuleGeneration.ts
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
import { ChatMessage } from "core";
|
||||
import { useCallback, useContext, useState } from "react";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { useAppSelector } from "../../redux/hooks";
|
||||
import { selectSelectedChatModel } from "../../redux/slices/configSlice";
|
||||
|
||||
interface UseRuleGenerationReturn {
|
||||
generateRule: (prompt: string) => Promise<void>;
|
||||
generatedContent: string;
|
||||
isGenerating: boolean;
|
||||
error: string | null;
|
||||
reset: () => void;
|
||||
}
|
||||
|
||||
export function useRuleGeneration(): UseRuleGenerationReturn {
|
||||
const [generatedContent, setGeneratedContent] = useState("");
|
||||
const [isGenerating, setIsGenerating] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
const currentHistory = useAppSelector((state) => state.session.history);
|
||||
const selectedChatModel = useAppSelector(selectSelectedChatModel);
|
||||
|
||||
const generateRule = useCallback(
|
||||
async (prompt: string) => {
|
||||
if (!selectedChatModel) {
|
||||
setError("No chat model selected");
|
||||
return;
|
||||
}
|
||||
|
||||
setIsGenerating(true);
|
||||
setError(null);
|
||||
setGeneratedContent("");
|
||||
|
||||
try {
|
||||
// Convert current history to ChatMessage format
|
||||
const chatMessages: ChatMessage[] = currentHistory.map(
|
||||
(item) => item.message,
|
||||
);
|
||||
|
||||
// Add our rule generation prompt
|
||||
const messages: ChatMessage[] = [
|
||||
...chatMessages,
|
||||
{
|
||||
role: "user",
|
||||
content: `The user has requested that we write a new rule. Here is their request: ${prompt}`,
|
||||
},
|
||||
];
|
||||
|
||||
// Create abort controller for this request
|
||||
const abortController = new AbortController();
|
||||
|
||||
// Stream the response
|
||||
const gen = ideMessenger.llmStreamChat(
|
||||
{
|
||||
messages,
|
||||
completionOptions: {},
|
||||
title: selectedChatModel.title,
|
||||
},
|
||||
abortController.signal,
|
||||
);
|
||||
|
||||
let accumulatedContent = "";
|
||||
|
||||
// Process each chunk
|
||||
for await (const chunks of gen) {
|
||||
for (const chunk of chunks) {
|
||||
if (chunk.role === "assistant" && chunk.content) {
|
||||
accumulatedContent += chunk.content;
|
||||
setGeneratedContent(accumulatedContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
setError(err instanceof Error ? err.message : "An error occurred");
|
||||
} finally {
|
||||
setIsGenerating(false);
|
||||
}
|
||||
},
|
||||
[ideMessenger, currentHistory, selectedChatModel],
|
||||
);
|
||||
|
||||
const reset = useCallback(() => {
|
||||
setGeneratedContent("");
|
||||
setError(null);
|
||||
setIsGenerating(false);
|
||||
}, []);
|
||||
|
||||
return {
|
||||
generateRule,
|
||||
generatedContent,
|
||||
isGenerating,
|
||||
error,
|
||||
reset,
|
||||
};
|
||||
}
|
||||
|
|
@ -7,8 +7,8 @@ import { ChatHistoryItem } from "core";
|
|||
import { renderChatMessage } from "core/util/messageContent";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice";
|
||||
import FeedbackButtons from "../FeedbackButtons";
|
||||
import GenerateRuleDialog from "../GenerateRuleDialog";
|
||||
import { FeedbackButtons } from "../FeedbackButtons";
|
||||
import { GenerateRuleDialog } from "../GenerateRuleDialog";
|
||||
import { CopyIconButton } from "../gui/CopyIconButton";
|
||||
import HeaderButtonWithToolTip from "../gui/HeaderButtonWithToolTip";
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ export default function ResponseActions({
|
|||
return (
|
||||
<div className="text-description-muted mx-2 flex cursor-default items-center justify-end space-x-1 bg-transparent pb-0 text-xs">
|
||||
<div
|
||||
className="border-border mr-1 border-y-0 border-l-0 border-r border-solid border-gray-500 pr-2"
|
||||
className="mr-1 border-y-0 border-l-0 border-r border-solid pr-2"
|
||||
onClick={onGenerateRule}
|
||||
>
|
||||
<span className="flex cursor-pointer items-center hover:brightness-125">
|
||||
|
|
@ -52,7 +52,7 @@ export default function ResponseActions({
|
|||
text="Continue generation"
|
||||
onClick={onContinueGeneration}
|
||||
>
|
||||
<BarsArrowDownIcon className="h-3.5 w-3.5 text-gray-500" />
|
||||
<BarsArrowDownIcon className="h-3.5 w-3.5" />
|
||||
</HeaderButtonWithToolTip>
|
||||
)}
|
||||
|
||||
|
|
@ -62,14 +62,14 @@ export default function ResponseActions({
|
|||
tabIndex={-1}
|
||||
onClick={onDelete}
|
||||
>
|
||||
<TrashIcon className="h-3.5 w-3.5 text-gray-500" />
|
||||
<TrashIcon className="text-description-muted h-3.5 w-3.5" />
|
||||
</HeaderButtonWithToolTip>
|
||||
|
||||
<CopyIconButton
|
||||
tabIndex={-1}
|
||||
text={renderChatMessage(item.message)}
|
||||
clipboardIconClassName="h-3.5 w-3.5 text-gray-500"
|
||||
checkIconClassName="h-3.5 w-3.5 text-green-400"
|
||||
clipboardIconClassName="h-3.5 w-3.5 text-description-muted"
|
||||
checkIconClassName="h-3.5 w-3.5 text-success"
|
||||
/>
|
||||
|
||||
<FeedbackButtons item={item} />
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { XMarkIcon } from "@heroicons/react/24/outline";
|
||||
import React, { isValidElement, useEffect } from "react";
|
||||
import React, { isValidElement } from "react";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
import styled from "styled-components";
|
||||
import {
|
||||
|
|
@ -8,7 +8,6 @@ import {
|
|||
vscBackground,
|
||||
vscForeground,
|
||||
} from "..";
|
||||
import { varWithFallback } from "../../styles/theme";
|
||||
|
||||
interface TextDialogProps {
|
||||
showDialog: boolean;
|
||||
|
|
@ -21,7 +20,8 @@ const ScreenCover = styled.div`
|
|||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: ${varWithFallback("background")}aa;
|
||||
background-color: rgba(0, 0, 0, 0.35);
|
||||
backdrop-filter: blur(0.5px);
|
||||
z-index: 100000;
|
||||
flex-direction: column;
|
||||
`;
|
||||
|
|
@ -41,25 +41,23 @@ const DialogContainer = styled.div`
|
|||
`;
|
||||
|
||||
const TextDialog = (props: TextDialogProps) => {
|
||||
useEffect(() => {
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
if (event.key === "Escape") {
|
||||
props.onClose();
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener("keydown", handleKeyDown);
|
||||
return () => {
|
||||
document.removeEventListener("keydown", handleKeyDown);
|
||||
};
|
||||
}, [props]);
|
||||
const handleKeyDown = (event: React.KeyboardEvent) => {
|
||||
if (event.key === "Escape") {
|
||||
props.onClose();
|
||||
}
|
||||
};
|
||||
|
||||
if (!isValidElement(props.message) && typeof props.message !== "string") {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<ScreenCover onClick={props.onClose} hidden={!props.showDialog}>
|
||||
<ScreenCover
|
||||
onClick={props.onClose}
|
||||
hidden={!props.showDialog}
|
||||
onKeyDown={handleKeyDown}
|
||||
tabIndex={-1}
|
||||
>
|
||||
<DialogContainer
|
||||
className="xs:w-[90%] no-scrollbar max-h-[95%] w-[92%] max-w-[600px] overflow-auto sm:w-[88%] md:w-[80%]"
|
||||
onClick={(e) => {
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ export function ContextItemsPeekItem({
|
|||
{contextItem.name}
|
||||
</div>
|
||||
<div
|
||||
className={`min-w-0 flex-1 overflow-hidden truncate whitespace-nowrap text-xs text-gray-400 ${isUrl ? "hover:underline" : ""}`}
|
||||
className={`text-description-muted min-w-0 flex-1 overflow-hidden truncate whitespace-nowrap text-xs ${isUrl ? "hover:underline" : ""}`}
|
||||
onClick={
|
||||
isUrl
|
||||
? (e) => {
|
||||
|
|
@ -156,7 +156,7 @@ export function ContextItemsPeekItem({
|
|||
</div>
|
||||
|
||||
{isUrl && (
|
||||
<ArrowTopRightOnSquareIcon className="mx-2 h-4 w-4 flex-shrink-0 text-gray-400 opacity-0 group-hover:opacity-100" />
|
||||
<ArrowTopRightOnSquareIcon className="text-description-muted mx-2 h-4 w-4 flex-shrink-0 opacity-0 group-hover:opacity-100" />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -201,7 +201,9 @@ export function ContextItemsPeek({
|
|||
<ContextItemsPeekItem key={idx} contextItem={contextItem} />
|
||||
))
|
||||
) : (
|
||||
<div className="pl-2 text-xs italic text-gray-400">No results</div>
|
||||
<div className="text-description-muted pl-2 text-xs italic">
|
||||
No results
|
||||
</div>
|
||||
)}
|
||||
</ToggleDiv>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -62,9 +62,9 @@ export function RulesPeekItem({ rule }: RulesPeekItemProps) {
|
|||
>
|
||||
<div className="flex w-full items-center">
|
||||
{isGlobal ? (
|
||||
<GlobeAltIcon className="mr-2 h-4 w-4 flex-shrink-0 text-gray-400" />
|
||||
<GlobeAltIcon className="text-description-muted mr-2 h-4 w-4 flex-shrink-0" />
|
||||
) : (
|
||||
<DocumentTextIcon className="mr-2 h-4 w-4 flex-shrink-0 text-gray-400" />
|
||||
<DocumentTextIcon className="text-description-muted mr-2 h-4 w-4 flex-shrink-0" />
|
||||
)}
|
||||
|
||||
<div className="flex min-w-0 flex-1 gap-2 text-xs">
|
||||
|
|
@ -87,7 +87,7 @@ export function RulesPeekItem({ rule }: RulesPeekItemProps) {
|
|||
>
|
||||
{displayedRule}
|
||||
{isRuleLong && (
|
||||
<span className="ml-1 text-gray-400 opacity-0 transition-opacity group-hover:opacity-100">
|
||||
<span className="text-description-muted ml-1 opacity-0 transition-opacity group-hover:opacity-100">
|
||||
{expanded ? "(collapse)" : "(expand)"}
|
||||
</span>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ function ThinkingBlockPeek({
|
|||
}}
|
||||
>
|
||||
{redactedThinking ? (
|
||||
<div className="pl-4 text-xs text-gray-400">
|
||||
<div className="text-description-muted pl-4 text-xs">
|
||||
Thinking content redacted due to safety reasons.
|
||||
</div>
|
||||
) : (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue