dsh-plugin-mini-dashboard

August 31, 2026 · View on GitHub

A session & token mini dashboard for DSH web. It renders just above the sidebar's "Settings" row and summarizes, in one small draggable float window, what your sessions are doing right now and what they have cost you today.

English | 中文

layout dsh Listed on dsh-plugin.org

alt text

What it shows

MetricMeaning
Active sessionsSessions running right now — including ones busy through a running subagent. Counted exactly like the sidebar status lights, so the number always matches the sidebar.
TodaySessions with activity today; blank sessions never count.
In/s · Out/sCurrent token throughput (tokens/s), decaying naturally to zero when idle. Scope is configurable: all sessions, or just the one you are working in. While a reply is still streaming and the provider has not reported usage yet, output speed is estimated live from the streamed text (≈ 4 characters per token); the larger of the two figures is shown.
In · OutTokens sent and generated today.
Cache read · Cache writeToday's cached-token usage, shown as two independently toggleable metrics.
BranchCurrent git branch of the current session's working directory (detached HEAD shows HEAD; upstream tracking/ahead info is stripped).
ChangesWorking-tree changes vs HEAD: changed file count from git status (untracked files included, renames count once) plus +added -removed line sums from git diff HEAD --numstat — staged and unstaged combined; untracked files are not line-counted and binary files count 0. A clean tree shows 0.
Git statusBranch and Changes combined in one cell, e.g. main(3 · +42 -7); just the branch name when the tree is clean, a dash when git is unavailable.

Git metrics — the three git rows follow the current session's working directory and stream over an SSE endpoint the plugin mounts at /mini-dashboard/events (same webServer.register mechanism as the in-box client-hmr channel). The endpoint accepts session ids only — never paths — and unknown ids answer 404; it sends no CORS headers and relies on DSH web's default posture of a loopback-bound, auth-free web surface. When git or the endpoint is unavailable the cells show , polling follows the panel's refresh interval (clamped to 1–30s by the endpoint), and the stream is closed only when all three git metrics are hidden or the panel is disabled — any single hidden metric keeps the stream open, since the three share one connection. An empty repository still names its branch, with the line counts reading 0 (nothing to diff against HEAD yet). All three are shown by default and can be toggled individually in Visible metrics; trendlines remain speed-metric-only.

Speed trendlines — both speed metrics can show a small sparkline next to the value: a filled curve along the card's right edge in Cards layout, a thin curve under the row in List layout, none in Compact. Pick Off / 1m / 3m / 5m per metric (default: 5 minutes for both). History is kept in memory for about 6 minutes and starts fresh after a page refresh; its detail follows the refresh interval.

The float window

  • Drag it by the header; resize from the bottom, right or corner edges. The height hugs the content until you fix one yourself — a fixed height is then shared evenly by the metrics, scrolling if it gets too short.
  • First launch places it at the bottom-right; position and size are remembered across restarts.
  • It snaps to screen edges when dropped nearby (threshold adjustable).
  • Content and backdrop transparency sliders let it blend into your theme; light and dark are handled automatically.
  • It stays above host dialogs and dropdowns, and hides itself while the sidebar is collapsed to the narrow rail.
  • With every metric turned off, only the title and the ⚙ button remain.
  • Running several DSH web windows at once? They share one saved position, and each window keeps the panel fully inside its own viewport — a spot dragged out in a big window stays visible in a small one. The last window you move it in wins.

Install

dsh plugin --profile web add dsh-plugin-mini-dashboard

Restart dsh web to take effect.

Configuration

Two places edit the same settings, and every change applies instantly:

  1. the mini dashboard section in DSH's built-in Settings dialog;
  2. the ⚙ popover on the panel itself — same options, always one click away.

Settings persist to ~/.dsh/settings.yaml (namespace mini-dashboard) and survive restarts.

SettingDefaultEffect
Enable panelonMaster switch
LayoutCardsCompact single row / Cards grid / List rows
Refresh interval2sUpdate cadence (1/2/5/10/30s); also caps trendline detail
Speed scopeCurrent sessionCount speeds across all sessions or the current one only
Output speed includes reasoningonOn: 10s window, thinking text counts toward the live estimate. Off: smoother 30s window that ignores it
Today usage includes subagentsonWhether subagent sessions add to today's token figures
Columns per row2Card layout density (1–4)
Snap to screen edgeonMagnet when dragging near an edge; a threshold slider (8–80px) appears alongside
Fg / Bg transparency0% / 15%Fade the metric text / the backdrop
Visible metricsall shownPer-metric show/hide; drag to reorder
Trendline5m (both speeds)Off / 1m / 3m / 5m, set per speed metric
Git metricsshownBranch / Changes / combined Git status, each individually toggleable in Visible metrics

How the numbers are counted

  • Session counts (Active, Today) mirror the sidebar: blank, archived and subagent-origin rows are never counted. A session counts as active when it is running itself, or when a subagent behind it is running.
  • Today's token figures are true per-day totals: provider usage is bucketed into 30-minute slots and summed over your local day. Archived sessions still count — tokens already spent do not disappear when a session is archived.
  • Cold sessions (not loaded in this host run) are served from DSH's persisted projection cache, which only holds rows written while the plugin was active. To close that gap the plugin backfills the cache at startup: every persisted session with activity inside the projection retention window gets its usage re-folded to the end of its log via the host's cold-read ladder, and the panel nudges one full session-list refresh until every visible row carries the projection — so the totals include all of today's sessions, not just the ones opened since the plugin came up.
  • If your DSH build lacks the session-projection service, the panel falls back to summing the full cumulative usage of sessions that were active today, which can over-count long-lived cross-day sessions.
  • Speeds come from a rolling window over provider-reported cumulative tokens and naturally decay to zero when idle.

Language

The panel follows DSH's language setting (Settings → Language) with Chinese and English text, switching instantly — no refresh needed.

Keywords

dsh · deepseek harness · dsh plugin · web plugin · mini dashboard · dashboard · session monitor · session dashboard · token usage · token counter · token statistics · tokens per second · usage stats · sidebar widget · float window · draggable panel · sparkline · 仪表盘 · 迷你仪表盘 · 面板 · 插件 · 会话监控 · 会话数 · token 统计 · token 用量 · 用量统计 · 吞吐速度 · 悬浮窗 · 可拖动 · 侧边栏 · 趋势线