Small improvements 4 (#247)

* removed Publish from progress bar

* removed publish tour related code

* make chat correctly in tours

* fixed use step completion
This commit is contained in:
arkml 2025-09-12 17:36:57 +05:30 committed by GitHub
parent 64a6cffe9c
commit 458302fc43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 37 deletions

View file

@ -38,7 +38,6 @@ interface TopBarProps {
onStartNewChatAndFocus: () => void;
onStartBuildTour?: () => void;
onStartTestTour?: () => void;
onStartPublishTour?: () => void;
onStartUseTour?: () => void;
onShareWorkflow: () => void;
shareUrl: string | null;
@ -77,7 +76,6 @@ export function TopBar({
onStartNewChatAndFocus,
onStartBuildTour,
onStartTestTour,
onStartPublishTour,
onStartUseTour,
onShareWorkflow,
shareUrl,
@ -98,16 +96,17 @@ export function TopBar({
// Progress bar steps with completion logic and current step detection
const step1Complete = hasAgentInstructionChanges;
const step2Complete = hasPlaygroundTested && hasAgentInstructionChanges;
const step3Complete = hasPublished && hasPlaygroundTested && hasAgentInstructionChanges;
const step4Complete = hasClickedUse && hasPublished && hasPlaygroundTested && hasAgentInstructionChanges;
// Keep publish as a prerequisite for Use completion, but remove it from the visual steps
// Mark "Use" complete as soon as a Use Assistant option is clicked
const step4Complete = hasClickedUse;
// Determine current step (first incomplete step)
const currentStep = !step1Complete ? 1 : !step2Complete ? 2 : !step3Complete ? 3 : !step4Complete ? 4 : null;
// Determine current step (first incomplete visual step: 1 -> 2 -> 4)
const currentStep = !step1Complete ? 1 : !step2Complete ? 2 : !step4Complete ? 4 : null;
const progressSteps: ProgressStep[] = [
{ id: 1, label: "Build: Ask the copilot to create your assistant. Add tools and connect data sources.", completed: step1Complete, isCurrent: currentStep === 1 },
{ id: 2, label: "Test: Test out your assistant by chatting with it. Use 'Fix' and 'Explain' to improve it.", completed: step2Complete, isCurrent: currentStep === 2 },
{ id: 3, label: "Publish: Make it live with the Publish button. You can always switch back to draft.", completed: step3Complete, isCurrent: currentStep === 3 },
// Removed the 'Publish' step from the progress bar
{ id: 4, label: "Use: Click the 'Use Assistant' button to chat, set triggers (like emails), or connect via API.", completed: step4Complete, isCurrent: currentStep === 4 },
];
@ -185,7 +184,6 @@ export function TopBar({
onStepClick={(step) => {
if (step.id === 1 && onStartBuildTour) onStartBuildTour();
if (step.id === 2 && onStartTestTour) onStartTestTour();
if (step.id === 3 && onStartPublishTour) onStartPublishTour();
if (step.id === 4 && onStartUseTour) onStartUseTour();
}}
/>

View file

@ -1077,7 +1077,6 @@ export function WorkflowEditor({
const [showTour, setShowTour] = useState(true);
const [showBuildTour, setShowBuildTour] = useState(false);
const [showTestTour, setShowTestTour] = useState(false);
const [showPublishTour, setShowPublishTour] = useState(false);
const [showUseTour, setShowUseTour] = useState(false);
// Centralized mode transition handler
@ -1192,10 +1191,8 @@ export function WorkflowEditor({
// Ensure chat is visible and collapse left panel
setActivePanel('playground');
setViewMode((prev: ViewMode) => prev);
updateViewMode(
viewMode === 'three_all' ? 'three_all' :
(viewMode === 'two_agents_skipper' ? 'two_agents_chat' : 'two_chat_skipper')
);
// Expand Chat to full view: hide Copilot panel and collapse Agents panel
updateViewMode('two_agents_chat');
setIsLeftPanelCollapsed(true);
}, [updateViewMode, viewMode]);
@ -1917,18 +1914,6 @@ export function WorkflowEditor({
});
});
}}
onStartPublishTour={() => {
// Switch to 3-pane first to ensure elements are visible
updateViewMode('three_all');
if (isLive) {
handleModeTransition('draft', 'switch_draft');
}
requestAnimationFrame(() => {
requestAnimationFrame(() => {
setShowPublishTour(true);
});
});
}}
onStartUseTour={() => {
updateViewMode('three_all');
requestAnimationFrame(() => {
@ -2317,7 +2302,11 @@ export function WorkflowEditor({
{ target: 'copilot', title: 'Step 2/2', content: 'Ask Copilot to improve your agents based on test results. Use "Fix" and "Explain" to iterate quickly.' },
]}
onStepChange={(index) => {
if (index === 0) setActivePanel('playground');
if (index === 0) {
// Ensure Chat is focused and any middle-pane detail overlay is dismissed
setActivePanel('playground');
dispatch({ type: 'unselect_agent' });
}
if (index === 1) setActivePanel('copilot');
}}
onComplete={() => setShowTestTour(false)}
@ -2335,21 +2324,16 @@ export function WorkflowEditor({
{ target: 'conversations', title: 'Step 5/5', content: 'Conversations: see all past interactions in one place, including manual chats, trigger activity, and API calls.' },
]}
onStepChange={(index) => {
if (index === 0) setActivePanel('playground');
if (index === 0) {
// Ensure Chat is focused and any middle-pane detail overlay is dismissed
setActivePanel('playground');
dispatch({ type: 'unselect_agent' });
}
}}
onComplete={() => setShowUseTour(false)}
/>
)}
{showPublishTour && (
<ProductTour
projectId={projectId}
forceStart
stepsOverride={[
{ target: 'deploy', title: 'Publish', content: 'Click Publish to make your workflow live, enabling triggers and API/SDK access. You can revert to a draft at any time.' },
]}
onComplete={() => setShowPublishTour(false)}
/>
)}
{/* Revert to Live Confirmation Modal */}
<Modal isOpen={isRevertModalOpen} onClose={onRevertModalClose}>