diff --git a/src/types/tags.ts b/src/types/tags.ts new file mode 100644 index 0000000..29a3e75 --- /dev/null +++ b/src/types/tags.ts @@ -0,0 +1,69 @@ +/** + * 自动标签功能相关类型定义 + */ + +// 标签统计信息 +export interface TagStats { + /** 标签名称 */ + name: string; + /** 该标签的对话数量 */ + count: number; +} + +// AI 推荐的标签 +export interface SuggestedTag { + /** 标签名称 */ + name: string; + /** AI 置信度 (0-100) */ + confidence: number; +} + +// 自动生成标签 API 响应 +export interface AutoTagResponse { + /** AI 推荐的标签列表 */ + suggestedTags: SuggestedTag[]; + /** 当前对话已有的标签 */ + currentTags: string[]; +} + +// 标签更新 API 请求 +export interface UpdateTagsRequest { + /** 新的标签数组 */ + tags: string[]; +} + +// 标签更新 API 响应 +export interface UpdateTagsResponse { + /** 更新后的标签数组 */ + tags: string[]; + /** 更新时间 */ + updatedAt: string; +} + +// 全局标签 API 响应 +export interface AllTagsResponse { + /** 标签统计列表 */ + tags: TagStats[]; + /** 总对话数 */ + totalConversations: number; +} + +// 标签筛选状态 +export interface TagFilterState { + /** 当前选中的标签 */ + selectedTags: string[]; + /** 是否启用筛选 */ + isFiltering: boolean; +} + +// 标签颜色 - 统一简洁风格 +export const TAG_COLOR = { + bg: 'rgba(113, 113, 122, 0.12)', // 灰色半透明背景 + text: '#71717A', // 灰色文字 + border: 'rgba(113, 113, 122, 0.2)', // 灰色边框 +} as const; + +// 获取标签颜色(统一返回相同颜色,保持简洁一致) +export function getTagColor(_tagName: string): typeof TAG_COLOR { + return TAG_COLOR; +}