diff --git a/front/components/assistant_builder/AssistantBuilder.tsx b/front/components/assistant_builder/AssistantBuilder.tsx
index 04cacea12f01..458ca0a6c9d2 100644
--- a/front/components/assistant_builder/AssistantBuilder.tsx
+++ b/front/components/assistant_builder/AssistantBuilder.tsx
@@ -480,7 +480,11 @@ export default function AssistantBuilder({
assertNever(screen);
}
})()}
-
+
}
buttonsRightPanel={
diff --git a/front/components/assistant_builder/PrevNextButtons.tsx b/front/components/assistant_builder/PrevNextButtons.tsx
index 218221bdbb36..9eb27518a9c8 100644
--- a/front/components/assistant_builder/PrevNextButtons.tsx
+++ b/front/components/assistant_builder/PrevNextButtons.tsx
@@ -3,13 +3,17 @@ import React from "react";
import type { BuilderScreen } from "@app/components/assistant_builder/types";
+interface PrevNextButtonsProps {
+ screen: BuilderScreen;
+ setScreen: (screen: BuilderScreen) => void;
+ setCurrentTab: (tab: string) => void;
+}
+
export function PrevNextButtons({
screen,
setScreen,
-}: {
- screen: BuilderScreen;
- setScreen: (screen: BuilderScreen) => void;
-}) {
+ setCurrentTab,
+}: PrevNextButtonsProps) {
return (
{screen !== "instructions" && (
@@ -18,11 +22,9 @@ export function PrevNextButtons({
size="md"
variant="highlight"
onClick={() => {
- if (screen === "actions") {
- setScreen("instructions");
- } else if (screen === "naming") {
- setScreen("actions");
- }
+ const newScreen = screen === "actions" ? "instructions" : "actions";
+ setScreen(newScreen);
+ setCurrentTab(newScreen);
}}
/>
)}
@@ -33,11 +35,9 @@ export function PrevNextButtons({
size="md"
variant="highlight"
onClick={() => {
- if (screen === "instructions") {
- setScreen("actions");
- } else if (screen === "actions") {
- setScreen("naming");
- }
+ const newScreen = screen === "instructions" ? "actions" : "naming";
+ setScreen(newScreen);
+ setCurrentTab(newScreen);
}}
/>
)}