Repository navigation
Add Keyboard Counter widget + examples/widgets wrapper pattern - #2
Closed
AxialForge wants to merge 0 commit into
Closed
AxialForge wants to merge 0 commit into
AxialForge wants to merge 0 commit into
Conversation
AxialForge
force-pushed
the
claude/keyboard-counter-desktop-app-kbgq30
branch
from
August 11, 2026 20:25
f443a48 to
4282712
Compare
Owner
Author
|
Closing — by request, the Keyboard Counter widget is moving out of ShopDeck into a dedicated, category-organized HTML Widgets collection ( Widgets in the new repo keep the ShopDeck Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Request: "build a simple desktop app that replicates the apluscalc keyboard counter (needed offline at work), and make a wrapper so I can add other widgets and calculators later."
The wrapper already exists — ShopDeck itself is a desktop home for self-contained HTML modules it opens at full fidelity, offline, in their own window. So this delivers the keyboard counter the wrapper-native way (one self-contained
.htmlmodule) and establishes anexamples/widgets/home + seeding pattern so the next widget/calculator is just another file.The apluscalc "keyboard counter" is a real-time keystroke / typing-speed test (not a tally counter): you type into a zone and it counts every keystroke, broken down by category, with KPM and the most-pressed key. This module replicates that.
Changes
examples/widgets/keyboard-counter.html— the widget. Real-time total keystrokes, per-category breakdown (letters, numbers, punctuation, spacebar, Enter, Backspace, modifiers, other), keystrokes-per-minute (+ peak), approximate words-per-minute, most-pressed key, unique keys, and session time. Light/dark adaptive, responsive,EscEscto reset. Fully inline & offline — opens in ShopDeck's window or by double-clicking in any browser on an offline machine.examples/widgets/README.md— documents the widget/calculator pattern (how to get widgets into ShopDeck and how to author a new one).scripts/seed-widgets.mjs+npm run seed:widgets— copy the bundled example widgets intoDocuments/ShopDeck Library/Widgets/.test/keyboard-counter.test.mjs— validates the manifest with ShopDeck's ownvalidateManifest, asserts self-containment (no remote assets /fetch), and unit-tests the widget's pure counting core by extracting the fencedKBCblock from the HTML and running it in a Nodevm(tests the real source, no browser needed).CHANGELOG.md— note the additions under Unreleased.Note:
keyboard-counter.htmlkeeps its logic in a pure DOM-free core (/*__KBC_CORE_START__*/ … /*__KBC_CORE_END__*/) so the module stays a single self-contained file while its rules remain unit-testable — a pattern reusable for future widgets.Verification
npm test— 46/46 pass (9 new).Hi 42!+Enter+Backspace+Shift+ArrowLeft → total 10, 6 text chars, correct per-category split).scanLibraryagainst a seeded library: the widget is catalogued as a proper module (inferred: false, title "Keyboard Counter", folderWidgets).Mapso most-pressed ties break to the first key used rather than lowest numeric key.How to try it
Or just double-click
examples/widgets/keyboard-counter.htmlin any browser — no app needed, works offline.🤖 Generated with Claude Code
Generated by Claude Code