fix: address remaining QA bugs — timer reset, ARIA, SW cache, og:url

BUG 2 — Timer not reset after mark-done: extract timerReset() and call
  it after marking a step done so the timer is ready for the next step
BUG 4 — ARIA tabpanel linking: add id/aria-controls on tabs,
  aria-labelledby on panels
BUG 6 — SW missing icons: add icon-192.png and icon-512.png to cache
  list, bump cache version to v2
BUG 7 — og:url: add missing meta tag
This commit is contained in:
djg 2026-09-23 02:25:59 +00:00
parent 80a4618d95
commit 453ae9c8a0
3 changed files with 18 additions and 11 deletions

View file

@ -15,15 +15,16 @@
<meta property="og:description" content="Break down scary tasks, tame time blindness, and build momentum. Free, no signup, data stays in your browser.">
<meta property="og:type" content="website">
<meta property="og:image" content="https://myadhd.dev/static/og.png">
<meta property="og:url" content="https://myadhd.dev/">
</head>
<body>
<header class="top">
<a class="logo" href="/">myadhd<span>.dev</span></a>
<nav class="tabs" role="tablist">
<a href="#breaker" data-tab="breaker" class="tab" role="tab" aria-selected="false">Break it down</a>
<a href="#timer" data-tab="timer" class="tab" role="tab" aria-selected="false">Focus timer</a>
<a href="#dopamine" data-tab="dopamine" class="tab" role="tab" aria-selected="false">Dopamine menu</a>
<a href="#now" data-tab="now" class="tab" role="tab" aria-selected="false">One thing</a>
<a href="#breaker" data-tab="breaker" class="tab" role="tab" id="tab-breaker" aria-selected="false" aria-controls="breaker">Break it down</a>
<a href="#timer" data-tab="timer" class="tab" role="tab" id="tab-timer" aria-selected="false" aria-controls="timer">Focus timer</a>
<a href="#dopamine" data-tab="dopamine" class="tab" role="tab" id="tab-dopamine" aria-selected="false" aria-controls="dopamine">Dopamine menu</a>
<a href="#now" data-tab="now" class="tab" role="tab" id="tab-now" aria-selected="false" aria-controls="now">One thing</a>
</nav>
</header>
@ -49,7 +50,7 @@
</section>
<!-- ============ TASK BREAKER ============ -->
<section id="breaker" class="tool" role="tabpanel" hidden>
<section id="breaker" class="tool" role="tabpanel" aria-labelledby="tab-breaker" hidden>
<div class="tool-head">
<h1>Break it down</h1>
<p class="sub">Big scary tasks are just 5–10 small boring ones wearing a trench coat. Name the monster; we'll slice it.</p>
@ -80,7 +81,7 @@
</section>
<!-- ============ FOCUS TIMER ============ -->
<section id="timer" class="tool" role="tabpanel" hidden>
<section id="timer" class="tool" role="tabpanel" aria-labelledby="tab-timer" hidden>
<div class="tool-head">
<h1>Focus timer</h1>
<p class="sub">A timer for time-blind brains: you always see how much time is left, how much is gone, and what phase you're in.</p>
@ -128,7 +129,7 @@
</section>
<!-- ============ DOPAMINE MENU ============ -->
<section id="dopamine" class="tool" role="tabpanel" hidden>
<section id="dopamine" class="tool" role="tabpanel" aria-labelledby="tab-dopamine" hidden>
<div class="tool-head">
<h1>Dopamine menu</h1>
<p class="sub">Quick, healthy mood hits so your brain stops hijacking you for worse ones. Pick how long you have.</p>
@ -152,7 +153,7 @@
</section>
<!-- ============ ONE THING ============ -->
<section id="now" class="tool" role="tabpanel" hidden>
<section id="now" class="tool" role="tabpanel" aria-labelledby="tab-now" hidden>
<div class="tool-head">
<h1>One thing</h1>
<p class="sub">Not the whole task. Not the project. The next physical action your hands can actually do.</p>

View file

@ -371,10 +371,12 @@
timerPaint();
});
$('#timer-reset').addEventListener('click', function () {
function timerReset() {
timerStop(); timer.left = timer.total; $('#timer-start').textContent = 'start';
timerPersist(); timerPaint();
});
}
$('#timer-reset').addEventListener('click', timerReset);
$$('.preset').forEach(function (p) {
p.addEventListener('click', function () {
@ -408,6 +410,8 @@
breakerRender();
}
}
// Reset timer so it's fresh for the next step
timerReset();
// Clear one-thing and show next step prompt
localStorage.removeItem('myadhd.now');
showTab('now');

View file

@ -1,11 +1,13 @@
/* myadhd.dev — service worker for offline PWA */
var CACHE = 'myadhd-v1';
var CACHE = 'myadhd-v2';
var ASSETS = [
'/',
'/index.html',
'/static/style.css',
'/static/app.js',
'/static/favicon.svg',
'/static/icon-192.png',
'/static/icon-512.png',
'/manifest.json'
];