Skip to content

feat(tray): add recent dictation snippets history menu 🤖🤖🤖 - #487

Open
LuigiKraken wants to merge 1 commit into
VocaHQ:mainfrom
LuigiKraken:feat/transcription-history
Open

feat(tray): add recent dictation snippets history menu 🤖🤖🤖#487
LuigiKraken wants to merge 1 commit into
VocaHQ:mainfrom
LuigiKraken:feat/transcription-history

Conversation

@LuigiKraken

Copy link
Copy Markdown

Description

Adds a Recent Snippets history menu to the system tray indicator. Each completed dictation session is kept as a snippet; clicking one copies its full text to the clipboard, and a Clear History entry empties the list. This makes it easy to re-paste something you just dictated, or recover earlier input if a paste went wrong.

Key behaviours:

  • One snippet per dictation session (everything said between start and stop). Voice commands like "delete that" are not recorded — they go through a separate callback path.
  • Recorded on recognition, not on injection success, so text can be recovered even when injection silently no-ops (e.g. on some Wayland compositors). The history is most valuable precisely when a paste/inject goes wrong, so it must not depend on injection succeeding.
  • In-memory only — nothing is written to disk; history clears on quit. A deliberate privacy choice for a tool that sees everything the user dictates. (Disk persistence could be added later behind an explicit opt-in.)
  • New history config section (enabled, max_items) with a matching Settings → General → Transcription History group (toggle + count).

Implementation notes:

  • New vocalinux/ui/transcription_history.py: a small, thread-safe, bounded (deque(maxlen=...)) store with a change-callback. Recording happens on the recognition thread; the tray submenu is rebuilt on the GTK main thread via GLib.idle_add.
  • TrayIndicator gains an optional transcription_history= parameter, so existing callers/tests that don't pass it keep working unchanged.

Related Issue

N/A — no existing issue for this; happy to open one to track it if you'd prefer.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📖 Documentation update
  • 🧹 Code refactoring
  • ✅ Test update

Checklist

  • My code follows the code style of this project (black, isort)
  • I have updated the documentation accordingly (no doc change felt necessary — the feature is discoverable in the tray + Settings; glad to add a README note if you'd like)
  • I have added tests to cover my changes (tests/test_transcription_history.py, plus updated tests/test_main.py)
  • All new and existing tests pass locally
  • Pre-commit hooks pass (black, isort, flake8 --select=E9,F63,F7,F82)

Screenshots (if applicable)

Additional Notes

  • Verified live on TUXEDO OS / KDE Plasma (Wayland): snippets record per dictation session, appear newest-first in the tray, and copy to the clipboard on click.
  • Opted into the agent-assisted fast-track per CONTRIBUTING.md (🤖🤖🤖 in the title).

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

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.53125% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.12%. Comparing base (c64b727) to head (cc46eac).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/vocalinux/ui/transcription_history.py 94.20% 2 Missing and 2 partials ⚠️
src/vocalinux/main.py 81.81% 0 Missing and 2 partials ⚠️
src/vocalinux/ui/tray_indicator.py 97.91% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #487      +/-   ##
==========================================
+ Coverage   84.72%   85.12%   +0.39%     
==========================================
  Files          31       32       +1     
  Lines        5068     5231     +163     
  Branches      782      807      +25     
==========================================
+ Hits         4294     4453     +159     
- Misses        595      596       +1     
- Partials      179      182       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Add a "Recent Snippets" submenu to the tray indicator that lists recent
dictation sessions. Clicking a snippet copies its full text to the
clipboard for easy re-pasting; a "Clear History" entry empties the list.

Snippets are recorded on recognition, independent of whether text
injection succeeds, so text can be recovered even when injection silently
no-ops (e.g. on some Wayland compositors). One snippet corresponds to one
dictation session (everything said between start and stop); voice commands
are not recorded since they take a separate callback path.

History is kept in memory only (newest-first, capped, never written to
disk) and clears on quit — a deliberate privacy choice for a tool that
sees everything dictated.

Adds a "history" config section (enabled, max_items) and matching
Settings UI under General. Includes unit tests for the new
TranscriptionHistory store.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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) tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant