driftnet 0.7.1 → 0.9.0

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/public/index.html CHANGED
@@ -361,8 +361,9 @@
361
361
  .hint { color: var(--muted); font-size: 13px; margin: -4px 2px 0; }
362
362
 
363
363
  /* A card sits on top of two action strips that show while it is dragged. */
364
- .swipe { position: relative; border-radius: 12px; overflow: hidden; scroll-margin-top: 90px; transition: height .25s ease, margin .25s ease, opacity .25s ease; }
364
+ .swipe { content-visibility: auto; contain-intrinsic-size: auto 150px; position: relative; border-radius: 12px; overflow: hidden; scroll-margin-top: 90px; transition: height .25s ease, margin .25s ease, opacity .25s ease; }
365
365
  .swipe.gone { opacity: 0; }
366
+ .page-more { display: flex; justify-content: center; padding: 8px 0 24px; }
366
367
  /* Inside the card (the swipe wrapper clips anything outside it). */
367
368
  .swipe.flash .card { animation: flash 2s ease; }
368
369
  @keyframes flash { 0%, 55% { outline: 3px solid var(--accent); outline-offset: -3px; background: var(--accent-soft); } 100% { outline-color: transparent; } }
@@ -399,6 +400,9 @@
399
400
  .plan-op.off { opacity: .5; }
400
401
  #plan-body { max-height: 55vh; overflow: auto; }
401
402
  .badge.folder { background: color-mix(in srgb, var(--c) 14%, var(--panel)); color: var(--c); font-weight: 600; }
403
+ .badge.health { background: var(--danger-soft); color: var(--danger); }
404
+ .badge.health.stale, .badge.health.moved { background: var(--accent-soft); color: var(--muted); }
405
+ .stars { color: var(--star); }
402
406
  .rating { font-size: 12px; color: var(--muted); white-space: nowrap; }
403
407
  .rating.must { color: var(--star); font-weight: 600; }
404
408
  .rating .ico { width: 13px; height: 13px; fill: currentColor; vertical-align: -2px; margin-right: 2px; }
@@ -409,6 +413,7 @@
409
413
  .meta .tags { font-size: 12px; color: color-mix(in srgb, var(--muted) 80%, transparent); }
410
414
  .meta { color: var(--muted); font-size: 13px; display: flex; gap: 4px 12px; flex-wrap: wrap; }
411
415
  .flag { color: var(--warn); font-size: 13px; }
416
+ .vflag { color: var(--muted); font-size: 13px; }
412
417
  .tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; }
413
418
  /* Desktop: the tools appear on hover / focus; a starred card keeps its star. */
414
419
  @media (hover: hover) and (pointer: fine) {
@@ -603,10 +608,29 @@
603
608
  <div class="dlg-actions">
604
609
  <button class="btn danger" id="fd-delete" type="button"></button><span class="spacer"></span>
605
610
  <button class="btn" id="fd-focus" type="button" hidden></button>
611
+ <button class="btn" id="fd-pack" type="button" hidden></button>
606
612
  <button class="btn" id="fd-cancel" type="button"></button><button class="btn primary" id="fd-save" type="submit"></button>
607
613
  </div>
608
614
  </form>
609
615
  </dialog>
616
+ <dialog id="pack-dlg" aria-labelledby="pk-title">
617
+ <form id="pack-form" method="dialog">
618
+ <h3 id="pk-title"></h3>
619
+ <p id="pk-help" style="color:var(--muted);font-size:13px;margin:0 0 12px"></p>
620
+ <p class="dlg-error" id="pk-error"></p>
621
+ <label><span id="pk-name-l"></span><input id="pk-name" maxlength="60" autocomplete="off"></label>
622
+ <label><span id="pk-desc-l"></span><textarea id="pk-desc" rows="2" maxlength="300"></textarea></label>
623
+ <div id="pk-link-box" hidden>
624
+ <label><span id="pk-link-l"></span><input id="pk-link" readonly></label>
625
+ <p id="pk-link-note" style="color:var(--muted);font-size:13px;margin:0 0 12px"></p>
626
+ </div>
627
+ <p id="pk-nolink" style="color:var(--muted);font-size:13px;margin:0 0 12px" hidden></p>
628
+ <div class="dlg-actions">
629
+ <button class="btn" id="pk-copy" type="button" hidden></button><span class="spacer"></span>
630
+ <button class="btn" id="pk-close" type="button"></button><button class="btn primary" id="pk-download" type="button"></button>
631
+ </div>
632
+ </form>
633
+ </dialog>
610
634
  <dialog id="move-dlg" aria-labelledby="mv-title">
611
635
  <h3 id="mv-title"></h3>
612
636
  <input id="mv-filter" class="search" style="max-width:none;width:100%;margin:0 0 8px" type="search" autocomplete="off">
@@ -691,11 +715,11 @@
691
715
  kind: "Kind", switchTo: "中文", nav: "Views and categories",
692
716
  stats: (n, s) => `${n} ${n === 1 ? "item" : "items"} · shared ${s}×`, shared: (n) => `shared ${n}×`,
693
717
  empty: "Nothing here yet — drop a link in your chat.", emptyFav: "No favorites yet — swipe a card right, or tap the star.",
694
- emptyTrash: "The trash is empty.", hint: "Swipe right to favorite, left to remove.", hintTrash: "Swipe right to restore.",
718
+ pageMore: (n) => `Show more (${n} left)`, emptyTrash: "The trash is empty.", hint: "Swipe right to favorite, left to remove.", hintTrash: "Swipe right to restore.",
695
719
  kinds: { repo: "Repos", product: "Products", video: "Videos", article: "Articles", post: "Posts", other: "Other" },
696
720
  kind1: { repo: "Repo", product: "Product", video: "Video", article: "Article", post: "Post", other: "Other" },
697
721
  worth: { skip: "skip", low: "low", normal: "worth a look", "must-see": "must-see" },
698
- flags: { injection: "prompt injection", "hidden-chars": "hidden characters", "low-reputation": "low-reputation source" },
722
+ flags: { injection: "prompt injection", "hidden-chars": "hidden characters", "low-reputation": "low-reputation source", "video-read": "read from video", "video-captions": "video captions", "video-ocr": "video on-screen text", "video-speech": "video speech" },
699
723
  pending: "waiting for a summary", noModel: "no summary — no model set up", enrichedBy: (a) => `summary by ${a}`,
700
724
  favorite: "Add to favorites", unfavorite: "Remove from favorites", remove: "Move to trash", restore: "Restore",
701
725
  swipeFav: "Favorite", swipeUnfav: "Unfavorite", swipeTrash: "Remove", swipeRestore: "Restore",
@@ -710,6 +734,7 @@
710
734
  moveTo: "Move to…", moveTitle: (n) => `Move “${n}” to`, moved: (n, f) => `Moved “${n}” to ${f}`, expand: "Show sub-folders",
711
735
  dragHint: "Drag onto a folder in the sidebar", foundIn: "Found in this post:", folderMoved: (n, f) => `“${n}” is now inside ${f}`,
712
736
  topLevelShort: "the top level",
737
+ pkShare: "Share as pack…", pkTitle: "Share as pack", pkHelp: "A pack is this folder, its sub-folders and the cards in them as one file. Someone else imports it with one click. Your notes, chat text and counters are never included.", pkName: "Pack name", pkDesc: "Description", pkDownload: "Download pack", pkLinkL: "Link to share", pkCopy: "Copy link", pkCopied: "Link copied", pkSigned: "Anyone with this link can download this one pack, and nothing else in your catalogue.", pkOpen: "Anyone who can reach this address can download this pack.", pkNoLink: "No public address is set, so there is no link to share yet. Set one in Settings → Access, or start a tunnel. You can still download the file.", pkClose: "Close", pkTooBig: "This folder is too big to share as a pack.",
713
738
  mapAll: "All", focusCrumb: "Mind map location", focusUp: "Up one level", focusFolder: "Focus on this folder", mapTree: "Mind map",
714
739
  mapHintFocus: "Double-click a folder (or press z on it) to focus on it.",
715
740
  kTreeNav: "Mind map: next / previous node", kTreeOpen: "Open a folder, or step into it", kTreeClose: "Close a folder, or step out to its parent", kTreeEnds: "First / last node", kTreeType: "Type a name", kTreeTypeText: "Jump to the node starting with it",
@@ -735,6 +760,10 @@
735
760
  split: "Split", splitHelp: "Cards and mind map side by side", splitCards: "Cards",
736
761
  kSelect: "Select or unselect the card", kRange: "Select a range", kHold: "Hold", kLong: "Start selecting on a phone", keysClose: "Close", kClear: "Clear the selection", kUndo: "Undo the last action", kHelp: "This list",
737
762
  kQuickNone: "Move a card into a folder first; the nine you use most get a number here.", kQuickN: (f) => `Move into ${f}`,
763
+ review: "Needs review", emptyReview: "No dead, archived or stale links found.", hintReview: "These links look dead, archived or stale. Refresh to re-read, check the link again from the card, or move them to the trash.",
764
+ checkLink: "Check link", linkChecked: "Link checked", linkCheckFailed: "Couldn't check the link",
765
+ health: { dead: ["☠", "dead", "The link no longer works (404 / gone)"], archived: ["🗄", "archived", "The repo is archived (read-only)"], stale: ["💤", "stale", "No pushes for 18 months"], moved: ["↪", "moved", "The repo moved or was renamed"] },
766
+ stars: (n) => `${n} GitHub stars`,
738
767
  inbox: "Inbox", emptyInbox: "Inbox zero — every card has a folder you chose.", hintInbox: "Tap a folder to file the card. Not filed yet: the cards below.",
739
768
  chipOther: "Other folder…", chipTitle: (p) => `Confidence ${p}%`,
740
769
  keysInbox: "In the Inbox", kChip: "File into the card's suggested folder 1–3", kSkip: "Skip: focus the next card", kQuickInbox: "In the Inbox, 1–3 pick the focused card's suggested folders instead; 4–9 still file into your most-used folders.",
@@ -756,8 +785,17 @@
756
785
  plugins: "Plugins", pluginsNone: (dir) => `No plugins. Put .js files in ${dir} — see examples/plugins in the repo.`,
757
786
  status: (e) => `Now: sorting by ${({ jev: "Jev", llm: "the model", heuristic: "built-in rules" })[e.judge] ?? e.judge}, summaries: ${e.summarizer === "off" ? "off" : e.summarizer}`, keep: "set — leave empty to keep", unset: "not set",
758
787
  locked: "set by the environment driftnet runs in", forbidden: "Server settings can only be changed on the computer running driftnet (or set DRIFTNET_TOKEN). Display settings still work.",
759
- savedServer: "Saved — already in effect", chat: "Chat replies", webhook: "Outgoing webhook", feed: "Feed (RSS)", genCopied: "New password generated and copied — press Save to keep it",
788
+ savedServer: "Saved — already in effect", chat: "Chat replies", webhook: "Outgoing webhook", digest: "Scheduled digest", feed: "Feed (RSS)", genCopied: "New password generated and copied — press Save to keep it",
760
789
  tabGeneral: "General", tabAccess: "Access", tabAi: "AI",
790
+ impPackTitle: "From a pack link", impPackHelp: "Paste the link someone sent you for a folder pack. It comes in already summarised (no model calls), under its own folder.", impPackGo: "Check link", impPackConfirm: (name, n, dup) => `Pack “${name}”: ${n} new cards (${dup} already there). Import it?`, impPackNone: (name, dup) => `Pack “${name}” has nothing new (${dup} already there). Import anyway to file them?`, impPackDone: (name, added, already) => `Imported “${name}”: ${added} added, ${already} already there.`,
791
+ impTitle: "Import bookmarks", impHelp: "Bring in a bookmarks file from your browser (HTML), Pocket, Raindrop (CSV), a driftnet JSON list, or any text with links.",
792
+ impFile: "Choose a file", impKeep: "Keep my bookmark folders (under Imported)", impReading: "Reading the file…",
793
+ impConfirm: (n, dup) => `Import ${n} links (${dup} already there)? With a model set up, each new link is one model call.`,
794
+ impNone: (dup, skip) => `Nothing new to import (${dup} already there, ${skip} skipped).`, impCapped: (n) => `Only the first ${n} links are taken in one import.`,
795
+ impSkipped: (n) => `${n} skipped (not web links, or private addresses).`, impStart: "Start import", impBusy: "An import is already running. Try again when it finishes.",
796
+ impProgress: (done, total, added, failed) => `Importing… ${done} of ${total} (${added} added, ${failed} failed)`,
797
+ impDone: (total, added, already, failed) => `Done: ${added} added, ${already} already there, ${failed} failed (of ${total}).`,
798
+ impFailedRun: "The import stopped unexpectedly.", impBadFile: "Couldn't read that file.",
761
799
  accessStatus: (pw, key, url) => `Password: ${pw === "✓" ? "set" : "not set"} · Share key: ${key === "✓" ? "made" : "none"} · Public URL: ${url === "—" ? "off" : url}`,
762
800
  access: "Access & connections",
763
801
  password: "Admin password", passwordHelp: "Once set, adding links, changing settings and agents that write all need it. At least 8 characters, no spaces.",
@@ -797,27 +835,51 @@
797
835
  DRIFTNET_LLM_API_KEY: ["API key", ""],
798
836
  DRIFTNET_LLM_EFFORT: ["Reasoning effort", ""],
799
837
  TYPESAFE_API_KEY: ["Jev key", "Optional: a ~100 ms classifier that saves model calls (console.typesafe.ai)"],
800
- DRIFTNET_JUDGE: ["Jev", ""],
838
+ DRIFTNET_JUDGE: ["Judge", "Who files each link before the model does. Rules is free: it needs no model."],
839
+ DRIFTNET_LLM_REGION: ["Region", "Bedrock: e.g. us-east-1. Vertex: e.g. us-central1 (default). Not used by other providers."],
840
+ AWS_ACCESS_KEY_ID: ["AWS access key ID", "Bedrock. Leave empty if you use a Bedrock API key."],
841
+ AWS_SECRET_ACCESS_KEY: ["AWS secret access key", "Bedrock."],
842
+ AWS_SESSION_TOKEN: ["AWS session token", "Bedrock, only for temporary credentials."],
843
+ AWS_BEARER_TOKEN_BEDROCK: ["Bedrock API key", "Bedrock: use this instead of the AWS keys above."],
844
+ GOOGLE_CLOUD_PROJECT: ["Google Cloud project", "Vertex. Optional when the credentials file names one."],
845
+ DRIFTNET_VERTEX_CREDENTIALS: ["Vertex credentials file", "Vertex: path to a service-account JSON file on this computer (or put an access token in API key)."],
846
+ DRIFTNET_JUDGE_RULES: ["Rules file", "For the Rules judge: a file path. One rule per line, e.g. github.com/* -> coding"],
801
847
  GITHUB_TOKEN: ["GitHub token", "Optional: GitHub lookups go from 60 to 5000 an hour"],
802
848
  DRIFTNET_LANGUAGE: ["Summary language", "English, Traditional Chinese (Taiwan), Japanese…"],
803
849
  DRIFTNET_LOCALE: ["Bot language", ""],
804
850
  DRIFTNET_REPLY: ["How the bot replies", ""],
851
+ DRIFTNET_REPLY_STYLE: ["Reply style", "Rich: embeds, blocks, cards and vote buttons where the platform has them. Text: plain messages."],
805
852
  DRIFTNET_PUBLIC_URL: ["This page's public URL", "Replies link here, e.g. https://driftnet.example.com"],
806
853
  DRIFTNET_SUMMARY_DEPTH: ["Summary detail", "How much each card says. Detailed costs more model tokens and reads twice as much of each page."],
807
854
  DRIFTNET_SUMMARY_RULES: ["Extra rules for summaries", "e.g. Say whether it's free. Mention if it needs a GPU."],
808
855
  DRIFTNET_BLOCK_DOMAINS: ["Never catalogue these domains", "Comma or space separated, e.g. example.com, spam.io"],
809
856
  DRIFTNET_WEBHOOK_URL: ["Webhook URL", "driftnet POSTs each new or updated card here (n8n, Zapier, Slack workflows…). Treated as a secret."],
810
857
  DRIFTNET_WEBHOOK_SECRET: ["Webhook signing secret", "Optional. Adds X-Driftnet-Signature: sha256=<HMAC of the body>."],
858
+ DRIFTNET_DIGEST: ["Digest", "A short summary of new cards, posted into your chats."],
859
+ DRIFTNET_DIGEST_AT: ["Digest time", "HH:MM in the server's local time zone, e.g. 09:00 (default)."],
860
+ DRIFTNET_DIGEST_DAY: ["Digest day (weekly)", ""],
861
+ DRIFTNET_DIGEST_TO: ["Digest targets", "Comma separated: telegram:<chat id>, discord:<channel id>, slack:<channel id>, line:<user, group or room id>. Uses the bot tokens already set."],
862
+ DRIFTNET_HEALTH: ["Link health check", "Weekly: a few cards at a time, driftnet checks that links still work and repos aren't archived. Marks dead, archived and stale cards."],
863
+ DRIFTNET_VIDEO: ["Read reels and shorts", "For Instagram, Facebook, Threads, TikTok, YouTube Shorts and X videos whose text says almost nothing, driftnet reads captions, on-screen text and speech with local tools (yt-dlp, ffmpeg, tesseract, whisper) if installed. One video at a time."],
864
+ DRIFTNET_YTDLP: ["yt-dlp path", "Only if yt-dlp is not on PATH."],
865
+ DRIFTNET_FFMPEG: ["ffmpeg path", "Only if ffmpeg is not on PATH."],
866
+ DRIFTNET_TESSERACT: ["tesseract path", "Only if tesseract (on-screen text) is not on PATH."],
867
+ DRIFTNET_WHISPER: ["whisper path", "Only if whisper or whisper-cli (speech) is not on PATH."],
811
868
  DRIFTNET_WEBHOOK_ALLOW_LOCAL: ["Allow a local webhook", "Needed when the receiver is on your own network (n8n on a LAN). Only that exact address is allowed."],
812
869
  },
813
870
  choices: {
814
- DRIFTNET_LLM_PROVIDER: { "": "None", anthropic: "Anthropic (API key)", openai: "OpenAI-compatible (OpenAI, Gemini, Grok, Ollama…)", "claude-cli": "Claude subscription (Claude Code CLI)", "gemini-cli": "Google account (Gemini CLI)" },
871
+ DRIFTNET_LLM_PROVIDER: { "": "None", anthropic: "Anthropic (API key)", openai: "OpenAI-compatible (OpenAI, Grok, Ollama…)", gemini: "Google Gemini (API key)", bedrock: "Amazon Bedrock", vertex: "Google Vertex AI", "claude-cli": "Claude subscription (Claude Code CLI)", "gemini-cli": "Google account (Gemini CLI)" },
815
872
  DRIFTNET_LLM_EFFORT: { "": "Default", low: "Low", medium: "Medium", high: "High", xhigh: "Extra high" },
816
- DRIFTNET_JUDGE: { "": "On when a key is set", off: "Off" },
873
+ DRIFTNET_JUDGE: { "": "Jev if a key is set", jev: "Jev", rules: "Rules (free, no model)", llm: "The model decides", heuristic: "The model decides", off: "No judge" },
817
874
  DRIFTNET_SUMMARY_DEPTH: { "": "Standard (default)", brief: "Brief: one line, 2 highlights, what you see", standard: "Standard", detailed: "Detailed: more highlights, use cases, how to try it" },
818
875
  DRIFTNET_LOCALE: { "": "Same as the summaries", en: "English", "zh-TW": "繁體中文" },
876
+ DRIFTNET_REPLY_STYLE: { "": "Rich (default)", rich: "Rich: cards and vote buttons", text: "Plain text" },
819
877
  DRIFTNET_REPLY: { "": "One line + link (default)", link: "One line + link", full: "Full summary", off: "Don't reply" },
878
+ DRIFTNET_DIGEST: { "": "Off (default)", off: "Off", daily: "Every day", weekly: "Every week" },
879
+ DRIFTNET_DIGEST_DAY: { "": "Monday (default)", mon: "Monday", tue: "Tuesday", wed: "Wednesday", thu: "Thursday", fri: "Friday", sat: "Saturday", sun: "Sunday" },
820
880
  DRIFTNET_WEBHOOK_ALLOW_LOCAL: { "": "No (public addresses only)", 1: "Yes" },
881
+ DRIFTNET_HEALTH: { "": "Off (default)", off: "Off", weekly: "Weekly (recommended)" },
882
+ DRIFTNET_VIDEO: { "": "Automatic (default)", auto: "Automatic: use the tools found", off: "Off" },
821
883
  },
822
884
  },
823
885
  },
@@ -826,10 +888,10 @@
826
888
  kind: "類型", switchTo: "EN", nav: "檢視與分類",
827
889
  stats: (n, s) => `${n} 則 · 分享 ${s} 次`, shared: (n) => `分享 ${n} 次`,
828
890
  empty: "還沒有內容,把連結丟進聊天室吧。", emptyFav: "還沒有最愛,把卡片往右滑或按星號。",
829
- emptyTrash: "垃圾桶是空的。", hint: "往右滑加入最愛,往左滑移到垃圾桶。", hintTrash: "往右滑還原。",
891
+ pageMore: (n) => `再顯示 ${n} 張`, emptyTrash: "垃圾桶是空的。", hint: "往右滑加入最愛,往左滑移到垃圾桶。", hintTrash: "往右滑還原。",
830
892
  kinds: { repo: "程式庫", product: "產品", video: "影片", article: "文章", post: "貼文", other: "其他" },
831
893
  worth: { skip: "略過", low: "次要", normal: "值得看", "must-see": "必看" },
832
- flags: { injection: "提示詞注入", "hidden-chars": "隱藏字元", "low-reputation": "低信譽來源" },
894
+ flags: { injection: "提示詞注入", "hidden-chars": "隱藏字元", "low-reputation": "低信譽來源", "video-read": "已從影片讀取", "video-captions": "影片字幕", "video-ocr": "影片畫面文字", "video-speech": "影片語音" },
833
895
  pending: "等待摘要", noModel: "沒有摘要(未設定模型)", enrichedBy: (a) => `由 ${a} 整理`,
834
896
  favorite: "加入最愛", unfavorite: "移出最愛", remove: "移到垃圾桶", restore: "還原",
835
897
  swipeFav: "加入最愛", swipeUnfav: "移出最愛", swipeTrash: "移到垃圾桶", swipeRestore: "還原",
@@ -844,6 +906,7 @@
844
906
  moveTo: "移動到…", moveTitle: (n) => `把「${n}」移動到`, moved: (n, f) => `已將「${n}」移到 ${f}`, expand: "展開子資料夾",
845
907
  dragHint: "拖到側邊欄的資料夾", foundIn: "從這篇找到:", folderMoved: (n, f) => `「${n}」已移到 ${f} 底下`,
846
908
  topLevelShort: "最上層",
909
+ pkShare: "分享成資料夾包…", pkTitle: "分享成資料夾包", pkHelp: "資料夾包把這個資料夾、底下的子資料夾和裡面的卡片包成一個檔案,別人一鍵就能匯入。你的筆記、聊天內容和各種計數都不會放進去。", pkName: "資料夾包名稱", pkDesc: "說明", pkDownload: "下載資料夾包", pkLinkL: "分享連結", pkCopy: "複製連結", pkCopied: "已複製連結", pkSigned: "拿到這個連結的人只能下載這一個資料夾包,看不到你目錄裡的其他內容。", pkOpen: "任何連得到這個位址的人都能下載這個資料夾包。", pkNoLink: "還沒設定公開網址,所以暫時沒有可分享的連結。請到「設定 → 存取」設定,或啟動通道。現在仍可以下載檔案。", pkClose: "關閉", pkTooBig: "這個資料夾太大,無法分享成資料夾包。",
847
910
  mapAll: "全部", focusCrumb: "樹狀圖位置", focusUp: "回上一層", focusFolder: "聚焦這個資料夾", mapTree: "樹狀圖",
848
911
  mapHintFocus: "連點兩下資料夾(或在資料夾上按 z)可以只看這個資料夾。",
849
912
  kTreeNav: "樹狀圖:下一個/上一個節點", kTreeOpen: "展開資料夾,或進入第一個子項", kTreeClose: "收合資料夾,或回到上一層", kTreeEnds: "第一個/最後一個節點", kTreeType: "直接輸入名稱", kTreeTypeText: "跳到名稱開頭相符的節點",
@@ -869,6 +932,10 @@
869
932
  split: "並排", splitHelp: "卡片列表與樹狀圖並排顯示", splitCards: "卡片",
870
933
  kSelect: "選取/取消選取這張", kRange: "選取一段範圍", kHold: "長按", kLong: "在手機上開始選取卡片", keysClose: "關閉", kClear: "取消全部選取", kUndo: "復原上一個動作", kHelp: "顯示這份清單",
871
934
  kQuickNone: "先把卡片移進某個資料夾;最常用的九個資料夾會在這裡得到數字鍵。", kQuickN: (f) => `移到 ${f}`,
935
+ review: "需要檢查", emptyReview: "沒有發現失效、封存或久未更新的連結。", hintReview: "這些連結看起來已失效、封存或久未更新。可以重新整理、在卡片上再檢查一次連結,或移到垃圾桶。",
936
+ checkLink: "檢查連結", linkChecked: "已檢查連結", linkCheckFailed: "無法檢查連結",
937
+ health: { dead: ["☠", "失效", "連結已經打不開(404/已移除)"], archived: ["🗄", "已封存", "這個儲存庫已封存(唯讀)"], stale: ["💤", "久未更新", "已超過 18 個月沒有更新"], moved: ["↪", "已搬家", "這個儲存庫已搬家或改名"] },
938
+ stars: (n) => `${n} 顆 GitHub 星`,
872
939
  inbox: "收件匣", emptyInbox: "收件匣清空了——每張卡片都有你選的資料夾。", hintInbox: "點一下資料夾就能歸檔。下面是還沒歸檔的卡片。",
873
940
  chipOther: "其他資料夾…", chipTitle: (p) => `信心 ${p}%`,
874
941
  keysInbox: "在收件匣", kChip: "歸到這張卡片建議的第 1–3 個資料夾", kSkip: "略過:移到下一張卡片", kQuickInbox: "在收件匣裡,1–3 改成選擇目前卡片的建議資料夾;4–9 仍然是放進最常用的資料夾。",
@@ -890,8 +957,17 @@
890
957
  plugins: "外掛", pluginsNone: (dir) => `沒有外掛。把 .js 檔放進 ${dir},範例在 repo 的 examples/plugins。`,
891
958
  status: (e) => `目前:分類用 ${({ jev: "Jev", llm: "模型", heuristic: "內建規則" })[e.judge] ?? e.judge},摘要用 ${e.summarizer === "off" ? "(未開啟)" : e.summarizer}`, keep: "已設定,留空就不變", unset: "未設定",
892
959
  locked: "由執行環境設定", forbidden: "伺服器設定只能在執行 driftnet 的那台電腦上改(或設定 DRIFTNET_TOKEN)。顯示設定照常可用。",
893
- savedServer: "已儲存,馬上生效", chat: "聊天室回覆", webhook: "對外 Webhook", feed: "訂閱源(RSS)", genCopied: "已產生新密碼並複製,按「儲存」才會生效",
960
+ savedServer: "已儲存,馬上生效", chat: "聊天室回覆", webhook: "對外 Webhook", digest: "定時摘要", feed: "訂閱源(RSS)", genCopied: "已產生新密碼並複製,按「儲存」才會生效",
894
961
  tabGeneral: "一般", tabAccess: "存取", tabAi: "AI",
962
+ impPackTitle: "從資料夾包連結匯入", impPackHelp: "貼上別人傳給你的資料夾包連結。卡片已經整理好(不會呼叫模型),會放進它自己的資料夾。", impPackGo: "檢查連結", impPackConfirm: (name, n, dup) => `資料夾包「${name}」:${n} 張新卡片(${dup} 張已經有了)。要匯入嗎?`, impPackNone: (name, dup) => `資料夾包「${name}」沒有新的卡片(${dup} 張已經有了)。仍要匯入把它們歸檔嗎?`, impPackDone: (name, added, already) => `已匯入「${name}」:新增 ${added}、原本就有 ${already}。`,
963
+ impTitle: "匯入書籤", impHelp: "匯入瀏覽器的書籤檔(HTML)、Pocket、Raindrop(CSV)、driftnet 的 JSON 清單,或任何含有連結的文字檔。",
964
+ impFile: "選擇檔案", impKeep: "保留我的書籤資料夾(放在「Imported」底下)", impReading: "讀取檔案中…",
965
+ impConfirm: (n, dup) => `匯入 ${n} 個連結(${dup} 個已經有了)?若已設定模型,每個新連結都會呼叫一次模型。`,
966
+ impNone: (dup, skip) => `沒有新的連結可匯入(${dup} 個已經有了,略過 ${skip} 個)。`, impCapped: (n) => `一次最多匯入前 ${n} 個連結。`,
967
+ impSkipped: (n) => `略過 ${n} 個(不是網頁連結,或是內網位址)。`, impStart: "開始匯入", impBusy: "已有匯入正在進行,請等它完成再試。",
968
+ impProgress: (done, total, added, failed) => `匯入中… ${done} / ${total}(新增 ${added}、失敗 ${failed})`,
969
+ impDone: (total, added, already, failed) => `完成:新增 ${added}、原本就有 ${already}、失敗 ${failed}(共 ${total})。`,
970
+ impFailedRun: "匯入意外中止。", impBadFile: "讀不了這個檔案。",
895
971
  accessStatus: (pw, key, url) => `密碼:${pw === "✓" ? "已設定" : "未設定"} · 分享碼:${key === "✓" ? "已產生" : "沒有"} · 公開網址:${url === "—" ? "關閉" : url}`,
896
972
  access: "存取與連線",
897
973
  password: "管理密碼", passwordHelp: "設定之後,新增連結、改設定、agent 寫入都需要它。至少 8 個字元,不能有空白。",
@@ -931,27 +1007,51 @@
931
1007
  DRIFTNET_LLM_API_KEY: ["API 金鑰", ""],
932
1008
  DRIFTNET_LLM_EFFORT: ["推理強度", ""],
933
1009
  TYPESAFE_API_KEY: ["Jev 金鑰", "選填:約 100ms 的分類器,可以省下模型呼叫(console.typesafe.ai)"],
934
- DRIFTNET_JUDGE: ["Jev", ""],
1010
+ DRIFTNET_JUDGE: ["判斷器", "在模型之前先決定每個連結放哪。「規則」免費,不需要模型。"],
1011
+ DRIFTNET_LLM_REGION: ["區域", "Bedrock:例如 us-east-1。Vertex:例如 us-central1(預設)。其他供應商用不到。"],
1012
+ AWS_ACCESS_KEY_ID: ["AWS 存取金鑰 ID", "Bedrock 用。有 Bedrock API 金鑰就留空。"],
1013
+ AWS_SECRET_ACCESS_KEY: ["AWS 秘密存取金鑰", "Bedrock 用。"],
1014
+ AWS_SESSION_TOKEN: ["AWS 工作階段權杖", "Bedrock 用,只有臨時憑證才需要。"],
1015
+ AWS_BEARER_TOKEN_BEDROCK: ["Bedrock API 金鑰", "Bedrock 用:填這個就不用上面的 AWS 金鑰。"],
1016
+ GOOGLE_CLOUD_PROJECT: ["Google Cloud 專案", "Vertex 用。憑證檔裡有寫專案就可以不填。"],
1017
+ DRIFTNET_VERTEX_CREDENTIALS: ["Vertex 憑證檔", "Vertex 用:這台電腦上服務帳戶 JSON 檔的路徑(或在「API 金鑰」填存取權杖)。"],
1018
+ DRIFTNET_JUDGE_RULES: ["規則檔", "給「規則」判斷器:檔案路徑。一行一條,例如 github.com/* -> coding"],
935
1019
  GITHUB_TOKEN: ["GitHub token", "選填:GitHub 查詢上限從每小時 60 次變 5000 次"],
936
1020
  DRIFTNET_LANGUAGE: ["摘要語言", "English、Traditional Chinese (Taiwan)、Japanese…"],
937
1021
  DRIFTNET_LOCALE: ["機器人語言", ""],
938
1022
  DRIFTNET_REPLY: ["機器人怎麼回覆", ""],
1023
+ DRIFTNET_REPLY_STYLE: ["回覆樣式", "豐富:各平台的 embed、區塊、卡片與投票按鈕;純文字:一般訊息。"],
939
1024
  DRIFTNET_PUBLIC_URL: ["這個網頁的公開網址", "回覆裡的連結會指到這裡,例如 https://driftnet.example.com"],
940
1025
  DRIFTNET_SUMMARY_DEPTH: ["摘要詳細程度", "每張卡片寫多少。詳細會用較多模型 token,且每個頁面讀兩倍的內容。"],
941
1026
  DRIFTNET_SUMMARY_RULES: ["摘要的額外規則", "例如:說明是否免費。需要 GPU 的話要提到。"],
942
1027
  DRIFTNET_BLOCK_DOMAINS: ["不要收錄的網域", "用逗號或空白分隔,例如 example.com, spam.io"],
943
1028
  DRIFTNET_WEBHOOK_URL: ["Webhook 網址", "每張新增或更新的卡片都會 POST 到這裡(n8n、Zapier、Slack 工作流程…)。視為機密。"],
944
1029
  DRIFTNET_WEBHOOK_SECRET: ["Webhook 簽章密鑰", "選填。會加上 X-Driftnet-Signature: sha256=<內容的 HMAC>。"],
1030
+ DRIFTNET_DIGEST: ["定時摘要", "把新卡片整理成一則短訊息,貼進你的聊天室。"],
1031
+ DRIFTNET_DIGEST_AT: ["摘要時間", "伺服器所在時區的 HH:MM,例如 09:00(預設)。"],
1032
+ DRIFTNET_DIGEST_DAY: ["摘要星期(每週)", ""],
1033
+ DRIFTNET_DIGEST_TO: ["摘要送到哪裡", "以逗號分隔:telegram:<聊天室 id>、discord:<頻道 id>、slack:<頻道 id>、line:<使用者、群組或聊天室 id>。使用已設定的機器人金鑰。"],
1034
+ DRIFTNET_HEALTH: ["連結健康檢查", "每週:每次幾張,檢查連結是否還能開、儲存庫是否已封存,並標記失效、封存、久未更新的卡片。"],
1035
+ DRIFTNET_VIDEO: ["讀影片(reels、shorts)", "Instagram、Facebook、Threads、TikTok、YouTube Shorts、X 的影片,若頁面文字幾乎沒內容,就用本機工具(yt-dlp、ffmpeg、tesseract、whisper,有裝才用)讀字幕、畫面文字和語音。一次只處理一支影片。"],
1036
+ DRIFTNET_YTDLP: ["yt-dlp 路徑", "只有 yt-dlp 不在 PATH 時才需要。"],
1037
+ DRIFTNET_FFMPEG: ["ffmpeg 路徑", "只有 ffmpeg 不在 PATH 時才需要。"],
1038
+ DRIFTNET_TESSERACT: ["tesseract 路徑", "只有 tesseract(讀畫面文字)不在 PATH 時才需要。"],
1039
+ DRIFTNET_WHISPER: ["whisper 路徑", "只有 whisper 或 whisper-cli(語音轉文字)不在 PATH 時才需要。"],
945
1040
  DRIFTNET_WEBHOOK_ALLOW_LOCAL: ["允許本機 Webhook", "接收端在你自己的區域網路時需要(例如內網的 n8n)。只放行你填的那個位址。"],
946
1041
  },
947
1042
  choices: {
948
- DRIFTNET_LLM_PROVIDER: { "": "不使用", anthropic: "Anthropic(API 金鑰)", openai: "OpenAI 相容(OpenAI、Gemini、Grok、Ollama…)", "claude-cli": "Claude 訂閱(Claude Code CLI)", "gemini-cli": "Google 帳號(Gemini CLI)" },
1043
+ DRIFTNET_LLM_PROVIDER: { "": "不使用", anthropic: "Anthropic(API 金鑰)", openai: "OpenAI 相容(OpenAI、Grok、Ollama…)", gemini: "Google Gemini(API 金鑰)", bedrock: "Amazon Bedrock", vertex: "Google Vertex AI", "claude-cli": "Claude 訂閱(Claude Code CLI)", "gemini-cli": "Google 帳號(Gemini CLI)" },
949
1044
  DRIFTNET_LLM_EFFORT: { "": "預設", low: "低", medium: "中", high: "高", xhigh: "極高" },
950
- DRIFTNET_JUDGE: { "": "有金鑰就開", off: "關閉" },
1045
+ DRIFTNET_JUDGE: { "": "有 Jev 金鑰就用 Jev", jev: "Jev", rules: "規則(免費,不用模型)", llm: "交給模型", heuristic: "交給模型", off: "不用判斷器" },
951
1046
  DRIFTNET_SUMMARY_DEPTH: { "": "標準(預設)", brief: "簡短:一句話、2 個重點、看得到什麼", standard: "標準", detailed: "詳細:更多重點、使用情境、怎麼試用" },
952
1047
  DRIFTNET_LOCALE: { "": "跟摘要一樣", en: "English", "zh-TW": "繁體中文" },
1048
+ DRIFTNET_REPLY_STYLE: { "": "豐富(預設)", rich: "豐富:卡片與投票按鈕", text: "純文字" },
953
1049
  DRIFTNET_REPLY: { "": "一行+連結(預設)", link: "一行+連結", full: "完整摘要", off: "不回覆" },
1050
+ DRIFTNET_DIGEST: { "": "關閉(預設)", off: "關閉", daily: "每天", weekly: "每週" },
1051
+ DRIFTNET_DIGEST_DAY: { "": "週一(預設)", mon: "週一", tue: "週二", wed: "週三", thu: "週四", fri: "週五", sat: "週六", sun: "週日" },
954
1052
  DRIFTNET_WEBHOOK_ALLOW_LOCAL: { "": "否(只允許公開位址)", 1: "是" },
1053
+ DRIFTNET_HEALTH: { "": "關閉(預設)", off: "關閉", weekly: "每週(建議)" },
1054
+ DRIFTNET_VIDEO: { "": "自動(預設)", auto: "自動:有找到工具就用", off: "關閉" },
955
1055
  },
956
1056
  },
957
1057
  },
@@ -965,6 +1065,14 @@
965
1065
  return (paneLock = paneLock.catch(() => {}).then(go));
966
1066
  }
967
1067
  const esc = (s) => String(s ?? "").replace(/[&<>"']/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[c]);
1068
+ // Warnings (injection, hidden characters, low reputation) keep ⚠; "read from video" is good news, not a warning.
1069
+ function flagLines(i, t) {
1070
+ const flags = i.flags ?? [];
1071
+ const warn = flags.filter((f) => !f.startsWith("video-"));
1072
+ const steps = flags.filter((f) => f.startsWith("video-") && f !== "video-read");
1073
+ return (warn.length ? `<div class="flag">⚠ ${esc(warn.map((f) => t.flags[f] ?? f).join(", "))}</div>` : "")
1074
+ + (flags.includes("video-read") ? `<div class="vflag">🎬 ${esc(t.flags["video-read"])}${steps.length ? ` · ${esc(steps.map((f) => t.flags[f] ?? f).join(", "))}` : ""}</div>` : "");
1075
+ }
968
1076
  const safeUrl = (u) => (/^https?:\/\//.test(u) ? u : "#");
969
1077
  const store = { get: (k) => { try { return localStorage.getItem(k); } catch { return null; } },
970
1078
  set: (k, v) => { try { localStorage.setItem(k, v); } catch {} } };
@@ -1018,7 +1126,7 @@
1018
1126
  history.replaceState(null, "", u.pathname + u.search + u.hash);
1019
1127
  })();
1020
1128
 
1021
- async function api(path, init = {}) {
1129
+ async function api(path, init = {}, meta = null) {
1022
1130
  // Reads work with the admin password or the share key; writes go through other helpers with the password.
1023
1131
  const token = store.get("driftnet-token") || store.get("driftnet-key");
1024
1132
  let res = await fetch(path, { ...init, headers: { ...(init.headers ?? {}), ...(token ? { authorization: `Bearer ${token}` } : {}) } });
@@ -1029,6 +1137,7 @@
1029
1137
  }
1030
1138
  if (res.status === 401) throw Object.assign(new Error("unauthorized"), { unauthorized: true });
1031
1139
  if (!res.ok) throw new Error(`HTTP ${res.status}`);
1140
+ if (meta) meta.total = Number(res.headers.get("x-total-count"));
1032
1141
  return res.json();
1033
1142
  }
1034
1143
 
@@ -1092,7 +1201,7 @@
1092
1201
  /** One line under the header saying what is shown, so a closed drawer hides nothing. */
1093
1202
  function updateCrumb() {
1094
1203
  const t = T();
1095
- const parts = [state.view === "favorites" ? t.favorites : state.view === "trash" ? t.trash : state.view === "inbox" ? t.inbox
1204
+ const parts = [state.view === "favorites" ? t.favorites : state.view === "trash" ? t.trash : state.view === "inbox" ? t.inbox : state.view === "review" ? t.review
1096
1205
  : state.view === "notes" ? t.notes : state.view === "map" ? t.map : t.all];
1097
1206
  if (state.category) parts.push(catLabel(state.category));
1098
1207
  if (state.kind) parts.push(t.kinds[state.kind] ?? state.kind);
@@ -1131,6 +1240,7 @@
1131
1240
  `<button type="button" class="menu" id="menu-close" aria-label="${esc(T().close)}">✕</button></div>` +
1132
1241
  `<div class="row">` +
1133
1242
  (role === "admin" || stats.inbox ? btn("view", "inbox", T().inbox, stats.inbox || "", "inbox") : "") +
1243
+ (stats.review || state.view === "review" ? btn("view", "review", T().review, stats.review || "", "refresh") : "") +
1134
1244
  btn("view", "all", T().all, stats.items, "all") + btn("view", "favorites", T().favorites, stats.favorites, "star") +
1135
1245
  btn("view", "map", T().map, "", "map") +
1136
1246
  `<button type="button" class="split-btn" data-split aria-pressed="${split}" title="${esc(T().splitHelp)}"><span class="lbl">${ic("split")}<span>${esc(T().split)}</span></span><span class="count"></span></button>` +
@@ -1232,6 +1342,9 @@
1232
1342
  const fb = $("fd-focus");
1233
1343
  fb.hidden = !id || state.view !== "map" || id === mapFocus;
1234
1344
  fb.textContent = t.focusFolder;
1345
+ const pb = $("fd-pack");
1346
+ pb.hidden = !id;
1347
+ pb.textContent = t.pkShare;
1235
1348
  $("fd-cancel").textContent = t.cancel;
1236
1349
  $("fd-save").textContent = t.save;
1237
1350
  $("fd-error").textContent = "";
@@ -1278,6 +1391,67 @@
1278
1391
  }
1279
1392
  }
1280
1393
 
1394
+ // ── Share a folder as a pack: name it, download it, or copy a link ─────────
1395
+ let packFolder = null, packLink = null;
1396
+ /** The link with the name and description the reader typed (the signature covers only the folder). */
1397
+ function packUrl() {
1398
+ if (!packLink?.url) return "";
1399
+ const u = new URL(packLink.url);
1400
+ if ($("pk-name").value.trim()) u.searchParams.set("name", $("pk-name").value.trim());
1401
+ if ($("pk-desc").value.trim()) u.searchParams.set("description", $("pk-desc").value.trim());
1402
+ return u.href;
1403
+ }
1404
+ $("fd-pack").onclick = async () => {
1405
+ const t = T(), id = editing, f = id ? folderById(id) : null;
1406
+ if (!f) return;
1407
+ $("folder-dlg").close();
1408
+ packFolder = id; packLink = null;
1409
+ $("pk-title").textContent = `${t.pkTitle}: ${catLabel(id)}`;
1410
+ $("pk-help").textContent = t.pkHelp;
1411
+ $("pk-name-l").textContent = t.pkName; $("pk-desc-l").textContent = t.pkDesc; $("pk-link-l").textContent = t.pkLinkL;
1412
+ $("pk-name").value = catLabel(id); $("pk-desc").value = f.description ?? "";
1413
+ $("pk-download").textContent = t.pkDownload; $("pk-close").textContent = t.pkClose; $("pk-copy").textContent = t.pkCopy;
1414
+ $("pk-error").textContent = "";
1415
+ $("pk-link-box").hidden = true; $("pk-copy").hidden = true; $("pk-nolink").hidden = true;
1416
+ $("pack-dlg").showModal();
1417
+ try {
1418
+ packLink = await api(`/api/folders/${encodeURIComponent(id)}/pack-link`);
1419
+ } catch { packLink = null; }
1420
+ if (packFolder !== id || !$("pack-dlg").open) return;
1421
+ if (packLink?.url) {
1422
+ $("pk-link-box").hidden = false; $("pk-copy").hidden = false;
1423
+ $("pk-link-note").textContent = packLink.signed ? t.pkSigned : t.pkOpen;
1424
+ $("pk-link").value = packUrl();
1425
+ } else {
1426
+ $("pk-nolink").hidden = false; $("pk-nolink").textContent = t.pkNoLink;
1427
+ }
1428
+ };
1429
+ for (const id of ["pk-name", "pk-desc"]) $(id).addEventListener("input", () => { if (packLink?.url) $("pk-link").value = packUrl(); });
1430
+ $("pk-link").onfocus = () => $("pk-link").select();
1431
+ $("pk-copy").onclick = async () => {
1432
+ await navigator.clipboard?.writeText($("pk-link").value).catch(() => {});
1433
+ toast(T().pkCopied);
1434
+ };
1435
+ $("pk-close").onclick = () => $("pack-dlg").close();
1436
+ $("pk-download").onclick = async () => {
1437
+ const q = new URLSearchParams();
1438
+ if ($("pk-name").value.trim()) q.set("name", $("pk-name").value.trim());
1439
+ if ($("pk-desc").value.trim()) q.set("description", $("pk-desc").value.trim());
1440
+ const token = store.get("driftnet-token") || store.get("driftnet-key");
1441
+ try {
1442
+ const res = await fetch(`/api/folders/${encodeURIComponent(packFolder)}/pack?${q}`, { headers: token ? { authorization: `Bearer ${token}` } : {} });
1443
+ if (res.status === 401) { $("pk-error").textContent = T().needPassword; return; }
1444
+ if (!res.ok) { $("pk-error").textContent = res.status === 413 ? T().pkTooBig : T().failed; return; }
1445
+ const blob = await res.blob();
1446
+ const m = /filename="([^"]+)"/.exec(res.headers.get("content-disposition") ?? "");
1447
+ const a = document.createElement("a");
1448
+ a.href = URL.createObjectURL(blob);
1449
+ a.download = m?.[1] ?? "folder.driftnet-pack.json";
1450
+ document.body.append(a); a.click(); a.remove();
1451
+ setTimeout(() => URL.revokeObjectURL(a.href), 5000);
1452
+ } catch { $("pk-error").textContent = T().failed; }
1453
+ };
1454
+
1281
1455
  // ── Move a card: picker (phones) or drag onto the sidebar (desktop) ───────
1282
1456
  let moving = null, movingMany = null;
1283
1457
  /** The nine folders cards were filed into most often (the server counts moves and undoes), in tree order on a tie: keys 1–9 file a card there. */
@@ -1403,6 +1577,7 @@
1403
1577
  if (el && !visible) {
1404
1578
  if (el.contains(document.activeElement)) (el.nextElementSibling ?? el.previousElementSibling)?.querySelector?.(".card")?.focus();
1405
1579
  dismiss(el);
1580
+ forgetItem(id);
1406
1581
  }
1407
1582
  else if (el) { el.outerHTML = card(item); attachSwipe(document.getElementById(`item-${id}`)); }
1408
1583
  refreshTree();
@@ -1411,7 +1586,7 @@
1411
1586
  if (onMap && onMap !== item) onMap.category = to;
1412
1587
  if (mapShown()) drawMap();
1413
1588
  bumpUse(to);
1414
- if (!quiet) { toast(T().moved(nameOf(item), folderPath(to)), async () => { await moveItem(id, from, true); render(); }); }
1589
+ if (!quiet) { toast(T().moved(nameOf(item), folderPath(to)), async () => { await moveItem(id, from, true); renderKeep(); }); }
1415
1590
  }
1416
1591
  const subtreeOf = (id) => { const out = new Set([id]); for (const q = [id]; q.length;) for (const k of kids(q.pop())) { out.add(k.id); q.push(k.id); } return out; };
1417
1592
  /** Re-draw just the tree's counts after a move. */
@@ -1518,7 +1693,7 @@
1518
1693
  const yes = (b) => (b ? "✓" : "—");
1519
1694
  const accessStatus = `<p class="set-status">${esc(st.accessStatus(yes(a.passwordSet), yes(a.readKey), a.tunnel.running ? a.tunnel.url : "—"))}</p>`;
1520
1695
  server = {
1521
- general: group("language") + group("chat") + group("webhook"),
1696
+ general: group("language") + group("chat") + group("digest") + group("webhook") + importPanel(),
1522
1697
  access: accessStatus + accessPanel(serverSettings, field) + (agentTokens ? tokensPanel(serverSettings.access, agentTokens, minted) + pairPanel(serverSettings.access) : ""),
1523
1698
  ai: `<p class="set-status" id="st-status">${esc(st.status(serverSettings.engines))}</p>` + group("model") + group("rules") +
1524
1699
  `<fieldset class="set-group"><legend>${esc(st.plugins)}</legend><div class="set-row">${plugins}</div></fieldset>`,
@@ -1542,6 +1717,94 @@
1542
1717
  $("settings-dlg").showModal();
1543
1718
  $("st-body").querySelector('[data-tab-btn][aria-selected="true"]')?.focus();
1544
1719
  }
1720
+ /** Settings › Import bookmarks: pick a file, preview the counts (dry run), confirm, then watch the job. */
1721
+ let importContent = "", importUrl = "", importPack = null, importTimer = null;
1722
+ function importPanel() {
1723
+ const st = T().st;
1724
+ importContent = ""; importUrl = ""; importPack = null; clearInterval(importTimer);
1725
+ return `<fieldset class="set-group" id="import-panel"><legend>${esc(st.impTitle)}</legend>
1726
+ <small>${esc(st.impHelp)}</small>
1727
+ <label class="set-row"><span>${esc(st.impFile)}</span><input type="file" id="im-file" accept=".html,.htm,.csv,.json,.txt,.md"></label>
1728
+ <label class="set-row check"><input type="checkbox" id="im-keep"><span>${esc(st.impKeep)}</span></label>
1729
+ <small>${esc(st.impPackHelp)}</small>
1730
+ <label class="set-row"><span>${esc(st.impPackTitle)}</span><input type="url" id="im-url" placeholder="https://…/api/folders/…/pack" autocomplete="off"></label>
1731
+ <div><button class="btn" type="button" id="im-url-go">${esc(st.impPackGo)}</button></div>
1732
+ <p class="set-status" id="im-status" role="status" aria-live="polite"></p>
1733
+ <div><button class="btn primary" type="button" id="im-start" hidden>${esc(st.impStart)}</button></div></fieldset>`;
1734
+ }
1735
+ async function importCall(body) {
1736
+ const token = store.get("driftnet-token");
1737
+ const res = await fetch("/api/import", { method: "POST", body: JSON.stringify(body),
1738
+ headers: { "content-type": "application/json", ...(token ? { authorization: `Bearer ${token}` } : {}) } }).catch(() => null);
1739
+ if (res?.status === 401) { askToken(); return null; }
1740
+ return res ? { status: res.status, body: await res.json().catch(() => ({})) } : null;
1741
+ }
1742
+ $("st-body").addEventListener("change", async (e) => {
1743
+ if (e.target.id !== "im-file") return;
1744
+ const st = T().st, out = $("im-status"), go = $("im-start");
1745
+ go.hidden = true; importContent = ""; importUrl = ""; importPack = null; clearInterval(importTimer);
1746
+ const file = e.target.files?.[0];
1747
+ if (!file) { out.textContent = ""; return; }
1748
+ out.textContent = st.impReading;
1749
+ const content = await new Promise((ok) => {
1750
+ const r = new FileReader();
1751
+ r.onload = () => ok(String(r.result));
1752
+ r.onerror = () => ok(null);
1753
+ r.readAsText(file);
1754
+ });
1755
+ if (content === null) { out.textContent = st.impBadFile; return; }
1756
+ const r = await importCall({ content, dryRun: true });
1757
+ if (!r || r.status !== 200) { out.textContent = r?.body?.error ?? T().failed; return; }
1758
+ const d = r.body;
1759
+ importContent = content;
1760
+ out.textContent = [d.total ? st.impConfirm(d.total, d.duplicates) : st.impNone(d.duplicates, d.skipped),
1761
+ d.total && d.skipped ? st.impSkipped(d.skipped) : "", d.capped ? st.impCapped(5000) : ""].filter(Boolean).join(" ");
1762
+ go.hidden = !d.total;
1763
+ });
1764
+ $("st-body").addEventListener("click", async (e) => {
1765
+ if (e.target.id !== "im-url-go") return;
1766
+ const st = T().st, out = $("im-status"), go = $("im-start");
1767
+ go.hidden = true; importContent = ""; importUrl = ""; importPack = null; clearInterval(importTimer);
1768
+ const url = $("im-url").value.trim();
1769
+ if (!url) return;
1770
+ out.textContent = st.impReading;
1771
+ const r = await importCall({ url, dryRun: true });
1772
+ if (!r || r.status !== 200) { out.textContent = r?.body?.error ?? T().failed; return; }
1773
+ const d = r.body;
1774
+ importUrl = url; importPack = d.pack ?? null;
1775
+ out.textContent = d.total ? st.impPackConfirm(d.pack?.name ?? "", d.total, d.duplicates) : st.impPackNone(d.pack?.name ?? "", d.duplicates);
1776
+ if (d.skipped) out.textContent += " " + st.impSkipped(d.skipped);
1777
+ go.hidden = false;
1778
+ });
1779
+ $("st-body").addEventListener("click", async (e) => {
1780
+ if (e.target.id !== "im-start") return;
1781
+ const st = T().st, out = $("im-status"), go = $("im-start");
1782
+ go.hidden = true;
1783
+ const fromPack = !!importUrl;
1784
+ const r = await importCall(fromPack ? { url: importUrl } : { content: importContent, folders: $("im-keep").checked ? "keep" : "none" });
1785
+ const pack = importPack;
1786
+ importContent = ""; importUrl = ""; importPack = null;
1787
+ if (!r) { out.textContent = T().failed; return; }
1788
+ if (r.status === 409) { out.textContent = st.impBusy; return; }
1789
+ if (r.status !== 202) { out.textContent = r.body?.error ?? T().failed; return; }
1790
+ const job = r.body.job;
1791
+ out.textContent = st.impProgress(0, r.body.total, 0, 0);
1792
+ const token = store.get("driftnet-token");
1793
+ const tick = async () => {
1794
+ if (!out.isConnected) return clearInterval(importTimer);
1795
+ const p = await fetch(`/api/import/${job}`, { headers: token ? { authorization: `Bearer ${token}` } : {} }).then((x) => x.ok ? x.json() : null).catch(() => null);
1796
+ if (!p) return;
1797
+ if (p.state === "running") out.textContent = st.impProgress(p.done, p.total, p.added, p.failed);
1798
+ else {
1799
+ clearInterval(importTimer);
1800
+ out.textContent = p.state !== "done" ? st.impFailedRun : pack ? st.impPackDone(pack.name, p.added, p.already) : st.impDone(p.total, p.added, p.already, p.failed);
1801
+ if (p.state === "done" && p.added) load();
1802
+ }
1803
+ };
1804
+ importTimer = setInterval(tick, 2000);
1805
+ // A pack is done by the time the server answers: don't make the reader wait for the first tick.
1806
+ if (fromPack) tick();
1807
+ });
1545
1808
  let settingsOpener = null;
1546
1809
  $("settings-dlg").addEventListener("close", () => { if (settingsOpener?.isConnected) settingsOpener.focus(); });
1547
1810
  $("st-cancel").onclick = () => $("settings-dlg").close();
@@ -1840,10 +2103,13 @@
1840
2103
  /** Cards shown per folder before the rest fold into a "+N" node. */
1841
2104
  const MAP_CAP = 15;
1842
2105
 
2106
+ let mapTotal = 0;
1843
2107
  async function renderMap() {
1844
2108
  const t = T();
1845
2109
  try {
1846
- mapItems = await api("/api/items?limit=500&minWorth=skip");
2110
+ const meta = {};
2111
+ mapItems = await api("/api/items?limit=500&minWorth=skip", {}, meta);
2112
+ mapTotal = meta.total;
1847
2113
  } catch (err) {
1848
2114
  if (err.unauthorized) return askToken();
1849
2115
  throw err;
@@ -2354,6 +2620,7 @@
2354
2620
  <h3 id="md-title"><a href="${esc(url)}" target="_blank" rel="noopener noreferrer">${esc(name)}</a></h3>
2355
2621
  <p class="md-sub"><span class="badge folder" style="--c:${folderColor(i.category)}">${esc(folderPath(i.category))}</span>
2356
2622
  <span class="rating ${i.worth === "must-see" ? "must" : ""}">${i.worth === "must-see" ? ic("star") : ""}${esc(t.worth[i.worth] ?? i.worth)}</span>
2623
+ ${healthBadge(i)}${starsHtml(i)}
2357
2624
  <span>#${i.id} · ${esc(t.kind1?.[i.kind] ?? t.kinds[i.kind] ?? i.kind)}</span></p>
2358
2625
  ${s?.oneLiner ? `<p class="md-one">${esc(s.oneLiner)}</p>` : ""}
2359
2626
  ${sec("demo", t.mdDemo, s?.demo ? `<p>${esc(s.demo)}</p>` : "")}
@@ -2363,7 +2630,7 @@
2363
2630
  ${sec("try", t.mdTry, s?.tryIt ? `<div class="md-try"><pre><code>${esc(s.tryIt)}</code></pre><button class="btn" type="button" data-md="copy">${esc(t.mdCopy)}</button></div>` : "")}
2364
2631
  ${sec("tags", t.mdTags, s?.tags?.length ? `<div class="md-tags tags">${s.tags.map((x) => `<span class="tag">#${esc(x)}</span>`).join(" ")}</div>` : "")}
2365
2632
  ${i.found?.length ? `<div class="found"><span>${esc(t.foundIn)}</span>${i.found.map((c) => `<a href="#item-${c.id}" data-open="${c.id}">${esc(c.name)}</a>`).join("")}</div>` : ""}
2366
- ${i.flags?.length ? `<div class="flag">⚠ ${esc(i.flags.map((f) => t.flags[f] ?? f).join(", "))}</div>` : ""}
2633
+ ${flagLines(i, t)}
2367
2634
  <div class="md-fine">${i.shareCount ? `<span>${esc(t.shared(i.shareCount))}</span>` : ""}<span>${esc(i.createdAt.slice(0, 10))}</span>${i.enrichedBy ? `<span>${esc(t.enrichedBy(i.enrichedBy.replace(/^agent:/, "")))}</span>` : ""}</div>`;
2368
2635
  const busy = refreshing.has(i.id);
2369
2636
  const btn = (act, icon, label, extra = "") => `<button class="btn ${extra}" type="button" data-md="${act}">${ic(icon)} ${esc(label)}</button>`;
@@ -2371,7 +2638,7 @@
2371
2638
  (admin ? (inTrash ? btn("restore", "undo", t.restore)
2372
2639
  : btn("favorite", "star", i.favorite ? t.unfavorite : t.favorite, i.favorite ? "on" : "") + btn("move", "move", t.moveTo) +
2373
2640
  `<button class="btn ${busy ? "spin" : ""}" type="button" data-md="refresh" ${busy ? "disabled" : ""}>${ic("refresh")} ${esc(t.refresh)}</button>` +
2374
- btn("note", "note", i.note ? t.editNote : t.addNote) + `<span class="spacer"></span>` + btn("trash", "trash", t.remove, "danger")) : "") +
2641
+ btn("health", "refresh", t.checkLink) + btn("note", "note", i.note ? t.editNote : t.addNote) + `<span class="spacer"></span>` + btn("trash", "trash", t.remove, "danger")) : "") +
2375
2642
  (modalFrom === "map" ? btn("list", "list", t.showInList) : "");
2376
2643
  }
2377
2644
  function openModal(id, from = "list") {
@@ -2429,6 +2696,7 @@
2429
2696
  }
2430
2697
  if (act1 === "move") { mdlDlg.close(); return openMovePicker(id); }
2431
2698
  if (act1 === "refresh") return refreshItem(id);
2699
+ if (act1 === "health") return checkLink(id);
2432
2700
  if (act1 === "note") return openItemNote(id);
2433
2701
  if (act1 === "favorite") {
2434
2702
  if (el) await run(el, "favorite");
@@ -2903,20 +3171,103 @@
2903
3171
  folders = await api("/api/folders").catch(() => folders);
2904
3172
  await load();
2905
3173
  }
2906
- async function renderCards() {
2907
- const p = new URLSearchParams({ limit: "300" });
3174
+ /** Cards fetched per page; the rest come as the reader reaches the end of the list. */
3175
+ const PAGE = 60;
3176
+ let pageTotal = 0, pageGen = 0, pageBusy = false, pageObserver = null, pageHost = null, keepPages = false;
3177
+ const listParams = () => {
3178
+ const p = new URLSearchParams();
2908
3179
  if (prefs.sort !== "best") p.set("sort", prefs.sort);
2909
- if (state.view !== "all") p.set("view", state.view);
3180
+ if (state.view === "review") p.set("health", "dead,archived,stale");
3181
+ else if (state.view !== "all") p.set("view", state.view);
2910
3182
  for (const k of ["category", "kind", "q"]) if (state[k]) p.set(k, state[k]);
2911
- items = await api(`/api/items?${p}`);
3183
+ return p;
3184
+ };
3185
+ const moreHtml = () => items.length < pageTotal
3186
+ ? `<div class="page-more" id="page-more"><button type="button" class="btn" data-page-more>${esc(T().pageMore(pageTotal - items.length))}</button></div>` : "";
3187
+ /** Redo the list after a change, keeping the pages already loaded (and the scroll position). */
3188
+ function renderKeep() { keepPages = true; return render(); }
3189
+ /** A card left the list for good: later pages must not skip or repeat one. */
3190
+ function forgetItem(id) {
3191
+ const i = items.findIndex((x) => x.id === id);
3192
+ if (i < 0) return;
3193
+ extraItems.set(id, items[i]);
3194
+ items.splice(i, 1);
3195
+ pageTotal = Math.max(0, pageTotal - 1);
3196
+ syncMore();
3197
+ }
3198
+ function syncMore() {
3199
+ const host = pageHost, old = host?.querySelector("#page-more");
3200
+ if (!host) return;
3201
+ if (items.length >= pageTotal) { pageObserver?.disconnect(); old?.remove(); return; }
3202
+ if (old) { old.querySelector("[data-page-more]").textContent = T().pageMore(pageTotal - items.length); return; }
3203
+ host.insertAdjacentHTML("beforeend", moreHtml());
3204
+ watchMore();
3205
+ }
3206
+ function watchMore() {
3207
+ pageObserver?.disconnect();
3208
+ const el = pageHost?.querySelector("#page-more");
3209
+ if (!el) return;
3210
+ el.querySelector("[data-page-more]").onclick = () => loadMore();
3211
+ if ("IntersectionObserver" in window) {
3212
+ pageObserver = new IntersectionObserver((es) => { if (es.some((e) => e.isIntersecting)) loadMore(); }, { rootMargin: "600px 0px" });
3213
+ pageObserver.observe(el);
3214
+ }
3215
+ }
3216
+ async function loadMore() {
3217
+ if (pageBusy || !pageHost || items.length >= pageTotal) return;
3218
+ const gen = pageGen, host = pageHost;
3219
+ pageBusy = true;
3220
+ try {
3221
+ const p = listParams();
3222
+ p.set("limit", String(PAGE)); p.set("offset", String(items.length));
3223
+ const meta = {};
3224
+ const more = await api(`/api/items?${p}`, {}, meta);
3225
+ if (gen !== pageGen) return;
3226
+ if (Number.isFinite(meta.total)) pageTotal = meta.total;
3227
+ const seen = new Set(items.map((i) => i.id));
3228
+ const fresh = more.filter((i) => !seen.has(i.id));
3229
+ items.push(...fresh);
3230
+ if (!more.length) pageTotal = items.length;
3231
+ host.querySelector("#page-more")?.remove();
3232
+ host.insertAdjacentHTML("beforeend", fresh.map(card).join(""));
3233
+ for (const i of fresh) attachSwipe(document.getElementById(`item-${i.id}`));
3234
+ host.insertAdjacentHTML("beforeend", moreHtml());
3235
+ watchMore();
3236
+ syncSelection();
3237
+ } catch (err) {
3238
+ if (err.unauthorized) askToken(); else toast(T().failed);
3239
+ } finally {
3240
+ pageBusy = false;
3241
+ }
3242
+ }
3243
+ async function renderCards() {
3244
+ const gen = ++pageGen;
3245
+ const keep = keepPages && items.length > PAGE; keepPages = false;
3246
+ const y = keep ? scrollY : 0;
3247
+ const p = listParams();
3248
+ p.set("limit", String(keep ? Math.min(500, items.length) : PAGE));
3249
+ const meta = {};
3250
+ // Split view with the map's own unfiltered fetch in hand: the first page is already there.
3251
+ const shared = !keep && splitOn() && state.view === "all" && !state.q && !state.category && !state.kind && prefs.sort === "best" && mapItems.length && Number.isFinite(mapTotal);
3252
+ let got;
3253
+ if (shared) { got = mapItems.slice(0, PAGE).map((i) => ({ ...i })); meta.total = mapTotal; }
3254
+ else got = await api(`/api/items?${p}`, {}, meta);
3255
+ if (gen !== pageGen) return;
3256
+ items = got;
3257
+ pageTotal = Number.isFinite(meta.total) ? meta.total : items.length;
3258
+ pageHost = $("list");
3259
+ pageBusy = false;
3260
+ pageObserver?.disconnect();
2912
3261
  const t = T();
2913
- const empty = state.view === "trash" ? t.emptyTrash : state.view === "favorites" ? t.emptyFav : state.view === "inbox" ? t.emptyInbox : t.empty;
3262
+ const empty = state.view === "trash" ? t.emptyTrash : state.view === "favorites" ? t.emptyFav : state.view === "inbox" ? t.emptyInbox : state.view === "review" ? t.emptyReview : t.empty;
2914
3263
  $("list").innerHTML = items.length
2915
- ? `<p class="hint swipe-hint">${esc(state.view === "trash" ? t.hintTrash : state.view === "inbox" ? t.hintInbox : t.hint)}</p>` + items.map(card).join("")
3264
+ ? `<p class="hint swipe-hint">${esc(state.view === "trash" ? t.hintTrash : state.view === "inbox" ? t.hintInbox : state.view === "review" ? t.hintReview : t.hint)}</p>` + items.map(card).join("") + moreHtml()
2916
3265
  : `<div class="empty first"><span>${esc(empty)}</span>${state.view === "all" && !state.q && !state.category && role === "admin"
2917
3266
  ? `<form class="add" id="add-form"><input id="add-url" type="url" inputmode="url" placeholder="${esc(t.addPlaceholder)}" aria-label="${esc(t.addPlaceholder)}">
2918
3267
  <button class="btn primary" type="submit">${ic("plus")} ${esc(t.addLink)}</button></form>
2919
3268
  <button class="btn" type="button" data-connect-empty>${ic("plug")} ${esc(t.st.connect)}</button>${templateChooser(t)}` : ""}</div>`;
3269
+ watchMore();
3270
+ if (keep) scrollTo({ top: y });
2920
3271
  $("add-form")?.addEventListener("submit", addLink);
2921
3272
  for (const b of $("list").querySelectorAll("[data-template]")) b.addEventListener("click", () => pickTemplate(b.dataset.template));
2922
3273
  $("list").querySelector("[data-connect-empty]")?.addEventListener("click", () => openConnect());
@@ -2937,6 +3288,17 @@
2937
3288
  if (mdlDlg.open) paintModal();
2938
3289
  }
2939
3290
 
3291
+ /** ☠ dead / 🗄 archived / 💤 stale / ↪ moved: what the last link check found (nothing for ok or unchecked). */
3292
+ function healthBadge(i) {
3293
+ const h = T().health[i.health];
3294
+ return h ? `<span class="badge health ${esc(i.health)}" title="${esc(h[2])}" role="img" aria-label="${esc(h[2])}">${h[0]} ${esc(h[1])}</span>` : "";
3295
+ }
3296
+ /** ★ 1.2k for repos whose star count is known. */
3297
+ function starsHtml(i) {
3298
+ if (typeof i.stars !== "number") return "";
3299
+ const n = i.stars >= 1000 ? `${(i.stars / 1000).toFixed(i.stars >= 10000 ? 0 : 1).replace(/\.0$/, "")}k` : String(i.stars);
3300
+ return `<span class="stars" title="${esc(T().stars(i.stars))}">★ ${n}</span>`;
3301
+ }
2940
3302
  function card(i) {
2941
3303
  const s = i.summary;
2942
3304
  const t = T();
@@ -2962,13 +3324,14 @@
2962
3324
  <span class="badge folder" style="--c:${folderColor(i.category)}">${esc(catLabel(i.category))}</span>
2963
3325
  <span class="rating ${i.worth === "must-see" ? "must" : ""}">${i.worth === "must-see" ? ic("star") : ""}${esc(t.worth[i.worth] ?? i.worth)}</span>
2964
3326
  ${i.pending ? `<span class="rating">${esc(summaries ? t.pending : t.noModel)}</span>` : ""}
3327
+ ${healthBadge(i)}
2965
3328
  </div>
2966
3329
  ${s ? `<p>${esc(s.oneLiner)}</p>` : ""}
2967
3330
  ${s?.demo ? `<p class="demo">${esc(s.demo)}</p>` : ""}
2968
- ${i.flags.length ? `<div class="flag">⚠ ${esc(i.flags.map((f) => t.flags[f] ?? f).join(", "))}</div>` : ""}
3331
+ ${flagLines(i, t)}
2969
3332
  ${state.view === "inbox" ? inboxChips(i) : ""}
2970
3333
  <div class="meta">
2971
- <span>#${i.id}</span><span>${esc(t.kind1?.[i.kind] ?? t.kinds[i.kind] ?? i.kind)}</span>${i.shareCount ? `<span>${esc(t.shared(i.shareCount))}</span>` : ""}
3334
+ <span>#${i.id}</span><span>${esc(t.kind1?.[i.kind] ?? t.kinds[i.kind] ?? i.kind)}</span>${starsHtml(i)}${i.shareCount ? `<span>${esc(t.shared(i.shareCount))}</span>` : ""}
2972
3335
  <span>${esc(i.createdAt.slice(0, 10))}</span>
2973
3336
  ${i.note ? `<span class="has-note" title="${esc(t.mdHasNote)}" role="img" aria-label="${esc(t.mdHasNote)}">${ic("note")}</span>` : ""}
2974
3337
  </div>
@@ -3048,14 +3411,15 @@
3048
3411
  if (el.contains(document.activeElement)) (el.nextElementSibling ?? el.previousElementSibling)?.querySelector?.(".card")?.focus();
3049
3412
  el.querySelector(".card").style.transform = `translateX(${action === "trash" ? "-110%" : "110%"})`;
3050
3413
  dismiss(el);
3414
+ forgetItem(id);
3051
3415
  const back = action === "trash" ? "restore" : "trash";
3052
- toast(action === "trash" ? t.removed(nameOf(item)) : t.restored(nameOf(item)), async () => { await act(id, back); load(); });
3416
+ toast(action === "trash" ? t.removed(nameOf(item)) : t.restored(nameOf(item)), async () => { await act(id, back); keepPages = true; load(); });
3053
3417
  } else {
3054
3418
  const on = !item.favorite;
3055
3419
  if (!(await act(id, on ? "favorite" : "unfavorite"))) return;
3056
3420
  item.favorite = on;
3057
3421
  const hadFocus = el.contains(document.activeElement);
3058
- if (state.view === "favorites" && !on) dismiss(el);
3422
+ if (state.view === "favorites" && !on) { dismiss(el); forgetItem(id); }
3059
3423
  else { el.outerHTML = card(item); attachSwipe(document.getElementById(`item-${id}`)); if (hadFocus) document.querySelector(`#item-${id} .card`)?.focus(); }
3060
3424
  if (on) toast(t.faved(nameOf(item)));
3061
3425
  }
@@ -3070,6 +3434,19 @@
3070
3434
  if (mapShown()) drawMap();
3071
3435
  if (modalId === id && mdlDlg.open) paintModal();
3072
3436
  }
3437
+ /** Test one card's link right now (the weekly job does this in batches). */
3438
+ async function checkLink(id) {
3439
+ const item = find(id);
3440
+ if (!item) return;
3441
+ const token = store.get("driftnet-token");
3442
+ const res = await fetch(`/api/items/${id}/health`, { method: "POST", headers: token ? { authorization: `Bearer ${token}` } : {} }).catch(() => null);
3443
+ if (res?.status === 401) return needAdmin();
3444
+ if (!res?.ok) return toast(T().linkCheckFailed);
3445
+ Object.assign(item, await res.json().catch(() => ({})));
3446
+ toast(T().linkChecked);
3447
+ repaintItem(id);
3448
+ refreshCounts();
3449
+ }
3073
3450
  async function refreshItem(id) {
3074
3451
  const item = find(id);
3075
3452
  if (!item || refreshing.has(id)) return;
@@ -3097,7 +3474,7 @@
3097
3474
  if (!stats) return;
3098
3475
  $("stats").textContent = T().stats(stats.items, stats.shares);
3099
3476
  const set = (v, n) => { const c = $("nav").querySelector(`[data-field="view"][data-value="${v}"] .count`); if (c) c.textContent = n || (v === "all" ? "0" : ""); };
3100
- set("all", stats.items); set("favorites", stats.favorites); set("trash", stats.trash); set("inbox", stats.inbox);
3477
+ set("all", stats.items); set("favorites", stats.favorites); set("trash", stats.trash); set("inbox", stats.inbox); set("review", stats.review);
3101
3478
  }
3102
3479
 
3103
3480
  // ── Select several cards: x, Shift-click or a long press; then act on all of them ──
@@ -3163,7 +3540,7 @@
3163
3540
  if (!r) return;
3164
3541
  clearSelection();
3165
3542
  await refreshFolders();
3166
- await render();
3543
+ await renderKeep();
3167
3544
  refreshCounts();
3168
3545
  if (action === "move" && state.view === "map") pulse(`f:${folder}`);
3169
3546
  const text = { move: () => t.bulkMoved(n, folderPath(folder)), trash: () => t.bulkRemoved(n), restore: () => t.bulkRestored(n),
@@ -3171,7 +3548,7 @@
3171
3548
  toast(text, async () => {
3172
3549
  if (!(await mapWrite("/api/items/bulk/undo", "POST", { undo: r.undo }))) return;
3173
3550
  await refreshFolders();
3174
- await render();
3551
+ await renderKeep();
3175
3552
  refreshCounts();
3176
3553
  });
3177
3554
  }