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 @@ -16,9 +16,6 @@

import { I18n } from '@coze-arch/i18n';

// Default session unique_id
export const DEFAULT_UNIQUE_ID = '0';

export const DEFAULT_CONVERSATION_NAME = 'Default';

export const MAX_LIMIT = 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import React, { useMemo, useState } from 'react';

import { useIDEGlobalStore } from '@coze-project-ide/framework';
import { I18n } from '@coze-arch/i18n';
import { IconCozChat } from '@coze-arch/coze-design/icons';
import { Modal, Select, Typography, Toast } from '@coze-arch/coze-design';
Expand All @@ -24,9 +25,8 @@ import {
type ProjectConversation,
} from '@coze-arch/bot-api/workflow_api';
import { workflowApi } from '@coze-arch/bot-api';
import { useIDEGlobalStore } from '@coze-project-ide/framework';

import { DEFAULT_UNIQUE_ID, DEFAULT_CONVERSATION_NAME } from '../../constants';
import { DEFAULT_CONVERSATION_NAME } from '../../constants';

import s from './index.module.less';

Expand Down Expand Up @@ -154,7 +154,7 @@ export const useDeleteChat = ({
style={{ width: '50%' }}
dropdownStyle={{ width: 220 }}
size="small"
defaultValue={DEFAULT_UNIQUE_ID}
defaultValue={optionList[0]?.value}
optionList={optionList}
onChange={value => {
const selectItem = staticList.find(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { type ProjectConversation } from '@coze-arch/bot-api/workflow_api';
import { TitleWithTooltip } from '../title-with-tooltip';
import commonStyles from '../conversation-content/index.module.less';
import { EditInput } from '../conversation-content/edit-input';
import { DEFAULT_UNIQUE_ID, type ErrorCode } from '../constants';
import { type ErrorCode } from '../constants';

import s from './index.module.less';

Expand Down Expand Up @@ -140,9 +140,7 @@ export const StaticChatList = ({
{item.conversation_name}
</Text>
)}
{editingUniqueId === item.unique_id ||
item.unique_id === DEFAULT_UNIQUE_ID ||
!canEdit ? null : (
{editingUniqueId === item.unique_id || !canEdit ? null : (
<div className={commonStyles.icons}>
<IconButton
size="small"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
import React, { useEffect, useState, useMemo } from 'react';

import { debounce } from 'lodash-es';
import { useService } from '@flowgram-adapter/free-layout-editor';
import { CONVERSATION_NAME, workflowApi } from '@coze-workflow/base';
import { I18n } from '@coze-arch/i18n';
import { Typography, Select } from '@coze-arch/coze-design';
import { CreateMethod, CreateEnv } from '@coze-arch/bot-api/workflow_api';
import { useService } from '@flowgram-adapter/free-layout-editor';

import { ChatflowService } from '@/services';

Expand Down Expand Up @@ -131,7 +131,7 @@ export const Conversations: React.FC<ConversationsProps> = ({
?.defaultValue || '';
const findItem = list.find(item => item.label === defaultName);
// The conversation_name of the start node is selected by default, if not, Default default session is selected by default
handleChange(findItem?.value || '0', findItem);
handleChange(findItem?.value || list[0]?.value, findItem || list[0]);
}
};

Expand All @@ -155,7 +155,6 @@ export const Conversations: React.FC<ConversationsProps> = ({
findItem?.value !== chatflowService.selectConversationItem?.value
) {
chatflowService.setSelectConversationItem(findItem);
handleChange(findItem?.value || '0');
}
}, [value, staticList, dynamicList]);

Expand Down
Loading