样式修改
This commit is contained in:
1 parent
c69486556a
commit
ca13a9199f
2 files changed
+12
-131
No files matched your search
@@ -48,7 +48,8 @@ const STATUS_LABEL: Record<string, string> = {
|
||||
export function AIWritingPanel() {
|
||||
const navigate = useNavigate();
|
||||
const { setArtifact } = useCanvasGraphContext();
|
||||
const { state, startWriting, submitIntervention, pauseWriting, resumeWriting, reset } = useAIWriting();
|
||||
// pauseWriting / resumeWriting 当前 UI 不暴露(见 header 注释),从解构里省略避免 unused 警告
|
||||
const { state, startWriting, submitIntervention, reset } = useAIWriting();
|
||||
const { sessions, loading: sessionsLoading, refresh, rename, remove } = useAIWritingSessions();
|
||||
const { articleTypes, refresh: refreshArticleTypes } = useArticleTypes();
|
||||
|
||||
@@ -269,34 +270,12 @@ export function AIWritingPanel() {
|
||||
新建
|
||||
</Button>
|
||||
)}
|
||||
{isRunning && !state.isPaused && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-7 px-2 text-xs gap-1 animate-breathe-stop text-red-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-950/30"
|
||||
onClick={pauseWriting}
|
||||
>
|
||||
<Square className="size-3 fill-current" />
|
||||
停止
|
||||
</Button>
|
||||
)}
|
||||
{state.isPaused && (
|
||||
<>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-7 px-2 text-xs gap-1 text-primary hover:text-primary hover:bg-primary/8"
|
||||
onClick={resumeWriting}
|
||||
>
|
||||
<Play className="size-3 fill-current" />
|
||||
继续
|
||||
</Button>
|
||||
<Button variant="ghost" size="sm" className="h-7 px-2 text-xs gap-1" onClick={reset}>
|
||||
<RotateCcw className="size-3" />
|
||||
重置
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
{/* ⏸️/▶️ "停止 / 继续" 按钮暂时隐藏 ——
|
||||
当前实现是 stream.stop() 断 SSE 订阅而非真正取消后端 run,
|
||||
点了停止后端继续烧 token,点继续 useStream 也不会自动重连,
|
||||
用户体验是半残废的。等后期想清楚怎么"真·暂停"(cancel run +
|
||||
保留 checkpoint)+ "真·继续"(重新订阅同一 run)再加回来。
|
||||
hook 里的 pauseWriting / resumeWriting 代码保留以便后期复用。 */}
|
||||
{(isDone || isError) && (
|
||||
<Button variant="ghost" size="sm" className="h-7 px-2 text-xs gap-1" onClick={reset}>
|
||||
<RotateCcw className="size-3" />
|
||||
|
||||
Reference in new issue
Block a user