Move recipe actions to bottom bar icon and edit goosehints to settings (#5864)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useRef, useState, useEffect, useMemo, useCallback } from 'react';
|
||||
import { Bug, FolderKey, ScrollText } from 'lucide-react';
|
||||
import { Bug, ScrollText, ChefHat } from 'lucide-react';
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from './ui/Tooltip';
|
||||
import { Button } from './ui/button';
|
||||
import type { View } from '../utils/navigationUtils';
|
||||
@@ -28,6 +28,8 @@ import MessageQueue from './MessageQueue';
|
||||
import { detectInterruption } from '../utils/interruptionDetector';
|
||||
import { DiagnosticsModal } from './ui/DownloadDiagnostics';
|
||||
import { Message } from '../api';
|
||||
import CreateRecipeFromSessionModal from './recipes/CreateRecipeFromSessionModal';
|
||||
import CreateEditRecipeModal from './recipes/CreateEditRecipeModal';
|
||||
|
||||
interface QueuedMessage {
|
||||
id: string;
|
||||
@@ -80,7 +82,6 @@ interface ChatInputProps {
|
||||
totalCost: number;
|
||||
};
|
||||
};
|
||||
setIsGoosehintsModalOpen?: (isOpen: boolean) => void;
|
||||
disableAnimation?: boolean;
|
||||
recipe?: Recipe | null;
|
||||
recipeId?: string | null;
|
||||
@@ -107,7 +108,6 @@ export default function ChatInput({
|
||||
messages = [],
|
||||
disableAnimation = false,
|
||||
sessionCosts,
|
||||
setIsGoosehintsModalOpen,
|
||||
recipe,
|
||||
recipeId,
|
||||
recipeAccepted,
|
||||
@@ -140,6 +140,8 @@ export default function ChatInput({
|
||||
const [tokenLimit, setTokenLimit] = useState<number>(TOKEN_LIMIT_DEFAULT);
|
||||
const [isTokenLimitLoaded, setIsTokenLimitLoaded] = useState(false);
|
||||
const [diagnosticsOpen, setDiagnosticsOpen] = useState(false);
|
||||
const [showCreateRecipeModal, setShowCreateRecipeModal] = useState(false);
|
||||
const [showEditRecipeModal, setShowEditRecipeModal] = useState(false);
|
||||
|
||||
// Save queue state (paused/interrupted) to storage
|
||||
useEffect(() => {
|
||||
@@ -1486,9 +1488,6 @@ export default function ChatInput({
|
||||
dropdownRef={dropdownRef}
|
||||
setView={setView}
|
||||
alerts={alerts}
|
||||
recipe={recipe}
|
||||
recipeId={recipeId}
|
||||
hasMessages={messages.length > 0}
|
||||
/>
|
||||
</div>
|
||||
</Tooltip>
|
||||
@@ -1500,21 +1499,34 @@ export default function ChatInput({
|
||||
<BottomMenuExtensionSelection sessionId={sessionId} />
|
||||
</>
|
||||
)}
|
||||
<div className="flex items-center h-full">
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
onClick={() => setIsGoosehintsModalOpen?.(true)}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="flex items-center justify-center text-text-default/70 hover:text-text-default text-xs cursor-pointer"
|
||||
>
|
||||
<FolderKey size={16} />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Configure goosehints</TooltipContent>
|
||||
</Tooltip>
|
||||
</div>
|
||||
{sessionId && (
|
||||
<>
|
||||
<div className="w-px h-4 bg-border-default mx-2" />
|
||||
<div className="flex items-center h-full">
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
onClick={() => {
|
||||
if (recipe) {
|
||||
setShowEditRecipeModal(true);
|
||||
} else {
|
||||
setShowCreateRecipeModal(true);
|
||||
}
|
||||
}}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="flex items-center justify-center text-text-default/70 hover:text-text-default text-xs cursor-pointer"
|
||||
>
|
||||
<ChefHat size={16} />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
{recipe ? 'View/Edit Recipe' : 'Create Recipe from Session'}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
{sessionId && (
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
@@ -1552,6 +1564,23 @@ export default function ChatInput({
|
||||
setMentionPopover((prev) => ({ ...prev, selectedIndex: index }))
|
||||
}
|
||||
/>
|
||||
|
||||
{sessionId && showCreateRecipeModal && (
|
||||
<CreateRecipeFromSessionModal
|
||||
isOpen={showCreateRecipeModal}
|
||||
onClose={() => setShowCreateRecipeModal(false)}
|
||||
sessionId={sessionId}
|
||||
/>
|
||||
)}
|
||||
|
||||
{recipe && showEditRecipeModal && (
|
||||
<CreateEditRecipeModal
|
||||
isOpen={showEditRecipeModal}
|
||||
onClose={() => setShowEditRecipeModal(false)}
|
||||
recipe={recipe}
|
||||
recipeId={recipeId}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user