Skip to content
Merged
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
35 changes: 20 additions & 15 deletions ui/desktop/src/components/RecipesView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ interface RecipesViewProps {
onLoadRecipe?: (recipe: Recipe) => void;
}

export default function RecipesView({ onLoadRecipe }: RecipesViewProps = {}) {
// @ts-expect-error until we make onLoadRecipe work for loading recipes in the same window
export default function RecipesView({ _onLoadRecipe }: RecipesViewProps = {}) {
const [savedRecipes, setSavedRecipes] = useState<SavedRecipe[]>([]);
const [loading, setLoading] = useState(true);
const [showSkeleton, setShowSkeleton] = useState(true);
Expand Down Expand Up @@ -93,20 +94,24 @@ export default function RecipesView({ onLoadRecipe }: RecipesViewProps = {}) {

const handleLoadRecipe = async (savedRecipe: SavedRecipe) => {
try {
if (onLoadRecipe) {
// Use the callback to navigate within the same window
onLoadRecipe(savedRecipe.recipe);
} else {
// Fallback to creating a new window (for backwards compatibility)
window.electron.createChatWindow(
undefined, // query
undefined, // dir
undefined, // version
undefined, // resumeSessionId
savedRecipe.recipe, // recipe config
undefined // view type
);
}
// onLoadRecipe is not working for loading recipes. It looks correct
// but the instructions are not flowing through to the server.
// Needs a fix but commenting out to get prod back up and running.
//
// if (onLoadRecipe) {
// // Use the callback to navigate within the same window
// onLoadRecipe(savedRecipe.recipe);
// } else {
// Fallback to creating a new window (for backwards compatibility)
window.electron.createChatWindow(
undefined, // query
undefined, // dir
undefined, // version
undefined, // resumeSessionId
savedRecipe.recipe, // recipe config
undefined // view type
);
// }
} catch (err) {
console.error('Failed to load recipe:', err);
setError(err instanceof Error ? err.message : 'Failed to load recipe');
Expand Down