Skip to content

v0.3.0 — notification customization, coverage gate, downloads badge

Latest

Choose a tag to compare

@ltao0829 ltao0829 released this 02 Oct 07:38
· 2 commits to main since this release

The first feature release on the DSH 0.2 line: notification customization, a coverage regression gate, and an npm downloads badge. No peer range changed, so a 0.2.x install upgrades in place.

Install

# from npm — name the range, see the cooldown note below
dsh plugin --profile <name> add @ltao0829/dsh-task-notify@^0.3.0

# or from Git, pinned to a release tag
dsh plugin --profile <name> add git+https://github.com/ltao0829/dsh-task-notify.git#v0.3.0

Then restart dsh web and refresh the page. The settings page appears under Settings → Plugins → 任务完成提醒.

Naming a version matters. pnpm 11 defaults minimumReleaseAge to 24 hours, so a release published less than a day ago is invisible to version resolution. Measured on 2026-10-02, four minutes after this release published, the bare dsh plugin add @ltao0829/dsh-task-notify resolved to 0.1.0 — the newest release older than 24 hours, which is not necessarily the immediately previous one — and the compatibility gate refused it. The refusal is explicit, and DSH restores package.json, the lockfile, and node_modules rather than leaving a half-installed profile. An explicit version or range is recorded in minimumReleaseAgeExclude and installs immediately; both directions were verified against this release.

Highlights

  • Title / body templates with {title} (task title), {session} (session ID), and {kind} (localized event type) placeholders. Empty templates keep the built-in localized copy, unknown placeholders stay as written, and output is rendered as plain text — a template cannot inject markup.
  • Four sound styles — none / single tone / the classic two-tone / a custom audio URL — plus a 0–100% volume control. A custom mode with an empty URL falls back to the two-tone; an unloadable URL degrades to silence.
  • Toast placement and duration — any of the four screen corners, and 3–15 seconds on screen (previously fixed at bottom-right for 5 seconds).
  • Quiet hours and per-session mute — a local-time window that may cross midnight (e.g. 22:00 → 08:00) suppresses every reminder, and named sessions never trigger one.
  • A raise-only coverage gate over src/**, plus an npm downloads badge backed purely by npm's public download API. No client-side reporting was added — the privacy guarantee is unchanged.

What changed

Added

  • Notification customization. The eight boolean switches gained user-facing configuration: templates, sound style and volume, toast corner and duration, quiet hours, and a per-session mute list.
  • Test coverage measurement and regression gate. @vitest/coverage-v8 (pinned to the exact vitest version), a pnpm run coverage script, and V8 coverage over src/** with text + lcov reporters. CI runs coverage after the build on both Node legs and uploads coverage/lcov.info from the Node 24 leg as an artifact.
  • npm downloads badge in both READMEs. Caveat to keep attached to the number: it counts npm tarball downloads per month (CI installs and registry mirrors included), not active users.

Changed

  • Settings storage upgraded to dsh.taskNotify.v3. A leftover v2 record is migrated once — every toggle is kept, and the retired sound boolean maps to soundMode: 'double' (off maps to 'off') — after which the v2 key is removed. Every stored field is sanitized on load: junk values degrade to their defaults, and volume / toastSeconds are clamped into 0–1 / 3–15. Upgrading therefore preserves your existing switches; nothing needs re-configuring.
  • The body-template box is its own labelled field rather than a second box under the title label — a placeholder is not an accessible name.
  • The install-cooldown note is now written from a measured run rather than from the documentation of pnpm's behaviour.

Fixed

  • Corrected the DSH 0.1.x install path. Earlier documentation told DSH 0.1.x users to install 0.1.2, but npm has only ever carried 0.1.0 and 0.2.0, and no v0.1.1 / v0.1.2 tag exists, so the instruction could not be followed. The 0.1.x line is now documented as discontinued.

Verification

Verified against a real DSH 0.2.0-rc.2 in an isolated, disposable DSH_HOME (see docs/verification-evidence.md):

Stage Result
pnpm pack tarball packed from the tagged commit
dsh plugin --profile web add <tarball> accepted by the 0.2 compatibility gate
dsh --profile web --dump-config task-notify present in the composed bundle tree
dsh web boot boot document fetched at HTTP 200 (token redirect followed) and it references this plugin in the client module graph
Shipped bundle package/lib/client.js carries the __ModuleLoader__.load handoff; externals are only react and react/jsx-runtime, both in the frozen platform module table
dsh plugin remove plugin and its entry removed cleanly

Local pipeline: typecheck ✅ · 97 tests passing (9 suites, 1 skipped — a describe.skipIf pair, not a disabled test) ✅ · coverage ✅ · build ✅ · pnpm pack --dry-run ✅ · package metadata check ✅

Published artifact integrity: npm's shasum for 0.3.0 (3d0e8080f49e06e0ad14aad67b82baaef8386a58, 36 files, 299,295 bytes unpacked) is byte-identical to the tarball this verification ran against.

Also verified end-to-end from the public registry into a throwaway profile: @^0.3.0 installs 0.3.0 immediately and the installed lib/client.js contains the v3 settings store; the tagged Git install (#v0.3.0) installs 0.3.0 as well.

Not covered by automation: the script does not drive a real browser, so in-page behavior (notification permission, Web Audio unlock, React rendering, template expansion) is covered in jsdom by tests/notification.spec.ts and tests/settings-card.spec.tsx rather than end-to-end.

Full changelog: CHANGELOG.md