- 侧栏与命令面板没有「待处理」;/console/inbox?kind= 按问题类型跳到整理记录「需要处理」、下载面板、运行状态或订阅 - 整理记录加「需要处理」筛选,行内写原因与推荐动作(指定作品 / 重新整理 / 让智能体识别 / 替换·保留两者·跳过 / 忽略), 详情页同样可处理;处理按钮从原待处理页抽成 components/decisions/decision-actions.tsx 复用 - 铃铛只放等你批准的智能体操作与系统健康;首页「要我处理」与运行状态「需要关注」放汇总计数,运行状态加智能体用量 - 设置 → 智能体:预算卡改为「用量与限制」(只剩单次工具调用与时长,附花费统计),自动调查卡加「整理识别不到作品时叫智能体识别」 - 集数待确认的原因显示在作品页集数映射(可确认建议规则 / 智能体建议)与订阅详情;未识别资源在媒体库「未识别」里直接选候选或指定 - 下载、站点、任务里指向待处理的链接改到对应页面 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
61 lines
2.4 KiB
TypeScript
61 lines
2.4 KiB
TypeScript
import type { Decision } from "@umt/contracts";
|
|
import { useDecisions } from "~/api/decisions.ts";
|
|
import { humanizeReason } from "~/lib/reasons.ts";
|
|
import { EpisodeDecision } from "./decision.tsx";
|
|
|
|
// 集数待确认的原因(2026-10-06 去掉待处理中心后):不再作为逐条要处理的条目,
|
|
// 同一作品的问题聚合在作品页「集数映射」与订阅详情里显示原因;智能体建议 / 建议规则仍可在这里一键确认。
|
|
// 数据来自内部事项 episode_mapping(只给关注中的作品开,见 server sources-identity/service/watched.ts)。
|
|
|
|
const OPEN = ["open", "investigating", "awaiting_user"];
|
|
|
|
function entityOf(d: Decision): string | null {
|
|
const m = d.evidence.mediaEntityId;
|
|
return typeof m === "string" ? m : d.subjectType === "media_entity" ? d.subjectId : null;
|
|
}
|
|
|
|
/** 某作品(可选按来源季)未关闭的集数待确认事项 */
|
|
export function useEpisodeIssues(entityId: string | null | undefined, season?: number | null) {
|
|
const q = useDecisions({ kind: "episode_mapping" }, !!entityId);
|
|
const items = (q.data?.pages.flatMap((p) => p.items) ?? []).filter(
|
|
(d) =>
|
|
OPEN.includes(d.status) &&
|
|
entityOf(d) === entityId &&
|
|
(season == null || (d.evidence as { season?: unknown }).season === season),
|
|
);
|
|
return { ...q, items };
|
|
}
|
|
|
|
/** 作品页集数映射分区:逐组写原因,建议规则 / 智能体建议可确认 */
|
|
export function EpisodeIssuesList({ entityId }: { entityId: string }) {
|
|
const { items } = useEpisodeIssues(entityId);
|
|
if (!items.length) return null;
|
|
return (
|
|
<div className="space-y-3">
|
|
<p className="text-caption font-medium text-foreground">换算不了的资源({items.length} 组)</p>
|
|
<ul className="space-y-3">
|
|
{items.map((d) => (
|
|
<li key={d.id} className="rounded-lg border border-border/80 p-3">
|
|
<EpisodeDecision d={d} open />
|
|
</li>
|
|
))}
|
|
</ul>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
/** 订阅详情:缺集原因一句一组(只读,处理去作品页) */
|
|
export function EpisodeIssueReasons({ entityId, season }: { entityId: string; season: number | null }) {
|
|
const { items } = useEpisodeIssues(entityId, season);
|
|
if (!items.length) return null;
|
|
return (
|
|
<ul className="mt-2 space-y-1 text-meta text-muted-foreground">
|
|
{items.map((d) => (
|
|
<li key={d.id} className="break-words">
|
|
{d.summary ? humanizeReason(d.summary) : d.title}
|
|
</li>
|
|
))}
|
|
</ul>
|
|
);
|
|
}
|