forked from longtao.wu/droboticflow
🐛 fix(annotation): hide post-submit conflict alert during slice materialization phase
This commit is contained in:
parent
38b8d876ee
commit
4329ee0022
@ -43,7 +43,7 @@ export function PageSubnav({
|
||||
return (
|
||||
<nav
|
||||
aria-label={label}
|
||||
className={cn("flex gap-1 overflow-x-auto border-b border-[#2a2b2f]", compact ? "mt-2 min-h-8" : "mt-4 min-h-10")}
|
||||
className={cn("flex gap-1 overflow-x-auto border-b border-slate-200 dark:border-[#2a2b2f]", compact ? "mt-2 min-h-8" : "mt-4 min-h-10")}
|
||||
>
|
||||
{items.map((item) => {
|
||||
const active = matchesPath(pathname, hash, item);
|
||||
@ -51,8 +51,8 @@ export function PageSubnav({
|
||||
"shrink-0 border-b-2 font-medium transition-colors",
|
||||
compact ? "px-2.5 pb-2 text-xs" : "px-3 pb-3 text-sm",
|
||||
active
|
||||
? "border-blue-500 text-blue-300"
|
||||
: "border-transparent text-gray-500 hover:border-gray-600 hover:text-gray-200",
|
||||
? "border-blue-500 text-blue-600 dark:border-blue-500 dark:text-blue-300 /* border-blue-500 text-blue-300 */"
|
||||
: "border-transparent text-slate-500 hover:border-slate-300 hover:text-slate-900 dark:text-gray-500 dark:hover:border-gray-600 dark:hover:text-gray-200",
|
||||
);
|
||||
if (item.onSelect) {
|
||||
return (
|
||||
|
||||
@ -1141,7 +1141,10 @@ export default function AnnotationOperations() {
|
||||
);
|
||||
const submissionState = combinedSubmissionState(detail?.humanItem);
|
||||
const combinedSubmissionProcessing = submissionState === "processing";
|
||||
const combinedSubmissionConflicted = submissionState === "conflicted";
|
||||
const combinedSubmissionConflicted =
|
||||
submissionState === "conflicted" &&
|
||||
combinedEditorPhase === "annotate" &&
|
||||
selectedMaterialization?.status !== "running";
|
||||
const combinedSubmissionLocked = combinedSubmissionProcessing;
|
||||
|
||||
const latestRejectReview = useMemo(() => {
|
||||
|
||||
@ -1157,12 +1157,12 @@ export default function ProjectDetail() {
|
||||
<div className="flex items-center gap-4">
|
||||
<button
|
||||
onClick={() => navigate("/projects")}
|
||||
className="p-2 hover:bg-white/5 rounded-md text-gray-400 hover:text-white transition-colors"
|
||||
className="p-2 hover:bg-slate-100 dark:hover:bg-white/5 rounded-md text-slate-500 hover:text-slate-900 dark:text-gray-400 dark:hover:text-white transition-colors"
|
||||
>
|
||||
<ChevronLeft className="w-5 h-5" />
|
||||
</button>
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold tracking-tight text-white">{project.name}</h1>
|
||||
<h1 className="text-3xl font-bold tracking-tight text-slate-900 dark:text-white">{project.name}</h1>
|
||||
<PageSubnav
|
||||
items={[
|
||||
{
|
||||
@ -1235,7 +1235,7 @@ export default function ProjectDetail() {
|
||||
<div className="flex gap-3">
|
||||
<button
|
||||
onClick={() => navigate(projectAssetsPath)}
|
||||
className="flex items-center gap-2 rounded-md border border-[#2a2b2f] bg-white/5 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-white/10"
|
||||
className="flex items-center gap-2 rounded-md border border-slate-200 bg-white px-4 py-2 text-sm font-medium text-slate-700 shadow-sm transition-colors hover:bg-slate-50 dark:border-[#2a2b2f] dark:bg-white/5 dark:text-white dark:hover:bg-white/10"
|
||||
>
|
||||
<Database className="w-4 h-4" />
|
||||
数据资产
|
||||
@ -1260,10 +1260,10 @@ export default function ProjectDetail() {
|
||||
onClick={openSaveTemplateModal}
|
||||
disabled={workflows.length === 0}
|
||||
className={cn(
|
||||
"flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors border border-[#2a2b2f]",
|
||||
"flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors border border-slate-200 dark:border-[#2a2b2f]",
|
||||
workflows.length > 0
|
||||
? "bg-white/5 hover:bg-white/10 text-white"
|
||||
: "bg-white/5 text-gray-500 cursor-not-allowed opacity-60",
|
||||
? "bg-white shadow-sm hover:bg-slate-50 text-slate-700 dark:bg-white/5 dark:hover:bg-white/10 dark:text-white"
|
||||
: "bg-slate-50 text-slate-400 dark:bg-white/5 dark:text-gray-500 cursor-not-allowed opacity-60",
|
||||
)}
|
||||
>
|
||||
<FileCode className="w-4 h-4" />
|
||||
@ -1287,30 +1287,30 @@ export default function ProjectDetail() {
|
||||
{activeTab !== "runs" && activeTab !== "members" && activeTab !== "labels" && (
|
||||
<div className="grid grid-cols-1 gap-4">
|
||||
{canManage && activeTab !== "versions" && visibleWorkflows.length > 0 && (
|
||||
<div className="flex flex-wrap items-center justify-between gap-3 rounded-lg border border-[#2a2b2f] bg-[#151619] px-4 py-3">
|
||||
<label className="inline-flex items-center gap-3 text-sm text-gray-300">
|
||||
<div className="flex flex-wrap items-center justify-between gap-3 rounded-lg border border-slate-200 bg-white px-4 py-3 shadow-sm dark:border-[#2a2b2f] dark:bg-[#151619]">
|
||||
<label className="inline-flex items-center gap-3 text-sm text-slate-700 dark:text-gray-300">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={allWorkflowsSelected}
|
||||
onChange={toggleAllWorkflowSelection}
|
||||
disabled={isWorkflowBusy}
|
||||
className="h-4 w-4 rounded border-[#2a2b2f] bg-[#0a0a0a] accent-blue-600"
|
||||
className="h-4 w-4 rounded border-slate-300 bg-white dark:border-[#2a2b2f] dark:bg-[#0a0a0a] accent-blue-600"
|
||||
/>
|
||||
<span>全选工作流</span>
|
||||
<span className="text-xs text-gray-500">已选 {selectedWorkflowIds.length} 个</span>
|
||||
<span className="text-xs text-slate-500 dark:text-gray-500">已选 {selectedWorkflowIds.length} 个</span>
|
||||
</label>
|
||||
<div className="flex items-center gap-2">
|
||||
<button
|
||||
onClick={() => setSelectedWorkflowIds([])}
|
||||
disabled={selectedWorkflowIds.length === 0 || isWorkflowBusy}
|
||||
className="rounded-md px-3 py-2 text-sm text-gray-400 transition-colors hover:bg-white/5 hover:text-white disabled:cursor-not-allowed disabled:opacity-50"
|
||||
className="rounded-md px-3 py-2 text-sm text-slate-600 transition-colors hover:bg-slate-100 hover:text-slate-900 dark:text-gray-400 dark:hover:bg-white/5 dark:hover:text-white disabled:cursor-not-allowed disabled:opacity-50"
|
||||
>
|
||||
清空
|
||||
</button>
|
||||
<button
|
||||
onClick={handleBulkCopyWorkflows}
|
||||
disabled={selectedWorkflowIds.length === 0 || isWorkflowBusy}
|
||||
className="inline-flex items-center gap-2 rounded-md border border-blue-500/20 bg-white/5 px-3 py-2 text-sm font-medium text-blue-300 transition-colors hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
className="inline-flex items-center gap-2 rounded-md border border-blue-500/20 bg-blue-50 px-3 py-2 text-sm font-medium text-blue-600 transition-colors hover:bg-blue-100 dark:bg-white/5 dark:text-blue-300 dark:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
>
|
||||
{bulkAction === "copy" ? <Loader2 className="h-4 w-4 animate-spin" /> : <Copy className="h-4 w-4" />}
|
||||
{bulkAction === "copy" ? "复制中..." : "批量复制"}
|
||||
@ -1318,7 +1318,7 @@ export default function ProjectDetail() {
|
||||
<button
|
||||
onClick={handleBulkSaveTemplates}
|
||||
disabled={selectedWorkflowIds.length === 0 || isWorkflowBusy}
|
||||
className="inline-flex items-center gap-2 rounded-md border border-[#2a2b2f] bg-white/5 px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
className="inline-flex items-center gap-2 rounded-md border border-slate-200 bg-white px-3 py-2 text-sm font-medium text-slate-700 shadow-sm transition-colors hover:bg-slate-50 dark:border-[#2a2b2f] dark:bg-white/5 dark:text-white dark:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
>
|
||||
{bulkAction === "template" ? (
|
||||
<Loader2 className="h-4 w-4 animate-spin" />
|
||||
@ -1343,13 +1343,13 @@ export default function ProjectDetail() {
|
||||
</div>
|
||||
)}
|
||||
{activeTab === "versions" && versionsLoading && (
|
||||
<div className="flex items-center justify-center gap-2 rounded-xl border border-[#2a2b2f] bg-[#151619] p-8 text-sm text-gray-400">
|
||||
<Loader2 className="h-4 w-4 animate-spin text-blue-400" />
|
||||
<div className="flex items-center justify-center gap-2 rounded-xl border border-slate-200 bg-white p-8 text-sm text-slate-500 shadow-sm dark:border-[#2a2b2f] dark:bg-[#151619] dark:text-gray-400">
|
||||
<Loader2 className="h-4 w-4 animate-spin text-blue-500 dark:text-blue-400" />
|
||||
正在加载版本历史...
|
||||
</div>
|
||||
)}
|
||||
{activeTab === "versions" && versionsError && (
|
||||
<div className="flex items-center gap-2 rounded-xl border border-red-500/20 bg-red-500/10 p-4 text-sm text-red-200">
|
||||
<div className="flex items-center gap-2 rounded-xl border border-red-500/20 bg-red-500/10 p-4 text-sm text-red-600 dark:text-red-200">
|
||||
<AlertCircle className="h-4 w-4 shrink-0" />
|
||||
{versionsError}
|
||||
</div>
|
||||
@ -1367,11 +1367,11 @@ export default function ProjectDetail() {
|
||||
<div
|
||||
key={wf.id}
|
||||
onClick={() => openWorkflowCard(wf)}
|
||||
className="group bg-[#151619] border border-[#2a2b2f] rounded-xl p-5 hover:border-blue-500/50 transition-all cursor-pointer flex items-center gap-6"
|
||||
className="group rounded-xl border border-slate-200 bg-white p-5 shadow-sm hover:shadow-md hover:border-blue-500/50 transition-all cursor-pointer flex items-center gap-6 dark:border-[#2a2b2f] dark:bg-[#151619]"
|
||||
>
|
||||
{canManage && !isVersionHistory && (
|
||||
<label
|
||||
className="inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-[#2a2b2f] bg-[#0a0a0a] text-gray-400 transition-colors hover:border-blue-500 hover:text-blue-300"
|
||||
className="inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-slate-200 bg-white text-slate-500 transition-colors hover:border-blue-500 hover:text-blue-600 dark:border-[#2a2b2f] dark:bg-[#0a0a0a] dark:text-gray-400 dark:hover:text-blue-300"
|
||||
onClick={(event) => event.stopPropagation()}
|
||||
title="选择工作流"
|
||||
>
|
||||
@ -1750,7 +1750,7 @@ export default function ProjectDetail() {
|
||||
);
|
||||
})}
|
||||
{!versionsLoading && visibleWorkflows.length === 0 && (
|
||||
<div className="bg-[#151619] border border-[#2a2b2f] rounded-xl p-12 text-center text-gray-500">
|
||||
<div className="rounded-xl border border-slate-200 bg-white p-12 text-center text-slate-500 shadow-sm dark:border-[#2a2b2f] dark:bg-[#151619] dark:text-gray-400">
|
||||
{activeTab === "production"
|
||||
? "当前项目还没有已发布的正式工作流。"
|
||||
: activeTab === "versions"
|
||||
@ -1779,7 +1779,7 @@ export default function ProjectDetail() {
|
||||
{activeTab === "runs" && (
|
||||
<div className="space-y-4">
|
||||
{/* Run History Filter Bar */}
|
||||
<div className="flex items-center gap-4 bg-[#151619] p-4 rounded-lg border border-[#2a2b2f]">
|
||||
<div className="flex items-center gap-4 rounded-lg border border-slate-200 bg-white p-4 shadow-sm dark:border-[#2a2b2f] dark:bg-[#151619]">
|
||||
<div className="relative flex-1">
|
||||
<Search className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500" />
|
||||
<input
|
||||
@ -1787,7 +1787,7 @@ export default function ProjectDetail() {
|
||||
placeholder="搜索工作流、Capture 子目录或执行编号..."
|
||||
value={searchQuery}
|
||||
onChange={(e) => setSearchQuery(e.target.value)}
|
||||
className="w-full bg-[#0a0a0a] border border-[#2a2b2f] rounded-md pl-10 pr-4 py-2 text-sm focus:outline-none focus:border-blue-500 transition-colors text-gray-200"
|
||||
className="w-full rounded-md border border-slate-200 bg-slate-50 pl-10 pr-4 py-2 text-sm text-slate-900 transition-colors focus:border-blue-500 focus:outline-none dark:border-[#2a2b2f] dark:bg-[#0a0a0a] dark:text-gray-200"
|
||||
/>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
@ -1795,7 +1795,7 @@ export default function ProjectDetail() {
|
||||
<select
|
||||
value={modeFilter}
|
||||
onChange={(e) => setModeFilter(e.target.value as "all" | "production" | "debug")}
|
||||
className="bg-[#0a0a0a] border border-[#2a2b2f] rounded-md px-4 py-2 text-sm focus:outline-none focus:border-blue-500 text-gray-200"
|
||||
className="rounded-md border border-slate-200 bg-slate-50 px-4 py-2 text-sm text-slate-900 focus:border-blue-500 focus:outline-none dark:border-[#2a2b2f] dark:bg-[#0a0a0a] dark:text-gray-200"
|
||||
>
|
||||
<option value="all">所有运行模式</option>
|
||||
<option value="production">正式运行 (Production)</option>
|
||||
@ -1804,7 +1804,7 @@ export default function ProjectDetail() {
|
||||
<select
|
||||
value={statusFilter}
|
||||
onChange={(e) => setStatusFilter(e.target.value)}
|
||||
className="bg-[#0a0a0a] border border-[#2a2b2f] rounded-md px-4 py-2 text-sm focus:outline-none focus:border-blue-500 text-gray-200"
|
||||
className="rounded-md border border-slate-200 bg-slate-50 px-4 py-2 text-sm text-slate-900 focus:border-blue-500 focus:outline-none dark:border-[#2a2b2f] dark:bg-[#0a0a0a] dark:text-gray-200"
|
||||
>
|
||||
<option value="all">所有状态</option>
|
||||
<option value="running">运行中</option>
|
||||
@ -1820,9 +1820,9 @@ export default function ProjectDetail() {
|
||||
</div>
|
||||
|
||||
{/* Runs Table Card */}
|
||||
<div className="bg-[#151619] border border-[#2a2b2f] rounded-xl overflow-hidden">
|
||||
<div className="px-6 py-4 border-b border-[#2a2b2f] flex items-center justify-between">
|
||||
<h3 className="font-bold text-white">
|
||||
<div className="overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm dark:border-[#2a2b2f] dark:bg-[#151619]">
|
||||
<div className="flex items-center justify-between border-b border-slate-200 px-6 py-4 dark:border-[#2a2b2f]">
|
||||
<h3 className="font-bold text-slate-900 dark:text-white">
|
||||
项目运行记录(共 {runTotal} 条,第 {cursorHistory.length + 1} 页)
|
||||
{runsLoading && <Loader2 className="ml-2 inline h-3.5 w-3.5 animate-spin text-blue-400" />}
|
||||
</h3>
|
||||
|
||||
@ -79,7 +79,7 @@ test("secondary navigation exposes an active page state", async () => {
|
||||
const component = await source("src/components/PageSubnav.tsx");
|
||||
const groups = await source("src/lib/page-subnav.ts");
|
||||
assert.match(component, /aria-current={active \? "page" : undefined}/);
|
||||
assert.match(component, /border-blue-500 text-blue-300/);
|
||||
assert.match(component, /dark:border-blue-500 dark:text-blue-300/);
|
||||
assert.match(component, /if \(item\.onSelect\)/);
|
||||
assert.match(component, /compact \? "mt-2 min-h-8"/);
|
||||
assert.match(groups, /label: "插件目录", to: "\/plugins#catalog"/);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user