Skip to content

⏲️ feat(nd): Hyperfocus Timer — gentle ND-safe work/break cycles in Mission Control#40

Merged
welshDog merged 1 commit intomainfrom
feature/nd-hyperfocus-timer
Mar 17, 2026
Merged

⏲️ feat(nd): Hyperfocus Timer — gentle ND-safe work/break cycles in Mission Control#40
welshDog merged 1 commit intomainfrom
feature/nd-hyperfocus-timer

Conversation

@welshDog
Copy link
Owner

⏲️ What This PR Does

Adds the Hyperfocus Timer — audit Feature #5 from the neurodivergent IDE roadmap.

Gentle, non-jarring work/break cycles designed specifically for ADHD brains. No forced interruptions. No aggressive alerts. Just a calm, persistent nudge that respects your flow state.

✅ 26/26 tests passing. Build clean. 0 axe violations.


📦 Files Added / Changed

File Purpose
lib/hyperfocus.ts State machine + helpers — timer logic, phase transitions, presets
components/HyperfocusTimer.tsx UI widget — non-modal, keyboard navigable, ARIA compliant
app/page.tsx Integrated into Mission Control top grid (next to Cognitive Load Meter)
__tests__/hyperfocus.test.ts State transition + cycle completion unit tests

🎯 Three ND-Tuned Presets

Preset Focus Break Cycles Best For
Micro 10 min 2 min ×3 Task initiation, low energy days
🎯 Standard 25 min 5 min ×4 Default ADHD-friendly Pomodoro
🦅 Deep 45 min 10 min ×3 Full hyperfocus flow sessions

✨ Key Behaviours

  • Non-modal — never blocks the screen or interrupts with popups
  • aria-live="assertive" — screen reader announces phase transitions (focus→break, break→focus, session complete)
  • Start / Pause / Reset controls — fully keyboard navigable
  • Cycle tracking — shows current cycle out of total (e.g. "Cycle 2 of 4")
  • localStorage persistence — survives page refresh mid-session
  • Sensory-theme aware — uses --hc-color-* CSS vars, adapts to CALM/FOCUS/ENERGISE
  • Cognitive Load Meter integration — timer state visible alongside load score

🧪 Test Coverage

npm -C agents/dashboard test
# 26/26 passing ✅
# New tests:
# - Timer starts in idle state with correct preset values
# - Phase transitions: focus → break → focus correctly
# - Cycle counter increments on break→focus transition
# - Session completes after all cycles exhaust
# - Reset returns to idle with original preset
# - Pause/resume preserves remaining time

🧠 ND Design Rationale

"As an ADHD developer who hyperfocuses for 6 hours without eating, I want gentle, non-jarring reminders that respect my flow state but protect my body."

  • No audio by default — auditory sensitivity support
  • No flashing — WCAG 2.3.1 compliant
  • Subtle border pulse on phase change — only if prefers-reduced-motion is NOT set
  • Session complete announcement is assertive — important enough to interrupt, rare enough not to annoy

🔮 What's Next

  • 💻 Brain Dump → Task Chunker — AI micro-task generator
  • 🔌 PLUGIN-001 — ND plugin SDK docs + manifest validator
  • 📊 Grafana panel — pipe session history into nightly wellbeing dashboard

⏲️ Audit Feature #5 — HyperCode V2.0 Neurodivergent IDE remediation plan.

@welshDog welshDog merged commit b217dfe into main Mar 17, 2026
4 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant