sync update from LAN repo (source master @ 6e3f02a2)
This commit is contained in:
1 parent
66a443e915
commit
6c25c89d93
431 files changed
+68511
-2240
No files matched your search
@@ -32,7 +32,7 @@ import {
|
||||
} from "@/components/ui/dialog";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { toast } from "sonner";
|
||||
import { toast } from "@/core/ui/feedback";
|
||||
import { useDesensitizeSubtree } from "@/roundtable-planning/lib/use-desensitize-subtree";
|
||||
|
||||
import { getStoredAuth } from "@/core/auth";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FileText, Loader2 } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { toast } from "@/core/ui/feedback";
|
||||
|
||||
import { downloadMarkdownDocxFromBackend } from "@/core/api/markdown-docx-export";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
@@ -33,6 +33,7 @@ import {
|
||||
type NodeProps,
|
||||
} from "@xyflow/react";
|
||||
import "@xyflow/react/dist/style.css";
|
||||
import { confirmAction } from "@/core/ui/feedback";
|
||||
import {
|
||||
Check,
|
||||
FileText,
|
||||
@@ -456,8 +457,12 @@ function NodeDetailModal({
|
||||
setEditing(false);
|
||||
onClose();
|
||||
};
|
||||
const handleDelete = () => {
|
||||
if (typeof window !== "undefined" && !window.confirm(`删除节点「${node.label}」及其连线?此操作不可撤销。`)) {
|
||||
const handleDelete = async () => {
|
||||
if (!(await confirmAction(`删除节点「${node.label}」及其连线?此操作不可撤销。`, {
|
||||
title: "删除流程节点?",
|
||||
confirmText: "删除",
|
||||
danger: true,
|
||||
}))) {
|
||||
return;
|
||||
}
|
||||
onChange?.(deleteNodeFromGraph(data, node.id));
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* 终态时弹一个**与「达成共识」同款**的顶部浮窗(bg-primary + Sparkles + bounce),
|
||||
* 因此用户切到聊天/任务/其它工作区页面也能收到完成提示。
|
||||
*
|
||||
* 自带浮窗(不走 sonner)—— 各工作区页各自挂了一个 sonner `<Toaster>`,若这里也用
|
||||
* sonner 会出现多 Toaster 重复弹;自渲染浮窗由本常驻 Provider 独占,天然不重复。
|
||||
* 自带长时任务浮窗(不走瞬时 Message)—— 自渲染浮窗由本常驻 Provider 独占,
|
||||
* 用来承载跨页面作业完成状态,避免与短时操作反馈混在一起。
|
||||
*
|
||||
* 不含「刷新恢复」:watchedJobIds 是内存态,整页刷新后丢失(本期范围)。Provider 缺失
|
||||
* 时(如 embed 路由在 PageRoutes 之外)`watchJob` 为 no-op,调用方不报错。
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
* 4. localStorage 配额导致的静默写失败 / 数据丢失 —— 改后端后不复存在。
|
||||
*/
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { confirmAction } from "@/core/ui/feedback";
|
||||
|
||||
import type { Step1Snapshot } from "@/roundtable-planning/hooks/useStep1Intent";
|
||||
import {
|
||||
@@ -616,10 +617,12 @@ export function useDraftPersistence(
|
||||
|
||||
const handleDeleteDraft = useCallback(
|
||||
(id: string) => {
|
||||
if (typeof window !== "undefined" && !window.confirm("确定要删除这条历史记录吗?此操作不可恢复。")) {
|
||||
return;
|
||||
}
|
||||
void (async () => {
|
||||
if (!(await confirmAction("确定要删除这条历史记录吗?此操作不可恢复。", {
|
||||
title: "删除历史记录?",
|
||||
confirmText: "删除",
|
||||
danger: true,
|
||||
}))) return;
|
||||
try {
|
||||
await apiDelete(id);
|
||||
} catch (err) {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useNavigate, useSearchParams } from "react-router-dom";
|
||||
import { toast } from "sonner";
|
||||
import { confirmAction, toast } from "@/core/ui/feedback";
|
||||
import { nanoid } from "nanoid";
|
||||
import {
|
||||
ArrowLeft,
|
||||
@@ -585,17 +585,20 @@ export default function BusinessChainEditorPage() {
|
||||
setStageGroups((prev) => addEmptyStage(prev));
|
||||
}, []);
|
||||
|
||||
const removeStage = useCallback((stageIdx: number) => {
|
||||
setStageGroups((prev) => {
|
||||
const stage = prev[stageIdx];
|
||||
if (stage && stage.seats.length > 0) {
|
||||
if (!window.confirm(`删除 Stage ${stageIdx + 1} 会移除其中 ${stage.seats.length} 个席位,确认?`)) {
|
||||
return prev;
|
||||
}
|
||||
}
|
||||
return deleteStageGroup(prev, stageIdx);
|
||||
});
|
||||
}, []);
|
||||
const removeStage = useCallback(async (stageIdx: number) => {
|
||||
const stage = stageGroups[stageIdx];
|
||||
if (
|
||||
stage?.seats.length &&
|
||||
!(await confirmAction(`删除 Stage ${stageIdx + 1} 会移除其中 ${stage.seats.length} 个席位。`, {
|
||||
title: "删除执行阶段?",
|
||||
confirmText: "删除阶段",
|
||||
danger: true,
|
||||
}))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
setStageGroups((prev) => deleteStageGroup(prev, stageIdx));
|
||||
}, [stageGroups]);
|
||||
|
||||
// ─── DnD ─────────────────────────────────────────────────────────────
|
||||
const onDragStart = useCallback(
|
||||
@@ -807,7 +810,11 @@ export default function BusinessChainEditorPage() {
|
||||
startNewChain();
|
||||
return;
|
||||
}
|
||||
if (!window.confirm(`确认删除业务链条「${title || "未命名"}」?此操作不可恢复。`)) {
|
||||
if (!(await confirmAction(`确认删除业务链条「${title || "未命名"}」?此操作不可恢复。`, {
|
||||
title: "删除业务链条?",
|
||||
confirmText: "删除",
|
||||
danger: true,
|
||||
}))) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
|
||||
@@ -55,7 +55,7 @@ import {
|
||||
XIcon,
|
||||
} from "lucide-react";
|
||||
import { AnimatePresence, motion } from "motion/react";
|
||||
import { toast } from "sonner";
|
||||
import { toast } from "@/core/ui/feedback";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useLocation, useSearchParams } from "react-router-dom";
|
||||
import { toast } from "sonner";
|
||||
import { toast } from "@/core/ui/feedback";
|
||||
import { Inbox, Loader2, RefreshCw, Sparkles } from "lucide-react";
|
||||
|
||||
import { fetchDashboardInputJson } from "@/core/auth/dashboard-input";
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* 后续 Phase 8 接通真实 `streamJob` 后,本页可删除(连同 WorkspaceRoutes 里的路由)。
|
||||
*/
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { toast } from "@/core/ui/feedback";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { DispatchChainModal } from "../components/DispatchChainModal";
|
||||
|
||||
Reference in new issue
Block a user