@ssamurias/dsh-fish 1.1.5 → 1.1.7
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 +27 -4
- package/CHANGELOG.md +150 -0
- package/README.md +31 -4
- package/RELEASE-NOTES-1.1.6.md +57 -0
- package/RELEASE-NOTES-1.1.7.md +76 -0
- package/lib/ask.js +7 -1
- package/lib/capture.js +1 -0
- package/lib/claim.js +23 -0
- package/lib/client.js +329 -79
- package/lib/comment.js +18 -10
- package/lib/cue.js +99 -23
- package/lib/derive.js +215 -49
- package/lib/desk.js +5 -2
- package/lib/didclaim.js +307 -0
- package/lib/events.js +32 -4
- package/lib/handoff.js +13 -3
- package/lib/health.js +4 -0
- package/lib/hear.js +8 -1
- package/lib/herperson.js +33 -18
- package/lib/home.js +4 -0
- package/lib/inbox.js +23 -7
- package/lib/index.js +9 -3
- package/lib/loadgate.js +48 -0
- package/lib/memorymap-html.js +1 -1
- package/lib/memorymap.js +22 -2
- package/lib/move.js +68 -8
- package/lib/observe-bili.js +32 -2
- package/lib/observe-config.js +81 -6
- package/lib/observe-data.js +3 -1
- package/lib/observe-home.js +15 -4
- package/lib/observe-http.js +4 -0
- package/lib/observe-state.js +3 -2
- package/lib/people.js +78 -2
- package/lib/persona.js +8 -3
- package/lib/proactive.js +11 -4
- package/lib/quality.js +207 -48
- package/lib/recall.js +73 -24
- package/lib/redact.js +27 -0
- package/lib/reset-pending.js +15 -5
- package/lib/reset.js +78 -0
- package/lib/restrict.js +40 -2
- package/lib/retire.js +42 -1
- package/lib/say.js +60 -13
- package/lib/scheduler.js +32 -27
- package/lib/schema.js +1 -1
- package/lib/selfdoc.js +6 -0
- package/lib/settings.js +166 -31
- package/lib/status.js +1 -1
- package/lib/timeintent.js +178 -0
- package/lib/turns.js +86 -28
- package/lib/types.d.ts +1 -0
- package/lib/wiki.js +72 -9
- package/lib/works.js +5 -0
- package/media/feedback-qr.jpg +0 -0
- package/package.json +4 -1
- package/tools/README.md +69 -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 -968
- 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 -812
- 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
|
@@ -436,6 +436,9 @@ window.__ModuleLoader__.load({
|
|
|
436
436
|
'.dfish .famhd .famname{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,Consolas,monospace}',
|
|
437
437
|
'.dfish .famhd .famcnt{flex:none;font-size:11px;color:var(--dsw-alias-label-tertiary)}',
|
|
438
438
|
'.dfish .famhd.open .famname{color:var(--dsw-alias-label-primary)}',
|
|
439
|
+
// 族标题右边那颗「补齐」(issue #191 方案 C):小、克制,跟族标题同一行。
|
|
440
|
+
'.dfish .famfill{flex:none;height:22px;padding:0 7px;font-size:11px;line-height:20px;border-radius:6px;border:1px solid rgba(128,128,128,.35);background:transparent;color:var(--dsw-alias-label-secondary,var(--dsw-alias-label-tertiary));cursor:pointer;white-space:nowrap}',
|
|
441
|
+
'.dfish .famfill:hover{background:rgba(128,128,128,.12);color:var(--dsw-alias-label-primary)}',
|
|
439
442
|
'.dfish .chipsnote{font-size:11.5px;line-height:17px;color:var(--dsw-alias-label-tertiary);background:rgba(128,128,128,.07);border-radius:6px;padding:6px 8px;margin:0 0 4px}',
|
|
440
443
|
'.dfish pre{margin:0;white-space:pre-wrap;word-break:break-word;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,inherit);font-family:ui-monospace,Consolas,monospace}',
|
|
441
444
|
'.dfish .empty{color:var(--dsw-alias-label-tertiary);font-size:13px;margin:0}',
|
|
@@ -570,8 +573,88 @@ window.__ModuleLoader__.load({
|
|
|
570
573
|
'.dfish .qrbtns button{height:30px;padding:0 14px;font-size:13px;border-radius:8px}',
|
|
571
574
|
'.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
575
|
'.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)}',
|
|
576
|
+
// 看过的视频:两列大图卡片(2026-12-01,用户要求参考 dsh-bili-scroll)。
|
|
577
|
+
// 按天分块,每块内部是 16:9 封面 + 两行标题 + 来路/UP 的网格。
|
|
578
|
+
// 封面用 aspect-ratio 撑住高度,取不到图时那一格留灰底——不会把整行拽塌。
|
|
579
|
+
'.dfish .histdays{display:flex;flex-direction:column;gap:16px;margin:2px 0}',
|
|
580
|
+
'.dfish .histday{min-width:0}',
|
|
581
|
+
'.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)}',
|
|
582
|
+
'.dfish .histdayhd b{font-weight:600;font-size:12.5px;letter-spacing:.02em;font-variant-numeric:tabular-nums}',
|
|
583
|
+
'.dfish .histgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}',
|
|
584
|
+
'.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}',
|
|
585
|
+
'.dfish .histcard:hover{border-color:var(--dsw-alias-state-business-primary);background:rgba(128,128,128,.08);color:inherit;text-decoration:none}',
|
|
586
|
+
'.dfish .histcard:hover .histtitle{text-decoration:underline}',
|
|
587
|
+
'.dfish .histcoverwrap{display:block;position:relative;aspect-ratio:16/9;background:rgba(128,128,128,.14);overflow:hidden}',
|
|
588
|
+
'.dfish .histcover{display:block;width:100%;height:100%;object-fit:cover}',
|
|
589
|
+
'.dfish .histbody{display:flex;flex-direction:column;gap:6px;padding:8px 10px 10px;min-width:0}',
|
|
590
|
+
'.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}',
|
|
591
|
+
'.dfish .histsub{display:flex;align-items:center;gap:6px;min-width:0;font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary)}',
|
|
592
|
+
'.dfish .histsub .tag{margin-left:0;flex:0 0 auto}',
|
|
593
|
+
'.dfish .histup{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
594
|
+
// 「看过画面」是三种来路里最实的一种,卡片上给它一点颜色;另两种保持灰。
|
|
595
|
+
'.dfish .histhow.watch{color:var(--dsw-alias-state-business-primary);border-color:var(--dsw-alias-state-business-primary)}',
|
|
596
|
+
// 手机窄屏(2026-12-01,用户要求:只在手机尺寸下变,电脑端一模一样)。
|
|
597
|
+
// 走 @media 而不是 container:dsh-Go 的网页版就是把官方 UI 铺在整个 WebView 里,
|
|
598
|
+
// 视口宽就是内容宽;桌面端超过 600 一行都不命中,样式与原来逐字相同。
|
|
599
|
+
// 触控尺寸:宿主在「手机布局 + 粗指针」下会给 button/select/input 兜 44×44,
|
|
600
|
+
// 这里自己先抬到 38–40,普通手机浏览器里也不至于太小;开关单独退出那条规则
|
|
601
|
+
// (data-dsh-adapt="off",见 03-widgets-header.js),否则 40×22 的胶囊会被撑成方块。
|
|
602
|
+
'@media (max-width: 600px){' + [
|
|
603
|
+
'.dfish{gap:12px}',
|
|
604
|
+
'.dfish .page{grid-template-columns:minmax(0,1fr);gap:12px}',
|
|
605
|
+
'.dfish .card{padding:11px 12px}',
|
|
606
|
+
'.dfish .tabs{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-overflow-scrolling:touch}',
|
|
607
|
+
'.dfish .tabs::-webkit-scrollbar{display:none}',
|
|
608
|
+
'.dfish .tabs .grow{display:none}',
|
|
609
|
+
'.dfish .tab{flex:0 0 auto;height:36px;padding:0 13px;font-size:13px}',
|
|
610
|
+
'.dfish .grid2{grid-template-columns:minmax(0,1fr)}',
|
|
611
|
+
'.dfish .kv{grid-template-columns:auto minmax(0,1fr);gap:4px 10px}',
|
|
612
|
+
'.dfish .form label{flex-direction:column;align-items:flex-start;gap:5px}',
|
|
613
|
+
// 输入框的 width:100% 要配 border-box,否则 padding 和描边会把它顶出卡片右边。
|
|
614
|
+
'.dfish input[type=text],.dfish input[type=number],.dfish input[type=time],.dfish input[type=date],.dfish select{box-sizing:border-box}',
|
|
615
|
+
'.dfish input[type=text]{min-width:0;width:100%;height:38px;font-size:16px}',
|
|
616
|
+
'.dfish input[type=number]{width:76px;height:38px;font-size:16px}',
|
|
617
|
+
'.dfish input[type=time]{height:38px;font-size:16px}',
|
|
618
|
+
'.dfish input[type=date]{height:38px;font-size:16px;max-width:100%}',
|
|
619
|
+
'.dfish select{height:38px;font-size:16px;max-width:100%}',
|
|
620
|
+
'.dfish textarea{min-height:88px;font-size:16px;line-height:22px}',
|
|
621
|
+
'.dfish button{height:38px;padding:0 12px}',
|
|
622
|
+
'.dfish .sw{width:46px;height:28px}',
|
|
623
|
+
'.dfish .sw .knob{width:22px;height:22px}',
|
|
624
|
+
'.dfish .sw.on .knob{left:20px}',
|
|
625
|
+
'.dfish .step{width:38px;height:38px;font-size:16px}',
|
|
626
|
+
'.dfish .chip{height:32px;padding:0 11px;font-size:12.5px}',
|
|
627
|
+
'.dfish .pager button{height:32px}',
|
|
628
|
+
'.dfish .seg>button{height:32px}',
|
|
629
|
+
'.dfish .go{height:38px}',
|
|
630
|
+
'.dfish .faq-btn{height:40px}',
|
|
631
|
+
'.dfish details.adv>summary{min-height:36px;line-height:36px}',
|
|
632
|
+
// 看过的视频:两列在 390 宽时每张只剩 ~170px,标题和来路标签挤成一团,回落单列。
|
|
633
|
+
'.dfish .histgrid{grid-template-columns:minmax(0,1fr);gap:10px}',
|
|
634
|
+
'.dfish .histtitle{font-size:13.5px;line-height:20px}',
|
|
635
|
+
// 日期头那颗「只看这天」写的是行内 style(22px),要 !important 才抬得动。
|
|
636
|
+
'.dfish .histdayhd button{height:32px!important;padding:0 10px!important;font-size:12px!important}',
|
|
637
|
+
// 六列固定表:不缩字,改成整表横向滑动(外层就是 overflowX:auto 的盒子)。
|
|
638
|
+
'.dfish .pressure-table{min-width:520px;table-layout:auto}',
|
|
639
|
+
// 图表的 viewBox 是 680–750 宽,硬缩到 390 时轴字只剩 6–7px;给一条横向滑动的地板。
|
|
640
|
+
'.dfish .chartscroll{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}',
|
|
641
|
+
'.dfish .chartscroll>svg{min-width:620px}',
|
|
642
|
+
// 月历:30px 格子排成 222px 宽在手机上够用但难点;窄屏撑满一行、格子抬到 34。
|
|
643
|
+
'.dfish .calwrap{display:block!important;width:100%;box-sizing:border-box}',
|
|
644
|
+
'.dfish .cal{grid-template-columns:repeat(7,minmax(0,1fr))!important;width:100%}',
|
|
645
|
+
'.dfish .cal>button{height:34px!important;line-height:34px!important}',
|
|
646
|
+
'.dfish .qrovl{padding:12px}',
|
|
647
|
+
'.dfish .qrcard{padding:16px 14px 12px}',
|
|
648
|
+
'.dfish .qrbtns button{height:40px}',
|
|
649
|
+
].join('') + '}',
|
|
573
650
|
].join('\n')
|
|
574
651
|
|
|
652
|
+
// 图表在窄屏下不缩字,改成一条可横向滑动的画布(2026-12-01,手机适配)。
|
|
653
|
+
// 包一层 div 而不是给 svg 加 overflow:svg 自己的 overflow 不产生滚动条。
|
|
654
|
+
function chartBox(svg) {
|
|
655
|
+
return h('div', { className: 'chartscroll' }, svg)
|
|
656
|
+
}
|
|
657
|
+
|
|
575
658
|
function useStyleOnce() {
|
|
576
659
|
useEffect(() => {
|
|
577
660
|
const current = document.querySelector(`style[data-tag="${CSS_TAG}"]`)
|
|
@@ -673,6 +756,7 @@ window.__ModuleLoader__.load({
|
|
|
673
756
|
}, String(d)))
|
|
674
757
|
}
|
|
675
758
|
return h('div', {
|
|
759
|
+
className: 'calwrap',
|
|
676
760
|
style: {
|
|
677
761
|
display: 'inline-block', marginTop: '6px', padding: '8px 10px',
|
|
678
762
|
border: '1px solid rgba(128,128,128,.28)', borderRadius: '8px',
|
|
@@ -710,6 +794,7 @@ window.__ModuleLoader__.load({
|
|
|
710
794
|
h('button', { disabled: o.busy || !month, title: o.nextTitle, onClick: () => o.setMonth(calShiftMonth(month, 1)) }, '›'),
|
|
711
795
|
h('button', { disabled: o.busy || !days.length, title: o.recentTitle, onClick: () => o.setMonth(calMonthOf(days[0])) }, '最近')),
|
|
712
796
|
h('div', {
|
|
797
|
+
className: 'cal',
|
|
713
798
|
style: {
|
|
714
799
|
display: 'grid', gridTemplateColumns: 'repeat(7, 30px)',
|
|
715
800
|
gap: '2px', marginTop: '6px', alignItems: 'center',
|
|
@@ -748,6 +833,10 @@ window.__ModuleLoader__.load({
|
|
|
748
833
|
}
|
|
749
834
|
function qStability(v) {
|
|
750
835
|
if (!v) return '—'
|
|
836
|
+
// 2026-11-30(外部反馈「设置页还是 18 秒」):稳定要跑 24 次全量派生,
|
|
837
|
+
// 现在不在请求里现算了——先给上一份,或者让后台算完再回来。
|
|
838
|
+
// 那两种情况都不是「样本不够」,不能印成「还没攒到判断」。
|
|
839
|
+
if (v.pending) return '正在量(后台算,不挡页面;过一会儿再打开就有数)'
|
|
751
840
|
const band = bandOf(v && v.band)
|
|
752
841
|
// 2026-10-27(用户 m06350):能测出来的时候,数字和判读一起给——只印那句
|
|
753
842
|
// 「长在这些事上,抽掉一条少一块」,用户看不出到底是多少,以为没测。
|
|
@@ -1194,8 +1283,11 @@ window.__ModuleLoader__.load({
|
|
|
1194
1283
|
// 1.1.4:一次性提示(升级后第一次打开插件页看一次)。
|
|
1195
1284
|
const [notices, setNotices] = useState([])
|
|
1196
1285
|
// 时段(2026-10-23 加):醒来 / 上网 / 说话,三段各自可调
|
|
1197
|
-
|
|
1198
|
-
|
|
1286
|
+
// 醒来时段可以是多段(2026-11-30,用户 m01985):中午一段、晚上一段,
|
|
1287
|
+
// 各段按长度分配定时醒来。第一段同时写回老字段 `window`,老读取点照旧。
|
|
1288
|
+
const [wakeSegs, setWakeSegs] = useState([['20:00', '23:00']])
|
|
1289
|
+
// 改一段里的开始(k=0)或结束(k=1)
|
|
1290
|
+
const setWakeSegAt = (i, k, v) => setWakeSegs((list) => list.map((s, j) => (j === i ? (k === 0 ? [v, s[1]] : [s[0], v]) : s)))
|
|
1199
1291
|
// 上网时段没单独配 = 跟着醒来时段(issue #86 第 2 条),所以初值就是醒来那两个数
|
|
1200
1292
|
const [browseFrom, setBrowseFrom] = useState('20:00')
|
|
1201
1293
|
const [browseTo, setBrowseTo] = useState('23:00')
|
|
@@ -1579,6 +1671,19 @@ window.__ModuleLoader__.load({
|
|
|
1579
1671
|
try {
|
|
1580
1672
|
// 2026-11-28(外部反馈:设置页七项全显示默认值):/state 读不到不该把后面
|
|
1581
1673
|
// 整段拖下水——设置页的值是从 /config 回的整份配置灌的,那条能走通就照常显示。
|
|
1674
|
+
// 2026-12-01(issue #184):这几条互不依赖,先一起发出去,
|
|
1675
|
+
// 别让 /state 一条一条排队——串起来只会让首屏等最长的那一条。
|
|
1676
|
+
const batchP = Promise.all([
|
|
1677
|
+
jget('/beliefs'),
|
|
1678
|
+
jget('/diary'),
|
|
1679
|
+
jget('/config'),
|
|
1680
|
+
jget('/browse'),
|
|
1681
|
+
jget('/inbox?limit=60').catch(() => null),
|
|
1682
|
+
jget('/home').catch(() => null),
|
|
1683
|
+
jget('/paths').catch(() => null),
|
|
1684
|
+
])
|
|
1685
|
+
// 就算 /state 失败、没人来 await,也别留一个没人管的拒绝
|
|
1686
|
+
batchP.catch(() => {})
|
|
1582
1687
|
let s = null
|
|
1583
1688
|
const stateFail = await jget('/state').then((r) => { s = r; return '' }).catch((e) => String(e?.message || e))
|
|
1584
1689
|
if (stateFail) setErr(stateFail)
|
|
@@ -1632,15 +1737,7 @@ window.__ModuleLoader__.load({
|
|
|
1632
1737
|
// 不再拉 /events(2026-11-02,用户 m00335):这里取回来的 e.rows 只进了
|
|
1633
1738
|
// setEvents,全文件没有一处渲染它——每 30 秒白拉 25 条事件(九成是后台记账)。
|
|
1634
1739
|
// 想看账本原文去「数据」页,那里给的是路径,不靠这条轮询。
|
|
1635
|
-
const [b, d, c, br, ib, hm, pth] = await
|
|
1636
|
-
jget('/beliefs'),
|
|
1637
|
-
jget('/diary'),
|
|
1638
|
-
jget('/config'),
|
|
1639
|
-
jget('/browse'),
|
|
1640
|
-
jget('/inbox?limit=60').catch(() => null),
|
|
1641
|
-
jget('/home').catch(() => null),
|
|
1642
|
-
jget('/paths').catch(() => null),
|
|
1643
|
-
])
|
|
1740
|
+
const [b, d, c, br, ib, hm, pth] = await batchP
|
|
1644
1741
|
setBeliefs(b)
|
|
1645
1742
|
setDiary(d)
|
|
1646
1743
|
// 首天正文随 /diary 一起回来了,先灌进翻页缓存(省一次往返)。
|
|
@@ -1655,7 +1752,13 @@ window.__ModuleLoader__.load({
|
|
|
1655
1752
|
setHome(hm)
|
|
1656
1753
|
setDataPaths(pth)
|
|
1657
1754
|
// 迁移工作区:只读她现在住哪、有多少东西(失败就只显示按钮,不影响别处)
|
|
1658
|
-
|
|
1755
|
+
// 大小是后台量的(issue #184):这一趟先给「正在量」,过几秒再取一次就有数了。
|
|
1756
|
+
jget('/move').then((mv) => {
|
|
1757
|
+
setMoveInfo(mv)
|
|
1758
|
+
if (mv && mv.sizing) {
|
|
1759
|
+
window.setTimeout(() => { jget('/move').then(setMoveInfo).catch(() => {}) }, 4000)
|
|
1760
|
+
}
|
|
1761
|
+
}).catch(() => {})
|
|
1659
1762
|
// 自动备份现在攒了几份(失败就当还没攒过)
|
|
1660
1763
|
jget('/backup/auto').then(setAutoState).catch(() => {})
|
|
1661
1764
|
// 出门:现在在哪、有哪些工作区可去、说明卡确认过没有(失败就只显示空页)
|
|
@@ -1795,7 +1898,11 @@ window.__ModuleLoader__.load({
|
|
|
1795
1898
|
setCloudLatestUp(cfg.cloud?.latestUp === true)
|
|
1796
1899
|
// 时段:醒来 / 上网 / 说话。坏值由服务端兜底,这里只做展示。
|
|
1797
1900
|
const w0 = Array.isArray(cfg.window) ? cfg.window : ['20:00', '23:00']
|
|
1798
|
-
|
|
1901
|
+
// 多段(2026-11-30):`windows` 是全量,老配置只有 `window` 时按一段处理。
|
|
1902
|
+
const ws = Array.isArray(cfg.windows) && cfg.windows.length
|
|
1903
|
+
? cfg.windows.filter((x) => Array.isArray(x) && x.length === 2).map((x) => [String(x[0]), String(x[1])])
|
|
1904
|
+
: []
|
|
1905
|
+
setWakeSegs(ws.length ? ws : [[String(w0[0]), String(w0[1])]])
|
|
1799
1906
|
// 上网时段:没单独配(null)就是跟着醒来时段,界面上直接显示醒来那两个数。
|
|
1800
1907
|
const b0 = Array.isArray(cfg.browse?.window) ? cfg.browse.window : w0
|
|
1801
1908
|
setBrowseFrom(b0[0]); setBrowseTo(b0[1])
|
|
@@ -1937,7 +2044,9 @@ window.__ModuleLoader__.load({
|
|
|
1937
2044
|
minDuration: Number(avoidMinDur),
|
|
1938
2045
|
upMids: avoidMids.split(/[,,\s]+/).map((x) => x.trim()).filter(Boolean),
|
|
1939
2046
|
},
|
|
1940
|
-
window
|
|
2047
|
+
// 醒来时段:`window` 是第一段(老字段),`windows` 是全量(2026-11-30)。
|
|
2048
|
+
window: wakeSegs[0] ? wakeSegs[0].slice() : ['20:00', '23:00'],
|
|
2049
|
+
windows: wakeSegs.map((s) => s.slice()),
|
|
1941
2050
|
// 2026-11-07(用户反馈):能上网这颗开关要写到两个地方——
|
|
1942
2051
|
// bili.enabled 是 0.9.x 下 bili_look / bili_watch 真正认的闸门;
|
|
1943
2052
|
// browse.enabled 留着给老参数(以及以后要不要恢复自动刷的那个决定)。
|
|
@@ -2019,8 +2128,13 @@ window.__ModuleLoader__.load({
|
|
|
2019
2128
|
if (from === to) return `${label}:开始和结束不能是同一时刻。要全天,请设 00:00–23:59。`
|
|
2020
2129
|
return ''
|
|
2021
2130
|
}
|
|
2022
|
-
|
|
2023
|
-
|
|
2131
|
+
const segs = Array.isArray(wakeSegs) && wakeSegs.length ? wakeSegs : [['20:00', '23:00']]
|
|
2132
|
+
for (let i = 0; i < segs.length; i += 1) {
|
|
2133
|
+
const label = segs.length > 1 ? `${S('她醒着的时间段')}(第 ${i + 1} 段)` : S('她醒着的时间段')
|
|
2134
|
+
const why = one(label, segs[i][0], segs[i][1])
|
|
2135
|
+
if (why) return why
|
|
2136
|
+
}
|
|
2137
|
+
return one('上网时段', browseFrom, browseTo)
|
|
2024
2138
|
|| one('评论时段', commentFrom, commentTo)
|
|
2025
2139
|
}
|
|
2026
2140
|
|
|
@@ -2169,7 +2283,12 @@ window.__ModuleLoader__.load({
|
|
|
2169
2283
|
// strictTools:这是用户刚在输入框里敲完点的「保存」,坏名字要当场拦下来。
|
|
2170
2284
|
// 页面自动保存走的是另一条(不带这个标记):那边丢掉坏名字、其余照存,
|
|
2171
2285
|
// 因为回传的是盘上已有的旧名单,用户没在编辑它(2026-10-31 issue #14)。
|
|
2172
|
-
|
|
2286
|
+
//
|
|
2287
|
+
// allowShrink:服务端对「白名单变少」一律 409(issue #191 第九节)——
|
|
2288
|
+
// 那条判据挡的是「拿一份小列表试形状就把生产名单换掉」这类误操作。
|
|
2289
|
+
// 这里是他亲手在框里删掉的名字、又亲手按了保存,所以由界面确认这一下:
|
|
2290
|
+
// **自动保存那条不带它**,那条每次整表回传,不该有资格删名字。
|
|
2291
|
+
const saved = await jpost('/config', { tools: { restrict: Boolean(toolsRestrict), allow: check.names }, strictTools: true, allowShrink: 'confirm' })
|
|
2173
2292
|
// 服务端存盘后会当场换刀(0.9.8 起):返回 toolsLive 就是换成了,没返回就是没动名单。
|
|
2174
2293
|
const live = saved?.toolsLive?.ok === true
|
|
2175
2294
|
const deferredTools = saved?.toolsLive?.deferred ?? 0
|
|
@@ -2522,7 +2641,25 @@ window.__ModuleLoader__.load({
|
|
|
2522
2641
|
: (r.retiredError
|
|
2523
2642
|
? ` 旧会话没收干净:${r.retiredError}。到「状态」页点一下「现在叫醒大肥鱼」,${SELF_SHE}开一次口,侧栏里才看得见新会话。`
|
|
2524
2643
|
: S(' 侧栏这会儿还看不到她——到「状态」页点一下「现在叫醒大肥鱼」,她开一次口,「跟大肥鱼说话」才会出现在侧栏里。'))
|
|
2644
|
+
// 2026-12-02(外部反馈:重置之后看过的视频还是老的):旧档已经被整目录搬去
|
|
2645
|
+
// dsh-fish-backups/reset-*,事件流里那些 watched:/look:/browse: 一条都不剩,
|
|
2646
|
+
// 服务端 /history 早就回空了——可界面上这张卡还停在重置前那一份,因为它是
|
|
2647
|
+
// load() 灌的,而 load() 只在打开设置页时跑一次。不重读就等于让人以为
|
|
2648
|
+
// 「重置没生效」。所以重置成功之后立刻重新读一遍盘,账本行数、日记、报告、
|
|
2649
|
+
// 看过的视频、她的东西这些会自己回到 0。
|
|
2650
|
+
// 筛选状态一并清干净:换了一局,之前挑的那一天 / 那个搜索词都已经不属于这局了,
|
|
2651
|
+
// 留着会停在「对上的 0 条」上,看起来像搜坏了(跟 pickHistDays 里同一个理由)。
|
|
2652
|
+
setHistPage(0)
|
|
2653
|
+
setHistPick('')
|
|
2654
|
+
setHistQ('')
|
|
2655
|
+
setHistOpen(false)
|
|
2656
|
+
setHistHint('')
|
|
2657
|
+
setHistMonth('')
|
|
2658
|
+
histQRef.current = ''
|
|
2659
|
+
if (histQTimer.current) { clearTimeout(histQTimer.current); histQTimer.current = null }
|
|
2525
2660
|
setResetMsg({ tone: 'ok', text: `${head}${tail}` })
|
|
2661
|
+
// 重读失败不该把「已重开」这条回执换成红字——数据其实没问题,只是这一屏没刷新。
|
|
2662
|
+
await load().catch(() => {})
|
|
2526
2663
|
} catch (e) {
|
|
2527
2664
|
setResetMsg({ tone: 'err', text: e.message })
|
|
2528
2665
|
} finally { setBusy('') }
|
|
@@ -2579,6 +2716,10 @@ window.__ModuleLoader__.load({
|
|
|
2579
2716
|
type: 'button',
|
|
2580
2717
|
className: 'sw' + (o.on ? ' on' : ''),
|
|
2581
2718
|
role: 'switch',
|
|
2719
|
+
// 2026-12-01:dsh-Go 的网页版会给 [data-slot="main"] 里的 button 兜 44×44
|
|
2720
|
+
// 的触控最小尺寸;开关是固定 40×22 的胶囊,被撑高会变成一块竖着的圆角砖。
|
|
2721
|
+
// 这一颗自己退出那条规则,窄屏样式里再把胶囊抬到 46×28。
|
|
2722
|
+
'data-dsh-adapt': 'off',
|
|
2582
2723
|
'aria-checked': o.on ? 'true' : 'false',
|
|
2583
2724
|
onClick: () => o.onChange(!o.on),
|
|
2584
2725
|
}, h('span', { className: 'knob' })))
|
|
@@ -2756,6 +2897,32 @@ window.__ModuleLoader__.load({
|
|
|
2756
2897
|
}
|
|
2757
2898
|
fams.sort((a, b) => b.names.length - a.names.length || a.fam.localeCompare(b.fam))
|
|
2758
2899
|
loose.sort()
|
|
2900
|
+
// ---- 按族一键补齐(issue #191 方案 C,2026-12-02)----
|
|
2901
|
+
// 报告人那台机器上装了 dsh-master,21 个 `master_*` 一句都调不动:白名单是显式
|
|
2902
|
+
// 放行名单,插件升级新加一族工具就得有人手工再来填一遍——而且不填的时候她只是
|
|
2903
|
+
// 答「这件事我做不到」,用户看不出是名单少了名字。
|
|
2904
|
+
//
|
|
2905
|
+
// 补齐只补**这一族里她这台机器上真有的那些**(otherList 就是从 known 里筛出来的),
|
|
2906
|
+
// 不补「已知的全部名字」:后者会写进这台机器上不存在的名字,下一次存盘又被
|
|
2907
|
+
// sanitize 丢掉,界面来回跳。
|
|
2908
|
+
//
|
|
2909
|
+
// 只补不放行的那部分(`!allowList.includes`)——已经放行的点一下不该变成「改成只放行它」。
|
|
2910
|
+
const famMissing = (names) => names.filter((n) => !allowList.includes(n))
|
|
2911
|
+
const fillFam = (names) => {
|
|
2912
|
+
const add = famMissing(names)
|
|
2913
|
+
if (!add.length) return
|
|
2914
|
+
setToolsAllowText([...allowList, ...add].join(', '))
|
|
2915
|
+
setToolsSaveNote('')
|
|
2916
|
+
setToolsSaveErr('')
|
|
2917
|
+
}
|
|
2918
|
+
const fillAllFams = () => {
|
|
2919
|
+
const add = [...famMissing(fams.flatMap((g) => g.names)), ...famMissing(loose)]
|
|
2920
|
+
if (!add.length) return
|
|
2921
|
+
setToolsAllowText([...allowList, ...add].join(', '))
|
|
2922
|
+
setToolsSaveNote('')
|
|
2923
|
+
setToolsSaveErr('')
|
|
2924
|
+
}
|
|
2925
|
+
const missingTotal = famMissing(fams.flatMap((g) => g.names)).length + famMissing(loose).length
|
|
2759
2926
|
// 默认全收着。已经点开的就记住——保存/刷新一次页面不该把用户翻到一半的组收回去。
|
|
2760
2927
|
const famOpen = (fam) => toolsOpenFams[fam] === true
|
|
2761
2928
|
const toggleFam = (fam) => setToolsOpenFams((prev) => ({ ...prev, [fam]: !prev[fam] }))
|
|
@@ -2812,30 +2979,56 @@ window.__ModuleLoader__.load({
|
|
|
2812
2979
|
h('div', { className: 'chips' }, nodes)]
|
|
2813
2980
|
: [])
|
|
2814
2981
|
// 一族一行的折叠条:点标题展开这一族,右边挂个数。
|
|
2815
|
-
|
|
2982
|
+
// `extra` 是跟「补齐」那颗按钮并排时要的样式(famhd 自己是 width:100%,
|
|
2983
|
+
// 放进 flex 行里会把右边那颗挤出去)。
|
|
2984
|
+
const famRow = (key, label, count, open, onToggle, extra) => h('button', {
|
|
2816
2985
|
type: 'button',
|
|
2817
2986
|
key,
|
|
2818
2987
|
className: `famhd${open ? ' open' : ''}`,
|
|
2819
2988
|
onClick: onToggle,
|
|
2989
|
+
...(extra ? { style: extra } : null),
|
|
2820
2990
|
},
|
|
2821
2991
|
h('span', { className: 'famcaret' }, open ? '▾' : '▸'),
|
|
2822
2992
|
h('span', { className: 'famname' }, label),
|
|
2823
2993
|
h('span', { className: 'famcnt' }, String(count)))
|
|
2994
|
+
// 族标题右边那颗「补齐」:只在这一族还有没放行的名字时出现。
|
|
2995
|
+
const famFill = (names) => {
|
|
2996
|
+
const add = famMissing(names)
|
|
2997
|
+
if (!add.length) return null
|
|
2998
|
+
return h('button', {
|
|
2999
|
+
type: 'button',
|
|
3000
|
+
className: 'famfill',
|
|
3001
|
+
title: `把「${names[0]}」这一族里还没放行的 ${add.length} 个名字一次填进白名单(还要按「保存设置」才生效)`,
|
|
3002
|
+
onClick: () => fillFam(names),
|
|
3003
|
+
}, `补齐 ${add.length}`)
|
|
3004
|
+
}
|
|
2824
3005
|
// 「装了但没放行」单独折一层:真机上能有一百多个,摊开就没法看了。
|
|
2825
3006
|
// 外层收着,点开才看见有哪些族;族再各自收着,点哪族开哪族。
|
|
2826
3007
|
const otherOpen = famOpen('__other')
|
|
2827
3008
|
const otherGroups = otherOpen
|
|
2828
3009
|
? [
|
|
2829
3010
|
h('div', { key: 'famall', className: 'row', style: { gap: '8px', margin: '6px 0 2px' } },
|
|
2830
|
-
h('button', { type: 'button', onClick: toggleAllFams }, allFamsOpen ? '全部收起' : '全部展开')
|
|
3011
|
+
h('button', { type: 'button', onClick: toggleAllFams }, allFamsOpen ? '全部收起' : '全部展开'),
|
|
3012
|
+
missingTotal
|
|
3013
|
+
? h('button', {
|
|
3014
|
+
type: 'button',
|
|
3015
|
+
className: 'famfill',
|
|
3016
|
+
title: '把这一整块里还没放行的名字全部填进白名单(填完还要按「保存设置」)',
|
|
3017
|
+
onClick: fillAllFams,
|
|
3018
|
+
}, `全部补齐 ${missingTotal}`)
|
|
3019
|
+
: null),
|
|
2831
3020
|
...fams.flatMap((g) => [
|
|
2832
|
-
|
|
3021
|
+
h('div', { key: `famrow:${g.fam}`, className: 'row', style: { gap: '6px', alignItems: 'center' } },
|
|
3022
|
+
famRow(`fam:${g.fam}`, `${g.fam}_…`, g.names.length, famOpen(g.fam), () => toggleFam(g.fam), { flex: '1', minWidth: '0' }),
|
|
3023
|
+
famFill(g.names)),
|
|
2833
3024
|
famOpen(g.fam)
|
|
2834
3025
|
? h('div', { key: `chips:${g.fam}`, className: 'chips' }, g.names.map((n) => toolChip(n, 'other')))
|
|
2835
3026
|
: null,
|
|
2836
3027
|
]),
|
|
2837
3028
|
loose.length
|
|
2838
|
-
?
|
|
3029
|
+
? h('div', { key: 'famrow:__loose', className: 'row', style: { gap: '6px', alignItems: 'center' } },
|
|
3030
|
+
famRow('fam:__loose', '零散的(凑不成一族)', loose.length, famOpen('__loose'), () => toggleFam('__loose'), { flex: '1', minWidth: '0' }),
|
|
3031
|
+
famFill(loose))
|
|
2839
3032
|
: null,
|
|
2840
3033
|
loose.length && famOpen('__loose')
|
|
2841
3034
|
? h('div', { key: 'chips:__loose', className: 'chips' }, loose.map((n) => toolChip(n, 'other')))
|
|
@@ -3910,7 +4103,7 @@ window.__ModuleLoader__.load({
|
|
|
3910
4103
|
const ticks = signed ? [-limit, -limit / 2, 0, limit / 2, limit] : [0, limit / 2, limit]
|
|
3911
4104
|
return h('section', { className: 'pressure-section' },
|
|
3912
4105
|
h('h4', null, label + '(压力分)'),
|
|
3913
|
-
h('svg', { viewBox: '0 0 680 250', role: 'group', 'aria-label': label, style: { width: '100%' } },
|
|
4106
|
+
chartBox(h('svg', { viewBox: '0 0 680 250', role: 'group', 'aria-label': label, style: { width: '100%' } },
|
|
3914
4107
|
...ticks.map(tick => h('g', { key: tick },
|
|
3915
4108
|
h('line', { x1: 58, x2: 660, y1: y(tick), y2: y(tick), stroke: 'currentColor',
|
|
3916
4109
|
opacity: tick === 0 ? .85 : .2, strokeWidth: tick === 0 ? 2 : 1 }),
|
|
@@ -3934,7 +4127,7 @@ window.__ModuleLoader__.load({
|
|
|
3934
4127
|
width: 30, height: barHeight, fill: barColors[row.horizon] }),
|
|
3935
4128
|
h('text', { x, y: value < 0 ? Math.min(220, y(value) + 12) : y(value) - 5, textAnchor: 'middle',
|
|
3936
4129
|
fill: 'currentColor', fontSize: 11 }, result.count + ' 次'))
|
|
3937
|
-
})),
|
|
4130
|
+
}))),
|
|
3938
4131
|
h('p', null, ...backtestHorizons.map(horizon => h('span', { key: horizon, style: { marginInlineEnd: 14 } },
|
|
3939
4132
|
h('span', { style: { color: barColors[horizon] }, 'aria-hidden': true }, '■ '), '提前 ' + horizon + ' 轮'))))
|
|
3940
4133
|
}
|
|
@@ -3966,7 +4159,7 @@ window.__ModuleLoader__.load({
|
|
|
3966
4159
|
h('label', null, '预测起点 ', h('select', { value: detailOrigin,
|
|
3967
4160
|
onChange: event => changeTrend({ backtestOrigin: Number(event.currentTarget.value) }) },
|
|
3968
4161
|
...detailOrigins.map(round => h('option', { key: round, value: round }, '第 ' + round + ' 轮'))))),
|
|
3969
|
-
h('svg', { viewBox: '0 0 680 255', role: 'group', 'aria-label': '真实压力与预测压力', style: { width: '100%' } },
|
|
4162
|
+
chartBox(h('svg', { viewBox: '0 0 680 255', role: 'group', 'aria-label': '真实压力与预测压力', style: { width: '100%' } },
|
|
3970
4163
|
...[0, 25, 50, 75, 100].map(value => h('g', { key: value },
|
|
3971
4164
|
h('line', { x1: 48, x2: 660, y1: detailY(value), y2: detailY(value), stroke: 'currentColor', opacity: .2 }),
|
|
3972
4165
|
h('text', { x: 40, y: detailY(value) + 4, textAnchor: 'end', fill: 'currentColor', fontSize: 12 }, value))),
|
|
@@ -3989,7 +4182,7 @@ window.__ModuleLoader__.load({
|
|
|
3989
4182
|
row ? h('circle', { cx: detailX(point.round), cy: detailY(row.estimate), r: 5, fill: '#c96a11' }) : null)
|
|
3990
4183
|
}),
|
|
3991
4184
|
...[...new Set([1, detailOrigin, ...detailRecords.map(row => row.target)])].map(round =>
|
|
3992
|
-
h('text', { key: round, x: detailX(round), y: 239, fill: 'currentColor', fontSize: 12, textAnchor: 'middle' }, round))),
|
|
4185
|
+
h('text', { key: round, x: detailX(round), y: 239, fill: 'currentColor', fontSize: 12, textAnchor: 'middle' }, round)))),
|
|
3993
4186
|
h('p', null, '蓝实线为真实压力,橙虚线通向各有效预测目标。竖线标出预测起点及已记录事件。'),
|
|
3994
4187
|
pressureTable(['目标轮', '实际', '预测', '误差', '归因'], detailRecords.map(row =>
|
|
3995
4188
|
[row.target, row.target, scoreOf(row.actual), scoreOf(row.estimate), signedScore(row.estimate - row.actual),
|
|
@@ -4111,7 +4304,7 @@ window.__ModuleLoader__.load({
|
|
|
4111
4304
|
!trendLoading && (loadedIds.some(id => trendData[id]?.status !== 'analyzed'))
|
|
4112
4305
|
? h('p', { className: 'hint' }, '部分会话的日志不可用或超出本地分析范围。') : null,
|
|
4113
4306
|
!shownSeries.some(line => line.points.some(point => Number.isFinite(point.score))) ? h('p', null, '该范围暂无可绘制的完整轮末读数。') : null,
|
|
4114
|
-
shownSeries.length ? h('svg', { viewBox: '0 0 750 282', role: 'group', 'aria-label': '用户已完成轮次与压力分',
|
|
4307
|
+
shownSeries.length ? chartBox(h('svg', { viewBox: '0 0 750 282', role: 'group', 'aria-label': '用户已完成轮次与压力分',
|
|
4115
4308
|
style: { width: '100%', height: 'auto', minHeight: '160px' } },
|
|
4116
4309
|
...[0, 25, 50, 75, 100].map(score => h('g', { key: score },
|
|
4117
4310
|
h('line', { x1: 46, x2: 726, y1: trendY(score), y2: trendY(score), stroke: 'currentColor', opacity: .14 }),
|
|
@@ -4142,7 +4335,7 @@ window.__ModuleLoader__.load({
|
|
|
4142
4335
|
h('rect', { x: 46, y: 32, width: 680, height: 204, fill: 'transparent',
|
|
4143
4336
|
onPointerMove: event => setTrendFocus(pointerRound(event)),
|
|
4144
4337
|
onPointerLeave: () => setTrendFocus(null),
|
|
4145
|
-
onClick: event => chooseRound(pointerRound(event)) })) : null,
|
|
4338
|
+
onClick: event => chooseRound(pointerRound(event)) }))) : null,
|
|
4146
4339
|
shownSeries.length ? h('div', null,
|
|
4147
4340
|
h('label', null, '查看第 ' + focusRound + ' 轮 ', h('input', { type: 'range', min: firstRound, max: maxRound,
|
|
4148
4341
|
value: focusRound, onChange: event => chooseRound(event.currentTarget.valueAsNumber) })),
|
|
@@ -4231,7 +4424,7 @@ window.__ModuleLoader__.load({
|
|
|
4231
4424
|
if (!points.some(point => lines.some(line => Number.isFinite(line.read(point))))) {
|
|
4232
4425
|
return h('p', { className: 'hint' }, '暂无可绘制的轮末分数。')
|
|
4233
4426
|
}
|
|
4234
|
-
return h('svg', { viewBox: '0 0 680 220', role: 'group', 'aria-label': '轮末压力走势(0–100)', style: { width: '100%' } },
|
|
4427
|
+
return chartBox(h('svg', { viewBox: '0 0 680 220', role: 'group', 'aria-label': '轮末压力走势(0–100)', style: { width: '100%' } },
|
|
4235
4428
|
...[0, 25, 50, 75, 100].map(value => h('g', { key: value },
|
|
4236
4429
|
h('line', { x1: 43, x2: 660, y1: y(value), y2: y(value), stroke: 'currentColor', opacity: .16 }),
|
|
4237
4430
|
h('text', { x: 35, y: y(value) + 4, fill: 'currentColor', fontSize: 12, textAnchor: 'end' }, value))),
|
|
@@ -4251,7 +4444,7 @@ window.__ModuleLoader__.load({
|
|
|
4251
4444
|
h('title', null, label),
|
|
4252
4445
|
...values.map(([line, score]) => h('circle', { key: line.label, cx: x(point.round), cy: y(score), r: 3, fill: line.color })),
|
|
4253
4446
|
point.markers.length ? h('path', { d: 'M ' + x(point.round) + ' 13 l 4 4 -4 4 -4 -4 z', fill: 'currentColor' }) : null)] : []
|
|
4254
|
-
}))
|
|
4447
|
+
})))
|
|
4255
4448
|
}
|
|
4256
4449
|
function lineToggles(key, options) {
|
|
4257
4450
|
const hidden = trendConfig[key] ?? []
|
|
@@ -4467,7 +4660,7 @@ window.__ModuleLoader__.load({
|
|
|
4467
4660
|
function contributionBars(values, name) {
|
|
4468
4661
|
if (!values) return h('p', { className: 'hint' }, '该公式或端点缺少可分解的分数。')
|
|
4469
4662
|
const scale = 208 / Math.max(1, ...values.map(Math.abs))
|
|
4470
|
-
return h('svg', { viewBox: '0 0 650 132', role: 'group', 'aria-label': name, style: { width: '100%' } },
|
|
4663
|
+
return chartBox(h('svg', { viewBox: '0 0 650 132', role: 'group', 'aria-label': name, style: { width: '100%' } },
|
|
4471
4664
|
h('line', { x1: 320, x2: 320, y1: 6, y2: 116, stroke: 'currentColor', opacity: .6 }),
|
|
4472
4665
|
...values.map((value, index) => {
|
|
4473
4666
|
const y = 15 + 35 * index
|
|
@@ -4476,7 +4669,7 @@ window.__ModuleLoader__.load({
|
|
|
4476
4669
|
h('title', null, label), h('text', { x: 10, y: y + 13, fill: 'currentColor', fontSize: 14 }, scoreNames[index]),
|
|
4477
4670
|
h('rect', { x: 320 + Math.min(0, value * scale), y, width: Math.abs(value * scale), height: 17, fill: childColors[index] }),
|
|
4478
4671
|
h('text', { x: 555, y: y + 13, fill: 'currentColor', fontSize: 14 }, signedScore(value)))
|
|
4479
|
-
}))
|
|
4672
|
+
})))
|
|
4480
4673
|
}
|
|
4481
4674
|
const attributionPanel = !wantAttribution ? null : h('section', { className: 'load-panel' },
|
|
4482
4675
|
h('h4', null, '压力变化归因 · v0.1'),
|
|
@@ -4908,7 +5101,7 @@ window.__ModuleLoader__.load({
|
|
|
4908
5101
|
'醒来通常带一张事件卡。定时醒来取「每天定时醒几次」和「每天几张事件卡」里小的;主动搭话另算,不占这个数。这是上限,不是保证:没有可出的事、或落点太靠后,可能少醒一次。',
|
|
4909
5102
|
h('div', { className: 'grid2' },
|
|
4910
5103
|
Num({ label: '每天定时醒几次', value: wakes, onChange: setWakes, min: 0, max: 12, unit: '次',
|
|
4911
|
-
hint: S('只限定时醒来(含空醒)。你手动叫醒会记一次、挤掉后面的定时醒来,但手动本身随时能按(每天醒 0 次时除外)。0 为关掉定时醒来,右上角「现在叫醒大肥鱼」也叫不醒;直接跟她说话不受影响。范围 0–12
|
|
5104
|
+
hint: S('只限定时醒来(含空醒)。你手动叫醒会记一次、挤掉后面的定时醒来,但手动本身随时能按(每天醒 0 次时除外)。0 为关掉定时醒来,右上角「现在叫醒大肥鱼」也叫不醒;直接跟她说话不受影响。范围 0–12:每醒一次都是一次模型调用,开得越密越慢、越费钱。醒来时段有几段时,这几下会按段长分到各段里——两段都开、次数却只有 1,就只会醒在其中一段。') }),
|
|
4912
5105
|
Num({ label: '每天几张事件卡', value: eventsPerDay, onChange: setEventsPerDay, min: 0, max: 12, unit: '张',
|
|
4913
5106
|
hint: S('只限定时醒来;和「每天定时醒几次」取小的(两个都调大才有效)。0 为关掉定时醒来,手动按钮也叫不醒;直接跟她说话不受影响。范围 0–12。') }),
|
|
4914
5107
|
Num({ label: '对话停下来多久才叫醒', value: quietMin, onChange: setQuietMin, min: 0, max: 60, unit: '分钟',
|
|
@@ -4916,8 +5109,36 @@ window.__ModuleLoader__.load({
|
|
|
4916
5109
|
Sel({ label: '每天问题卡数', value: questionsPerDay, onChange: setQuestionsPerDay, options: [0, 1, 2, 3, 4, 5, 6],
|
|
4917
5110
|
fmt: (v) => (Number(v) === 0 ? '0 张 · 不出问题卡' : `${v} 张`),
|
|
4918
5111
|
hint: S('每天最多几张问答类事件卡;她向你提请求的卡不归它管。') }),
|
|
4919
|
-
|
|
4920
|
-
|
|
5112
|
+
// 醒来时段可以有多段(2026-11-30,用户 m01985):有人的作息是
|
|
5113
|
+
// 「中午醒一段、晚上醒一段」。段与段之间她不会自己醒,定时醒来按段长
|
|
5114
|
+
// 分配,所以两段都要至少留够醒一次的时长。
|
|
5115
|
+
h('div', { className: 'fld' },
|
|
5116
|
+
h('div', { className: 'fl' },
|
|
5117
|
+
h('span', { className: 'flabel' }, S('她醒着的时间段')),
|
|
5118
|
+
h('span', { className: 'fhint' }, S('只在这些段里自己醒:定时醒来、空醒、主动搭话都算。可以加几段——中午一段、晚上一段;段与段之间她不会自己醒。过了结束时间,她不会再自己醒;你发消息、有人 @ 她、你按「叫醒」,任何时间都能把她叫醒。每段的开始和结束不能相同,最多 4 段。'))),
|
|
5119
|
+
(Array.isArray(wakeSegs) ? wakeSegs : []).map((seg, i) => h('div', { key: `wake-${i}`, style: { display: 'flex', gap: '8px', alignItems: 'flex-start' } },
|
|
5120
|
+
h('div', { style: { flex: '1' } },
|
|
5121
|
+
TimeRange({
|
|
5122
|
+
label: (Array.isArray(wakeSegs) && wakeSegs.length > 1) ? `第 ${i + 1} 段` : '',
|
|
5123
|
+
from: seg[0],
|
|
5124
|
+
to: seg[1],
|
|
5125
|
+
onFrom: (v) => setWakeSegAt(i, 0, v),
|
|
5126
|
+
onTo: (v) => setWakeSegAt(i, 1, v),
|
|
5127
|
+
})),
|
|
5128
|
+
(Array.isArray(wakeSegs) && wakeSegs.length > 1)
|
|
5129
|
+
? h('button', {
|
|
5130
|
+
className: 'ghost',
|
|
5131
|
+
style: { marginTop: '22px' },
|
|
5132
|
+
onClick: () => setWakeSegs((list) => list.filter((_, j) => j !== i)),
|
|
5133
|
+
}, '删掉这段')
|
|
5134
|
+
: null)),
|
|
5135
|
+
(Array.isArray(wakeSegs) && wakeSegs.length < 4)
|
|
5136
|
+
? h('button', {
|
|
5137
|
+
className: 'ghost',
|
|
5138
|
+
style: { marginTop: '6px' },
|
|
5139
|
+
onClick: () => setWakeSegs((list) => [...list, ['12:00', '14:00']]),
|
|
5140
|
+
}, '再加一段')
|
|
5141
|
+
: null))),
|
|
4921
5142
|
// 说话(1.0,用户 m04784):把两件跟「她怎么说话」有关的事放到一处。
|
|
4922
5143
|
// 「纠正鱼八股」是强行约束说话方式,和「不硬性规定她怎么说」的规矩相冲突,
|
|
4923
5144
|
// 所以默认关、标实验性,文案必须直说。
|
|
@@ -5374,13 +5595,15 @@ window.__ModuleLoader__.load({
|
|
|
5374
5595
|
)
|
|
5375
5596
|
|
|
5376
5597
|
// ---------------------------- 上网 ----------------------------
|
|
5377
|
-
// 视频观看历史分页(2026-10-28 用户 m00416
|
|
5598
|
+
// 视频观看历史分页(2026-10-28 用户 m00416;当晚按用户反馈改成「随量自适应」;
|
|
5599
|
+
// 2026-12-01 改成两列大图卡片之后重排档位):
|
|
5378
5600
|
// 0.6.6 之前是「按天分组、每页三天」——一天刷 10 条、查 3 天就是 30 条挤在一屏。
|
|
5379
5601
|
// 现在**按条翻页**,并且每页条数不是一个死数字,而是按「一天实际刷几条」分档:
|
|
5380
5602
|
// 一共 ≤ 8 条 → 一页全放下,连翻页条都不出(别让人看到「第 1 / 1 页」这种噪音);
|
|
5381
|
-
// 日均 > 20 条 → 6
|
|
5382
|
-
//
|
|
5383
|
-
|
|
5603
|
+
// 日均 > 20 条 → 6 条/页(3 行);> 10 → 8 条/页(4 行);其余 8 条。
|
|
5604
|
+
// 两列之后一页要凑成偶数,否则最后一行只挂一张、看着像缺了东西。
|
|
5605
|
+
// 也就是刷得越密、每页越短:重度用户一屏不会顶到十几张封面,轻度用户又不用为翻页而翻页。
|
|
5606
|
+
const HIST_PAGE_MAX = 8
|
|
5384
5607
|
const histFlat = (hist?.groups || []).flatMap((g) =>
|
|
5385
5608
|
(g.items || []).map((it) => ({ ...it, date: g.date })))
|
|
5386
5609
|
const histDayCount = (hist?.groups || []).length
|
|
@@ -5398,21 +5621,39 @@ window.__ModuleLoader__.load({
|
|
|
5398
5621
|
const histTotal = histErr ? 0 : histFound.length
|
|
5399
5622
|
const histPerDay = histDayCount ? histFlat.length / histDayCount : 0
|
|
5400
5623
|
const histPageSize = histTotal === 0 ? HIST_PAGE_MAX
|
|
5401
|
-
: histTotal <= 8 ? histTotal
|
|
5624
|
+
: histTotal <= 8 ? histTotal + (histTotal % 2)
|
|
5402
5625
|
: histPerDay > 20 ? 6
|
|
5403
|
-
:
|
|
5404
|
-
: histPerDay > 5 ? 10
|
|
5405
|
-
: HIST_PAGE_MAX
|
|
5626
|
+
: HIST_PAGE_MAX
|
|
5406
5627
|
const histPages = Math.max(1, Math.ceil(histTotal / histPageSize))
|
|
5407
5628
|
const histAt = Math.min(histPage, histPages - 1)
|
|
5408
5629
|
const histSlice = histFound.slice(histAt * histPageSize, histAt * histPageSize + histPageSize)
|
|
5630
|
+
// 大图卡片一页就能顶出屏幕,翻完页得把列表顶端带回视野,否则看到的还是页面底部,
|
|
5631
|
+
// 会以为没翻过去。只在点翻页时滚,敲搜索词时不动(否则每按一个字页面就往下跳)。
|
|
5632
|
+
const histListRef = useRef(null)
|
|
5633
|
+
const histGo = (p) => {
|
|
5634
|
+
setHistPage(p)
|
|
5635
|
+
const node = histListRef.current
|
|
5636
|
+
if (node && typeof node.scrollIntoView === 'function') {
|
|
5637
|
+
setTimeout(() => node.scrollIntoView({ block: 'start', behavior: 'smooth' }), 0)
|
|
5638
|
+
}
|
|
5639
|
+
}
|
|
5409
5640
|
const histPager = histPages > 1
|
|
5410
5641
|
? h('div', { className: 'row' },
|
|
5411
|
-
h('button', { disabled: histAt <= 0, onClick: () =>
|
|
5642
|
+
h('button', { disabled: histAt <= 0, onClick: () => histGo(histAt - 1) }, '较新'),
|
|
5412
5643
|
h('span', { className: 'dim' }, `第 ${histAt + 1} / ${histPages} 页 · 一页 ${histPageSize} 条`),
|
|
5413
|
-
h('button', { disabled: histAt >= histPages - 1, onClick: () =>
|
|
5644
|
+
h('button', { disabled: histAt >= histPages - 1, onClick: () => histGo(histAt + 1) }, '更早'))
|
|
5414
5645
|
: null
|
|
5415
5646
|
const histHow = (how) => (how === 'watch' ? '看过画面' : how === 'look' ? '点开读过' : '只是翻到过')
|
|
5647
|
+
// 一天有几十条时,一页装不下:按日期把这一页重新切成几块,每块自己带日期头。
|
|
5648
|
+
// 头里报「本页 n / 共 N 条」,这样翻到第二页也知道后面还有这一天。
|
|
5649
|
+
const histDayTotal = new Map()
|
|
5650
|
+
for (const it of histFound) histDayTotal.set(it.date, (histDayTotal.get(it.date) || 0) + 1)
|
|
5651
|
+
const histPageGroups = []
|
|
5652
|
+
for (const it of histSlice) {
|
|
5653
|
+
const g = histPageGroups[histPageGroups.length - 1]
|
|
5654
|
+
if (g && g.date === it.date) g.items.push(it)
|
|
5655
|
+
else histPageGroups.push({ date: it.date, items: [it] })
|
|
5656
|
+
}
|
|
5416
5657
|
|
|
5417
5658
|
const biliPage = h('div', { className: 'page' },
|
|
5418
5659
|
// 第二个参数是这一组的说明(note),控件从第三个起。0.9.5 把装控件的 grid2 填进了 note 位,
|
|
@@ -5621,7 +5862,7 @@ window.__ModuleLoader__.load({
|
|
|
5621
5862
|
groupFull('看过的视频',
|
|
5622
5863
|
// 三种关系分开说(2026-11-24,用户 m01923):以前只剩「看过画面」一种标,
|
|
5623
5864
|
// 另外两类(她自己点开读过、自动逛时只是翻到过)在列表里长得一样,只能猜。
|
|
5624
|
-
S('
|
|
5865
|
+
S('按天从近到远,点卡片打开原视频。「看过画面」是抽帧看过的,「点开读过」是她自己点开的,「只是翻到过」是自动逛时翻到的。'),
|
|
5625
5866
|
h('div', { className: 'grid2', style: { marginBottom: '6px' } },
|
|
5626
5867
|
Text({ label: '找一条', value: histQ,
|
|
5627
5868
|
onChange: (v) => { setHistQ(v); setHistPage(0); searchHist(v) },
|
|
@@ -5693,39 +5934,48 @@ window.__ModuleLoader__.load({
|
|
|
5693
5934
|
: histPick
|
|
5694
5935
|
? `这一天没有记录(${histPick})。把日子放宽,或者清掉筛选。`
|
|
5695
5936
|
: (histBusy ? '正在读…' : '还没有记录。'))
|
|
5696
|
-
: h('div',
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
background: 'rgba(128,128,128,.15)',
|
|
5716
|
-
},
|
|
5717
|
-
}),
|
|
5718
|
-
// 2026-10-30:真的抽帧看过画面的那几条要能一眼认出来,
|
|
5719
|
-
// 否则它跟"只扫了眼标题"在列表里长得一样(客户反馈的原点)。
|
|
5720
|
-
// 2026-11-24(用户 m01923):三类分开标,「看过画面」不再吃掉另两类的区别。
|
|
5721
|
-
h('span', { className: 'tag', style: { flex: '0 0 auto' } }, histHow(it.how)),
|
|
5722
|
-
h('a', {
|
|
5937
|
+
: h('div', { className: 'histdays', ref: histListRef }, histPageGroups.map((g) => {
|
|
5938
|
+
const dayAll = histDayTotal.get(g.date) || g.items.length
|
|
5939
|
+
return h('section', { key: `day|${g.date}`, className: 'histday' },
|
|
5940
|
+
h('div', { className: 'histdayhd' },
|
|
5941
|
+
h('b', null, g.date.slice(5)),
|
|
5942
|
+
h('span', null, g.items.length < dayAll
|
|
5943
|
+
? `本页 ${g.items.length} / 共 ${dayAll} 条`
|
|
5944
|
+
: `${g.items.length} 条`),
|
|
5945
|
+
// 一天刷满几十条时会连着翻好几页;从这一页直接收窄到这一天,不用再开月历。
|
|
5946
|
+
h('button', {
|
|
5947
|
+
style: {
|
|
5948
|
+
marginLeft: 'auto', height: '22px', padding: '0 8px',
|
|
5949
|
+
fontSize: '11.5px', borderRadius: '6px',
|
|
5950
|
+
},
|
|
5951
|
+
onClick: () => { setHistPick(g.date); setHistOpen(false); setHistPage(0) },
|
|
5952
|
+
}, '只看这天')),
|
|
5953
|
+
h('div', { className: 'histgrid' }, g.items.map((it) => h('a', {
|
|
5954
|
+
key: `${g.date}|${it.bvid}`,
|
|
5955
|
+
className: 'histcard',
|
|
5723
5956
|
href: it.url,
|
|
5724
5957
|
target: '_blank',
|
|
5725
5958
|
rel: 'noreferrer',
|
|
5726
|
-
|
|
5727
|
-
},
|
|
5728
|
-
|
|
5959
|
+
title: esc(it.title) || it.bvid,
|
|
5960
|
+
},
|
|
5961
|
+
// 封面缺了就把 img 藏掉,外面那格按 16:9 留着灰底,卡片高度不会跟着抖。
|
|
5962
|
+
h('span', { className: 'histcoverwrap' },
|
|
5963
|
+
h('img', {
|
|
5964
|
+
className: 'histcover',
|
|
5965
|
+
src: `${API}/cover/${it.bvid}`,
|
|
5966
|
+
alt: '',
|
|
5967
|
+
loading: 'lazy',
|
|
5968
|
+
onError: (e) => { e.currentTarget.style.display = 'none' },
|
|
5969
|
+
})),
|
|
5970
|
+
h('span', { className: 'histbody' },
|
|
5971
|
+
h('span', { className: 'histtitle' }, esc(it.title) || it.bvid),
|
|
5972
|
+
h('span', { className: 'histsub' },
|
|
5973
|
+
// 2026-10-30:真的抽帧看过画面的那几条要能一眼认出来,
|
|
5974
|
+
// 否则它跟"只扫了眼标题"在列表里长得一样(客户反馈的原点)。
|
|
5975
|
+
// 2026-11-24(用户 m01923):三类分开标,「看过画面」不再吃掉另两类的区别。
|
|
5976
|
+
h('span', { className: `tag histhow ${it.how}` }, histHow(it.how)),
|
|
5977
|
+
it.up ? h('span', { className: 'tag histup' }, esc(it.up)) : null))))))
|
|
5978
|
+
})),
|
|
5729
5979
|
histPages > 1
|
|
5730
5980
|
? h('div', { className: 'row', style: { marginTop: '10px' } }, histPager)
|
|
5731
5981
|
: null,
|
|
@@ -6415,10 +6665,10 @@ window.__ModuleLoader__.load({
|
|
|
6415
6665
|
border: '0.5px solid var(--dsw-alias-border-l2)',
|
|
6416
6666
|
},
|
|
6417
6667
|
}),
|
|
6418
|
-
// 2026-
|
|
6419
|
-
//
|
|
6668
|
+
// 2026-12-01:换回 1 群(615628177)。这个群开着「搜群号进群」,
|
|
6669
|
+
// 两种进法都写上——扫码扫不出来时,复制群号去搜也行。
|
|
6420
6670
|
h('div', { className: 'hint', style: { margin: '10px 0 0' } },
|
|
6421
|
-
'
|
|
6671
|
+
'群号:615628177 —— 扫码进群,或者复制这个号去搜。'))))
|
|
6422
6672
|
|
|
6423
6673
|
// 顺序是用户定的:①手上能用什么 ②为什么默认只放这几个 ③关于(版本 / 检查更新 / GitHub)。
|
|
6424
6674
|
// 「关于」放最后——它是这个页的收尾,不是打开就要看的东西。
|
|
@@ -7711,7 +7961,7 @@ window.__ModuleLoader__.load({
|
|
|
7711
7961
|
}
|
|
7712
7962
|
|
|
7713
7963
|
const moveHint = moveInfo
|
|
7714
|
-
? `现在住在 ${moveInfo.root}(${moveInfo.files}
|
|
7964
|
+
? `现在住在 ${moveInfo.root}(${moveInfo.files} 个文件${moveInfo.sizing ? ',正在量大小…' : `,约 ${Math.max(1, Math.round((moveInfo.bytes || 0) / 1024))}KB`})${moveInfo.moved ? '——已经搬过一次了' : ''}。`
|
|
7715
7965
|
: ''
|
|
7716
7966
|
|
|
7717
7967
|
const moveCard = h('div', { style: { marginTop: '14px' } },
|