Invoice-Downloader
EthanYoQ
电子发票整理与报销准备工具:从邮箱批量收集 PDF/OFD/XML 发票,OCR 识别、分类归档并生成 Excel 汇总;提供 Windows/macOS 桌面版与 DSH 插件。
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:feifandiv/dsh-unread-badge
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English · 中文
Adds the two things DeepSeek Harness does not answer on its own: what is unread and where the work is. A Dock number badge, a task overview at the sidebar foot (running / blocked / done, click through to the session), a coloured dot on every Workspace row, a floating handle on the left edge while the sidebar is collapsed, and the last three sessions you visited.
Pure renderer-side patch: no Host route, no disk writes, no new data source. Every fact comes from the host's own
sessionStatus/sessions.list/workspaces.list.
Scope — a restrained patch. It does these few things and does not touch the DSH core: it only takes official extension seats (
sidebar.footer.action,settings.general.item,shell.overlay) and never replaces layout, changes kernel behaviour or touches another plugin's data. Upgrading DSH normally needs no change here; disable or remove the plugin and the official UI is back.
| Need | Implementation |
|---|---|
| The red number on the app icon = unread tasks | navigator.setAppBadge(n): a finished reply you have not opened, or a run that errored, counts as one unread; all cleared once opened |
| A task overview at the sidebar foot | A persistent row in the sidebar.footer.action seat: 2 running · 1 blocked · 3 done; open it for groups (blocked / failed / running / done) and click any row to jump to that session |
| A floating handle while the sidebar is collapsed | A small edge handle in the shell.overlay seat (only while the sidebar is collapsed): click for the same task panel, drag it up or down, position remembered locally |
| The last three sessions you visited | Automatically remembers the three sessions you actually opened (from the sidebar, from history, or from anywhere else) in localStorage; survives reloads; hide one or clear all |
| A dot on collapsed workspaces | A 7 px dot inserted at the right edge of every data-row-key="workspace:<id>" row, coloured by the group's status |
| Sound | Not reimplemented: it coexists with dsh-notify-me / dsh-plugin-notify-sounds and stays silent, so you never get a double chime |
Colour priority (one row shows only the highest-priority dot):
| Colour | Meaning |
|---|---|
| 🔴 Red | A session in the group failed (api-session/error) |
| 🟢 Green | The group has a finished but unopened reply |
| 🔵 Blue (breathing) | A session in the group is running (can be turned off in Settings) |
"Already seen" reuses the host's own verdict: the session is showing in the main view (retainedBy.mainView > 0) or the host cleared completionUnread. Failures have no native unread slot, so the plugin tracks them itself and clears on open; starting a new run in the same session also clears the previous failure mark.
Subagent sessions are ignored by default — they are steps of the turn you started, not tasks of yours. Archived sessions are ignored too.
A persistent row at the very bottom of the sidebar (above Settings), sharing the seat with DSH's own "Automated tasks":
● Tasks 2 running · 1 blocked · 3 done
Clicking it opens a 320 px popover upwards with four priority-ordered groups:
Tasks
Blocked 1
◐ Fix expired login waiting for approval · dsh-unread-badge 3 min
Running 2
● Refactor plugin panel dsh-unread-badge 12 min
● Proofread transcript copy project 4 min
Done 3
✓ Generate weekly report daily 8 min
Recent Clear
○ Weekly report read daily just now
| Group | Rule | Colour |
|---|---|---|
| Blocked | pendingInteraction: approval / plan review / question all count |
Amber |
| Failed | The run errored (api-session/error); cleared when opened |
Red |
| Running | Running and not waiting for you | Blue (breathing) |
| Done | Finished but never opened (completionUnread); disappears on open |
Green |
| Recent | The last three sessions you actually visited; only those not already in the four groups above | Neutral hollow ring |
uiWorkspace.openSession(id) opens that session and the popover closes; click outside or press Esc to close.× to hide just that entry; "Clear" in the group header empties all of them. Clearing does not immediately write the current session back — recording resumes once you switch to another session.Collapse the sidebar and the task row disappears with it — you had to expand the sidebar just to click a task. The floating handle covers that gap:
shell.overlay (the frame-wide layer above every column), so it is not affected by the sidebar width or overflow and stays when the sidebar is fully hidden;dsh-unread-badge:float-top);"Open a finished session → glance at it → get pulled away → come back and forget where I was" is what history catches:
retainedBy.mainView > 0 (the session the main view is showing). So every route counts: opened from the sidebar, reopened from history, or newly created;localStorage (dsh-unread-badge:history), so reloads and restarts keep it;× on hover) or cleared; the whole group can be switched off in Settings.uiSession.sessionStatus Map<sessionId, {running, pendingInteraction, completionUnread}>
sessions.list { ids, byId } → retainedBy.mainView / origin / running
uiWorkspace.workspaces.list { items: [{ workspaceId, sessionIds }] } → which workspace a session belongs to
remote.$on('api-session/error') (sessionId, message) → failure
retainedBy.mainView > 0 → the session the main view shows; history keys off it
data-sidebar-scrollport / data-sidebar-toggle → sidebar expanded or collapsed (used by the floating handle)
The sidebar has no "workspace header row" slot (sidebar.* only has the session-row group), so the dot is a DOM patch: it locates the row through data-row-key and inserts before row.lastElementChild. If DSH changes either structure the dot disappears, but nothing throws and no native feature is affected.
From npm:
dsh plugin --profile <profile> add @fanfan4589/dsh-unread-badge
Or in the DSH desktop app: Plugins → add a plugin → point it at the checkout directory (for example /absolute/path/to/dsh-unread-badge), then refresh the window once.
Uninstall through Plugin Manager; preferences and history stay in localStorage.
Settings → General → Unread badge:
Preferences live in localStorage under dsh-unread-badge:prefs.
In the DevTools console (⌘⌥I):
__dshUnreadBadge.state()
// { badgeCount, badgeSupported, dock, dots, running, panel, float, history, recent, current, errors, workspaces }
__dshUnreadBadge.tasks() // the snapshot the panel uses: { counts, groups, total }
__dshUnreadBadge.refresh() // recompute immediately
__dshUnreadBadge.state().recent // history entries [{ id, at }], newest first
__dshUnreadBadge.forget('id') // hide one history entry
__dshUnreadBadge.clearHistory() // clear history
badgeSupported: false means the renderer has no navigator.setAppBadge (e.g. the web build is not installed as a PWA) — the badge is unavailable, the dots still work.workspaces exposes each workspace's current {unread, error, running} counts.data-row-key prefix / row-end action button).overflow, so the popover is position: fixed above the trigger row and re-measures on resize/scroll. On very narrow windows it sticks to the edge and narrows to 240 px.[data-sidebar-scrollport] (expanded) and the rail width measured from [data-sidebar-toggle]. A DSH sidebar restructure means updating those selectors; when detection fails it falls back to "expanded", so the handle stays hidden and nothing else breaks.localStorage, so another browser or a cache wipe loses it; only the session id and "last visited" time are stored, and titles always come from the live host.title → displayTitle → directory name → session id.This plugin is an independent implementation: no code was copied from other plugins. Two works in the same direction were read to confirm how the host APIs behave, and are credited here:
navigator.setAppBadge(), and the "unread = finished-unread + failed" fact model, were learned and verified from it.uiSession.sessionStatus / sessions.list, and the inject idiom, were informed by its implementation.Both are MIT, so even snippet-level borrowing is permitted with attribution; this plugin is released under MIT itself, see LICENSE.
node --check client.js
node test/smoke.mjs # offline smoke: host stubs + aggregation + dots + badge + error fallback + task snapshot (blocked/running/done/history + hiding history)
client.js is a module the browser can load directly (window.__ModuleLoader__.load); reload the page after edits, there is no build step. index.js is an empty Host half so the bundle row resolves.
MIT © 2026 feifandiv
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: notification。