iter(g300): 修正 toast 悬停暂停从未生效

This commit is contained in:
HIsheR
2026-10-27 00:25:55 +08:00
parent a8ff91c0a8
commit c013998f88
7 changed files with 51 additions and 20 deletions
+10
View File
@@ -0,0 +1,10 @@
import { readFileSync, writeFileSync } from 'node:fs';
// 用法:node .ua/add-entry.mjs <条目json文件>:把自补条目追加进 backlog(按 id 升序插到末尾)
const [src] = process.argv.slice(2);
const b = JSON.parse(readFileSync('.ua/backlog.json', 'utf8'));
const entry = JSON.parse(readFileSync(src, 'utf8'));
if (b.items.some((i) => i.id === entry.id)) throw new Error(`id 已存在:${entry.id}`);
b.items.push(entry);
writeFileSync('.ua/backlog.json', JSON.stringify(b, null, 2) + '\n', 'utf8');
console.log('added', entry.id, entry.title);
+10 -1
View File
@@ -3086,6 +3086,15 @@
"motivation": "清单只覆盖到 sparkline,后期新增的命令面板、通知条、环形进度没有抽查位——视觉类条目收尾时「照单过一遍」会直接跳过它们,等于裸奔。",
"acceptance": "① ITERATION.md 新增三段共 11 条,维度落在五类内;② ua.js 的 REQUIRED 从 13 扩到 16、下限自动变 48 条、OK 文案同步;③ AGENTS 的清单描述同步为十六段 ≥48 条;④ npm run verify / check 全绿。",
"notes": "ITERATION.md 抽查清单加 commandPalette(4) / noticeBar(3) / progressRing(4);REQUIRED 13→16、条目下限自动 39→48、verify OK 文案与 AGENTS 描述同步"
},
{
"id": "g300",
"domain": "tune",
"status": "open",
"title": "toast 悬停暂停从未生效:宿主穿透把指针拦在门外",
"motivation": "toast.ts 里写了 pointerenter 暂停倒计时,但样式只在 .ua-toast.is-closable / .is-action 时才给 pointer-events: auto,默认 toast 全程穿透——最常见的「toast.success(msg)」根本收不到 hover,暂停逻辑成了死代码;键盘用户 Tab 进关闭按钮时也照样被倒计时收走。",
"acceptance": "① .ua-toast 自身接收指针,删掉 is-closable / is-action 两处补丁式 pointer-events(宿主容器仍穿透,只有卡片本体可命中);② 暂停 / 恢复抽成 pause/resume,剩余时长不低于 400ms 且重复进入不二次扣减;③ focusin / focusout 与悬停同口径暂停,焦点在卡片内部移动不恢复;④ manifest 的 closable 说明与手把手步骤同步,npm run check 全绿。",
"notes": ""
}
]
}
}
+3 -2
View File
@@ -1,6 +1,6 @@
{
"$schema": "ui-arch-registry-index/0.1",
"generatedAt": "2026-10-26T15:38:27.731Z",
"generatedAt": "2026-10-26T16:25:36.184Z",
"repoRoot": ".",
"packages": [
{
@@ -1257,7 +1257,7 @@
{
"n": "closable",
"t": "boolean",
"d": "显示关闭按钮,点 × 立即收起;缺省 false(仅可关闭的 toast 接收指针事件,其余保持穿透)",
"d": "显示关闭按钮,点 × 立即收起;缺省 false(任意 toast 都接收指针,悬停或聚焦即暂停倒计时)",
"df": "false"
},
{
@@ -1282,6 +1282,7 @@
"steps": [
"直接调用语义工厂:toast.info / success / warning / error(message, duration?),无需先建容器",
"不传 duration 时默认停留 3 秒后自动淡出并移除节点",
"鼠标悬停或键盘 Tab 进卡片时倒计时暂停,移出 / 焦点离开后按剩余时长续走(剩余不足 400ms 时补到 400ms,避免松手即消失);宿主容器仍穿透,只有卡片本体这一小块可命中",
"多条消息在右上角自动纵向堆叠,互不遮挡",
"需要完整入参(含 variant)时用 showToast(props);组件挂载容器由内部懒创建,样式随 ui.css 一起引入",
"同屏最多 4 条,超出自动挤掉最早一条;需要用户主动确认的消息用 showToast({ closable: true }) 给个 ×",