From 4b9d6ce6d887c6f0b5395e81b1dd7dd5103cc337 Mon Sep 17 00:00:00 2001 From: vybe Date: Sun, 24 May 2026 20:59:00 +0000 Subject: [PATCH] chore(polish): manifest, docs, tests, and nits for dms-plugin-dev alignment - plugin.json: added capabilities + requires; bumped to 0.2.0 - README: corrected "auto-refresh" claim (now documents the intentional on-demand + defensive poll-act-poll); added Implementation notes section covering Proc + I18n + best practices - test/lib.test.js: updated the manual verification comment (now references Proc + preserved behavior) - Minor version references in README example + caption - All changes keep exact toggle semantics and follow repo style Written by AI agent working for @jtmorris. Model: grok-build-0.1. --- README.md | 13 ++++++++++--- tailscalectl/plugin.json | 5 ++++- test/lib.test.js | 6 +++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4cdd9e1..7b83e2c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A lightweight widget plugin that shows Tailscale connectivity status on the Dank Bar with quick controls for toggling connection, switching exit nodes, and copying peer addresses. -![Tailscale Widget v0.1.0](resources/dms_tailscalectl_v0.1.0.png) +![Tailscale Widget v0.2.0](resources/dms_tailscalectl_v0.1.0.png) ## Features @@ -14,7 +14,7 @@ A lightweight widget plugin that shows Tailscale connectivity status on the Dank - Peer list with hostnames and IPs - **Click-to-copy** any hostname or IP to clipboard - **Exit node selection** — click `↗` on any exit-node-capable peer to route through it -- **Auto-refresh** — status polls every 5 seconds +- **On-demand status** — polls Tailscale for ground truth on load, explicit actions, and post-mutation verification (defensive poll-act-poll for toggles; no always-on timer) - **Toast notifications** for all errors ## Requirements @@ -70,7 +70,7 @@ A lightweight widget plugin that shows Tailscale connectivity status on the Dank "id": "tailscalectl", "name": "Tailscale", "description": "Tailscale status and controls on the Dank Bar", - "version": "0.1.0", + "version": "0.2.0", "author": "John Morris & Vybe (AI Slop... er... Coding Assistant)", "icon": "vpn_key", "type": "widget", @@ -79,6 +79,13 @@ A lightweight widget plugin that shows Tailscale connectivity status on the Dank } ``` +## Implementation notes + +- Uses `Proc` singleton (from `qs.Common`) for all external `tailscale` commands (one-shot stdout capture + auto cleanup). +- Fully I18n-ready via `I18n.tr(...)` (source keys in American English only today; see `tailscalectl/i18n/` for scaffolding). +- Follows current `dms-plugin-dev` + DMS 1.4 plugin best practices (capabilities, requires, no raw Process for one-shots, etc.). +- Toggle uses intentional defensive poll-act-poll (see code comments). + ## Testing ```bash diff --git a/tailscalectl/plugin.json b/tailscalectl/plugin.json index 6d9280b..6f9c82f 100644 --- a/tailscalectl/plugin.json +++ b/tailscalectl/plugin.json @@ -6,6 +6,9 @@ "author": "John Morris", "icon": "vpn_key", "type": "widget", + "capabilities": ["dankbar-widget"], "component": "./TailscaleWidget.qml", - "permissions": ["process"] + "permissions": ["process"], + "requires": ["tailscale"], + "version": "0.2.0" } diff --git a/test/lib.test.js b/test/lib.test.js index 0c7ab47..ee06864 100644 --- a/test/lib.test.js +++ b/test/lib.test.js @@ -8,9 +8,9 @@ const { parsePeers, makeExitNodeCommand, findActiveExitNode, errorMessage, forma * * All functions in lib.js are exercised via Node's built-in test runner. * - * TailscaleWidget.qml has no automated test coverage. The four Process - * objects, their onExited handlers, and all widget UI behavior must be - * verified manually. + * TailscaleWidget.qml has no automated test coverage. The Proc.runCommand + * calls, callback-based coordination (exact poll-act-poll preserved), and all + * widget UI behavior must be verified manually in a running DMS instance. */ test("parsePeers extracts exitNode from ExitNodeOption", () => {