GeezerVison is showing github.com — Star on GitHub: quiet links with the live count, one nudge after the … · jetzhu/MorseCodeAudioCoder@0826879
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: README.md +4Lines changed: 4 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | # Beeper Morse Console: Morse code simulator, decoder and trainer | 2 | 2 |
| | 3 | +[](https://github.com/jetzhu/MorseCodeAudioCoder/stargazers) | | 4 | +[](https://github.com/jetzhu/MorseCodeAudioCoder/releases/latest) | | 5 | +[](https://github.com/jetzhu/MorseCodeAudioCoder/actions/workflows/ci.yml) | | 6 | + | 3 | 7 | Live page: <https://jetzhu.github.io/MorseCodeAudioCoder/> (browser, nothing | 4 | 8 | uploaded). Windows desktop app on the [releases page](https://github.com/jetzhu/MorseCodeAudioCoder/releases/latest). | 5 | 9 |
| |
Collapse file Copy file name to clipboardExpand all lines: docs/INTERFACES.md +7Lines changed: 7 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -491,6 +491,13 @@ Behavioural requirements | 491 | 491 | decoder's input bus like Play does. A Sent line decodes the operator's own | 492 | 492 | keying locally (an adaptive `MorseDecoder` fed from the keyer's transition | 493 | 493 | log) with a Clear button. | | 494 | +- Star on GitHub (2026-09-23, v0.1.12): a quiet link in the page footer and | | 495 | + download panel with the live star count (one `GET` of the repository from | | 496 | + api.github.com, named in the About privacy sentence), and in the desktop | | 497 | + status bar; a one-time nudge ("Useful? Star it on GitHub") after the first | | 498 | + decoded word or the first correct practice target, remembered in | | 499 | + localStorage `morse.star.nudged` / QSettings `star/nudged`. No third-party | | 500 | + scripts. README carries shields.io badges. | 494 | 501 | - Reference chart (2026-09-23, v0.1.11): section G in both apps, built from | 495 | 502 | `morse/reference.py` / `web/js/reference.js` (`chart_entries(table)`: | 496 | 503 | letters, digits, then punctuation by code length, code, character; | |
Collapse file Copy file name to clipboardExpand all lines: docs/PROMOTION.md +7Lines changed: 7 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -98,6 +98,13 @@ Other places that fit: the Hackaday tip line (the beeper angle), the | 98 | 98 | awesome-ham-radio lists on GitHub (open a pull request adding the link), QRZ | 99 | 99 | and eHam forums, and your radio club's newsletter. | 100 | 100 |
| | 101 | +## 4b. Stars from the page itself | | 102 | + | | 103 | +The page and the desktop app carry a quiet "Star on GitHub" link (footer, | | 104 | +download panel, status bar) and ask once, after the first decoded word or the | | 105 | +first correct practice target. Nothing pushier: no popups, no repeats, no | | 106 | +third-party button scripts. | | 107 | + | 101 | 108 | ## 5. Watch and adjust | 102 | 109 |
| 103 | 110 | After a few weeks, Search Console's Performance report shows impressions per | |
Collapse file Copy file name to clipboard +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | """Morse code audio decoder for a PC beeper.""" | 2 | 2 |
| 3 | | -__version__ = "0.1.11" | | 3 | +__version__ = "0.1.12" |
Collapse file Copy file name to clipboardExpand all lines: morse/ui.py +32Lines changed: 32 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -827,6 +827,9 @@ def set_value(self, text: str, unit: str = "") -> None: | 827 | 827 | """QSettings key: weight in percent.""" | 828 | 828 | SETTINGS_REF_OPEN = "reference/open" | 829 | 829 | """QSettings key: whether the Morse chart (section G) is shown.""" | | 830 | +SETTINGS_STAR_NUDGED = "star/nudged" | | 831 | +"""QSettings key: the one-time request to star the repository has been shown.""" | | 832 | +REPO_URL = "https://github.com/jetzhu/MorseCodeAudioCoder" | 830 | 833 | DEFAULT_SIDETONE_HZ = 600 | 831 | 834 | """A comfortable pitch to key with; the beeper's 2491 Hz is shrill to sit next to.""" | 832 | 835 | SIDETONE_MAX_HZ = 4000 | @@ -2014,6 +2017,7 @@ def _pr_check(self, auto: bool) -> None: | 2014 | 2017 | self.pr_readouts["Timing error"].set_value(f"{round(rep.error_pct)}" if rep.marks + rep.gaps else "\u2014", "%") | 2015 | 2018 | t = self.theme | 2016 | 2019 | if result.perfect: | | 2020 | + self._maybe_star_nudge() | 2017 | 2021 | self.pr_result_label.setText("Correct. Press Next target to continue.") | 2018 | 2022 | self.pr_result_label.setStyleSheet(f"color: {t.good}; font-weight: 600;") | 2019 | 2023 | self.pr_target_label.setStyleSheet(f"color: {t.good};") | @@ -2057,8 +2061,34 @@ def _build_statusbar(self) -> QtWidgets.QWidget: | 2057 | 2061 | self.status_error.setFont(font) | 2058 | 2062 | lay.addStretch(1) | 2059 | 2063 | lay.addWidget(self.status_error) | | 2064 | + # A quiet, permanent link; a one-time nudge makes it bold after the first success. | | 2065 | + self.status_star = QtWidgets.QLabel() | | 2066 | + self.status_star.setFont(font) | | 2067 | + self.status_star.setTextFormat(Qt.TextFormat.RichText) | | 2068 | + self.status_star.setOpenExternalLinks(True) | | 2069 | + self.status_star.setToolTip("Stars are how projects like this get found") | | 2070 | + self._star_nudged = str(self.settings.value(SETTINGS_STAR_NUDGED, "0")).strip() in ("1", "true") | | 2071 | + self._set_star_text(nudge=False) | | 2072 | + lay.addWidget(self.status_star) | 2060 | 2073 | return bar | 2061 | 2074 |
| | 2075 | + def _set_star_text(self, nudge: bool) -> None: | | 2076 | + t = self.theme | | 2077 | + if nudge: | | 2078 | + self.status_star.setText(f'Useful? <a href="{REPO_URL}" style="color:{t.ink}; font-weight:600;">' | | 2079 | + f'\u2605 Star it on GitHub</a>') | | 2080 | + else: | | 2081 | + self.status_star.setText(f'<a href="{REPO_URL}" style="color:{t.ink3}; text-decoration:none;">' | | 2082 | + f'\u2605 Star on GitHub</a>') | | 2083 | + | | 2084 | + def _maybe_star_nudge(self) -> None: | | 2085 | + """Ask once, at a moment the app has just done something for the person.""" | | 2086 | + if self._star_nudged: | | 2087 | + return | | 2088 | + self._star_nudged = True | | 2089 | + self.settings.setValue(SETTINGS_STAR_NUDGED, "1") | | 2090 | + self._set_star_text(nudge=True) | | 2091 | + | 2062 | 2092 | def _apply_stylesheet(self) -> None: | 2063 | 2093 | t = self.theme | 2064 | 2094 | self.setStyleSheet(f""" | @@ -2598,6 +2628,8 @@ def _log_emit(self, text: str) -> None: | 2598 | 2628 | self._log.add(text, self.pipeline.elapsed_ms, time.time()) | 2599 | 2629 | if hasattr(self, "log_button"): | 2600 | 2630 | self.log_button.setEnabled(True) | | 2631 | + if " " in text and self._log.text.strip() and hasattr(self, "status_star"): | | 2632 | + self._maybe_star_nudge() # a whole word decoded | 2601 | 2633 |
| 2602 | 2634 | def log_header(self) -> list[tuple[str, str]]: | 2603 | 2635 | """The lines above the table in an exported log.""" | |
Collapse file Copy file name to clipboardExpand all lines: tests/test_ui_offscreen.py +16Lines changed: 16 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -653,3 +653,19 @@ def test_reference_chart_toggles_lights_and_plays(qapp, window: ui.MainWindow, s | 653 | 653 | assert not other._ref_open | 654 | 654 | finally: | 655 | 655 | other.close() | | 656 | + | | 657 | + | | 658 | +def test_star_link_and_one_time_nudge(qapp, window: ui.MainWindow, settings) -> None: | | 659 | + assert ui.REPO_URL in window.status_star.text() | | 660 | + assert "Useful?" not in window.status_star.text() | | 661 | + drive_replay(window) # decodes SOS and, at the flush, the word space | | 662 | + assert "Useful?" in window.status_star.text() | | 663 | + assert str(settings.value(ui.SETTINGS_STAR_NUDGED)) == "1" | | 664 | + settings.sync() | | 665 | + other = ui.make_window(replay_args(), settings=settings) | | 666 | + try: | | 667 | + assert "Useful?" not in other.status_star.text(), "asked once per install" | | 668 | + other._log_emit("A ") | | 669 | + assert "Useful?" not in other.status_star.text() | | 670 | + finally: | | 671 | + other.close() |
Collapse file Copy file name to clipboardExpand all lines: web/css/app.css +7Lines changed: 7 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -167,6 +167,13 @@ button.ctl.start.running { background: var(--panel); border-color: var(--ink-3); | 167 | 167 | } | 168 | 168 | .msgbar button.x:hover { color: var(--ink); background: var(--panel); } | 169 | 169 | .msgbar.note { background: var(--panel-2); } | | 170 | +.msgbar.star { background: var(--panel-2); } | | 171 | +.msgbar.star .icon { color: var(--trace); } | | 172 | +.msgbar.star a { color: var(--ink); font-weight: 600; } | | 173 | +a.star { color: var(--ink-2); text-decoration: none; white-space: nowrap; } | | 174 | +a.star:hover { color: var(--ink); text-decoration: underline; } | | 175 | +a.star .starcount:not(:empty)::before { content: " · "; } | | 176 | +.foot a.star { margin-left: 8px; } | 170 | 177 |
| 171 | 178 | .body { display: grid; grid-template-columns: minmax(0, 1fr) 232px; } | 172 | 179 | .main { display: grid; grid-template-rows: 212px 232px minmax(168px, auto); border-right: 1px solid var(--line); min-width: 0; } | |
Collapse file Copy file name to clipboardExpand all lines: web/index.html +10-2Lines changed: 10 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -245,6 +245,12 @@ <h1>Beeper Morse Console</h1> | 245 | 245 | <button class="x" id="noteDismiss" aria-label="Dismiss" title="Dismiss">×</button> | 246 | 246 | </div> | 247 | 247 |
| | 248 | + <div class="msgbar star" id="starNudge" role="status" hidden> | | 249 | + <span class="icon" aria-hidden="true">★</span> | | 250 | + <span class="txt">Useful? <a id="starNudgeLink" href="https://github.com/jetzhu/MorseCodeAudioCoder" target="_blank" rel="noopener">Star it on GitHub</a>. Shown once; nothing is tracked.</span> | | 251 | + <button class="x" id="starNudgeDismiss" aria-label="Dismiss" title="Dismiss">×</button> | | 252 | + </div> | | 253 | + | 248 | 254 | <div class="body"> | 249 | 255 | <div class="main"> | 250 | 256 | <section class="panel" aria-label="Spectrum"> | @@ -492,6 +498,7 @@ <h2>Morse Console for Windows</h2> | 492 | 498 | works on machines where the browser only gets a processed signal, and it needs no browser and no | 493 | 499 | internet connection.</p> | 494 | 500 | <p class="muted" id="dlNote">Looking up the latest release…</p> | | 501 | + <p class="muted"><a class="star" href="https://github.com/jetzhu/MorseCodeAudioCoder" target="_blank" rel="noopener">★ Star on GitHub<span class="starcount" data-starcount></span></a> if the page or the app is useful to you: stars are how projects like this get found.</p> | 495 | 502 | </div> | 496 | 503 | <div class="assets" id="dlAssets"> | 497 | 504 | <span class="k">Downloads</span> | @@ -550,8 +557,8 @@ <h3>Encoder, hand key and practice</h3> | 550 | 557 | you can rebind. The Practice strip hands out words, call signs and number groups and grades your | 551 | 558 | copy and rhythm. The decoded log, with the time each word arrived, can be downloaded. A Morse code chart at the bottom of the console lists the 26 letters, 10 digits and the punctuation marks . , ? / = ' ( ) : ; + - _ " @ ! with their codes; the letter being keyed or decoded lights up in it, and clicking a character plays it.</p> | 552 | 559 | <h3>Privacy</h3> | 553 | | - <p>Everything runs in this browser tab. No audio, text or settings are sent anywhere; the only network | 554 | | - requests are for the fonts and the release list of the desktop app on GitHub.</p> | | 560 | + <p>Everything runs in this browser tab. No audio, text or settings are sent anywhere; the only network requests are for the fonts and, from GitHub, the release list of the desktop app and the | | 561 | + repository's star count.</p> | 555 | 562 | <h3>Browsers and the desktop app</h3> | 556 | 563 | <p>Chrome and Edge give the page the raw microphone signal. Firefox on Windows supplies a processed | 557 | 564 | signal that suppresses steady tones, so the desktop app, which reads the raw endpoint and needs no | @@ -575,6 +582,7 @@ <h2 id="faqTitle">Frequently asked questions</h2> | 575 | 582 | <div class="foot"> | 576 | 583 | Chrome or Edge recommended. Source and issues: <a href="https://github.com/jetzhu/MorseCodeAudioCoder">github.com/jetzhu/MorseCodeAudioCoder</a>. | 577 | 584 | The <a href="mock.html">design mock</a> shows the same window on simulated audio. | | 585 | + <a class="star" id="starLink" href="https://github.com/jetzhu/MorseCodeAudioCoder" target="_blank" rel="noopener">★ Star on GitHub<span class="starcount" data-starcount></span></a> | 578 | 586 | </div> | 579 | 587 | </div> | 580 | 588 |
| |
Collapse file Copy file name to clipboardExpand all lines: web/js/app.js +41-1Lines changed: 41 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -45,6 +45,8 @@ const HIST_MARKS = 30; | 45 | 45 | /** Auto-detect accepts a peak only this far above the band median. */ | 46 | 46 | const AUTO_MIN_PROMINENCE_DB = 10; | 47 | 47 | const RELEASES_API = "https://api.github.com/repos/jetzhu/MorseCodeAudioCoder/releases/latest"; | | 48 | +const REPO_API = "https://api.github.com/repos/jetzhu/MorseCodeAudioCoder"; | | 49 | +const STORE_STAR_NUDGE = "morse.star.nudged"; | 48 | 50 | const RELEASES_PAGE = "https://github.com/jetzhu/MorseCodeAudioCoder/releases"; | 49 | 51 | const REPO_GIT = "https://github.com/jetzhu/MorseCodeAudioCoder.git"; | 50 | 52 | const STORAGE = { device: "morse.deviceId", f0: "morse.f0", micProc: "morse.micProcessing" }; | @@ -85,6 +87,7 @@ const el = { | 85 | 87 | msgBar: $("msgBar"), msgText: $("msgText"), msgDismiss: $("msgDismiss"), | 86 | 88 | chopHint: $("chopHint"), chopDismiss: $("chopDismiss"), | 87 | 89 | noteBar: $("noteBar"), noteText: $("noteText"), noteDismiss: $("noteDismiss"), | | 90 | + starNudge: $("starNudge"), starNudgeLink: $("starNudgeLink"), starNudgeDismiss: $("starNudgeDismiss"), | 88 | 91 | f0Label: $("f0Label"), specInfo: $("specInfo"), | 89 | 92 | sym: $("symBuf"), hint: $("symHint"), text: $("textOut"), | 90 | 93 | dit: $("ditV"), dah: $("dahV"), lgap: $("lgapV"), off: $("offV"), | @@ -221,7 +224,40 @@ const log = new DecodedLog(); | 221 | 224 |
| 222 | 225 | /** Stamp newly decoded text with the audio clock and the computer clock. */ | 223 | 226 | function logEmit(text) { | 224 | | - if (text) log.add(text, state.blocks * state.blockMs, Date.now()); | | 227 | + if (!text) return; | | 228 | + log.add(text, state.blocks * state.blockMs, Date.now()); | | 229 | + if (text.includes(" ") && log.text.trim()) maybeStarNudge(); // a whole word decoded | | 230 | +} | | 231 | + | | 232 | +// ------------------------------------------------------------------- stars | | 233 | + | | 234 | +/** | | 235 | + * One quiet request to star the repository, at a moment the page has just | | 236 | + * done something for the person (first decoded word, first correct practice | | 237 | + * target). Shown once per browser; dismissing or following the link ends it. | | 238 | + */ | | 239 | +function maybeStarNudge() { | | 240 | + if (store.get(STORE_STAR_NUDGE) === "1" || !el.starNudge.hidden) return; | | 241 | + el.starNudge.hidden = false; | | 242 | +} | | 243 | + | | 244 | +function endStarNudge() { | | 245 | + store.set(STORE_STAR_NUDGE, "1"); | | 246 | + el.starNudge.hidden = true; | | 247 | +} | | 248 | + | | 249 | +/** Read the repository's star count from GitHub and show it next to the star links. */ | | 250 | +async function loadStarCount() { | | 251 | + try { | | 252 | + const r = await fetch(REPO_API, { headers: { Accept: "application/vnd.github+json" } }); | | 253 | + if (!r.ok) return; | | 254 | + const info = await r.json(); | | 255 | + const n = Number(info.stargazers_count); | | 256 | + if (!Number.isFinite(n)) return; | | 257 | + for (const span of document.querySelectorAll("[data-starcount]")) span.textContent = `${n} ${n === 1 ? "star" : "stars"}`; | | 258 | + } catch { | | 259 | + /* offline or rate-limited: the link stands without a count */ | | 260 | + } | 225 | 261 | } | 226 | 262 |
| 227 | 263 | /** The `Pipeline.process_block` order: detector, decoder feed, idle, then the display buffers. */ | @@ -1626,6 +1662,7 @@ function practiceCheck(auto = false) { | 1626 | 1662 | if (auto && !s.perfect) return; | 1627 | 1663 | pr.checked = true; | 1628 | 1664 | practice.record(s); | | 1665 | + if (s.perfect) maybeStarNudge(); | 1629 | 1666 | const r = rhythm(keyedRuns(), sent.dec.ditMs); | 1630 | 1667 | el.prAcc.innerHTML = `${Math.round(100 * s.accuracy)}<small>%</small>`; | 1631 | 1668 | el.prWpm.innerHTML = `${sent.dec.timingReady || sent.runs.length >= 3 ? sent.dec.wpm.toFixed(1) : "—"}<small>WPM</small>`; | @@ -1802,6 +1839,9 @@ function wire() { | 1802 | 1839 | el.chopHint.hidden = true; | 1803 | 1840 | state.chopDismissed = true; | 1804 | 1841 | }); | | 1842 | + el.starNudgeDismiss.addEventListener("click", endStarNudge); | | 1843 | + el.starNudgeLink.addEventListener("click", endStarNudge); | | 1844 | + loadStarCount(); | 1805 | 1845 | el.noteDismiss.addEventListener("click", () => { | 1806 | 1846 | el.noteBar.hidden = true; | 1807 | 1847 | }); | |
Collapse file Copy file name to clipboardExpand all lines: web/test/seo.test.mjs +7Lines changed: 7 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -70,3 +70,10 @@ test("the chart is in the HTML and matches the shared table", () => { | 70 | 70 | assert.ok(html.includes("Morse code simulator")); | 71 | 71 | assert.ok(/<h3>Is this a Morse code simulator\?<\/h3>/.test(html)); | 72 | 72 | }); | | 73 | + | | 74 | +test("the star links and the one-time nudge are in the page", () => { | | 75 | + assert.ok(html.includes('id="starLink"')); | | 76 | + assert.ok(html.includes('id="starNudge"') && html.includes("hidden")); | | 77 | + assert.equal((html.match(/data-starcount/g) || []).length, 2, "footer and download panel"); | | 78 | + assert.ok(html.includes("repository's star count"), "the privacy sentence names the extra request"); | | 79 | +}); |
|