@ssamurias/dsh-fish 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +13 -3
- package/CHANGELOG.md +110 -1
- package/README.md +37 -122
- package/RELEASE-NOTES-1.1.5.md +49 -0
- package/RELEASE-NOTES-1.1.6.md +57 -0
- package/lib/ask.js +7 -1
- package/lib/becoming.js +70 -0
- package/lib/claim.js +23 -0
- package/lib/client.js +306 -71
- package/lib/cue.js +99 -23
- package/lib/decisions.js +207 -0
- package/lib/derive.js +148 -13
- package/lib/events.js +28 -0
- package/lib/guard.js +75 -9
- package/lib/handoff.js +9 -1
- package/lib/herpeople.js +1 -1
- package/lib/home.js +4 -0
- package/lib/index.js +9 -3
- package/lib/memorymap-html.js +1 -1
- package/lib/move.js +68 -8
- package/lib/observe-bili.js +32 -2
- package/lib/observe-config.js +14 -2
- package/lib/observe-data.js +19 -1
- package/lib/observe-home.js +13 -3
- package/lib/observe-state.js +3 -2
- package/lib/people.js +20 -11
- package/lib/peopledoc.js +1 -1
- package/lib/persona.js +15 -0
- package/lib/proactive.js +4 -2
- package/lib/quality.js +202 -48
- package/lib/recall.js +103 -24
- package/lib/reset-pending.js +15 -5
- package/lib/reset.js +78 -0
- package/lib/retire.js +42 -1
- package/lib/say.js +45 -3
- package/lib/scheduler.js +69 -30
- package/lib/selfdoc.js +1 -1
- package/lib/settings.js +148 -31
- package/lib/speak.js +10 -5
- package/lib/status.js +1 -1
- package/lib/timeintent.js +178 -0
- package/lib/turns.js +40 -1
- package/lib/types.d.ts +1 -0
- package/lib/wiki.js +66 -8
- package/package.json +4 -1
- package/tools/README.md +70 -0
- package/tools/recall-bench.mjs +240 -0
- package/tools/recall-cases.json +64 -0
- package/tools/recall-live-cases.json +20 -0
- package/lib/client/00-shell.js +0 -630
- package/lib/client/01-state-load.js +0 -962
- package/lib/client/02-actions.js +0 -692
- package/lib/client/03-widgets-header.js +0 -749
- package/lib/client/04-pressure-lab.js +0 -906
- package/lib/client/05-pressure-charts.js +0 -431
- package/lib/client/06-tab-status-grow.js +0 -479
- package/lib/client/07-tab-home-bili.js +0 -610
- package/lib/client/08-tab-memory-plugins.js +0 -676
- package/lib/client/09-tab-outing.js +0 -797
- package/lib/client/10-data-handlers.js +0 -519
- package/lib/client/11-tab-data-frame.js +0 -755
- package/lib/client/12-pressure-chip-mount.js +0 -579
- package/scripts/build-client.mjs +0 -97
- package/scripts/sync-pressure-formulas.mjs +0 -14
package/lib/client.js
CHANGED
|
@@ -570,8 +570,88 @@ window.__ModuleLoader__.load({
|
|
|
570
570
|
'.dfish .qrbtns button{height:30px;padding:0 14px;font-size:13px;border-radius:8px}',
|
|
571
571
|
'.dfish .qrbtns button.go{background:var(--dsw-alias-state-business-primary);border-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-label-primary-inverted,#fff)}',
|
|
572
572
|
'.dfish .qrbtns button.go:hover:not(:disabled){opacity:.9;color:var(--dsw-alias-label-primary-inverted,#fff);border-color:var(--dsw-alias-state-business-primary)}',
|
|
573
|
+
// 看过的视频:两列大图卡片(2026-12-01,用户要求参考 dsh-bili-scroll)。
|
|
574
|
+
// 按天分块,每块内部是 16:9 封面 + 两行标题 + 来路/UP 的网格。
|
|
575
|
+
// 封面用 aspect-ratio 撑住高度,取不到图时那一格留灰底——不会把整行拽塌。
|
|
576
|
+
'.dfish .histdays{display:flex;flex-direction:column;gap:16px;margin:2px 0}',
|
|
577
|
+
'.dfish .histday{min-width:0}',
|
|
578
|
+
'.dfish .histdayhd{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 7px;padding:0 0 5px;border-bottom:.5px solid var(--dsw-alias-border-l2);font-size:12px;line-height:17px;color:var(--dsw-alias-label-tertiary)}',
|
|
579
|
+
'.dfish .histdayhd b{font-weight:600;font-size:12.5px;letter-spacing:.02em;font-variant-numeric:tabular-nums}',
|
|
580
|
+
'.dfish .histgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}',
|
|
581
|
+
'.dfish .histcard{display:flex;flex-direction:column;min-width:0;overflow:hidden;border:.5px solid var(--dsw-alias-border-l2);border-radius:10px;background:rgba(128,128,128,.04);color:inherit;text-decoration:none;transition:border-color .15s,background .15s}',
|
|
582
|
+
'.dfish .histcard:hover{border-color:var(--dsw-alias-state-business-primary);background:rgba(128,128,128,.08);color:inherit;text-decoration:none}',
|
|
583
|
+
'.dfish .histcard:hover .histtitle{text-decoration:underline}',
|
|
584
|
+
'.dfish .histcoverwrap{display:block;position:relative;aspect-ratio:16/9;background:rgba(128,128,128,.14);overflow:hidden}',
|
|
585
|
+
'.dfish .histcover{display:block;width:100%;height:100%;object-fit:cover}',
|
|
586
|
+
'.dfish .histbody{display:flex;flex-direction:column;gap:6px;padding:8px 10px 10px;min-width:0}',
|
|
587
|
+
'.dfish .histtitle{font-size:13px;line-height:19px;font-weight:500;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}',
|
|
588
|
+
'.dfish .histsub{display:flex;align-items:center;gap:6px;min-width:0;font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary)}',
|
|
589
|
+
'.dfish .histsub .tag{margin-left:0;flex:0 0 auto}',
|
|
590
|
+
'.dfish .histup{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
591
|
+
// 「看过画面」是三种来路里最实的一种,卡片上给它一点颜色;另两种保持灰。
|
|
592
|
+
'.dfish .histhow.watch{color:var(--dsw-alias-state-business-primary);border-color:var(--dsw-alias-state-business-primary)}',
|
|
593
|
+
// 手机窄屏(2026-12-01,用户要求:只在手机尺寸下变,电脑端一模一样)。
|
|
594
|
+
// 走 @media 而不是 container:dsh-Go 的网页版就是把官方 UI 铺在整个 WebView 里,
|
|
595
|
+
// 视口宽就是内容宽;桌面端超过 600 一行都不命中,样式与原来逐字相同。
|
|
596
|
+
// 触控尺寸:宿主在「手机布局 + 粗指针」下会给 button/select/input 兜 44×44,
|
|
597
|
+
// 这里自己先抬到 38–40,普通手机浏览器里也不至于太小;开关单独退出那条规则
|
|
598
|
+
// (data-dsh-adapt="off",见 03-widgets-header.js),否则 40×22 的胶囊会被撑成方块。
|
|
599
|
+
'@media (max-width: 600px){' + [
|
|
600
|
+
'.dfish{gap:12px}',
|
|
601
|
+
'.dfish .page{grid-template-columns:minmax(0,1fr);gap:12px}',
|
|
602
|
+
'.dfish .card{padding:11px 12px}',
|
|
603
|
+
'.dfish .tabs{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-overflow-scrolling:touch}',
|
|
604
|
+
'.dfish .tabs::-webkit-scrollbar{display:none}',
|
|
605
|
+
'.dfish .tabs .grow{display:none}',
|
|
606
|
+
'.dfish .tab{flex:0 0 auto;height:36px;padding:0 13px;font-size:13px}',
|
|
607
|
+
'.dfish .grid2{grid-template-columns:minmax(0,1fr)}',
|
|
608
|
+
'.dfish .kv{grid-template-columns:auto minmax(0,1fr);gap:4px 10px}',
|
|
609
|
+
'.dfish .form label{flex-direction:column;align-items:flex-start;gap:5px}',
|
|
610
|
+
// 输入框的 width:100% 要配 border-box,否则 padding 和描边会把它顶出卡片右边。
|
|
611
|
+
'.dfish input[type=text],.dfish input[type=number],.dfish input[type=time],.dfish input[type=date],.dfish select{box-sizing:border-box}',
|
|
612
|
+
'.dfish input[type=text]{min-width:0;width:100%;height:38px;font-size:16px}',
|
|
613
|
+
'.dfish input[type=number]{width:76px;height:38px;font-size:16px}',
|
|
614
|
+
'.dfish input[type=time]{height:38px;font-size:16px}',
|
|
615
|
+
'.dfish input[type=date]{height:38px;font-size:16px;max-width:100%}',
|
|
616
|
+
'.dfish select{height:38px;font-size:16px;max-width:100%}',
|
|
617
|
+
'.dfish textarea{min-height:88px;font-size:16px;line-height:22px}',
|
|
618
|
+
'.dfish button{height:38px;padding:0 12px}',
|
|
619
|
+
'.dfish .sw{width:46px;height:28px}',
|
|
620
|
+
'.dfish .sw .knob{width:22px;height:22px}',
|
|
621
|
+
'.dfish .sw.on .knob{left:20px}',
|
|
622
|
+
'.dfish .step{width:38px;height:38px;font-size:16px}',
|
|
623
|
+
'.dfish .chip{height:32px;padding:0 11px;font-size:12.5px}',
|
|
624
|
+
'.dfish .pager button{height:32px}',
|
|
625
|
+
'.dfish .seg>button{height:32px}',
|
|
626
|
+
'.dfish .go{height:38px}',
|
|
627
|
+
'.dfish .faq-btn{height:40px}',
|
|
628
|
+
'.dfish details.adv>summary{min-height:36px;line-height:36px}',
|
|
629
|
+
// 看过的视频:两列在 390 宽时每张只剩 ~170px,标题和来路标签挤成一团,回落单列。
|
|
630
|
+
'.dfish .histgrid{grid-template-columns:minmax(0,1fr);gap:10px}',
|
|
631
|
+
'.dfish .histtitle{font-size:13.5px;line-height:20px}',
|
|
632
|
+
// 日期头那颗「只看这天」写的是行内 style(22px),要 !important 才抬得动。
|
|
633
|
+
'.dfish .histdayhd button{height:32px!important;padding:0 10px!important;font-size:12px!important}',
|
|
634
|
+
// 六列固定表:不缩字,改成整表横向滑动(外层就是 overflowX:auto 的盒子)。
|
|
635
|
+
'.dfish .pressure-table{min-width:520px;table-layout:auto}',
|
|
636
|
+
// 图表的 viewBox 是 680–750 宽,硬缩到 390 时轴字只剩 6–7px;给一条横向滑动的地板。
|
|
637
|
+
'.dfish .chartscroll{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}',
|
|
638
|
+
'.dfish .chartscroll>svg{min-width:620px}',
|
|
639
|
+
// 月历:30px 格子排成 222px 宽在手机上够用但难点;窄屏撑满一行、格子抬到 34。
|
|
640
|
+
'.dfish .calwrap{display:block!important;width:100%;box-sizing:border-box}',
|
|
641
|
+
'.dfish .cal{grid-template-columns:repeat(7,minmax(0,1fr))!important;width:100%}',
|
|
642
|
+
'.dfish .cal>button{height:34px!important;line-height:34px!important}',
|
|
643
|
+
'.dfish .qrovl{padding:12px}',
|
|
644
|
+
'.dfish .qrcard{padding:16px 14px 12px}',
|
|
645
|
+
'.dfish .qrbtns button{height:40px}',
|
|
646
|
+
].join('') + '}',
|
|
573
647
|
].join('\n')
|
|
574
648
|
|
|
649
|
+
// 图表在窄屏下不缩字,改成一条可横向滑动的画布(2026-12-01,手机适配)。
|
|
650
|
+
// 包一层 div 而不是给 svg 加 overflow:svg 自己的 overflow 不产生滚动条。
|
|
651
|
+
function chartBox(svg) {
|
|
652
|
+
return h('div', { className: 'chartscroll' }, svg)
|
|
653
|
+
}
|
|
654
|
+
|
|
575
655
|
function useStyleOnce() {
|
|
576
656
|
useEffect(() => {
|
|
577
657
|
const current = document.querySelector(`style[data-tag="${CSS_TAG}"]`)
|
|
@@ -673,6 +753,7 @@ window.__ModuleLoader__.load({
|
|
|
673
753
|
}, String(d)))
|
|
674
754
|
}
|
|
675
755
|
return h('div', {
|
|
756
|
+
className: 'calwrap',
|
|
676
757
|
style: {
|
|
677
758
|
display: 'inline-block', marginTop: '6px', padding: '8px 10px',
|
|
678
759
|
border: '1px solid rgba(128,128,128,.28)', borderRadius: '8px',
|
|
@@ -710,6 +791,7 @@ window.__ModuleLoader__.load({
|
|
|
710
791
|
h('button', { disabled: o.busy || !month, title: o.nextTitle, onClick: () => o.setMonth(calShiftMonth(month, 1)) }, '›'),
|
|
711
792
|
h('button', { disabled: o.busy || !days.length, title: o.recentTitle, onClick: () => o.setMonth(calMonthOf(days[0])) }, '最近')),
|
|
712
793
|
h('div', {
|
|
794
|
+
className: 'cal',
|
|
713
795
|
style: {
|
|
714
796
|
display: 'grid', gridTemplateColumns: 'repeat(7, 30px)',
|
|
715
797
|
gap: '2px', marginTop: '6px', alignItems: 'center',
|
|
@@ -748,6 +830,10 @@ window.__ModuleLoader__.load({
|
|
|
748
830
|
}
|
|
749
831
|
function qStability(v) {
|
|
750
832
|
if (!v) return '—'
|
|
833
|
+
// 2026-11-30(外部反馈「设置页还是 18 秒」):稳定要跑 24 次全量派生,
|
|
834
|
+
// 现在不在请求里现算了——先给上一份,或者让后台算完再回来。
|
|
835
|
+
// 那两种情况都不是「样本不够」,不能印成「还没攒到判断」。
|
|
836
|
+
if (v.pending) return '正在量(后台算,不挡页面;过一会儿再打开就有数)'
|
|
751
837
|
const band = bandOf(v && v.band)
|
|
752
838
|
// 2026-10-27(用户 m06350):能测出来的时候,数字和判读一起给——只印那句
|
|
753
839
|
// 「长在这些事上,抽掉一条少一块」,用户看不出到底是多少,以为没测。
|
|
@@ -986,6 +1072,10 @@ window.__ModuleLoader__.load({
|
|
|
986
1072
|
const [note, setNote] = useState('')
|
|
987
1073
|
// 设置界面重做(2026-10-23):当前页 + 新增的几个环境项
|
|
988
1074
|
const [tab, setTab] = useState('now')
|
|
1075
|
+
// 判决账(2026-11-29,用户 m00311):只读,和运行日志分开一张卡,不混在一起。
|
|
1076
|
+
// 放在 tab 之后:client.test.mjs 按下标找 tab,不能再往它前面加 state。
|
|
1077
|
+
const [decisions, setDecisions] = useState(null)
|
|
1078
|
+
const [decisionsBusy, setDecisionsBusy] = useState(false)
|
|
989
1079
|
const [pressure, setPressure] = useState(null)
|
|
990
1080
|
const [structureExperiment, setStructureExperiment] = useState({})
|
|
991
1081
|
const [requestExperiment, setRequestExperiment] = useState({})
|
|
@@ -1190,8 +1280,11 @@ window.__ModuleLoader__.load({
|
|
|
1190
1280
|
// 1.1.4:一次性提示(升级后第一次打开插件页看一次)。
|
|
1191
1281
|
const [notices, setNotices] = useState([])
|
|
1192
1282
|
// 时段(2026-10-23 加):醒来 / 上网 / 说话,三段各自可调
|
|
1193
|
-
|
|
1194
|
-
|
|
1283
|
+
// 醒来时段可以是多段(2026-11-30,用户 m01985):中午一段、晚上一段,
|
|
1284
|
+
// 各段按长度分配定时醒来。第一段同时写回老字段 `window`,老读取点照旧。
|
|
1285
|
+
const [wakeSegs, setWakeSegs] = useState([['20:00', '23:00']])
|
|
1286
|
+
// 改一段里的开始(k=0)或结束(k=1)
|
|
1287
|
+
const setWakeSegAt = (i, k, v) => setWakeSegs((list) => list.map((s, j) => (j === i ? (k === 0 ? [v, s[1]] : [s[0], v]) : s)))
|
|
1195
1288
|
// 上网时段没单独配 = 跟着醒来时段(issue #86 第 2 条),所以初值就是醒来那两个数
|
|
1196
1289
|
const [browseFrom, setBrowseFrom] = useState('20:00')
|
|
1197
1290
|
const [browseTo, setBrowseTo] = useState('23:00')
|
|
@@ -1575,6 +1668,19 @@ window.__ModuleLoader__.load({
|
|
|
1575
1668
|
try {
|
|
1576
1669
|
// 2026-11-28(外部反馈:设置页七项全显示默认值):/state 读不到不该把后面
|
|
1577
1670
|
// 整段拖下水——设置页的值是从 /config 回的整份配置灌的,那条能走通就照常显示。
|
|
1671
|
+
// 2026-12-01(issue #184):这几条互不依赖,先一起发出去,
|
|
1672
|
+
// 别让 /state 一条一条排队——串起来只会让首屏等最长的那一条。
|
|
1673
|
+
const batchP = Promise.all([
|
|
1674
|
+
jget('/beliefs'),
|
|
1675
|
+
jget('/diary'),
|
|
1676
|
+
jget('/config'),
|
|
1677
|
+
jget('/browse'),
|
|
1678
|
+
jget('/inbox?limit=60').catch(() => null),
|
|
1679
|
+
jget('/home').catch(() => null),
|
|
1680
|
+
jget('/paths').catch(() => null),
|
|
1681
|
+
])
|
|
1682
|
+
// 就算 /state 失败、没人来 await,也别留一个没人管的拒绝
|
|
1683
|
+
batchP.catch(() => {})
|
|
1578
1684
|
let s = null
|
|
1579
1685
|
const stateFail = await jget('/state').then((r) => { s = r; return '' }).catch((e) => String(e?.message || e))
|
|
1580
1686
|
if (stateFail) setErr(stateFail)
|
|
@@ -1628,15 +1734,7 @@ window.__ModuleLoader__.load({
|
|
|
1628
1734
|
// 不再拉 /events(2026-11-02,用户 m00335):这里取回来的 e.rows 只进了
|
|
1629
1735
|
// setEvents,全文件没有一处渲染它——每 30 秒白拉 25 条事件(九成是后台记账)。
|
|
1630
1736
|
// 想看账本原文去「数据」页,那里给的是路径,不靠这条轮询。
|
|
1631
|
-
const [b, d, c, br, ib, hm, pth] = await
|
|
1632
|
-
jget('/beliefs'),
|
|
1633
|
-
jget('/diary'),
|
|
1634
|
-
jget('/config'),
|
|
1635
|
-
jget('/browse'),
|
|
1636
|
-
jget('/inbox?limit=60').catch(() => null),
|
|
1637
|
-
jget('/home').catch(() => null),
|
|
1638
|
-
jget('/paths').catch(() => null),
|
|
1639
|
-
])
|
|
1737
|
+
const [b, d, c, br, ib, hm, pth] = await batchP
|
|
1640
1738
|
setBeliefs(b)
|
|
1641
1739
|
setDiary(d)
|
|
1642
1740
|
// 首天正文随 /diary 一起回来了,先灌进翻页缓存(省一次往返)。
|
|
@@ -1651,7 +1749,13 @@ window.__ModuleLoader__.load({
|
|
|
1651
1749
|
setHome(hm)
|
|
1652
1750
|
setDataPaths(pth)
|
|
1653
1751
|
// 迁移工作区:只读她现在住哪、有多少东西(失败就只显示按钮,不影响别处)
|
|
1654
|
-
|
|
1752
|
+
// 大小是后台量的(issue #184):这一趟先给「正在量」,过几秒再取一次就有数了。
|
|
1753
|
+
jget('/move').then((mv) => {
|
|
1754
|
+
setMoveInfo(mv)
|
|
1755
|
+
if (mv && mv.sizing) {
|
|
1756
|
+
window.setTimeout(() => { jget('/move').then(setMoveInfo).catch(() => {}) }, 4000)
|
|
1757
|
+
}
|
|
1758
|
+
}).catch(() => {})
|
|
1655
1759
|
// 自动备份现在攒了几份(失败就当还没攒过)
|
|
1656
1760
|
jget('/backup/auto').then(setAutoState).catch(() => {})
|
|
1657
1761
|
// 出门:现在在哪、有哪些工作区可去、说明卡确认过没有(失败就只显示空页)
|
|
@@ -1681,6 +1785,8 @@ window.__ModuleLoader__.load({
|
|
|
1681
1785
|
jget('/rules').then(setRules).catch(() => {})
|
|
1682
1786
|
// 运行日志:失败就当没这回事(日志本身坏了不该拖垮设置页)
|
|
1683
1787
|
jget('/log?lines=40').then(setLogTail).catch(() => {})
|
|
1788
|
+
// 判决账:只读聚合,失败就当这栏还没账(不影响其它卡片)。
|
|
1789
|
+
jget('/decisions?days=7').then(setDecisions).catch(() => {})
|
|
1684
1790
|
// 她的东西(1.0.4):只读清单,失败就当这栏还没东西。
|
|
1685
1791
|
jget('/works?limit=30').then(setWorks).catch(() => {})
|
|
1686
1792
|
// 报告:先拿日期列表,再取最新那天的正文(失败不影响其它卡片)
|
|
@@ -1789,7 +1895,11 @@ window.__ModuleLoader__.load({
|
|
|
1789
1895
|
setCloudLatestUp(cfg.cloud?.latestUp === true)
|
|
1790
1896
|
// 时段:醒来 / 上网 / 说话。坏值由服务端兜底,这里只做展示。
|
|
1791
1897
|
const w0 = Array.isArray(cfg.window) ? cfg.window : ['20:00', '23:00']
|
|
1792
|
-
|
|
1898
|
+
// 多段(2026-11-30):`windows` 是全量,老配置只有 `window` 时按一段处理。
|
|
1899
|
+
const ws = Array.isArray(cfg.windows) && cfg.windows.length
|
|
1900
|
+
? cfg.windows.filter((x) => Array.isArray(x) && x.length === 2).map((x) => [String(x[0]), String(x[1])])
|
|
1901
|
+
: []
|
|
1902
|
+
setWakeSegs(ws.length ? ws : [[String(w0[0]), String(w0[1])]])
|
|
1793
1903
|
// 上网时段:没单独配(null)就是跟着醒来时段,界面上直接显示醒来那两个数。
|
|
1794
1904
|
const b0 = Array.isArray(cfg.browse?.window) ? cfg.browse.window : w0
|
|
1795
1905
|
setBrowseFrom(b0[0]); setBrowseTo(b0[1])
|
|
@@ -1931,7 +2041,9 @@ window.__ModuleLoader__.load({
|
|
|
1931
2041
|
minDuration: Number(avoidMinDur),
|
|
1932
2042
|
upMids: avoidMids.split(/[,,\s]+/).map((x) => x.trim()).filter(Boolean),
|
|
1933
2043
|
},
|
|
1934
|
-
window
|
|
2044
|
+
// 醒来时段:`window` 是第一段(老字段),`windows` 是全量(2026-11-30)。
|
|
2045
|
+
window: wakeSegs[0] ? wakeSegs[0].slice() : ['20:00', '23:00'],
|
|
2046
|
+
windows: wakeSegs.map((s) => s.slice()),
|
|
1935
2047
|
// 2026-11-07(用户反馈):能上网这颗开关要写到两个地方——
|
|
1936
2048
|
// bili.enabled 是 0.9.x 下 bili_look / bili_watch 真正认的闸门;
|
|
1937
2049
|
// browse.enabled 留着给老参数(以及以后要不要恢复自动刷的那个决定)。
|
|
@@ -2013,8 +2125,13 @@ window.__ModuleLoader__.load({
|
|
|
2013
2125
|
if (from === to) return `${label}:开始和结束不能是同一时刻。要全天,请设 00:00–23:59。`
|
|
2014
2126
|
return ''
|
|
2015
2127
|
}
|
|
2016
|
-
|
|
2017
|
-
|
|
2128
|
+
const segs = Array.isArray(wakeSegs) && wakeSegs.length ? wakeSegs : [['20:00', '23:00']]
|
|
2129
|
+
for (let i = 0; i < segs.length; i += 1) {
|
|
2130
|
+
const label = segs.length > 1 ? `${S('她醒着的时间段')}(第 ${i + 1} 段)` : S('她醒着的时间段')
|
|
2131
|
+
const why = one(label, segs[i][0], segs[i][1])
|
|
2132
|
+
if (why) return why
|
|
2133
|
+
}
|
|
2134
|
+
return one('上网时段', browseFrom, browseTo)
|
|
2018
2135
|
|| one('评论时段', commentFrom, commentTo)
|
|
2019
2136
|
}
|
|
2020
2137
|
|
|
@@ -2573,6 +2690,10 @@ window.__ModuleLoader__.load({
|
|
|
2573
2690
|
type: 'button',
|
|
2574
2691
|
className: 'sw' + (o.on ? ' on' : ''),
|
|
2575
2692
|
role: 'switch',
|
|
2693
|
+
// 2026-12-01:dsh-Go 的网页版会给 [data-slot="main"] 里的 button 兜 44×44
|
|
2694
|
+
// 的触控最小尺寸;开关是固定 40×22 的胶囊,被撑高会变成一块竖着的圆角砖。
|
|
2695
|
+
// 这一颗自己退出那条规则,窄屏样式里再把胶囊抬到 46×28。
|
|
2696
|
+
'data-dsh-adapt': 'off',
|
|
2576
2697
|
'aria-checked': o.on ? 'true' : 'false',
|
|
2577
2698
|
onClick: () => o.onChange(!o.on),
|
|
2578
2699
|
}, h('span', { className: 'knob' })))
|
|
@@ -3904,7 +4025,7 @@ window.__ModuleLoader__.load({
|
|
|
3904
4025
|
const ticks = signed ? [-limit, -limit / 2, 0, limit / 2, limit] : [0, limit / 2, limit]
|
|
3905
4026
|
return h('section', { className: 'pressure-section' },
|
|
3906
4027
|
h('h4', null, label + '(压力分)'),
|
|
3907
|
-
h('svg', { viewBox: '0 0 680 250', role: 'group', 'aria-label': label, style: { width: '100%' } },
|
|
4028
|
+
chartBox(h('svg', { viewBox: '0 0 680 250', role: 'group', 'aria-label': label, style: { width: '100%' } },
|
|
3908
4029
|
...ticks.map(tick => h('g', { key: tick },
|
|
3909
4030
|
h('line', { x1: 58, x2: 660, y1: y(tick), y2: y(tick), stroke: 'currentColor',
|
|
3910
4031
|
opacity: tick === 0 ? .85 : .2, strokeWidth: tick === 0 ? 2 : 1 }),
|
|
@@ -3928,7 +4049,7 @@ window.__ModuleLoader__.load({
|
|
|
3928
4049
|
width: 30, height: barHeight, fill: barColors[row.horizon] }),
|
|
3929
4050
|
h('text', { x, y: value < 0 ? Math.min(220, y(value) + 12) : y(value) - 5, textAnchor: 'middle',
|
|
3930
4051
|
fill: 'currentColor', fontSize: 11 }, result.count + ' 次'))
|
|
3931
|
-
})),
|
|
4052
|
+
}))),
|
|
3932
4053
|
h('p', null, ...backtestHorizons.map(horizon => h('span', { key: horizon, style: { marginInlineEnd: 14 } },
|
|
3933
4054
|
h('span', { style: { color: barColors[horizon] }, 'aria-hidden': true }, '■ '), '提前 ' + horizon + ' 轮'))))
|
|
3934
4055
|
}
|
|
@@ -3960,7 +4081,7 @@ window.__ModuleLoader__.load({
|
|
|
3960
4081
|
h('label', null, '预测起点 ', h('select', { value: detailOrigin,
|
|
3961
4082
|
onChange: event => changeTrend({ backtestOrigin: Number(event.currentTarget.value) }) },
|
|
3962
4083
|
...detailOrigins.map(round => h('option', { key: round, value: round }, '第 ' + round + ' 轮'))))),
|
|
3963
|
-
h('svg', { viewBox: '0 0 680 255', role: 'group', 'aria-label': '真实压力与预测压力', style: { width: '100%' } },
|
|
4084
|
+
chartBox(h('svg', { viewBox: '0 0 680 255', role: 'group', 'aria-label': '真实压力与预测压力', style: { width: '100%' } },
|
|
3964
4085
|
...[0, 25, 50, 75, 100].map(value => h('g', { key: value },
|
|
3965
4086
|
h('line', { x1: 48, x2: 660, y1: detailY(value), y2: detailY(value), stroke: 'currentColor', opacity: .2 }),
|
|
3966
4087
|
h('text', { x: 40, y: detailY(value) + 4, textAnchor: 'end', fill: 'currentColor', fontSize: 12 }, value))),
|
|
@@ -3983,7 +4104,7 @@ window.__ModuleLoader__.load({
|
|
|
3983
4104
|
row ? h('circle', { cx: detailX(point.round), cy: detailY(row.estimate), r: 5, fill: '#c96a11' }) : null)
|
|
3984
4105
|
}),
|
|
3985
4106
|
...[...new Set([1, detailOrigin, ...detailRecords.map(row => row.target)])].map(round =>
|
|
3986
|
-
h('text', { key: round, x: detailX(round), y: 239, fill: 'currentColor', fontSize: 12, textAnchor: 'middle' }, round))),
|
|
4107
|
+
h('text', { key: round, x: detailX(round), y: 239, fill: 'currentColor', fontSize: 12, textAnchor: 'middle' }, round)))),
|
|
3987
4108
|
h('p', null, '蓝实线为真实压力,橙虚线通向各有效预测目标。竖线标出预测起点及已记录事件。'),
|
|
3988
4109
|
pressureTable(['目标轮', '实际', '预测', '误差', '归因'], detailRecords.map(row =>
|
|
3989
4110
|
[row.target, row.target, scoreOf(row.actual), scoreOf(row.estimate), signedScore(row.estimate - row.actual),
|
|
@@ -4105,7 +4226,7 @@ window.__ModuleLoader__.load({
|
|
|
4105
4226
|
!trendLoading && (loadedIds.some(id => trendData[id]?.status !== 'analyzed'))
|
|
4106
4227
|
? h('p', { className: 'hint' }, '部分会话的日志不可用或超出本地分析范围。') : null,
|
|
4107
4228
|
!shownSeries.some(line => line.points.some(point => Number.isFinite(point.score))) ? h('p', null, '该范围暂无可绘制的完整轮末读数。') : null,
|
|
4108
|
-
shownSeries.length ? h('svg', { viewBox: '0 0 750 282', role: 'group', 'aria-label': '用户已完成轮次与压力分',
|
|
4229
|
+
shownSeries.length ? chartBox(h('svg', { viewBox: '0 0 750 282', role: 'group', 'aria-label': '用户已完成轮次与压力分',
|
|
4109
4230
|
style: { width: '100%', height: 'auto', minHeight: '160px' } },
|
|
4110
4231
|
...[0, 25, 50, 75, 100].map(score => h('g', { key: score },
|
|
4111
4232
|
h('line', { x1: 46, x2: 726, y1: trendY(score), y2: trendY(score), stroke: 'currentColor', opacity: .14 }),
|
|
@@ -4136,7 +4257,7 @@ window.__ModuleLoader__.load({
|
|
|
4136
4257
|
h('rect', { x: 46, y: 32, width: 680, height: 204, fill: 'transparent',
|
|
4137
4258
|
onPointerMove: event => setTrendFocus(pointerRound(event)),
|
|
4138
4259
|
onPointerLeave: () => setTrendFocus(null),
|
|
4139
|
-
onClick: event => chooseRound(pointerRound(event)) })) : null,
|
|
4260
|
+
onClick: event => chooseRound(pointerRound(event)) }))) : null,
|
|
4140
4261
|
shownSeries.length ? h('div', null,
|
|
4141
4262
|
h('label', null, '查看第 ' + focusRound + ' 轮 ', h('input', { type: 'range', min: firstRound, max: maxRound,
|
|
4142
4263
|
value: focusRound, onChange: event => chooseRound(event.currentTarget.valueAsNumber) })),
|
|
@@ -4225,7 +4346,7 @@ window.__ModuleLoader__.load({
|
|
|
4225
4346
|
if (!points.some(point => lines.some(line => Number.isFinite(line.read(point))))) {
|
|
4226
4347
|
return h('p', { className: 'hint' }, '暂无可绘制的轮末分数。')
|
|
4227
4348
|
}
|
|
4228
|
-
return h('svg', { viewBox: '0 0 680 220', role: 'group', 'aria-label': '轮末压力走势(0–100)', style: { width: '100%' } },
|
|
4349
|
+
return chartBox(h('svg', { viewBox: '0 0 680 220', role: 'group', 'aria-label': '轮末压力走势(0–100)', style: { width: '100%' } },
|
|
4229
4350
|
...[0, 25, 50, 75, 100].map(value => h('g', { key: value },
|
|
4230
4351
|
h('line', { x1: 43, x2: 660, y1: y(value), y2: y(value), stroke: 'currentColor', opacity: .16 }),
|
|
4231
4352
|
h('text', { x: 35, y: y(value) + 4, fill: 'currentColor', fontSize: 12, textAnchor: 'end' }, value))),
|
|
@@ -4245,7 +4366,7 @@ window.__ModuleLoader__.load({
|
|
|
4245
4366
|
h('title', null, label),
|
|
4246
4367
|
...values.map(([line, score]) => h('circle', { key: line.label, cx: x(point.round), cy: y(score), r: 3, fill: line.color })),
|
|
4247
4368
|
point.markers.length ? h('path', { d: 'M ' + x(point.round) + ' 13 l 4 4 -4 4 -4 -4 z', fill: 'currentColor' }) : null)] : []
|
|
4248
|
-
}))
|
|
4369
|
+
})))
|
|
4249
4370
|
}
|
|
4250
4371
|
function lineToggles(key, options) {
|
|
4251
4372
|
const hidden = trendConfig[key] ?? []
|
|
@@ -4461,7 +4582,7 @@ window.__ModuleLoader__.load({
|
|
|
4461
4582
|
function contributionBars(values, name) {
|
|
4462
4583
|
if (!values) return h('p', { className: 'hint' }, '该公式或端点缺少可分解的分数。')
|
|
4463
4584
|
const scale = 208 / Math.max(1, ...values.map(Math.abs))
|
|
4464
|
-
return h('svg', { viewBox: '0 0 650 132', role: 'group', 'aria-label': name, style: { width: '100%' } },
|
|
4585
|
+
return chartBox(h('svg', { viewBox: '0 0 650 132', role: 'group', 'aria-label': name, style: { width: '100%' } },
|
|
4465
4586
|
h('line', { x1: 320, x2: 320, y1: 6, y2: 116, stroke: 'currentColor', opacity: .6 }),
|
|
4466
4587
|
...values.map((value, index) => {
|
|
4467
4588
|
const y = 15 + 35 * index
|
|
@@ -4470,7 +4591,7 @@ window.__ModuleLoader__.load({
|
|
|
4470
4591
|
h('title', null, label), h('text', { x: 10, y: y + 13, fill: 'currentColor', fontSize: 14 }, scoreNames[index]),
|
|
4471
4592
|
h('rect', { x: 320 + Math.min(0, value * scale), y, width: Math.abs(value * scale), height: 17, fill: childColors[index] }),
|
|
4472
4593
|
h('text', { x: 555, y: y + 13, fill: 'currentColor', fontSize: 14 }, signedScore(value)))
|
|
4473
|
-
}))
|
|
4594
|
+
})))
|
|
4474
4595
|
}
|
|
4475
4596
|
const attributionPanel = !wantAttribution ? null : h('section', { className: 'load-panel' },
|
|
4476
4597
|
h('h4', null, '压力变化归因 · v0.1'),
|
|
@@ -4902,7 +5023,7 @@ window.__ModuleLoader__.load({
|
|
|
4902
5023
|
'醒来通常带一张事件卡。定时醒来取「每天定时醒几次」和「每天几张事件卡」里小的;主动搭话另算,不占这个数。这是上限,不是保证:没有可出的事、或落点太靠后,可能少醒一次。',
|
|
4903
5024
|
h('div', { className: 'grid2' },
|
|
4904
5025
|
Num({ label: '每天定时醒几次', value: wakes, onChange: setWakes, min: 0, max: 12, unit: '次',
|
|
4905
|
-
hint: S('只限定时醒来(含空醒)。你手动叫醒会记一次、挤掉后面的定时醒来,但手动本身随时能按(每天醒 0 次时除外)。0 为关掉定时醒来,右上角「现在叫醒大肥鱼」也叫不醒;直接跟她说话不受影响。范围 0–12
|
|
5026
|
+
hint: S('只限定时醒来(含空醒)。你手动叫醒会记一次、挤掉后面的定时醒来,但手动本身随时能按(每天醒 0 次时除外)。0 为关掉定时醒来,右上角「现在叫醒大肥鱼」也叫不醒;直接跟她说话不受影响。范围 0–12:每醒一次都是一次模型调用,开得越密越慢、越费钱。醒来时段有几段时,这几下会按段长分到各段里——两段都开、次数却只有 1,就只会醒在其中一段。') }),
|
|
4906
5027
|
Num({ label: '每天几张事件卡', value: eventsPerDay, onChange: setEventsPerDay, min: 0, max: 12, unit: '张',
|
|
4907
5028
|
hint: S('只限定时醒来;和「每天定时醒几次」取小的(两个都调大才有效)。0 为关掉定时醒来,手动按钮也叫不醒;直接跟她说话不受影响。范围 0–12。') }),
|
|
4908
5029
|
Num({ label: '对话停下来多久才叫醒', value: quietMin, onChange: setQuietMin, min: 0, max: 60, unit: '分钟',
|
|
@@ -4910,8 +5031,36 @@ window.__ModuleLoader__.load({
|
|
|
4910
5031
|
Sel({ label: '每天问题卡数', value: questionsPerDay, onChange: setQuestionsPerDay, options: [0, 1, 2, 3, 4, 5, 6],
|
|
4911
5032
|
fmt: (v) => (Number(v) === 0 ? '0 张 · 不出问题卡' : `${v} 张`),
|
|
4912
5033
|
hint: S('每天最多几张问答类事件卡;她向你提请求的卡不归它管。') }),
|
|
4913
|
-
|
|
4914
|
-
|
|
5034
|
+
// 醒来时段可以有多段(2026-11-30,用户 m01985):有人的作息是
|
|
5035
|
+
// 「中午醒一段、晚上醒一段」。段与段之间她不会自己醒,定时醒来按段长
|
|
5036
|
+
// 分配,所以两段都要至少留够醒一次的时长。
|
|
5037
|
+
h('div', { className: 'fld' },
|
|
5038
|
+
h('div', { className: 'fl' },
|
|
5039
|
+
h('span', { className: 'flabel' }, S('她醒着的时间段')),
|
|
5040
|
+
h('span', { className: 'fhint' }, S('只在这些段里自己醒:定时醒来、空醒、主动搭话都算。可以加几段——中午一段、晚上一段;段与段之间她不会自己醒。过了结束时间,她不会再自己醒;你发消息、有人 @ 她、你按「叫醒」,任何时间都能把她叫醒。每段的开始和结束不能相同,最多 4 段。'))),
|
|
5041
|
+
(Array.isArray(wakeSegs) ? wakeSegs : []).map((seg, i) => h('div', { key: `wake-${i}`, style: { display: 'flex', gap: '8px', alignItems: 'flex-start' } },
|
|
5042
|
+
h('div', { style: { flex: '1' } },
|
|
5043
|
+
TimeRange({
|
|
5044
|
+
label: (Array.isArray(wakeSegs) && wakeSegs.length > 1) ? `第 ${i + 1} 段` : '',
|
|
5045
|
+
from: seg[0],
|
|
5046
|
+
to: seg[1],
|
|
5047
|
+
onFrom: (v) => setWakeSegAt(i, 0, v),
|
|
5048
|
+
onTo: (v) => setWakeSegAt(i, 1, v),
|
|
5049
|
+
})),
|
|
5050
|
+
(Array.isArray(wakeSegs) && wakeSegs.length > 1)
|
|
5051
|
+
? h('button', {
|
|
5052
|
+
className: 'ghost',
|
|
5053
|
+
style: { marginTop: '22px' },
|
|
5054
|
+
onClick: () => setWakeSegs((list) => list.filter((_, j) => j !== i)),
|
|
5055
|
+
}, '删掉这段')
|
|
5056
|
+
: null)),
|
|
5057
|
+
(Array.isArray(wakeSegs) && wakeSegs.length < 4)
|
|
5058
|
+
? h('button', {
|
|
5059
|
+
className: 'ghost',
|
|
5060
|
+
style: { marginTop: '6px' },
|
|
5061
|
+
onClick: () => setWakeSegs((list) => [...list, ['12:00', '14:00']]),
|
|
5062
|
+
}, '再加一段')
|
|
5063
|
+
: null))),
|
|
4915
5064
|
// 说话(1.0,用户 m04784):把两件跟「她怎么说话」有关的事放到一处。
|
|
4916
5065
|
// 「纠正鱼八股」是强行约束说话方式,和「不硬性规定她怎么说」的规矩相冲突,
|
|
4917
5066
|
// 所以默认关、标实验性,文案必须直说。
|
|
@@ -5368,13 +5517,15 @@ window.__ModuleLoader__.load({
|
|
|
5368
5517
|
)
|
|
5369
5518
|
|
|
5370
5519
|
// ---------------------------- 上网 ----------------------------
|
|
5371
|
-
// 视频观看历史分页(2026-10-28 用户 m00416
|
|
5520
|
+
// 视频观看历史分页(2026-10-28 用户 m00416;当晚按用户反馈改成「随量自适应」;
|
|
5521
|
+
// 2026-12-01 改成两列大图卡片之后重排档位):
|
|
5372
5522
|
// 0.6.6 之前是「按天分组、每页三天」——一天刷 10 条、查 3 天就是 30 条挤在一屏。
|
|
5373
5523
|
// 现在**按条翻页**,并且每页条数不是一个死数字,而是按「一天实际刷几条」分档:
|
|
5374
5524
|
// 一共 ≤ 8 条 → 一页全放下,连翻页条都不出(别让人看到「第 1 / 1 页」这种噪音);
|
|
5375
|
-
// 日均 > 20 条 → 6
|
|
5376
|
-
//
|
|
5377
|
-
|
|
5525
|
+
// 日均 > 20 条 → 6 条/页(3 行);> 10 → 8 条/页(4 行);其余 8 条。
|
|
5526
|
+
// 两列之后一页要凑成偶数,否则最后一行只挂一张、看着像缺了东西。
|
|
5527
|
+
// 也就是刷得越密、每页越短:重度用户一屏不会顶到十几张封面,轻度用户又不用为翻页而翻页。
|
|
5528
|
+
const HIST_PAGE_MAX = 8
|
|
5378
5529
|
const histFlat = (hist?.groups || []).flatMap((g) =>
|
|
5379
5530
|
(g.items || []).map((it) => ({ ...it, date: g.date })))
|
|
5380
5531
|
const histDayCount = (hist?.groups || []).length
|
|
@@ -5392,21 +5543,39 @@ window.__ModuleLoader__.load({
|
|
|
5392
5543
|
const histTotal = histErr ? 0 : histFound.length
|
|
5393
5544
|
const histPerDay = histDayCount ? histFlat.length / histDayCount : 0
|
|
5394
5545
|
const histPageSize = histTotal === 0 ? HIST_PAGE_MAX
|
|
5395
|
-
: histTotal <= 8 ? histTotal
|
|
5546
|
+
: histTotal <= 8 ? histTotal + (histTotal % 2)
|
|
5396
5547
|
: histPerDay > 20 ? 6
|
|
5397
|
-
:
|
|
5398
|
-
: histPerDay > 5 ? 10
|
|
5399
|
-
: HIST_PAGE_MAX
|
|
5548
|
+
: HIST_PAGE_MAX
|
|
5400
5549
|
const histPages = Math.max(1, Math.ceil(histTotal / histPageSize))
|
|
5401
5550
|
const histAt = Math.min(histPage, histPages - 1)
|
|
5402
5551
|
const histSlice = histFound.slice(histAt * histPageSize, histAt * histPageSize + histPageSize)
|
|
5552
|
+
// 大图卡片一页就能顶出屏幕,翻完页得把列表顶端带回视野,否则看到的还是页面底部,
|
|
5553
|
+
// 会以为没翻过去。只在点翻页时滚,敲搜索词时不动(否则每按一个字页面就往下跳)。
|
|
5554
|
+
const histListRef = useRef(null)
|
|
5555
|
+
const histGo = (p) => {
|
|
5556
|
+
setHistPage(p)
|
|
5557
|
+
const node = histListRef.current
|
|
5558
|
+
if (node && typeof node.scrollIntoView === 'function') {
|
|
5559
|
+
setTimeout(() => node.scrollIntoView({ block: 'start', behavior: 'smooth' }), 0)
|
|
5560
|
+
}
|
|
5561
|
+
}
|
|
5403
5562
|
const histPager = histPages > 1
|
|
5404
5563
|
? h('div', { className: 'row' },
|
|
5405
|
-
h('button', { disabled: histAt <= 0, onClick: () =>
|
|
5564
|
+
h('button', { disabled: histAt <= 0, onClick: () => histGo(histAt - 1) }, '较新'),
|
|
5406
5565
|
h('span', { className: 'dim' }, `第 ${histAt + 1} / ${histPages} 页 · 一页 ${histPageSize} 条`),
|
|
5407
|
-
h('button', { disabled: histAt >= histPages - 1, onClick: () =>
|
|
5566
|
+
h('button', { disabled: histAt >= histPages - 1, onClick: () => histGo(histAt + 1) }, '更早'))
|
|
5408
5567
|
: null
|
|
5409
5568
|
const histHow = (how) => (how === 'watch' ? '看过画面' : how === 'look' ? '点开读过' : '只是翻到过')
|
|
5569
|
+
// 一天有几十条时,一页装不下:按日期把这一页重新切成几块,每块自己带日期头。
|
|
5570
|
+
// 头里报「本页 n / 共 N 条」,这样翻到第二页也知道后面还有这一天。
|
|
5571
|
+
const histDayTotal = new Map()
|
|
5572
|
+
for (const it of histFound) histDayTotal.set(it.date, (histDayTotal.get(it.date) || 0) + 1)
|
|
5573
|
+
const histPageGroups = []
|
|
5574
|
+
for (const it of histSlice) {
|
|
5575
|
+
const g = histPageGroups[histPageGroups.length - 1]
|
|
5576
|
+
if (g && g.date === it.date) g.items.push(it)
|
|
5577
|
+
else histPageGroups.push({ date: it.date, items: [it] })
|
|
5578
|
+
}
|
|
5410
5579
|
|
|
5411
5580
|
const biliPage = h('div', { className: 'page' },
|
|
5412
5581
|
// 第二个参数是这一组的说明(note),控件从第三个起。0.9.5 把装控件的 grid2 填进了 note 位,
|
|
@@ -5615,7 +5784,7 @@ window.__ModuleLoader__.load({
|
|
|
5615
5784
|
groupFull('看过的视频',
|
|
5616
5785
|
// 三种关系分开说(2026-11-24,用户 m01923):以前只剩「看过画面」一种标,
|
|
5617
5786
|
// 另外两类(她自己点开读过、自动逛时只是翻到过)在列表里长得一样,只能猜。
|
|
5618
|
-
S('
|
|
5787
|
+
S('按天从近到远,点卡片打开原视频。「看过画面」是抽帧看过的,「点开读过」是她自己点开的,「只是翻到过」是自动逛时翻到的。'),
|
|
5619
5788
|
h('div', { className: 'grid2', style: { marginBottom: '6px' } },
|
|
5620
5789
|
Text({ label: '找一条', value: histQ,
|
|
5621
5790
|
onChange: (v) => { setHistQ(v); setHistPage(0); searchHist(v) },
|
|
@@ -5687,39 +5856,48 @@ window.__ModuleLoader__.load({
|
|
|
5687
5856
|
: histPick
|
|
5688
5857
|
? `这一天没有记录(${histPick})。把日子放宽,或者清掉筛选。`
|
|
5689
5858
|
: (histBusy ? '正在读…' : '还没有记录。'))
|
|
5690
|
-
: h('div',
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
background: 'rgba(128,128,128,.15)',
|
|
5710
|
-
},
|
|
5711
|
-
}),
|
|
5712
|
-
// 2026-10-30:真的抽帧看过画面的那几条要能一眼认出来,
|
|
5713
|
-
// 否则它跟"只扫了眼标题"在列表里长得一样(客户反馈的原点)。
|
|
5714
|
-
// 2026-11-24(用户 m01923):三类分开标,「看过画面」不再吃掉另两类的区别。
|
|
5715
|
-
h('span', { className: 'tag', style: { flex: '0 0 auto' } }, histHow(it.how)),
|
|
5716
|
-
h('a', {
|
|
5859
|
+
: h('div', { className: 'histdays', ref: histListRef }, histPageGroups.map((g) => {
|
|
5860
|
+
const dayAll = histDayTotal.get(g.date) || g.items.length
|
|
5861
|
+
return h('section', { key: `day|${g.date}`, className: 'histday' },
|
|
5862
|
+
h('div', { className: 'histdayhd' },
|
|
5863
|
+
h('b', null, g.date.slice(5)),
|
|
5864
|
+
h('span', null, g.items.length < dayAll
|
|
5865
|
+
? `本页 ${g.items.length} / 共 ${dayAll} 条`
|
|
5866
|
+
: `${g.items.length} 条`),
|
|
5867
|
+
// 一天刷满几十条时会连着翻好几页;从这一页直接收窄到这一天,不用再开月历。
|
|
5868
|
+
h('button', {
|
|
5869
|
+
style: {
|
|
5870
|
+
marginLeft: 'auto', height: '22px', padding: '0 8px',
|
|
5871
|
+
fontSize: '11.5px', borderRadius: '6px',
|
|
5872
|
+
},
|
|
5873
|
+
onClick: () => { setHistPick(g.date); setHistOpen(false); setHistPage(0) },
|
|
5874
|
+
}, '只看这天')),
|
|
5875
|
+
h('div', { className: 'histgrid' }, g.items.map((it) => h('a', {
|
|
5876
|
+
key: `${g.date}|${it.bvid}`,
|
|
5877
|
+
className: 'histcard',
|
|
5717
5878
|
href: it.url,
|
|
5718
5879
|
target: '_blank',
|
|
5719
5880
|
rel: 'noreferrer',
|
|
5720
|
-
|
|
5721
|
-
},
|
|
5722
|
-
|
|
5881
|
+
title: esc(it.title) || it.bvid,
|
|
5882
|
+
},
|
|
5883
|
+
// 封面缺了就把 img 藏掉,外面那格按 16:9 留着灰底,卡片高度不会跟着抖。
|
|
5884
|
+
h('span', { className: 'histcoverwrap' },
|
|
5885
|
+
h('img', {
|
|
5886
|
+
className: 'histcover',
|
|
5887
|
+
src: `${API}/cover/${it.bvid}`,
|
|
5888
|
+
alt: '',
|
|
5889
|
+
loading: 'lazy',
|
|
5890
|
+
onError: (e) => { e.currentTarget.style.display = 'none' },
|
|
5891
|
+
})),
|
|
5892
|
+
h('span', { className: 'histbody' },
|
|
5893
|
+
h('span', { className: 'histtitle' }, esc(it.title) || it.bvid),
|
|
5894
|
+
h('span', { className: 'histsub' },
|
|
5895
|
+
// 2026-10-30:真的抽帧看过画面的那几条要能一眼认出来,
|
|
5896
|
+
// 否则它跟"只扫了眼标题"在列表里长得一样(客户反馈的原点)。
|
|
5897
|
+
// 2026-11-24(用户 m01923):三类分开标,「看过画面」不再吃掉另两类的区别。
|
|
5898
|
+
h('span', { className: `tag histhow ${it.how}` }, histHow(it.how)),
|
|
5899
|
+
it.up ? h('span', { className: 'tag histup' }, esc(it.up)) : null))))))
|
|
5900
|
+
})),
|
|
5723
5901
|
histPages > 1
|
|
5724
5902
|
? h('div', { className: 'row', style: { marginTop: '10px' } }, histPager)
|
|
5725
5903
|
: null,
|
|
@@ -7705,7 +7883,7 @@ window.__ModuleLoader__.load({
|
|
|
7705
7883
|
}
|
|
7706
7884
|
|
|
7707
7885
|
const moveHint = moveInfo
|
|
7708
|
-
? `现在住在 ${moveInfo.root}(${moveInfo.files}
|
|
7886
|
+
? `现在住在 ${moveInfo.root}(${moveInfo.files} 个文件${moveInfo.sizing ? ',正在量大小…' : `,约 ${Math.max(1, Math.round((moveInfo.bytes || 0) / 1024))}KB`})${moveInfo.moved ? '——已经搬过一次了' : ''}。`
|
|
7709
7887
|
: ''
|
|
7710
7888
|
|
|
7711
7889
|
const moveCard = h('div', { style: { marginTop: '14px' } },
|
|
@@ -8118,6 +8296,14 @@ window.__ModuleLoader__.load({
|
|
|
8118
8296
|
showReport && reports.md ? h('pre', { style: { marginTop: '8px', maxHeight: '320px', overflow: 'auto' } }, reports.md) : null)
|
|
8119
8297
|
}
|
|
8120
8298
|
|
|
8299
|
+
// 判决账里的时间:给人看的短格式(月-日 时:分),坏时间就给空。
|
|
8300
|
+
const decisionWhen = (iso) => {
|
|
8301
|
+
const t = new Date(iso)
|
|
8302
|
+
if (Number.isNaN(t.getTime())) return ''
|
|
8303
|
+
const p = (n) => String(n).padStart(2, '0')
|
|
8304
|
+
return `${p(t.getMonth() + 1)}-${p(t.getDate())} ${p(t.getHours())}:${p(t.getMinutes())}`
|
|
8305
|
+
}
|
|
8306
|
+
|
|
8121
8307
|
const dataPage = h('div', { className: 'page' },
|
|
8122
8308
|
group('数据在哪',
|
|
8123
8309
|
'一个文件夹装全部。想备份、想搬走、想看原始记录,都在这一格里。',
|
|
@@ -8361,6 +8547,55 @@ window.__ModuleLoader__.load({
|
|
|
8361
8547
|
}, '清空日志')),
|
|
8362
8548
|
h('p', { className: 'hint' }, S('导出的是纯文本:版本、自检结果、脱敏后的配置、日志末尾。没有 cookie,没有她说过的话。'))),
|
|
8363
8549
|
|
|
8550
|
+
// ---- 判决账(2026-11-29,用户 m00311)----
|
|
8551
|
+
// 单独一张卡:它回答的是「她为什么醒 / 为什么没醒」,不是「插件运行时报了什么错」。
|
|
8552
|
+
// 只读,不参与任何判定,也不进她的提示词。放在数据列,不和运行日志混。
|
|
8553
|
+
group('判决账',
|
|
8554
|
+
S('她每一次醒来、没醒,为什么,回没回。只记账,不参与她的判断,也不进她的提示词。'),
|
|
8555
|
+
!decisions
|
|
8556
|
+
? h('p', { className: 'empty' }, decisionsBusy ? '读取中…' : '还没读。')
|
|
8557
|
+
: h('div', null,
|
|
8558
|
+
h('p', { className: 'hint' },
|
|
8559
|
+
`近 ${decisions.days} 天一共 ${decisions.total} 条。`),
|
|
8560
|
+
decisions.groups?.length
|
|
8561
|
+
? h('div', { style: { marginTop: '8px' } },
|
|
8562
|
+
h('div', {
|
|
8563
|
+
className: 'row',
|
|
8564
|
+
style: { fontSize: '12px', color: 'var(--dsw-alias-label-secondary)', padding: '3px 0' },
|
|
8565
|
+
},
|
|
8566
|
+
h('span', { style: { flex: '1' } }, '原因'),
|
|
8567
|
+
h('span', { style: { width: '48px', textAlign: 'right' } }, '次数'),
|
|
8568
|
+
h('span', { style: { width: '40px', textAlign: 'right' } }, '醒'),
|
|
8569
|
+
h('span', { style: { width: '48px', textAlign: 'right' } }, '开口')),
|
|
8570
|
+
...decisions.groups.map((g) => h('div', {
|
|
8571
|
+
key: g.code,
|
|
8572
|
+
className: 'row',
|
|
8573
|
+
style: { padding: '3px 0', borderTop: '0.5px solid var(--dsw-alias-border-l2)' },
|
|
8574
|
+
},
|
|
8575
|
+
h('span', { style: { flex: '1' } }, g.label || g.code),
|
|
8576
|
+
h('span', { style: { width: '48px', textAlign: 'right' } }, String(g.count)),
|
|
8577
|
+
h('span', { style: { width: '40px', textAlign: 'right' } }, String(g.woke || 0)),
|
|
8578
|
+
h('span', { style: { width: '48px', textAlign: 'right' } }, String(g.replied || 0)))))
|
|
8579
|
+
: h('p', { className: 'empty' }, S('近七天还没有账。')),
|
|
8580
|
+
decisions.recent?.length
|
|
8581
|
+
? h('details', { style: { marginTop: '10px' } },
|
|
8582
|
+
h('summary', { style: { cursor: 'pointer', fontSize: '12px' } },
|
|
8583
|
+
`最近 ${Math.min(20, decisions.recent.length)} 条`),
|
|
8584
|
+
h('div', { style: { maxHeight: '180px', overflow: 'auto', marginTop: '6px' } },
|
|
8585
|
+
...decisions.recent.slice(0, 20).map((d, i) => h('p', {
|
|
8586
|
+
key: `${d.at || ''}-${i}`,
|
|
8587
|
+
className: 'hint',
|
|
8588
|
+
style: { margin: '2px 0' },
|
|
8589
|
+
}, `${decisionWhen(d.at)} ${d.woke ? (d.replied ? '开口' : '醒了没说') : '没醒'} ${d.why || ''}`))))
|
|
8590
|
+
: null),
|
|
8591
|
+
h('div', { className: 'row' },
|
|
8592
|
+
h('button', {
|
|
8593
|
+
onClick: () => {
|
|
8594
|
+
setDecisionsBusy(true)
|
|
8595
|
+
jget('/decisions?days=7').then(setDecisions).catch(() => {}).finally(() => setDecisionsBusy(false))
|
|
8596
|
+
},
|
|
8597
|
+
}, decisionsBusy ? '读取中…' : '刷新判决账'))),
|
|
8598
|
+
|
|
8364
8599
|
importCard,
|
|
8365
8600
|
|
|
8366
8601
|
// 宿主旧了(0.8.1):比升级自检更基础——先告诉它为什么有个功能没反应。
|