🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
💄 style(project): simplify the project home composer (#21481)
LiJian91cf2fe8d8a7
diff --git a/locales/en-US/project.json b/locales/en-US/project.jsonindex 47682cd5c06..d3eb3b86806 100644--- a/locales/en-US/project.json+++ b/locales/en-US/project.json@@ -147,7 +147,6 @@"members.updateFailed": "Could not update the agent","overview.activeTasks": "In progress","overview.composerPlaceholder": "Tell the project what to move forward next…",- "overview.contextEnabled": "Project context loaded","overview.contextTitle": "Project context","overview.createTask": "Create task","overview.createTaskFailed": "Could not create the task",@@ -157,8 +156,8 @@"overview.goalSummary": "Project goals","overview.goalsEmpty": "Add a goal to make project progress visible here.","overview.latestWorks": "Latest outputs",- "overview.mode.chat": "Ask coordinator",- "overview.mode.task": "New task",+ "overview.mode.chat": "Chat",+ "overview.mode.task": "Task","overview.needsAttention": "Needs your attention","overview.nextActionDescription": "Tell {{name}} what you want to achieve. Its coordinator will use the project context to move it forward.","overview.nextActionTitle": "What should we move forward next?",@@ -167,22 +166,18 @@"overview.nothingNeedsAttention": "Nothing needs your attention right now.","overview.openTasks": "Open task workspace","overview.projectSummary": "Project summary",- "overview.prompts.findBlockers": "Find the current blockers",- "overview.prompts.planMilestone": "Plan the next milestone",- "overview.prompts.summarizeProgress": "Summarize recent progress","overview.reviewProject": "Review project completion","overview.sendFailed": "Could not create the topic","overview.sendHint": "⌘ ↵ to send","overview.startConversation": "Start moving","overview.taskFailed": "This task needs recovery",- "overview.taskModeHint": "Added to the project's task list","overview.taskPlaceholder": "Describe the task to add to this project…","overview.taskWaiting": "Waiting for your decision","overview.tasksEmpty": "No tasks belong to this project yet.","overview.tasksTitle": "Project tasks","overview.title": "Keep this project moving","overview.viewAllTasks": "View all tasks",- "overview.worksEmptyDescription": "Documents, files, tasks, and external results created by the Project Coordinator will appear here.",+ "overview.worksEmptyDescription": "Documents and GitHub or Linear items from your chats and tasks will collect here.","overview.worksEmptyTitle": "No outputs yet","rename.action": "Rename","rename.error": "Could not rename the project.",@@ -194,7 +189,7 @@"sections.conversations": "Topics","sections.dashboard": "Dashboards","sections.goals": "Goals",- "sections.home": "Project home",+ "sections.home": "Home","sections.knowledgeBases": "Libraries","sections.tasks": "Tasks","settings.addDirectory": "Add folder",diff --git a/locales/zh-CN/project.json b/locales/zh-CN/project.jsonindex 085041a2a0b..08124565c96 100644--- a/locales/zh-CN/project.json+++ b/locales/zh-CN/project.json@@ -147,7 +147,6 @@"members.updateFailed": "更新 Agent 失败","overview.activeTasks": "正在推进","overview.composerPlaceholder": "告诉项目接下来要推进什么…",- "overview.contextEnabled": "已载入项目上下文","overview.contextTitle": "项目上下文","overview.createTask": "创建任务","overview.createTaskFailed": "创建任务失败",@@ -157,8 +156,8 @@"overview.goalSummary": "项目目标","overview.goalsEmpty": "添加目标后,可以在这里持续查看项目进度。","overview.latestWorks": "最新产物",- "overview.mode.chat": "问协调 Agent",- "overview.mode.task": "新建任务",+ "overview.mode.chat": "对话",+ "overview.mode.task": "任务","overview.needsAttention": "需要你处理","overview.nextActionDescription": "告诉 {{name}} 你想达成什么,Project Coordinator 会结合项目上下文继续推进。","overview.nextActionTitle": "接下来推进什么?",@@ -167,22 +166,18 @@"overview.nothingNeedsAttention": "目前没有需要你处理的事项。","overview.openTasks": "打开任务工作台","overview.projectSummary": "项目概况",- "overview.prompts.findBlockers": "梳理当前阻塞",- "overview.prompts.planMilestone": "规划下一个里程碑",- "overview.prompts.summarizeProgress": "总结最近进展","overview.reviewProject": "验收项目完成情况","overview.sendFailed": "无法新建话题","overview.sendHint": "⌘ ↵ 发送","overview.startConversation": "开始推进","overview.taskFailed": "这个任务需要恢复处理",- "overview.taskModeHint": "将加入项目任务列表","overview.taskPlaceholder": "描述要加入这个项目的任务…","overview.taskWaiting": "正在等待你的决定","overview.tasksEmpty": "这个项目还没有关联任务。","overview.tasksTitle": "项目任务","overview.title": "继续推进这个项目","overview.viewAllTasks": "查看全部任务",- "overview.worksEmptyDescription": "Project Coordinator 创建的文档、文件、任务和外部结果会显示在这里。",+ "overview.worksEmptyDescription": "对话和任务产出的文档、GitHub 与 Linear 条目会汇总在这里。","overview.worksEmptyTitle": "还没有产物","rename.action": "重命名","rename.error": "无法重命名项目。",@@ -194,7 +189,7 @@"sections.conversations": "话题","sections.dashboard": "看板","sections.goals": "目标",- "sections.home": "项目主页",+ "sections.home": "首页","sections.knowledgeBases": "资料库","sections.tasks": "任务","settings.addDirectory": "添加文件夹",diff --git a/packages/locales/src/default/project.ts b/packages/locales/src/default/project.tsindex 4021bc6e992..a8288b5b558 100644--- a/packages/locales/src/default/project.ts+++ b/packages/locales/src/default/project.ts@@ -197,7 +197,6 @@ export default {'list.viewAll': 'View all projects','overview.noDescription': 'A dedicated workspace for this long-running goal.','overview.activeTasks': 'In progress',- 'overview.contextEnabled': 'Project context loaded','overview.contextTitle': 'Project context','overview.description': 'Start with a question, or review the project’s progress and outputs.','overview.goalCount': '{{completed}} of {{total}} goals completed',@@ -218,7 +217,7 @@ export default {'overview.title': 'Keep this project moving','overview.viewAllTasks': 'View all tasks','overview.worksEmptyDescription':- 'Documents, files, tasks, and external results created by the Project Coordinator will appear here.',+ 'Documents and GitHub or Linear items from your chats and tasks will collect here.','overview.worksEmptyTitle': 'No outputs yet','rename.action': 'Rename','rename.error': 'Could not rename the project.',@@ -227,9 +226,6 @@ export default {'rename.title': 'Rename project','overview.openTasks': 'Open task workspace','overview.composerPlaceholder': 'Tell the project what to move forward next…',- 'overview.prompts.findBlockers': 'Find the current blockers',- 'overview.prompts.planMilestone': 'Plan the next milestone',- 'overview.prompts.summarizeProgress': 'Summarize recent progress','overview.sendHint': '⌘ ↵ to send','overview.startConversation': 'Start moving','overview.tasksEmpty': 'No tasks belong to this project yet.',@@ -238,7 +234,7 @@ export default {'sections.acceptance': 'Acceptance','sections.dashboard': 'Dashboards','sections.goals': 'Goals',- 'sections.home': 'Project home',+ 'sections.home': 'Home','sections.knowledgeBases': 'Libraries','sections.conversations': 'Topics','sections.tasks': 'Tasks',@@ -297,9 +293,8 @@ export default {'settings.members': 'Members','overview.createTask': 'Create task','overview.createTaskFailed': 'Could not create the task',- 'overview.mode.chat': 'Ask coordinator',- 'overview.mode.task': 'New task',+ 'overview.mode.chat': 'Chat',+ 'overview.mode.task': 'Task','overview.sendFailed': 'Could not create the topic',- 'overview.taskModeHint': "Added to the project's task list",'overview.taskPlaceholder': 'Describe the task to add to this project…',};diff --git a/src/features/Projects/Workspace/index.tsx b/src/features/Projects/Workspace/index.tsxindex 1529603dc43..98a99201af1 100644--- a/src/features/Projects/Workspace/index.tsx+++ b/src/features/Projects/Workspace/index.tsx@@ -6,12 +6,11 @@ import {cssVar,Flexbox,Segmented,- Tag,Text,TextArea,toast,} from '@lobehub/ui';-import { SendHorizontalIcon, SparklesIcon } from 'lucide-react';+import { SendHorizontalIcon } from 'lucide-react';import { memo, useState } from 'react';import { useTranslation } from 'react-i18next';import { useParams } from 'react-router';@@ -45,9 +44,13 @@ const styles = createStaticStyles(({ css }) => ({overflow: auto;width: 100%;`,+ heading: css`+ text-align: center;+ `,intro: css`width: 100%;max-width: 760px;+ margin-inline: auto;`,page: css`box-sizing: border-box;@@ -60,28 +63,6 @@ const styles = createStaticStyles(({ css }) => ({padding-block: 32px 48px;}`,- prompt: css`- cursor: pointer;-- padding-block: 5px;- padding-inline: 10px;- border: 0;- border-radius: 999px;-- color: ${cssVar.colorTextSecondary};-- background: ${cssVar.colorFillQuaternary};-- &:disabled {- cursor: not-allowed;- opacity: 0.5;- }-- &:hover:not(:disabled) {- color: ${cssVar.colorText};- background: ${cssVar.colorFillTertiary};- }- `,shell: css`overflow: hidden;height: 100%;@@ -112,72 +93,47 @@ const ProjectComposer = ({ project }: { project: ProjectDetail['project'] }) =>toast.error(t(mode === 'task' ? 'overview.createTaskFailed' : 'overview.sendFailed'));}};- const prompts = [- t('overview.prompts.summarizeProgress'),- t('overview.prompts.planMilestone'),- t('overview.prompts.findBlockers'),- ];return (- <Flexbox gap={10}>- <Flexbox className={styles.composer}>- <TextArea- autoFocus- autoSize={{ maxRows: 7, minRows: 3 }}- className={styles.textarea}- disabled={sending}- value={message}- placeholder={t(- mode === 'task' ? 'overview.taskPlaceholder' : 'overview.composerPlaceholder',- )}- onChange={(event) => setMessage(event.target.value)}- onKeyDown={(event) => {- if ((event.metaKey || event.ctrlKey) && event.key === 'Enter') void submit();- }}+ <Flexbox className={styles.composer}>+ <TextArea+ autoFocus+ autoSize={{ maxRows: 7, minRows: 3 }}+ className={styles.textarea}+ disabled={sending}+ value={message}+ placeholder={t(+ mode === 'task' ? 'overview.taskPlaceholder' : 'overview.composerPlaceholder',+ )}+ onChange={(event) => setMessage(event.target.value)}+ onKeyDown={(event) => {+ if ((event.metaKey || event.ctrlKey) && event.key === 'Enter') void submit();+ }}+ />+ <Flexbox+ horizontal+ align={'center'}+ className={styles.composerFooter}+ justify={'space-between'}+ >+ <Segmented+ size={'small'}+ value={mode}+ options={[+ { label: t('overview.mode.chat'), value: 'chat' },+ { label: t('overview.mode.task'), value: 'task' },+ ]}+ onChange={(value) => setMode(value as ProjectComposerMode)}+ />+ <Button+ aria-label={t(mode === 'task' ? 'overview.createTask' : 'overview.startConversation')}+ disabled={!message.trim()}+ icon={SendHorizontalIcon}+ loading={sending}+ shape={'circle'}+ type={'primary'}+ onClick={submit}/>- <Flexbox- horizontal- align={'center'}- className={styles.composerFooter}- justify={'space-between'}- >- <Flexbox horizontal align={'center'} gap={8}>- <Segmented- size={'small'}- value={mode}- options={[- { label: t('overview.mode.chat'), value: 'chat' },- { label: t('overview.mode.task'), value: 'task' },- ]}- onChange={(value) => setMode(value as ProjectComposerMode)}- />- <Tag icon={<SparklesIcon size={12} />}>{project.name}</Tag>- <Text fontSize={12} type={'secondary'}>- {t(mode === 'task' ? 'overview.taskModeHint' : 'overview.contextEnabled')}- </Text>- </Flexbox>- <Button- aria-label={t(mode === 'task' ? 'overview.createTask' : 'overview.startConversation')}- disabled={!message.trim()}- icon={SendHorizontalIcon}- loading={sending}- type={'primary'}- onClick={submit}- />- </Flexbox>- </Flexbox>- <Flexbox horizontal gap={8} wrap={'wrap'}>- {prompts.map((prompt) => (- <button- className={styles.prompt}- disabled={sending}- key={prompt}- type={'button'}- onClick={() => setMessage(prompt)}- >- {prompt}- </button>- ))}</Flexbox></Flexbox>);@@ -200,7 +156,7 @@ const ProjectWorkspace = memo(() => {<div className={styles.content}><Flexbox className={styles.page} gap={0}><Flexbox className={styles.intro} gap={18}>- <Flexbox gap={5}>+ <Flexbox align={'center'} className={styles.heading} gap={5}><Text fontSize={26} weight={650}>{t('overview.title')}</Text>