fix: strip empty extensions array when deeplink also (#7096)

This commit is contained in:
Zane
2026-02-10 08:47:19 -08:00
committed by GitHub
parent 0d5db02a02
commit 7267621ab8
8 changed files with 44 additions and 57 deletions
@@ -40,11 +40,17 @@ export const BottomMenuExtensionSelection = ({ sessionId }: BottomMenuExtensionS
}, 500);
};
const handleExtensionsLoaded = () => {
setRefreshTrigger((prev) => prev + 1);
};
window.addEventListener(AppEvents.SESSION_CREATED, handleSessionLoaded);
window.addEventListener(AppEvents.SESSION_EXTENSIONS_LOADED, handleExtensionsLoaded);
window.addEventListener(AppEvents.MESSAGE_STREAM_FINISHED, handleSessionLoaded);
return () => {
window.removeEventListener(AppEvents.SESSION_CREATED, handleSessionLoaded);
window.removeEventListener(AppEvents.SESSION_EXTENSIONS_LOADED, handleExtensionsLoaded);
window.removeEventListener(AppEvents.MESSAGE_STREAM_FINISHED, handleSessionLoaded);
};
}, []);
@@ -32,7 +32,7 @@ import {
} from '../../api';
import ImportRecipeForm, { ImportRecipeButton } from './ImportRecipeForm';
import CreateEditRecipeModal from './CreateEditRecipeModal';
import { generateDeepLink, Recipe, stripEmptyExtensions } from '../../recipe';
import { generateDeepLink, encodeRecipe, Recipe, stripEmptyExtensions } from '../../recipe';
import { useNavigation } from '../../hooks/useNavigation';
import { CronPicker } from '../schedule/CronPicker';
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/dialog';
@@ -165,15 +165,16 @@ export default function RecipesView() {
}
};
const handleStartRecipeChatInNewWindow = (recipeId: string) => {
const handleStartRecipeChatInNewWindow = async (recipe: Recipe) => {
try {
const encodedRecipe = await encodeRecipe(stripEmptyExtensions(recipe) as Recipe);
window.electron.createChatWindow(
undefined,
getInitialWorkingDir(),
undefined,
undefined,
'pair',
recipeId
encodedRecipe
);
trackRecipeStarted(true, undefined, true);
} catch (error) {
@@ -521,7 +522,7 @@ export default function RecipesView() {
<Button
onClick={(e) => {
e.stopPropagation();
handleStartRecipeChatInNewWindow(recipeManifestResponse.id);
handleStartRecipeChatInNewWindow(recipe);
}}
variant="outline"
size="sm"