Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export const AgentForm: React.FC<AgentFormProps> = ({ editingAgentId, onDelete }
buttonId: BUTTON_IDS.SAVE_AND_CHAT,
navigateToListView: false,
});
deferNavigateToAgentBuilderUrl(appPaths.agent.root({ agentId: data.id }));
deferNavigateToAgentBuilderUrl(appPaths.agent.conversations.new({ agentId: data.id }));
},
[deferNavigateToAgentBuilderUrl, handleSave]
);
Expand Down Expand Up @@ -394,7 +394,7 @@ export const AgentForm: React.FC<AgentFormProps> = ({ editingAgentId, onDelete }
<EuiButton
{...commonProps}
onClick={() =>
navigateToAgentBuilderUrl(appPaths.agent.root({ agentId: editingAgentId }))
navigateToAgentBuilderUrl(appPaths.agent.conversations.new({ agentId: editingAgentId }))
}
>
{i18n.translate('xpack.agentBuilder.agents.form.chatButton', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ export const AgentsList: React.FC = () => {
'data-test-subj': (agent) => `agentBuilderAgentsListChat-${agent.id}`,
isPrimary: true,
showOnHover: true,
href: (agent) => createAgentBuilderUrl(appPaths.agent.root({ agentId: agent.id })),
href: (agent) =>
createAgentBuilderUrl(appPaths.agent.conversations.new({ agentId: agent.id })),
},
{
type: 'icon',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import type { AgentDefinition } from '@kbn/agent-builder-common';

import { useUiPrivileges } from '../../hooks/use_ui_privileges';
import { useNavigation } from '../../hooks/use_navigation';
import { appPaths } from '../../utils/app_paths';
import { useUiPrivileges } from '../../../hooks/use_ui_privileges';
import { useNavigation } from '../../../hooks/use_navigation';
import { appPaths } from '../../../utils/app_paths';
import {
getMaxListHeight,
selectorPopoverPanelStyles,
useSelectorListStyles,
} from '../conversations/conversation_input/input_actions/input_actions.styles';
import { useAgentOptions } from '../conversations/conversation_input/input_actions/agent_selector/use_agent_options';
} from '../../conversations/conversation_input/input_actions/input_actions.styles';
import { useAgentOptions } from './use_agent_options';

const AGENT_OPTION_ROW_HEIGHT = 44;

Expand Down Expand Up @@ -132,6 +132,7 @@ export const AgentSelectorDropdown: React.FC<AgentSelectorDropdownProps> = ({
flush="both"
color="text"
onClick={() => setIsPopoverOpen((v) => !v)}
data-test-subj="agentBuilderAgentSelectorButton"
>
{selectedAgent?.name ?? fallbackLabel}
</EuiButtonEmpty>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import type { AgentDefinition } from '@kbn/agent-builder-common';
import React, { useMemo } from 'react';
import { css } from '@emotion/react';
import { i18n } from '@kbn/i18n';
import { AgentAvatar } from '../../../../common/agent_avatar';
import { OptionText } from '../option_text';
import { AgentAvatar } from '../agent_avatar';
import { OptionText } from '../../conversations/conversation_input/input_actions/option_text';

type AgentOptionData = EuiSelectableOption<{ agent?: AgentDefinition }>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { EuiButton } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { useConversationContext } from '../../../context/conversation/conversation_context';
import { useNavigation } from '../../../hooks/use_navigation';
import { useLastAgentId } from '../../../hooks/use_last_agent_id';
import { appPaths } from '../../../utils/app_paths';

const NEW_CONVERSATION_BUTTON_LABEL = i18n.translate(
Expand All @@ -22,14 +23,15 @@ const NEW_CONVERSATION_BUTTON_LABEL = i18n.translate(
export const StartNewConversationButton: React.FC = () => {
const { navigateToAgentBuilderUrl } = useNavigation();
const { isEmbeddedContext, setConversationId } = useConversationContext();
const lastAgentId = useLastAgentId();

const handleClick = useCallback(() => {
if (isEmbeddedContext) {
setConversationId?.(undefined);
} else {
navigateToAgentBuilderUrl(appPaths.root);
navigateToAgentBuilderUrl(appPaths.agent.conversations.new({ agentId: lastAgentId }));
}
}, [isEmbeddedContext, setConversationId, navigateToAgentBuilderUrl]);
}, [isEmbeddedContext, setConversationId, navigateToAgentBuilderUrl, lastAgentId]);

return (
<EuiButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,17 @@
*/

import React from 'react';
import { EuiFlexGroup, EuiTourStep } from '@elastic/eui';
import { EuiFlexGroup } from '@elastic/eui';
import { ConversationsHistoryButton } from './conversations_history_button';
import { useHasActiveConversation } from '../../../hooks/use_conversation';
import { NewConversationButton } from './new_conversation_button';
import { TourStep, useAgentBuilderTour } from '../../../context/agent_builder_tour_context';

export const ConversationLeftActions: React.FC<{}> = () => {
const hasActiveConversation = useHasActiveConversation();
const { getStepProps } = useAgentBuilderTour();

return (
<EuiFlexGroup gutterSize="s" alignItems="center" responsive={false}>
<EuiTourStep {...getStepProps(TourStep.ConversationsHistory)}>
<ConversationsHistoryButton />
</EuiTourStep>
<ConversationsHistoryButton />
{hasActiveConversation && <NewConversationButton />}
</EuiFlexGroup>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
*/

import React from 'react';
import { EuiFlexGroup, EuiTourStep } from '@elastic/eui';
import { EuiFlexGroup } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { useConversationContext } from '../../../context/conversation/conversation_context';
import { MoreActionsButton } from './more_actions_button';
import { CloseDockedViewButton } from './close_docked_view_button';
import { TourStep, useAgentBuilderTour } from '../../../context/agent_builder_tour_context';

const labels = {
container: i18n.translate('xpack.agentBuilder.conversationActions.container', {
Expand All @@ -30,8 +29,6 @@ export const ConversationRightActions: React.FC<ConversationRightActionsProps> =
}) => {
const { isEmbeddedContext } = useConversationContext();

const { getStepProps } = useAgentBuilderTour();

return (
<EuiFlexGroup
gutterSize="s"
Expand All @@ -40,9 +37,7 @@ export const ConversationRightActions: React.FC<ConversationRightActionsProps> =
aria-label={labels.container}
responsive={false}
>
<EuiTourStep {...getStepProps(TourStep.ConversationActions)}>
<MoreActionsButton onRenameConversation={onRenameConversation} />
</EuiTourStep>
<MoreActionsButton onRenameConversation={onRenameConversation} />
{isEmbeddedContext ? <CloseDockedViewButton onClose={onClose} /> : null}
</EuiFlexGroup>
);
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading