Skip to content

feat(ui): floating glowing dictation overlay - #516

Open
jatinkrmalik wants to merge 8 commits into
mainfrom
feature/dictation-overlay
Open

feat(ui): floating glowing dictation overlay#516
jatinkrmalik wants to merge 8 commits into
mainfrom
feature/dictation-overlay

Conversation

@jatinkrmalik

@jatinkrmalik jatinkrmalik commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

Adds a SuperWhisper-style floating on-screen indicator so users can see that the mic is hot without staring at the tray icon.

  • Glowing orb at the bottom-center while recognition is LISTENING (green pulse) or PROCESSING (amber, quieter)
  • Passive window: no keyboard focus, skip taskbar/pager, click-through input region
  • Soft optional GtkLayerShell on Wayland; plain always-on-top GTK window everywhere else (no new hard dependency)
  • Settings → General → Show Dictation Overlay (ui.show_overlay, default on)

Wired through the same RecognitionState callbacks as the tray icon (toggle and push-to-talk).

How to try it locally

git fetch origin feature/dictation-overlay
git checkout feature/dictation-overlay
pip install -e ".[dev]"   # or ./install.sh --dev
vocalinux --debug
# or: PYTHONPATH=src python -m vocalinux.main --debug
  1. Start dictation with your hotkey (toggle or hold push-to-talk).
  2. You should see a green glowing orb near the bottom of the screen while listening, then amber while processing, and it should disappear when idle.
  3. Tray icon still goes green/orange as before.
  4. Turn it off under Settings → General → Show Dictation Overlay if you prefer tray-only.

Test plan

  • pytest tests/test_dictation_overlay.py (state → show/hide, disabled config, non-focus flags, soft layer-shell)
  • Related tray/config/settings tests still pass
  • Manual: hotkey start → overlay appears; stop → hides
  • Manual: disable overlay in Settings while listening → hides immediately
  • Manual: X11 and/or Wayland session if available

Screenshots (overlay)

Floating indicator while recognition is active:

Listening (green) Processing (amber)
Listening overlay Processing overlay

@github-actions github-actions Bot added app Core Python application (src, packaging) tests Test suite changes labels Jul 15, 2026
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.61745% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.82%. Comparing base (0a7acae) to head (392dd77).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/vocalinux/ui/dictation_overlay.py 92.41% 18 Missing and 3 partials ⚠️
src/vocalinux/ui/tray_indicator.py 94.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #516      +/-   ##
==========================================
+ Coverage   84.39%   84.82%   +0.42%     
==========================================
  Files          32       33       +1     
  Lines        5672     5970     +298     
  Branches      915      950      +35     
==========================================
+ Hits         4787     5064     +277     
- Misses        687      705      +18     
- Partials      198      201       +3     
Files with missing lines Coverage Δ
src/vocalinux/ui/config_manager.py 98.73% <100.00%> (+0.03%) ⬆️
src/vocalinux/ui/tray_indicator.py 84.61% <94.11%> (+0.78%) ⬆️
src/vocalinux/ui/dictation_overlay.py 92.41% <92.41%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added documentation Improvements or additions to documentation resources Icons, sounds, screenshots, promo assets labels Jul 15, 2026
Show a bottom-center non-focus overlay while recognition is LISTENING
or PROCESSING so users get a clear visual cue beyond the tray icon.
Optional GtkLayerShell on Wayland; plain always-on-top GTK fallback
elsewhere. Configurable via ui.show_overlay (default on) and Settings.
Overlay unit tests no longer construct real GTK windows or import
tray_indicator, which was loading gi.repository early and breaking
later tests that mock GI (single-instance and suspend GLib checks).
Capture the floating glowing orb in listening (green) and processing
(amber) states for the PR and README screenshots section.
Exercise GTK init, draw/animation, positioning, layer-shell fallbacks,
tray overlay wiring, settings toggle, and config edge cases so patch
coverage on the floating overlay clears the 80% Codecov target.
Avoid instance-level MagicMock shadowing of set_overlay_enabled under
some import/mock orderings (seen on CI Python 3.10).
Assign a MagicMock config_manager on the instance so assertions do not
depend on the constructor patch (which can leave a real ConfigManager
under some Python versions / import orders).
Drop the hand-drawn mic glyph, simplify the Cairo clear/pulse path,
reuse ConfigManager get_bool/set, tighten tray overlay helpers, and
delete string-grep structural tests that proved nothing.
@jatinkrmalik
jatinkrmalik force-pushed the feature/dictation-overlay branch from a7d6a2c to 1f56b88 Compare July 15, 2026 07:28
Use a full-width bottom strip (layer-shell left/right/bottom anchors, or
resize+move fallback) so the orb is bottom-center on Wayland. Map the
window once and toggle opacity instead of hide/show so compositors do not
re-activate it and yank focus out of the editor (which broke IBus inject).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Core Python application (src, packaging) documentation Improvements or additions to documentation resources Icons, sounds, screenshots, promo assets tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant