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
53 changes: 29 additions & 24 deletions apps/desktop/src/renderer/src/features/runs/running-workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,48 @@ export function RunningWorkspace({
const totalCount = activeGroups.length + activeRuns.length

return (
<div className="flex h-full min-h-0 flex-col overflow-hidden bg-background px-4 py-5 md:px-6 md:py-6">
<header className="flex shrink-0 items-start gap-3 border-b border-border pb-5">
<div className="flex size-9 shrink-0 items-center justify-center rounded-lg bg-success/10 text-success">
<Activity className="size-5" />
</div>
<div>
<h1 className="font-heading text-lg font-semibold text-foreground">运行中</h1>
<p className="mt-1 text-xs text-muted-foreground">
<div className="flex h-full min-h-0 flex-col overflow-hidden bg-background">
<header className="flex shrink-0 items-center justify-between border-b border-border bg-card/60 px-6 py-3.5">
<div className="flex flex-col gap-0.5">
<h1 className="font-heading text-lg font-semibold tracking-tight text-foreground">
运行中
</h1>
<p className="text-xs text-muted-foreground">
{totalCount > 0 ? `${totalCount} 个活动项正在运行` : '查看当前项目脚本和批量任务'}
</p>
</div>
</header>

<div className="min-h-0 flex-1 overflow-y-auto pt-5">
<main className="min-h-0 flex-1 overflow-y-auto p-5">
{totalCount > 0 ? (
<SidebarRunningSection
variant="page"
activeRuns={activeRuns}
activeGroups={activeGroups}
projects={projects}
onSelectGroup={onSelectGroup}
onOpenRun={onOpenRun}
/>
<div className="mx-auto flex max-w-4xl flex-col gap-3">
<SidebarRunningSection
variant="page"
activeRuns={activeRuns}
activeGroups={activeGroups}
projects={projects}
onSelectGroup={onSelectGroup}
onOpenRun={onOpenRun}
/>
</div>
) : (
<div
role="status"
aria-label="运行中空状态"
className="flex min-h-56 flex-col items-center justify-center gap-2 rounded-xl border border-dashed border-border/80 p-8 text-center"
className="flex h-full min-h-64 flex-col items-center justify-center gap-3 text-center"
>
<Activity className="size-8 text-muted-foreground/40" />
<h2 className="text-sm font-semibold text-foreground">当前没有运行中的任务</h2>
<p className="max-w-sm text-xs text-muted-foreground">
启动项目脚本或批量任务后,它们会在这里集中显示,方便查看日志和停止运行。
</p>
<div className="flex size-12 items-center justify-center rounded-xl border border-border bg-card/60 text-muted-foreground shadow-xs">
<Activity className="size-6" />
</div>
<div>
<h2 className="text-sm font-semibold text-foreground">当前没有运行中的任务</h2>
<p className="mt-1 text-xs text-muted-foreground">
启动项目脚本或批量任务后,它们会在这里集中显示,方便查看日志和停止运行。
</p>
</div>
</div>
)}
</div>
</main>
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,18 @@ export function SidebarRunningSection({
)}
aria-label="运行中任务"
>
<header className="flex items-center justify-between px-1">
<div className="flex items-center gap-1.5">
<span
className={cn(
'font-semibold tracking-wider text-muted-foreground',
page ? 'text-sm' : 'text-[11px]'
)}
>
运行中
</span>
<span className="rounded bg-success/15 px-1.5 py-0.5 font-mono text-[10px] font-medium text-success">
{totalCount}
</span>
</div>
</header>
{!page && (
<header className="flex items-center justify-between px-1">
<div className="flex items-center gap-1.5">
<span className="text-[11px] font-semibold tracking-wider text-muted-foreground">
运行中
</span>
<span className="rounded bg-success/15 px-1.5 py-0.5 font-mono text-[10px] font-medium text-success">
{totalCount}
</span>
</div>
</header>
)}

{actionError && (
<p className="flex items-start gap-1 px-1.5 text-xs text-destructive">
Expand All @@ -104,7 +101,10 @@ export function SidebarRunningSection({
return (
<li
key={group.groupId}
className="group flex items-center justify-between gap-1.5 rounded-lg border border-border/50 bg-card/60 px-2 py-1.5 transition-colors hover:bg-muted/50"
className={cn(
'group flex items-center justify-between gap-1.5 rounded-lg border border-border/50 bg-card/60 transition-colors hover:bg-muted/50',
page ? 'px-3 py-2.5' : 'px-2 py-1.5'
)}
>
<button
type="button"
Expand Down Expand Up @@ -162,7 +162,10 @@ export function SidebarRunningSection({
return (
<li
key={run.id}
className="group flex items-center justify-between gap-1.5 rounded-lg border border-border/50 bg-card/60 px-2 py-1.5 transition-colors hover:bg-muted/50"
className={cn(
'group flex items-center justify-between gap-1.5 rounded-lg border border-border/50 bg-card/60 transition-colors hover:bg-muted/50',
page ? 'px-3 py-2.5' : 'px-2 py-1.5'
)}
>
<button
type="button"
Expand Down
3 changes: 2 additions & 1 deletion docs/PROGRESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ M4-3 Android:
- #137 已发布(v1.12.0):修复批量任务子任务运行态仍显示灰色已完成与编辑弹窗名称输入框左边框遮挡;抽离纯 TS 状态解析函数 `resolveGroupStatus` 并补齐单测,批量列表与详情联动长任务活跃态高亮,更新相关 E2E 断言;`pnpm check` 与 Playwright `pnpm e2e` 全部通过。
- #138 已发布(v1.12.0):项目详情脚本列表支持显式排序(默认/名称升降序/运行中优先),排序保持来源分组内生效,持久化存入 localStorage;纯函数测试与 Playwright E2E 全部通过。
- #141 已发布(v1.12.0):为每一个脚本增加启动成功的检测标识与多模态就绪感知;支持 ports/http/output/alive 多模态探针与 alive 默认存活窗口,UI 渲染启动呼吸/就绪常亮/无响应警告指示灯与悬停目标提示,无障碍友好;单测与 Playwright E2E 全部通过。
- #143 已完成:统一右侧工作区顶栏与操作按钮样式规范;统一使用 bg-card/60 顶栏容器底色与 px-6 py-3.5 内边距,统一主副标题间距(gap-0.5)与 font-heading 字族,统一新建操作按钮尺寸(h-8 px-3 text-xs font-semibold shadow-xs)与图标尺寸(size-3.5);pnpm check 与 Playwright pnpm e2e 全部通过。
- #143 已发布(v1.12.0):统一右侧工作区顶栏与操作按钮样式规范;统一使用 bg-card/60 顶栏容器底色与 px-6 py-3.5 内边距,统一主副标题间距(gap-0.5)与 font-heading 字族,统一新建操作按钮尺寸(h-8 px-3 text-xs font-semibold shadow-xs)与图标尺寸(size-3.5);pnpm check 与 Playwright pnpm e2e 全部通过。
- #145 已完成:对齐「运行中」工作区顶栏与页面布局规范;统一顶栏为通栏 bg-card/60 与 px-6 py-3.5 内边距,移除大图标方块与双重标题,内容区增加 max-w-4xl 居中约束并优化空状态与条目内边距;pnpm check 与 Playwright pnpm e2e 全部通过。

桌面 MVP 发布:

Expand Down