papersearch 0.7.2 → 0.7.3

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.
Files changed (60) hide show
  1. package/dist/capabilities/download/batch/batch.d.ts.map +1 -1
  2. package/dist/capabilities/download/batch/batch.js +297 -14
  3. package/dist/capabilities/download/batch/batch.js.map +1 -1
  4. package/dist/capabilities/download/batch/batchFolder.js +1 -1
  5. package/dist/capabilities/download/batch/batchFolder.js.map +1 -1
  6. package/dist/capabilities/download/batch/batchSummary.js +1 -1
  7. package/dist/capabilities/download/batch/batchSummary.js.map +1 -1
  8. package/dist/capabilities/download/batch/networkLoss.d.ts +1 -1
  9. package/dist/capabilities/download/batch/networkLoss.js +1 -1
  10. package/dist/capabilities/download/content/markdown/shortfall.js +5 -5
  11. package/dist/capabilities/download/content/markdown/shortfall.js.map +1 -1
  12. package/dist/infrastructure/runlog/failureClass.d.ts +16 -9
  13. package/dist/infrastructure/runlog/failureClass.d.ts.map +1 -1
  14. package/dist/infrastructure/runlog/failureClass.js +64 -54
  15. package/dist/infrastructure/runlog/failureClass.js.map +1 -1
  16. package/dist/infrastructure/school/SchoolAttempt.d.ts.map +1 -1
  17. package/dist/infrastructure/school/SchoolAttempt.js +61 -56
  18. package/dist/infrastructure/school/SchoolAttempt.js.map +1 -1
  19. package/dist/infrastructure/school/SchoolMcpClient.d.ts +6 -2
  20. package/dist/infrastructure/school/SchoolMcpClient.d.ts.map +1 -1
  21. package/dist/infrastructure/school/SchoolMcpClient.js +14 -3
  22. package/dist/infrastructure/school/SchoolMcpClient.js.map +1 -1
  23. package/dist/infrastructure/school/index.d.ts +1 -1
  24. package/dist/infrastructure/school/index.d.ts.map +1 -1
  25. package/dist/infrastructure/school/types.d.ts +10 -3
  26. package/dist/infrastructure/school/types.d.ts.map +1 -1
  27. package/dist/management/failures/index.d.ts +5 -2
  28. package/dist/management/failures/index.d.ts.map +1 -1
  29. package/dist/management/failures/index.js +21 -4
  30. package/dist/management/failures/index.js.map +1 -1
  31. package/package.json +1 -1
  32. package/school/paper_search_school/adapters/base.py +4 -0
  33. package/school/paper_search_school/adapters/oup/__init__.py +20 -0
  34. package/school/paper_search_school/adapters/sage/__init__.py +4 -1
  35. package/school/paper_search_school/adapters/taylor_francis/__init__.py +3 -0
  36. package/school/paper_search_school/adapters/thieme/__init__.py +4 -2
  37. package/school/paper_search_school/assets/capsule.html +125 -49
  38. package/school/paper_search_school/assets/capsule_en.json +32 -54
  39. package/school/paper_search_school/assets/capsule_fr.json +32 -54
  40. package/school/paper_search_school/assets/capsule_ja.json +32 -54
  41. package/school/paper_search_school/assets/capsule_ko.json +32 -54
  42. package/school/paper_search_school/assets/capsule_zh-Hant.json +27 -53
  43. package/school/paper_search_school/cold_start.py +22 -11
  44. package/school/paper_search_school/engine/access_rules.py +3 -2
  45. package/school/paper_search_school/engine/batch.py +12 -4
  46. package/school/paper_search_school/engine/batch_access.py +21 -9
  47. package/school/paper_search_school/engine/batch_capture.py +1 -1
  48. package/school/paper_search_school/engine/batch_institution.py +130 -29
  49. package/school/paper_search_school/engine/bridge.py +16 -3
  50. package/school/paper_search_school/engine/router.py +2 -1
  51. package/school/paper_search_school/orchestrator.py +44 -18
  52. package/school/paper_search_school/progress_reporter.py +17 -8
  53. package/school/paper_search_school/progress_view.py +1 -1
  54. package/school/paper_search_school/publishers/builtin/sage.json +4 -2
  55. package/school/paper_search_school/publishers/builtin/thieme.json +3 -1
  56. package/school/paper_search_school/school_switch.py +34 -52
  57. package/school/paper_search_school/server.py +10 -8
  58. package/skills/paper-search/SKILL.md +1 -1
  59. package/skills/paper-search/references/browser-download.md +7 -9
  60. package/skills/paper-search/references/publisher-support.md +2 -2
@@ -9,6 +9,7 @@
9
9
  through the card (user, 2026-11-10). */
10
10
  --bg: #ffffff; --fg: #111827; --dim: #6b7280; --faint: #9ca3af;
11
11
  --line: rgba(17, 24, 39, 0.10); --track: rgba(17, 24, 39, 0.10); --hover: rgba(17, 24, 39, 0.06);
12
+ --fill: rgba(17, 24, 39, 0.045); --edge: rgba(17, 24, 39, 0.12);
12
13
  --accent: #2563eb; --ok: #16a34a; --bad: #dc2626;
13
14
  --warn: #92400e; --warn-bg: #fef3c7; --warn-line: #f3d27a; --warn-dot: #d97706;
14
15
  /* Inside the window's 10 px margin (body.mac): a shadow running past it was cut off
@@ -19,6 +20,7 @@
19
20
  :root {
20
21
  --bg: #202124; --fg: #f3f4f6; --dim: #a1a1aa; --faint: #71717a;
21
22
  --line: rgba(255, 255, 255, 0.12); --track: rgba(255, 255, 255, 0.14); --hover: rgba(255, 255, 255, 0.08);
23
+ --fill: rgba(255, 255, 255, 0.05); --edge: rgba(255, 255, 255, 0.16);
22
24
  --accent: #60a5fa; --ok: #4ade80; --bad: #f87171;
23
25
  --warn: #fbbf24; --warn-bg: #3a2d10; --warn-line: #6b5216; --warn-dot: #fbbf24;
24
26
  --shadow: 0 3px 7px rgba(0, 0, 0, 0.42), 0 1px 2px rgba(0, 0, 0, 0.32);
@@ -243,6 +245,10 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
243
245
  .about-name .pro-pill { margin-left: 6px; vertical-align: 2px; }
244
246
  .about-version { font-size: 12px; color: var(--dim); margin-top: 3px; }
245
247
  .about-version.new, .about-version.bad { color: var(--bad); }
248
+ /* 有新版本 X, a link to what is new (user, 2026-11-22: 乙, in the line, not under the button). */
249
+ .about-version .ver-notes { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer;
250
+ text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
251
+ .about-version .ver-notes svg.i { width: 11px; height: 11px; margin-left: 2px; vertical-align: -1px; stroke-width: 2.2; }
246
252
  .about-action { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; }
247
253
  .about-action .btn.primary { width: 100%; justify-content: center; padding: 6px 10px; font-size: 13px; }
248
254
  .about-action .btn.link { padding: 0; font-size: 12px; }
@@ -264,6 +270,7 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
264
270
  .version-link .pl-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
265
271
  .version-link:hover .pl-text { text-decoration: underline; }
266
272
  .version-link svg.i { width: 14px; height: 14px; flex: none; }
273
+ .version-link .pro-pill { margin-left: 2px; flex: none; }
267
274
  .reopen-line { display: flex; align-items: center; gap: 8px; width: 100%; margin: 8px 0 0; padding: 7px 10px; border: none; border-radius: 8px;
268
275
  background: rgba(22, 163, 74, 0.10); color: var(--ok); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
269
276
  .reopen-line svg.i { width: 14px; height: 14px; flex: none; }
@@ -342,8 +349,30 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
342
349
  .key-edit { background: var(--hover); border-radius: 8px; padding: 8px 10px; margin: 0 0 6px; }
343
350
  /* The school sign-in page (PaperSearch Pro): the schools saved, one the default for downloads, each with its
344
351
  account; the fields beside their names, close together (user, 2026-11-20). */
345
- .login-school { border-bottom: 0.5px solid var(--line); }
346
- .login-row { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 0; text-align: left; font-size: 13px;
352
+ /* A card per school (user, 2026-11-22: 甲, the schools hard to tell apart in one list): the closed ones filled, the open
353
+ one white with an edge, 添加学校 a dashed one; its rarer actions in ⋯, a confirmation in place of its last line. */
354
+ .login-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
355
+ .login-school { position: relative; border-radius: 10px; background: var(--fill); padding: 0 10px; }
356
+ .login-school.open { background: var(--bg); box-shadow: 0 0 0 1px var(--edge), 0 2px 8px rgba(17, 24, 39, 0.06); padding-bottom: 10px; }
357
+ .login-school.add { background: none; border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); }
358
+ /* The open card's head: no masked account (its field is under it), room kept for ⋯ before the chevron. */
359
+ .login-row .ls-end { flex: none; width: 0; margin-left: auto; }
360
+ .login-row .ls-end.with-menu { width: 24px; }
361
+ .ls-dots { position: absolute; right: 29px; top: 7px; width: 24px; height: 24px; margin: 0; border-radius: 6px; background: var(--hover); }
362
+ .ls-dots svg.i { width: 15px; height: 15px; }
363
+ .ls-menu { position: absolute; right: 29px; top: 34px; z-index: 6; min-width: 120px; padding: 4px 0; border-radius: 8px; background: var(--bg);
364
+ box-shadow: 0 0 0 0.5px var(--line), 0 6px 20px rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.08); }
365
+ .ls-menu button { display: block; width: 100%; padding: 6px 14px; border: none; background: none; font: inherit; font-size: 12.5px;
366
+ color: var(--fg); text-align: left; white-space: nowrap; cursor: pointer; }
367
+ .ls-menu button:hover, .ls-menu button:focus-visible { background: var(--hover); outline: none; }
368
+ .ls-menu button.danger { color: var(--bad); }
369
+ .login-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; height: 30px; margin-top: 2px; font-size: 12px; color: var(--dim); }
370
+ .login-foot .grow { flex: 1; }
371
+ .login-foot .switch, .login-foot .btn { flex: none; white-space: nowrap; }
372
+ .login-foot.asking { padding: 0 4px 0 10px; border-radius: 8px; background: color-mix(in srgb, var(--bad) 9%, transparent); color: var(--bad); }
373
+ .login-foot.asking .q { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
374
+ .login-foot .btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
375
+ .login-row { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 0; text-align: left; font-size: 13px;
347
376
  border: none; background: none; color: inherit; font-family: inherit; cursor: pointer; }
348
377
  .login-row:hover .ls-name { color: var(--accent); }
349
378
  .login-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
@@ -372,16 +401,14 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
372
401
  .login-form .key-actions .btn { white-space: nowrap; }
373
402
  /* The less used ones under the buttons, the same for every school (user, 2026-11-20: rows of buttons that differed
374
403
  from school to school, and wrapped). */
375
- .login-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12px; }
376
- .login-links .link-btn { border: none; background: none; padding: 0; font: inherit; color: var(--dim); cursor: pointer; }
377
- .login-links .link-btn:hover, .login-links .link-btn:focus-visible { color: var(--accent); }
378
- .login-links .link-btn.danger:hover, .login-links .link-btn.danger:focus-visible, .login-links .link-btn.confirm { color: var(--bad); }
379
- .login-links .sep { color: var(--dim); }
380
404
  /* 测试登录 (user, 2026-11-21, as drawn): the article, then how the test went; while it runs, its steps in rows of their
381
405
  own height and one line for what the download says, so that the page does not move as it goes. */
382
406
  .login-form .test-result { grid-column: 1 / -1; }
383
407
  .login-form .test-err { grid-column: 2; }
384
408
  .test-article { display: flex; align-items: center; gap: 8px; min-width: 0; }
409
+ .login-form .test-article { grid-column: 1 / -1; }
410
+ .test-article .lbl { flex: none; color: var(--dim); font-size: 12px; }
411
+ .test-article .link-btn.edit svg.i { width: 13px; height: 13px; }
385
412
  .test-article .what { flex: 1; min-width: 0; color: var(--fg); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
386
413
  .test-article .what.empty { color: var(--dim); font-size: 11.5px; } /* none filled in: what to do */
387
414
  .test-article .test-btn { padding: 3px 10px; flex: none; white-space: nowrap; }
@@ -506,7 +533,7 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
506
533
  .paper-list .open-article:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
507
534
  .tag { display: inline-block; font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 5px; flex: none; }
508
535
  .tag.no_access, .tag.other { background: var(--hover); color: var(--fg); }
509
- .tag.user_side, .tag.school_side, .tag.publisher_or_network, .tag.article_or_site { background: var(--warn-bg); color: var(--warn); }
536
+ .tag.user_side, .tag.external { background: var(--warn-bg); color: var(--warn); }
510
537
  .tag.unsupported { background: rgba(37, 99, 235, 0.12); color: var(--accent); }
511
538
  .tag.unexplained { background: rgba(220, 38, 38, 0.12); color: var(--bad); }
512
539
  .tag.doubt { background: var(--hover); color: var(--dim); }
@@ -598,6 +625,8 @@ const ICONS = {
598
625
  pause: '<path d="M9 6.5v11M15 6.5v11"/>',
599
626
  dots: '<circle cx="6" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="18" cy="12" r="1"/>',
600
627
  left: '<path d="M15 6l-6 6 6 6"/>',
628
+ external: '<path d="M7 17L17 7M9 7h8v8"/>',
629
+ edit: '<path d="M4 20h4L19 9l-4-4L4 16z"/><path d="M13.5 6.5l4 4"/>',
601
630
  right: '<path d="M9 6l6 6-6 6"/>',
602
631
  down: '<path d="M6 9l6 6 6-6"/>',
603
632
  up: '<path d="M6 15l6-6 6 6"/>',
@@ -703,6 +732,7 @@ let proStatus = null, proInstall = { state: "idle" }, proInstallTimer = 0;
703
732
  // The school sign-in page (school_login_state); its error line.
704
733
  let schoolLogin = null, loginError = "", loginValues = {}, loginShown = false;
705
734
  // The school whose account is open on the page (its entityID), and 添加学校: what was typed, what was found.
735
+ let loginMenu = ""; // the open school's ⋯ menu, open (its key)
706
736
  let loginOpen = "", schoolQuery = "", schoolFound = null, schoolFinding = false, confirmForget = "", loginAdding = false;
707
737
  // 测试登录 (school_test.py): the test as the window runs it ({state: idle, running (key, step, phase), done (key, ok,
708
738
  // title, detail, seconds)}); the article it opens for the school open ({doi}: "" while none is set), and its box: open
@@ -1006,8 +1036,9 @@ function attentionCard() {
1006
1036
  return html + "</div></div>";
1007
1037
  }
1008
1038
 
1009
- const CLASS_TAGS = { no_access: "没权限", user_side: "你这边", school_side: "学校那边", publisher_or_network: "出版社或网络",
1010
- article_or_site: "文章或网站", unsupported: "暂不支持", unexplained: "原因不明", other: "其他", doubt: "待核对" };
1039
+ // The five failure classes by the names PaperSearch gives them everywhere (failureClass.ts, 2026-11-22).
1040
+ const CLASS_TAGS = { no_access: "没权限", user_side: "要你处理", external: "外部原因", unsupported: "暂不支持",
1041
+ unexplained: "原因不明", other: "其他", doubt: "待核对" };
1011
1042
  let openGroups = null, groupsRun = ""; // null: each reason row as the view opens it
1012
1043
  // Main-text rows first, then the supplementary files' rows, numbered on.
1013
1044
  function allGroups() { return V.summary.groups.concat(V.summary.supplement_groups || [], V.summary.markdown_groups || [], V.summary.doubt_groups || []); }
@@ -1456,8 +1487,11 @@ function versionLink() {
1456
1487
  const update = newerVersion();
1457
1488
  const said = update ? (versionCheck.update ? "有新版本 " + versionCheck.latest + ",点此更新" : "有新版本,点此更新")
1458
1489
  : "PaperSearch" + (versionInfo.running ? " " + versionInfo.running : "");
1490
+ // Pro installed: its pill after the version, as on its features' rows (user, 2026-11-22); a newer version's red line alone.
1491
+ const pro = !update && proOn() && !!(proStatus && proStatus.ok && proStatus.installed);
1459
1492
  return '<button type="button" class="version-link' + (update ? " new" : "") + '" data-act="settings_page" data-page="about">'
1460
- + (update ? icon("upcircle") : "") + '<span class="pl-text">' + esc(said) + "</span></button>";
1493
+ + (update ? icon("upcircle") : "") + '<span class="pl-text">' + esc(said) + "</span>"
1494
+ + (pro ? '<span class="pro-pill">Pro</span>' : "") + "</button>";
1461
1495
  }
1462
1496
 
1463
1497
 
@@ -1505,7 +1539,6 @@ function aboutAction() {
1505
1539
  return '<div class="about-action">' + (busy()
1506
1540
  ? '<button type="button" class="btn primary" disabled>' + esc("下载结束后更新") + "</button>"
1507
1541
  : '<button type="button" class="btn primary" data-act="update_all">' + esc(label) + "</button>")
1508
- + (versionCheck.update && versionCheck.notes ? '<button type="button" class="btn link" data-act="release_notes">' + esc("这次更新了什么") + "</button>" : "")
1509
1542
  + "</div>";
1510
1543
  }
1511
1544
  return versionCheck.state === "running" ? "" : '<div class="about-action"><button type="button" class="btn link" data-act="check_versions">'
@@ -1517,9 +1550,14 @@ const aboutComing = () => '<div class="about-sub">' + esc("即将推出") + "</d
1517
1550
  function settingsAbout() {
1518
1551
  const installed = proOn() && !!(proStatus && proStatus.ok && proStatus.installed);
1519
1552
  const [tone, line] = versionLine();
1553
+ // A newer PaperSearch with its notes: 有新版本 X is the link to them, ↗ after it (user, 2026-11-22: 乙).
1554
+ const said = "有新版本 " + versionCheck.latest;
1555
+ const notes = tone === "new" && versionCheck.update && versionCheck.notes && line.endsWith(said);
1556
+ const version = notes ? esc(line.slice(0, -said.length)) + '<button type="button" class="ver-notes" data-act="release_notes">'
1557
+ + esc(said) + icon("external") + "</button>" : esc(line);
1520
1558
  const hero = '<div class="about-hero">' + appIcon(56, installed) + '<div class="about-name' + (installed ? " with-pill" : "") + '">PaperSearch'
1521
1559
  + (installed ? '<span class="pro-pill">Pro</span>' : "") + '</div><div class="about-version' + (tone ? " " + tone : "") + '" role="status">'
1522
- + esc(line) + "</div></div>" + aboutAction();
1560
+ + version + "</div></div>" + aboutAction();
1523
1561
  let pro = "";
1524
1562
  if (proOn() && installed) {
1525
1563
  pro = '<div class="about-gap"></div>' + (proAction() ? '<div class="pro-action">' + proAction() + "</div>" : "") + proUsage(false) + aboutComing()
@@ -1624,7 +1662,7 @@ function loginTesting(t) {
1624
1662
  // tests). 文章 beside 账号 and 密码, two characters each; its line ends where their boxes end.
1625
1663
  function loginTest(s) {
1626
1664
  if (!testArticle) return "";
1627
- const label = "<span>" + esc("文章") + "</span>";
1665
+ const label = testArticle.doi || testEditing ? '<span class="lbl">' + esc("测试文章") + "</span>" : "";
1628
1666
  const t = schoolTest.state === "done" && schoolTest.key === s.key ? schoolTest : null;
1629
1667
  const result = t ? '<div class="test-result ' + (t.ok ? "ok" : "bad") + '" role="status">' + icon(t.ok ? "check" : "alert")
1630
1668
  + '<div><div class="t">' + esc(t.title) + "</div>" + (t.detail ? '<div class="d">' + esc(t.detail) + "</div>" : "")
@@ -1632,7 +1670,7 @@ function loginTest(s) {
1632
1670
  // Also for a school whose account is not saved yet: 测试 saves what is typed first.
1633
1671
  const test = '<button class="btn test-btn" data-act="school_test">' + esc("测试") + "</button>";
1634
1672
  if (testEditing) {
1635
- return result + label + '<div class="test-article"><span class="test-edit">'
1673
+ return result + '<div class="test-article">' + label + '<span class="test-edit">'
1636
1674
  + '<input id="test-article" type="text" autocomplete="off" spellcheck="false" value="' + esc(testArticleText)
1637
1675
  + '" placeholder="' + esc("DOI 或文章网址") + '" aria-label="' + esc("测试文章") + '">'
1638
1676
  + '<button type="button" class="link-btn" data-act="test_article_save"' + (testArticleSaving ? " disabled" : "") + ">"
@@ -1640,23 +1678,27 @@ function loginTest(s) {
1640
1678
  + (testArticleError ? '<div class="err test-err" role="status">' + esc(testArticleError) + "</div>" : "");
1641
1679
  }
1642
1680
  const doi = testArticle.doi;
1643
- return result + label + '<div class="test-article"><span class="what' + (doi ? "" : " empty") + '"' + (doi ? ' title="' + esc(doi) + '"' : "")
1681
+ return result + '<div class="test-article">' + label + '<span class="what' + (doi ? "" : " empty") + '"' + (doi ? ' title="' + esc(doi) + '"' : "")
1644
1682
  + ">" + esc(doi || "填入学校订阅文章 DOI 或网址") + "</span>"
1645
- + '<button type="button" class="link-btn" data-act="test_article_edit">' + esc(doi ? "修改" : "填写") + "</button>" + test + "</div>";
1683
+ + (doi ? '<button type="button" class="link-btn edit" data-act="test_article_edit" aria-label="' + esc("修改") + '">' + icon("edit") + "</button>"
1684
+ : '<button type="button" class="link-btn" data-act="test_article_edit">' + esc("填写") + "</button>") + test + "</div>";
1646
1685
  }
1647
1686
 
1648
1687
  function loginSchool(s, index) {
1649
- const shown = loginOpen === s.key;
1688
+ const shown = loginOpen === s.key, items = loginMenuItems(s);
1650
1689
  // Their order, where there is more than one (user, 2026-11-21: 没权限时换下一所学校 goes down it; 1 the default).
1651
1690
  const many = ((schoolLogin && schoolLogin.schools) || []).length > 1;
1652
1691
  const row = '<button type="button" class="login-row" data-act="login_open" data-key="' + esc(s.key) + '" aria-expanded="' + shown + '">'
1653
1692
  + (many ? '<span class="ls-n">' + (index + 1) + "</span>" : "") + '<span class="ls-name">' + esc(schoolName(s)) + "</span>"
1654
1693
  + (s.current ? '<span class="tag default">' + esc("默认") + "</span>" : "") + tagHtml(s.status)
1655
- + '<span class="ls-acct">' + esc(s.saved ? (s.enabled ? s.username : "已关闭") : "未填账号") + "</span>"
1694
+ + (shown ? '<span class="ls-end' + (items.length ? " with-menu" : "") + '"></span>'
1695
+ : '<span class="ls-acct">' + esc(s.saved ? (s.enabled ? s.username : "已关闭") : "未填账号") + "</span>")
1656
1696
  + icon(shown ? "down" : "right") + "</button>";
1657
1697
  if (!shown) return '<div class="login-school">' + row + "</div>";
1658
- if (schoolTest.state === "running" && schoolTest.key === s.key) return '<div class="login-school">' + row + loginTesting(schoolTest) + "</div>";
1659
- return '<div class="login-school">' + row
1698
+ if (schoolTest.state === "running" && schoolTest.key === s.key) return '<div class="login-school open">' + row + loginTesting(schoolTest) + "</div>";
1699
+ const menu = !items.length ? "" : '<button type="button" class="iconbtn ls-dots" data-act="login_menu" aria-label="' + esc("更多操作") + '" aria-expanded="'
1700
+ + (loginMenu === s.key) + '">' + icon("dots") + "</button>" + (loginMenu === s.key ? '<div class="ls-menu" role="menu">' + items.join("") + "</div>" : "");
1701
+ return '<div class="login-school open">' + row + menu
1660
1702
  + (s.off === "rejected" ? '<div class="err" style="text-align:left;margin:0 0 8px">'
1661
1703
  + esc("学校没有接受保存的密码,自动登录已关闭;更新密码后保存,就会重新打开") + "</div>" : "")
1662
1704
  + '<div class="login-form">'
@@ -1669,24 +1711,34 @@ function loginSchool(s, index) {
1669
1711
  + icon("eye") + "</button></span>"
1670
1712
  // A line for an error, or the next step once a school is added; "saved" said on the button itself (user, 2026-11-20).
1671
1713
  + '<div class="err' + (loginError ? "" : " ok") + '" id="login-error" role="status">' + esc(loginError || loginDone) + "</div>"
1672
- + loginTest(s)
1673
- + '<div class="key-actions">'
1674
- + (s.saved ? '<button class="btn" data-act="login_switch">' + esc(s.enabled ? "关闭自动登录" : "打开自动登录") + "</button>" : "")
1675
- + '<span class="grow"></span>'
1676
- + '<button class="btn primary" data-act="save_login">' + (loginSaved ? icon("check") + esc("已保存") : esc("保存")) + "</button></div>"
1677
- + loginLinks(s) + "</div></div>";
1678
- }
1679
-
1680
- // Under the buttons, the same for every school: set it as the default (not the default already), clear its account
1681
- // and password (saved ones), remove it (not the default: another is made the default first); the last two asked twice.
1682
- function loginLinks(s) {
1683
- const links = [];
1684
- if (!s.current) links.push('<button type="button" class="link-btn" data-act="set_default" data-key="' + esc(s.key) + '">' + esc("设为默认") + "</button>");
1685
- if (s.saved) links.push('<button type="button" class="link-btn danger' + (confirmClear === "login" ? " confirm" : "") + '" data-act="clear_login">'
1686
- + esc(confirmClear === "login" ? "确认清除账号密码" : "清除账号密码") + "</button>");
1687
- if (!s.current) links.push('<button type="button" class="link-btn danger' + (confirmForget === s.key ? " confirm" : "") + '" data-act="forget_school" data-key="'
1688
- + esc(s.key) + '">' + esc(confirmForget === s.key ? "确认移除" : "移除这所学校") + "</button>");
1689
- return links.length ? '<div class="login-links">' + links.join('<span class="sep">·</span>') + "</div>" : "";
1714
+ + loginTest(s) + loginFoot(s) + "</div></div>";
1715
+ }
1716
+
1717
+ // ⋯, the same for every school: set it as the default (not the default already), clear its account and password (saved
1718
+ // ones), remove it (not the default: another is made the default first); the last two asked again in place (loginFoot).
1719
+ function loginMenuItems(s) {
1720
+ const items = [];
1721
+ if (!s.current) items.push('<button type="button" role="menuitem" data-act="set_default" data-key="' + esc(s.key) + '">' + esc("设为默认") + "</button>");
1722
+ if (s.saved) items.push('<button type="button" role="menuitem" class="danger" data-act="clear_login">' + esc("清除账号密码") + "</button>");
1723
+ if (!s.current) items.push('<button type="button" role="menuitem" class="danger" data-act="forget_school" data-key="' + esc(s.key) + '">'
1724
+ + esc("移除这所学校") + "</button>");
1725
+ return items;
1726
+ }
1727
+
1728
+ // The card's last line: 自动登录's switch (a saved account) and 保存; while a clearing or a removal is asked, that question
1729
+ // in its place, the same height (user, 2026-11-22: the old confirmation moved the page down).
1730
+ function loginFoot(s) {
1731
+ const forget = confirmForget === s.key;
1732
+ if (forget || confirmClear === "login") {
1733
+ return '<div class="login-foot asking" role="alert"><span class="q">' + esc(forget ? "移除这所学校?" : "清除账号和密码?") + '</span><span class="grow"></span>'
1734
+ + '<button type="button" class="btn" data-act="cancel_confirm">' + esc("取消") + "</button>"
1735
+ + (forget ? '<button type="button" class="btn danger" data-act="forget_school" data-key="' + esc(s.key) + '">' + esc("移除") + "</button>"
1736
+ : '<button type="button" class="btn danger" data-act="clear_login">' + esc("清除") + "</button>") + "</div>";
1737
+ }
1738
+ return '<div class="login-foot">' + (s.saved ? "<span>" + esc("自动登录") + '</span><button type="button" class="switch' + (s.enabled ? " on" : "")
1739
+ + '" data-act="login_switch" role="switch" aria-checked="' + !!s.enabled + '" aria-label="' + esc("自动登录") + '"></button>' : "")
1740
+ + '<span class="grow"></span><button type="button" class="btn primary" data-act="save_login">'
1741
+ + (loginSaved ? icon("check") + esc("已保存") : esc("保存")) + "</button></div>";
1690
1742
  }
1691
1743
 
1692
1744
  function loginFound() {
@@ -1705,8 +1757,8 @@ function settingsLogin() {
1705
1757
  if (!s || !s.ok) return head + '<div class="err" style="text-align:left">' + esc((s && s.error) || "读取失败") + "</div>";
1706
1758
  if (!s.pro) return head + '<div class="pro-desc">' + esc("学校登录页自动填写账号和密码,批量下载不用守着。") + "</div>" + proNeeded();
1707
1759
  // 添加学校 a row like the schools', opened to its search (user, 2026-11-20: a box alone said nothing).
1708
- return head + '<div style="margin-top:8px">' + (s.schools || []).map(loginSchool).join("")
1709
- + '<div class="login-school"><button type="button" class="login-row login-add-row" data-act="login_add" aria-expanded="' + loginAdding + '">'
1760
+ return head + '<div class="login-list">' + (s.schools || []).map(loginSchool).join("")
1761
+ + '<div class="login-school add"><button type="button" class="login-row login-add-row" data-act="login_add" aria-expanded="' + loginAdding + '">'
1710
1762
  + icon("plus") + '<span class="ls-name">' + esc("添加学校") + "</span>" + icon(loginAdding ? "down" : "right") + "</button>"
1711
1763
  + (loginAdding ? '<div class="login-add"><div class="login-find"><input id="school-query" type="text" autocomplete="off" spellcheck="false" value="'
1712
1764
  + esc(schoolQuery) + '" placeholder="' + esc("中文名、英文名或学校网址") + '" aria-label="' + esc("学校名称") + '">'
@@ -2124,6 +2176,15 @@ function keepSupportPlace(last) {
2124
2176
  if (last) keepScroll = null;
2125
2177
  }
2126
2178
 
2179
+ // The card's own border, as drawn: 0.5px a side is one device pixel on a Retina screen but a whole pixel (1px a side)
2180
+ // on a 1x screen (user, 2026-11-22: an external 1080p screen). The surface is as wide as what the border leaves, so it
2181
+ // lies in the same place whichever edge it is anchored to while the window lays itself out.
2182
+ function rootBorder() {
2183
+ const style = getComputedStyle(root);
2184
+ return [parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth),
2185
+ parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth)].map((n) => n || 0);
2186
+ }
2187
+
2127
2188
  let fitGeneration = 0, layoutQueue = Promise.resolve();
2128
2189
  let settledGeneration = 0, settledSize = null, settledExpanded = null;
2129
2190
  function fit(previous) {
@@ -2133,11 +2194,11 @@ function fit(previous) {
2133
2194
  const to = [Math.ceil(target.width), Math.ceil(target.height)];
2134
2195
  const from = previous.width && previous.height ? [previous.width, previous.height] : to;
2135
2196
  const expanded = root.classList.contains("card");
2136
- const border = document.body.classList.contains("mac") ? 1 : 0;
2197
+ const border = rootBorder();
2137
2198
  // Fix the content width before awaiting the native bridge. Otherwise an
2138
2199
  // absolutely positioned surface shrink-wraps for a frame on every tick.
2139
- root.firstElementChild.style.width = Math.max(0, to[0] - border) + "px";
2140
- root.style.setProperty("--content-max-height", Math.max(0, to[1] - border) + "px");
2200
+ root.firstElementChild.style.width = Math.max(0, to[0] - border[0]) + "px";
2201
+ root.style.setProperty("--content-max-height", Math.max(0, to[1] - border[1]) + "px");
2141
2202
  if (settledGeneration === generation - 1 && settledExpanded === expanded && settledSize
2142
2203
  && to.every((size, i) => size === settledSize[i] && Math.abs(size - from[i]) < 1)) {
2143
2204
  // Elapsed time/countdowns update the text, not the window geometry.
@@ -2156,13 +2217,17 @@ async function animateFit(generation, expanded, from, to, pad) {
2156
2217
  if (generation !== fitGeneration || dragging || closing) return;
2157
2218
  const layout = await api().begin_layout(expanded, to[0] + pad, to[1] + pad, generation);
2158
2219
  if (generation !== fitGeneration || dragging || closing || !layout.vertical) return;
2159
- document.body.classList.remove("grow-up", "grow-down", "grow-left", "grow-right");
2160
- document.body.classList.add("grow-" + layout.vertical, "grow-" + layout.horizontal);
2161
2220
  from = [layout.from_width - pad, layout.from_height - pad];
2162
2221
  to = [layout.width - pad, layout.height - pad];
2163
- const border = document.body.classList.contains("mac") ? 1 : 0;
2164
- root.style.setProperty("--content-max-height", Math.max(0, to[1] - border) + "px");
2165
- root.firstElementChild.style.width = Math.max(0, to[0] - border) + "px";
2222
+ // Anchored to the edge that moves only along a side whose size changes: a layout that changes nothing (a size read
2223
+ // back a fraction of a pixel off on a 1x screen or at 125%/150% scaling) leaves the page where it lies, never a pixel
2224
+ // to one side for the length of the animation (user, 2026-11-22: it shook left and right there).
2225
+ document.body.classList.remove("grow-up", "grow-down", "grow-left", "grow-right");
2226
+ document.body.classList.add("grow-" + (Math.abs(to[1] - from[1]) >= 1 ? layout.vertical : "down"),
2227
+ "grow-" + (Math.abs(to[0] - from[0]) >= 1 ? layout.horizontal : "right"));
2228
+ const border = rootBorder();
2229
+ root.style.setProperty("--content-max-height", Math.max(0, to[1] - border[1]) + "px");
2230
+ root.firstElementChild.style.width = Math.max(0, to[0] - border[0]) + "px";
2166
2231
  keepSupportPlace(false);
2167
2232
  const duration = matchMedia('(prefers-reduced-motion: reduce)').matches ? 0 : 240;
2168
2233
  const started = performance.now();
@@ -2212,6 +2277,7 @@ function say(text) { flash = { text: text, until: Date.now() + 6000 }; render(tr
2212
2277
 
2213
2278
  let inputActivation = Promise.resolve();
2214
2279
  async function act(action, target) {
2280
+ if (action !== "login_menu") loginMenu = "";
2215
2281
  const v = V;
2216
2282
  switch (action) {
2217
2283
  // Back as a capsule when restored, unless pinned: a pinned card comes back open (user, 2026-11-20:
@@ -2472,6 +2538,11 @@ async function act(action, target) {
2472
2538
  if (loginAdding) root.querySelector("#school-query")?.focus();
2473
2539
  return;
2474
2540
  }
2541
+ case "login_menu":
2542
+ loginMenu = loginMenu === loginOpen ? "" : loginOpen; confirmClear = ""; confirmForget = "";
2543
+ return render(true);
2544
+ case "cancel_confirm":
2545
+ confirmClear = ""; confirmForget = ""; return render(true);
2475
2546
  case "login_open": {
2476
2547
  loginOpen = loginOpen === target.dataset.key ? "" : target.dataset.key;
2477
2548
  loginError = ""; loginDone = ""; confirmClear = ""; confirmForget = ""; loginShown = false; loginSaved = false;
@@ -2695,6 +2766,11 @@ root.addEventListener("click", (event) => {
2695
2766
  // the window's drag, while which the page is not drawn again.
2696
2767
  document.addEventListener("pointerdown", (event) => {
2697
2768
  if (languageOpen && !event.target.closest(".lang-wrap")) closeLanguageMenu();
2769
+ if (loginMenu && !event.target.closest(".ls-menu, .ls-dots")) {
2770
+ loginMenu = "";
2771
+ root.querySelector(".ls-menu")?.remove();
2772
+ root.querySelector(".ls-dots")?.setAttribute("aria-expanded", "false");
2773
+ }
2698
2774
  }, true);
2699
2775
  function closeLanguageMenu() {
2700
2776
  languageOpen = false;
@@ -8,10 +8,6 @@
8
8
  "按原因": "by reason",
9
9
  "正文已保存": "main text saved",
10
10
  "没权限": "No access",
11
- "你这边": "Your side",
12
- "学校那边": "School",
13
- "出版社或网络": "Publisher or network",
14
- "文章或网站": "Article or site",
15
11
  "暂不支持": "Unsupported",
16
12
  "原因不明": "Unclear",
17
13
  "待核对": "Check",
@@ -150,44 +146,13 @@
150
146
  "没有完成登录": "Not signed in",
151
147
  "机构 PDF 批量下载": "School PDF batch",
152
148
  "等待下载进程响应(暂无新进度)": "Waiting for the download (no news)",
153
- "DOI 没指向能登录的网站": "DOI leads to no login site",
154
- "DOI 暂时查不到": "DOI not found yet",
155
149
  "网络中断": "Network down",
156
150
  "网络断了,等网络恢复后接着下": "Offline; waiting to go on",
157
- "DOI 没有登记": "DOI never registered",
158
- "PDF 身份未确认": "PDF identity unconfirmed",
159
- "下载已取消": "Download cancelled",
160
- "下载时程序出错": "Program error",
161
- "下载环境不可用": "Download setup down",
162
- "下载环境被占用": "Download setup busy",
163
- "下载等待超时": "Download timed out",
164
- "人机验证没通过": "Failed bot check",
165
- "任务已终止": "Task stopped",
166
- "你标记过无权限": "You marked no access",
167
- "你跳过了这一篇": "You skipped it",
168
- "全文尚未发布": "Full text not out yet",
169
- "全文未确认有效": "Full text unconfirmed",
170
- "出版社网站没响应": "Publisher site silent",
171
- "出版社页面出错": "Publisher page error",
172
- "到了每小时下载上限": "Hourly limit reached",
173
151
  "只在其他平台提供": "Only on another platform",
174
- "后端结果无法使用": "Backend result unusable",
175
- "学校密码已过期": "School password expired",
176
152
  "学校没有订阅": "No school subscription",
177
153
  "学校登录系统出错": "School login error",
178
- "学校登录被拒绝": "School login refused",
179
- "学校账号被锁定": "School account locked",
180
- "找不到学校的登录路线": "No login route for school",
181
- "找不到机构登录入口": "No institution login",
182
- "网站没有学校登录入口": "Site has no school login",
183
- "拿到的 PDF 无效": "Invalid PDF",
184
- "拿到的是别篇 PDF": "Another paper's PDF",
185
- "拿到网页不是文件": "Got a page, not a file",
186
154
  "没取到 PDF": "No PDF",
187
- "没找到可用 PDF": "No usable PDF",
188
155
  "没进入学校登录页": "School login not reached",
189
- "浏览器没有响应": "Browser not responding",
190
- "浏览器连接断了": "Browser connection lost",
191
156
  "需要 PaperSearch Pro": "Needs PaperSearch Pro",
192
157
  "Markdown 全文": "Markdown full text",
193
158
  "测试中": "Testing",
@@ -195,20 +160,8 @@
195
160
  "已安装": "Installed",
196
161
  "提交 issue": "Report an issue",
197
162
  "读取失败": "Couldn't read",
198
- "PaperSearch Pro 暂不可用": "PaperSearch Pro unavailable now",
199
163
  "登录后没回到出版社": "No return to publisher",
200
- "登录重试已用尽": "Login retries used up",
201
- "登录页被关闭": "Login page closed",
202
- "下载浏览器被关闭了": "Browser closed",
203
- "等学校登录超时": "School login timed out",
204
- "网站人机验证拦截": "Blocked by bot check",
205
- "网站拦截了当前网络": "Site blocked network",
206
- "认证入口未注册": "Login entry unregistered",
207
- "需要学校登录": "School login needed",
208
- "页面处理超时": "Page timed out",
209
- "页面提示全文受限": "Full text restricted",
210
164
  "没有有效 DOI": "No valid DOI",
211
- "没有进行机构下载": "No school download",
212
165
  "附录没下载成功": "Supp. not downloaded",
213
166
  "机构订阅": "Subscription",
214
167
  "预印本": "Preprint",
@@ -307,7 +260,6 @@
307
260
  "下载时找免费全文": "Finds free full texts",
308
261
  "检索论文、核对 DOI 是否真实": "Search papers; check DOIs are real",
309
262
  "填你常用的邮箱就行,不用注册": "Your usual email will do; no sign-up",
310
- "网站暂不支持自动下载附录": "No supp. rule; get by hand",
311
263
  "已达每小时上限": "Hourly limit reached",
312
264
  "补充材料": "Supp.",
313
265
  "PDF、补充材料": "PDF, Supp.",
@@ -318,7 +270,6 @@
318
270
  "正在查找文件": "Finding files",
319
271
  "PDF 已保存": "PDF saved",
320
272
  "这批下载已没有暂停的篇目": "Nothing is paused",
321
- "学校登录中途失效,已暂停": "School login lapsed; paused",
322
273
  "继续": "Resume",
323
274
  "已收到:这一篇下完后接着下暂停的篇目": "Got it: resuming the paused",
324
275
  "登录并继续": "Sign in & resume",
@@ -327,7 +278,6 @@
327
278
  "展开进度窗口": "Open the progress window",
328
279
  "已确认": "Confirmed",
329
280
  "正在继续下载": "Resuming",
330
- "学校订阅下载扩展需要更新": "Extension needs an update",
331
281
  "网站暂不支持转换": "No page rules for site",
332
282
  "网页只有摘要": "Page has abstract only",
333
283
  "文章页没有正文": "Page has no full text",
@@ -336,7 +286,6 @@
336
286
  "没有可转换的全文": "No full text to convert",
337
287
  "图片没下载成功": "Figures not downloaded",
338
288
  "表格没取到": "Tables not fetched",
339
- "PubMed Central 没响应": "PubMed Central did not answer",
340
289
  "如需登录,会打开学校登录页": "Sign-in page opens if needed",
341
290
  "其他篇目已完成,等你回来点“登录并继续”": "Others done; press Sign in & resume",
342
291
  "已终止,未处理": "Stopped, not done",
@@ -385,7 +334,6 @@
385
334
  "安装包不全": "Package incomplete",
386
335
  "请先在终端运行 gh auth login 登录 GitHub": "Run gh auth login in a terminal first",
387
336
  "测试版": "Beta",
388
- "学校登录后没回到出版社": "School login didn't return",
389
337
  "马上生效": "Apply now",
390
338
  "开": "On",
391
339
  "关": "Off",
@@ -777,6 +725,10 @@
777
725
  "停止测试": "Stop the test",
778
726
  "测试登录": "Test sign-in",
779
727
  "测试文章": "Test article",
728
+ "自动登录": "Auto sign-in",
729
+ "清除账号和密码?": "Clear this account?",
730
+ "移除这所学校?": "Remove this school?",
731
+ "更多操作": "More actions",
780
732
  "测试下的 PDF 已删掉": "the test PDF was deleted",
781
733
  "正在停止…": "Stopping…",
782
734
  "学校登录测试": "School sign-in test",
@@ -828,7 +780,6 @@
828
780
  "已是最新版本": "Up to date",
829
781
  "有新版本": "New version",
830
782
  "有新版本,点此更新": "New version: update",
831
- "这次更新了什么": "What's new",
832
783
  "下载结束后更新": "Update when done",
833
784
  "更新": "Update",
834
785
  "完成后窗口会自动重新打开": "The window reopens when done",
@@ -848,7 +799,34 @@
848
799
  "没权限时换下一所学校": "Next school if no access",
849
800
  "单篇论文": "One paper",
850
801
  "网站已阻止当前访问,未取得 PDF": "Site blocked access; no PDF",
851
- "读不到 GitHub 登录(远程连接读不到),请在这台电脑上直接操作": "Can't read the GitHub login over a remote connection; use this computer directly"
802
+ "读不到 GitHub 登录(远程连接读不到),请在这台电脑上直接操作": "Can't read the GitHub login over a remote connection; use this computer directly",
803
+ "要你处理": "Needs you",
804
+ "你标记过没权限": "You marked no access",
805
+ "等你登录超时": "Login wait timed out",
806
+ "你跳过或终止了": "Skipped or stopped",
807
+ "学校登录中途失效": "School login lapsed",
808
+ "全文还没上线": "Full text not online yet",
809
+ "DOI 查不到": "DOI not found",
810
+ "页面或浏览器卡住": "Page or browser stuck",
811
+ "没进行学校订阅下载": "No school download",
812
+ "外部原因": "External",
813
+ "出版社没开通本校": "Not enabled for school",
814
+ "浏览器被关闭": "Browser closed",
815
+ "浏览器被占用": "Browser in use",
816
+ "密码被学校拒绝": "Password rejected",
817
+ "账号被锁或密码过期": "Locked or expired",
818
+ "被网站拦截": "Blocked by site",
819
+ "出版社网站出错": "Publisher site error",
820
+ "达到每小时下载上限": "Hourly limit reached",
821
+ "网站没有学校登录": "Site has no school login",
822
+ "网站暂未适配": "Site not adapted yet",
823
+ "附录暂未适配": "Files not adapted yet",
824
+ "拿错 PDF": "Wrong PDF",
825
+ "没法确认 PDF": "PDF unconfirmed",
826
+ "扩展需要更新": "Extension needs update",
827
+ "需要 Pro": "Needs Pro",
828
+ "Pro 暂不可用": "Pro unavailable",
829
+ "PMC 没响应": "PMC not responding"
852
830
  },
853
831
  "patterns": [
854
832
  [