Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion wework/src/features/todo/CloudTodoWorkspace.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2845,7 +2845,8 @@ describe('CloudTodoWorkspace', () => {
expect(screen.getByTestId('workspace-issue-composer')).toBeVisible()
expect(screen.getByTestId('workspace-issue-input')).toHaveValue('Issue with details')
expect(screen.getByTestId('workspace-issue-composer')).toHaveClass('fixed')
expect(screen.queryByRole('heading', { name: '新建 Issue' })).not.toBeInTheDocument()
expect(screen.getByRole('heading', { name: '新建 Issue' })).toBeVisible()
expect(screen.getByTestId('workspace-issue-close')).toBeVisible()
})

it('only offers direct creation in intake columns', async () => {
Expand Down
3 changes: 3 additions & 0 deletions wework/src/features/todo/IssueComposer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ describe('IssueComposer', () => {
'aria-selected',
'true'
)
expect(screen.getByTestId('workspace-issue-heading')).toHaveTextContent('要推进什么?')
expect(screen.getByText('描述目标、问题或交付,创建后会进入当前项目空间。')).toBeVisible()
expect(screen.queryByText('描述要推进的事情,创建后自动进入所选看板。')).not.toBeInTheDocument()
expect(screen.queryByTestId('project-work-button')).not.toBeInTheDocument()
expect(screen.queryByTestId('model-selector-button')).not.toBeInTheDocument()
Expand Down Expand Up @@ -133,6 +135,7 @@ describe('IssueComposer', () => {
await userEvent.click(screen.getByTestId('workspace-create-task-tab'))

expect(screen.getByTestId('workspace-create-task-tab')).toHaveAttribute('aria-selected', 'true')
expect(screen.getByTestId('workspace-issue-heading')).toHaveTextContent('要执行什么?')
expect(screen.getByTestId('workspace-issue-input')).toHaveTextContent('修复创建流程')
expect(screen.getByTestId('project-work-button')).toHaveTextContent('Wegent')
await userEvent.click(screen.getByTestId('project-work-button'))
Expand Down
99 changes: 84 additions & 15 deletions wework/src/features/todo/IssueComposer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useContext, useEffect, useRef, useState } from 'react'
import { ArrowUp, Maximize2, Minimize2, Paperclip, X } from 'lucide-react'
import { ArrowUp, Bot, LayoutDashboard, Maximize2, Minimize2, Paperclip, X } from 'lucide-react'
import type { CloudProject } from '@/api/deliveries'
import { type ProjectChatControls, type ProjectWorkControls } from '@/components/chat/ChatInput'
import { AttachmentBadges } from '@/components/chat/composer/AttachmentBadges'
Expand Down Expand Up @@ -406,10 +406,10 @@ export function IssueComposer({
focusable[nextIndex]?.focus()
}}
className={cn(
'w-full max-w-[760px]',
'w-full max-w-[736px]',
presentation === 'popup' &&
!fullScreen &&
'max-h-full overflow-y-auto rounded-2xl border border-border bg-background p-6 shadow-2xl',
'max-h-full overflow-y-auto rounded-2xl border border-border bg-background p-6 shadow-xl',
fullScreen &&
'fixed bottom-4 left-4 right-4 top-[54px] z-modal flex w-auto max-h-none max-w-none flex-col overflow-hidden rounded-2xl border border-border bg-background p-0 shadow-xl'
)}
Expand Down Expand Up @@ -540,6 +540,54 @@ export function IssueComposer({
</>
) : (
<>
{presentation === 'page' ? (
<div className="mb-8 flex flex-col items-center text-center">
<Bot className="mb-5 h-9 w-9 text-text-muted/55" aria-hidden="true" />
<h1
data-testid="workspace-issue-heading"
className="text-xl font-normal leading-9 tracking-normal text-text-primary/95"
>
{creationMode === 'issue'
? t('todo.issue_composer_title', '要推进什么?')
: t('todo.issue_task_composer_title', '要执行什么?')}
</h1>
<p className="mt-2 max-w-[520px] text-sm leading-5 text-text-muted">
{creationMode === 'issue'
? t(
'todo.issue_composer_subtitle',
'描述目标、问题或交付,创建后会进入当前项目空间。'
)
: t(
'todo.issue_task_composer_subtitle',
'描述需要完成的工作,并选择本地工作空间和执行配置。'
)}
</p>
</div>
) : (
<div className="mb-5 flex items-center justify-between">
<div className="flex min-w-0 items-center gap-2">
<LayoutDashboard className="h-4 w-4 shrink-0 text-text-muted" />
<div className="min-w-0">
<h2 className="truncate text-sm font-medium text-text-primary">
{t('todo.new_issue', '新建 Issue')}
</h2>
<p className="truncate text-xs text-text-muted">
{selectedWorkItemProject?.name ??
t('workbench.default_work_item_board', '我的任务')}
</p>
</div>
</div>
<button
type="button"
data-testid="workspace-issue-close"
onClick={onCancel}
className="flex h-8 w-8 items-center justify-center rounded-lg text-text-secondary hover:bg-muted hover:text-text-primary"
aria-label={t('common.close', '关闭')}
>
<X className="h-4 w-4" />
</button>
Comment thread
qdaxb marked this conversation as resolved.
Resolved
</div>
)}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
<div className="mb-3 flex items-center justify-between">
<div
data-testid="workspace-issue-creation-tabs"
Expand Down Expand Up @@ -578,17 +626,38 @@ export function IssueComposer({
{t('todo.create_task_tab', '创建任务')}
</button>
</div>
{creationMode === 'issue' ? (
<button
type="button"
data-testid="workspace-issue-expand"
onClick={() => setFullScreen(true)}
className="flex h-8 w-8 items-center justify-center rounded-lg text-text-secondary hover:bg-muted hover:text-text-primary"
aria-label={t('todo.expand_issue_editor', '全屏编辑')}
>
<Maximize2 className="h-4 w-4" />
</button>
) : null}
<div className="flex items-center gap-2">
<span className="hidden text-xs text-text-muted sm:inline">
{creationMode === 'issue'
? t('todo.issue_create_mode_hint', '仅创建,不会启动执行')
: t('todo.task_create_mode_hint', '创建后立即进入执行流程')}
</span>
{creationMode === 'issue' ? (
<button
type="button"
data-testid="workspace-issue-expand"
onClick={() => setFullScreen(true)}
className="flex h-8 w-8 items-center justify-center rounded-lg text-text-secondary hover:bg-muted hover:text-text-primary"
aria-label={t('todo.expand_issue_editor', '全屏编辑')}
>
<Maximize2 className="h-4 w-4" />
</button>
) : null}
</div>
</div>
<div className="mb-2 flex items-center justify-between px-1 text-xs text-text-muted">
<span className="flex min-w-0 items-center gap-1.5">
<LayoutDashboard className="h-3.5 w-3.5 shrink-0" />
<span className="truncate">
{selectedWorkItemProject?.name ??
t('workbench.default_work_item_board', '我的任务')}
</span>
</span>
<span className="shrink-0">
{creationMode === 'issue'
? t('todo.issue_submit_shortcut', '⌘↵ 创建')
: t('todo.task_submit_shortcut', '⌘↵ 创建并执行')}
</span>
</div>
{creationMode === 'task' && workbench?.selectProject && selectedLocalProject ? (
<ConnectedIssueProjectWork
Expand All @@ -603,7 +672,7 @@ export function IssueComposer({
renderComposer(fallbackProjectWork)
)}
{hasDraft ? (
<div className="mt-2 flex items-center justify-end gap-2">
<div className="mt-3 flex items-center justify-end gap-2">
<span
data-testid="workspace-issue-draft-status"
className="text-xs text-text-muted"
Expand Down
8 changes: 8 additions & 0 deletions wework/src/i18n/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -2891,6 +2891,14 @@
"issue_placeholder": "Describe what you want to move forward…",
"issue_title_placeholder": "Issue title",
"issue_content_placeholder": "Write the issue details…",
"issue_composer_title": "What should move forward?",
"issue_task_composer_title": "What should we execute?",
"issue_composer_subtitle": "Describe the goal, problem, or deliverable. It will be added to the current project space.",
"issue_task_composer_subtitle": "Describe the work, then choose the local workspace and execution settings.",
"issue_create_mode_hint": "Create only, without starting execution",
"task_create_mode_hint": "Create and enter the execution flow",
"issue_submit_shortcut": "⌘↵ Create",
"task_submit_shortcut": "⌘↵ Create and run",
"expand_issue_editor": "Edit full screen",
"collapse_issue_editor": "Collapse editor",
"issue_drop_files_hint": "Drop or paste images and files",
Expand Down
8 changes: 8 additions & 0 deletions wework/src/i18n/locales/zh-CN/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -2888,6 +2888,14 @@
"issue_placeholder": "描述你想推进的事情…",
"issue_title_placeholder": "Issue 标题",
"issue_content_placeholder": "填写 Issue 内容…",
"issue_composer_title": "要推进什么?",
"issue_task_composer_title": "要执行什么?",
"issue_composer_subtitle": "描述目标、问题或交付,创建后会进入当前项目空间。",
"issue_task_composer_subtitle": "描述需要完成的工作,并选择本地工作空间和执行配置。",
"issue_create_mode_hint": "仅创建,不会启动执行",
"task_create_mode_hint": "创建后立即进入执行流程",
"issue_submit_shortcut": "⌘↵ 创建",
"task_submit_shortcut": "⌘↵ 创建并执行",
"expand_issue_editor": "全屏编辑",
"collapse_issue_editor": "收起编辑器",
"issue_drop_files_hint": "支持拖拽、粘贴图片或文件",
Expand Down
Loading