Commit Graph
51 Commits
Author SHA1 Message Date
44dac3b4ab docs(mirror): add Codeberg mirror setup and optional sync workflow (#595)
* docs(mirror): add Codeberg mirror setup and optional sync workflow

Document one-time Codeberg migration (pull mirrors are disabled on
Codeberg.org) plus an optional GitHub Actions push for ongoing sync.

Links the expected mirror URL from README and CONTRIBUTING.

Co-authored-by: Jatin K Malik <jatinkrmalik@users.noreply.github.com>

* docs(mirror): drop maintainer setup doc from PR

Keep only the README mirror table and optional sync workflow.
Setup notes are one-off and do not belong in the repo.

Co-authored-by: Jatin K Malik <jatinkrmalik@users.noreply.github.com>

* chore(ci): remove obsolete mirror setup comment

Co-authored-by: Jatin K Malik <jatinkrmalik@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Jatin K Malik <jatinkrmalik@users.noreply.github.com>
2026-07-26 18:14:09 -07:00
Jatin K MalikandGitHub 02b341bae3 feat(packaging): add self-contained AppImage build (x86_64 + aarch64) (#573)
* feat(packaging): add self-contained AppImage build

Bundles the wheel plus PyGObject/GTK3/AppIndicator/IBus typelibs into a
relocatable x86_64 AppImage via linuxdeploy + linuxdeploy-plugin-gtk, so
users get a zero-install, no-sandbox-negotiation alternative alongside
AUR/PyPI. Wired into nightly and tagged releases, plus a smoke-test job
in the PR pipeline since AppImage/ELF bundling can't be verified on a
macOS dev machine.

* feat(packaging): add aarch64 AppImage builds

Parameterizes build.sh on uname -m instead of hardcoding x86_64 (both
linuxdeploy and appimagetool publish aarch64 continuous builds, and
pywhispercpp ships manylinux_aarch64 wheels, so no from-source compile
needed). Adds an arch matrix to the PR smoke-test job, and a second
job in nightly.yml/release.yml that builds on GitHub's free
ubuntu-24.04-arm hosted runner and attaches the aarch64 AppImage to
the same release the x86_64 job already created.
2026-07-23 23:05:05 -07:00
Jatin K MalikandGitHub 10db2ba93f ci(flatpak): build arch matrix without job-level matrix if (#536)
GitHub rejects job-level if expressions that reference matrix
(Unrecognized named-value: matrix). Resolve the include list in a
small setup job instead so PRs stay x86_64-only.
2026-07-16 20:18:10 -07:00
Jatin K MalikandGitHub dea8e68544 ci(flatpak): reuse builder cache and skip aarch64 on PRs (#535)
Using github.sha in the cache key forced a full rebuild on every commit.
Hash packaging/flatpak instead so .flatpak-builder can restore across
runs, and only rebuild modules that actually changed.

PRs build x86_64 only; main and workflow_dispatch still cover both arches.
Drop the extra upload-artifact step in favor of the action's own upload.
2026-07-16 19:58:19 -07:00
Jatin K MalikandGitHub 3deb523efd feat(flatpak): add Flatpak packaging for universal distribution (#484)
* feat(flatpak): add Flatpak packaging for universal distribution

Adds a Flathub-ready Flatpak for the whisper.cpp engine, plus the minimal
runtime adaptations Flatpak actually needs — deliberately scoped down from the
earlier attempts (#416, #428), which bundled unrelated whisper.cpp GPU, audio,
and clipboard changes.

Packaging (packaging/flatpak/):
- app manifest, AppStream metainfo, and desktop entry (com.vocalinux.Vocalinux)
- generated offline Python dependency modules (flatpak-pip-generator)
- bundled shared modules: PortAudio, libayatana-appindicator, xdotool, xsel

Runtime changes (Flatpak-only, behaviour unchanged outside a sandbox):
- utils/paths.py: honour XDG_CONFIG_HOME/XDG_DATA_HOME so config, models and
  runtime data live under ~/.var/app/<app-id> in the sandbox
- autostart uses `flatpak run <app-id>` (the host launcher is always on PATH)
- text injection and keyboard backend detect a Wayland host reached via XWayland
  (no Wayland socket granted) and route through xdotool / pynput-on-X11
- tray indicator references the exported `<app-id>-*` host icon theme names

Also: a CI workflow building x86_64 + aarch64 bundles, and README / packaging
README / distro-compatibility doc updates.

Verified with a full flatpak-builder build + bundle install on aarch64:
pywhispercpp loads its native libraries without LD_LIBRARY_PATH, XDG paths
redirect correctly, bundled tools are present, and the entrypoint runs.
Manifest and builddir lint are clean and AppStream metadata validates.

Closes #167

* chore(flatpak): sync metainfo version to 0.14.0-beta

Also ignore flatpak-build-dir/ so local builder output stays untracked.

* refactor(flatpak): trim docs and comments after ponytail review

Drop redundant packaging README command blocks, shrink path/tray/autostart
comments, and stop ignoring a non-canonical build-dir name.

* fix(flatpak): close readiness gaps for v0.14.0-beta

Route log files through XDG data dirs so Flatpak keeps them under
~/.var/app, refresh AppStream screenshots to vocalinux.com, and use
the SPDX GPL-3.0-only license id.

* fix(flatpak): enable global hotkeys via evdev and --device=input

pynput over XWayland only receives keys for the focused X client. Prefer
evdev inside Flatpak and grant /dev/input so shortcuts work app-wide.

* fix(flatpak): inject text with ydotool/uinput on Wayland

xdotool only reaches XWayland clients, so typing appeared to succeed but
never hit native apps. Ship ydotool, grant --device=all for uinput, start
ydotoold on demand, and type via uinput inside the Flatpak.

* fix(flatpak): paste via wl-copy + Ctrl+V instead of typing

ydotool type injects character-by-character. Ship wl-clipboard, grant
--socket=wayland, and prefer clipboard paste for instant insertion.

* test(text-injection): expect ydotool default key-delay of 2

Matches the shipped VOCALINUX_YDOTOOL_KEY_DELAY default used when
clipboard paste falls back to character typing.
2026-07-16 00:03:30 -07:00
Jatin K MalikandGitHub 6545e4ea66 feat(packaging): add AUR release package and CI publish (#518)
* feat(packaging): add AUR release package and CI publish

Ship packaging/aur/vocalinux for yay installs of tagged releases, wire
AUR publish into the release workflow (skipped until secrets are set),
and document one-time maintainer setup.

Fixes #116

* refactor(packaging): slim AUR PR to PKGBUILD + CI

Drop systemd unit, install script, website edits, and long docs.
Keep release PKGBUILD, minimal publish job, and short AUR setup notes.
2026-07-14 23:41:31 -07:00
Jatin K MalikandGitHub 7b4a081048 feat(ci): add automatic PR labeling workflow (#473)
Configure actions/labeler@v5 to automatically label PRs based on file paths.
Maps changes to: app, web, documentation, ci, tests, installer, resources, dependencies.

Creates 6 new labels to complement existing issue labels for better PR organization.
2026-06-11 22:38:41 -07:00
Jatin K Malik 0e15b4e788 Add GitHub Sponsors funding configuration 2026-06-06 19:44:59 -07:00
3f5a5effff feat(vad): add Silero VAD and drop silence-only buffers (#447)
* feat(vad): replace amplitude-based VAD with Silero neural network

Replace the simple amplitude threshold VAD with Silero VAD, a lightweight
neural network model that classifies audio as speech/non-speech. This
addresses the root cause of #302 (silence not stopping recording) and

- Add silero_vad.py wrapper using ONNX Runtime with bundled Silero v5 model
- Accumulate 512-sample chunks with 64-sample context window per official API
- Map existing vad_sensitivity (1-5) to Silero thresholds (0.8-0.3)
- Use max() across sub-chunks to avoid missing speech onsets
- Fall back to amplitude VAD when onnxruntime is unavailable
- Add onnxruntime as optional dependency (pip install vocalinux[vad])

Closes #344

* address review: add tests, LICENSE, logging, validation fixes

- Add unit tests for SileroVAD (process, reset, fallback, sensitivity mapping)
- Add MIT LICENSE for bundled Silero VAD model in data/
- Log which VAD backend is active on init
- Validate chunk length in SileroVAD.process()
- Skip is_speech check until a full Silero chunk is processed
- Add thread safety note to SileroVAD docstring
- Document resampling rate effect on VAD resolution
- Comment explaining why load_silero_vad() catches broad Exception

* address review: bundle license, document [vad] extra, surface backend in UI

- Pack data/LICENSE into the wheel (pyproject package-data) so attribution
  travels with the model
- README: short note on enabling neural VAD via vocalinux[vad]
- Settings: VAD Sensitivity row subtitle shows the active backend; if
  onnxruntime is missing, an info-row beneath the group spells out the
  install command and the restart requirement
- silero_vad.is_silero_available() probes onnxruntime + model presence
  w/o instantiating an InferenceSession
- CI installs .[dev,vad] so Silero paths get exercised
- Integration test for _record_audio Silero branch (mocked pyaudio +
  scripted SileroVAD), covering silence flush, speech reset, and
  sensitivity threshold mapping at sens=1 vs sens=5
- Tests no longer skip when other modules globally mock numpy: pop the
  top-level numpy ref so a fresh import gives the real package, and
  swap sys.modules["numpy"] inside the _record_audio call so the lazy
  import inside the function picks up real numpy too

* fix(vad): drop silence-only recording buffers

* test(vad): align stop buffer expectations

* test(vad): preserve real numpy module

* fix(install): install vad support opportunistically

* test(vad): cover recognition manager vad edges

---------

Co-authored-by: Sbenazar <127324689+Sbenazar@users.noreply.github.com>
2026-06-02 12:43:51 -07:00
Jatin K MalikandGitHub c0246d5fc8 docs: clarify PyPI installation requirements (#423) 2026-05-06 23:00:01 -07:00
Jatin K MalikandGitHub fa17b88f74 chore: bump minimum Python from 3.8 to 3.9 (#336)
* chore: bump minimum Python from 3.8 to 3.9 and adopt PEP 585 builtins

- Update requires-python, classifiers, mypy target, and black target in pyproject.toml
- Replace Python 3.8 with 3.9 in CI matrix and nightly workflow
- Replace typing.List/Dict/Tuple/Set with builtin list/dict/tuple/set (PEP 585)
- Update all 3.8 version references in README, docs, website, and install.sh
- Fix test_wayland_no_tools to mock IBus availability
- Remove List from common_types re-exports and update test

* style: reformat test files for Black 26.x and pin version in CI

Black 26.x introduced parenthesized context manager formatting.
Reformat 7 test files and pin Black>=26,<27 in CI to prevent
future drift from unpinned version upgrades.
2026-03-21 12:15:10 -07:00
Jatin K MalikandGitHub fa4da40e7b test(coverage): improve test coverage from 57% to 80%+ (#327)
* test(coverage): improve test coverage from 57% to 80%+

Add 30 new test files with 861 additional test cases to improve
overall test coverage from 57% to 80%+ (statement coverage).

Key modules covered:
- recognition_manager.py: 43% → 69% (audio device detection, transcription,
  model download, engine initialization, buffer management)
- text_injector.py: improved coverage for X11/Wayland text injection,
  environment detection, clipboard fallback, shortcut injection
- ibus_engine.py: 22% → 73% (engine lifecycle, text injection, socket server)
- evdev_backend.py: 11% → 78% (device detection, key event handling)
- pynput_backend.py: 43% → 76% (start/stop, key handling, callbacks)
- keyboard_backends/__init__.py: 54% → improved (backend creation, env detection)
- whispercpp_model_info.py: 32% → improved (GPU detection, model recommendations)
- about_dialog.py, first_run_dialog.py, main.py, single_instance.py,
  common_types.py, config_manager.py, autostart_manager.py: various improvements

All 1433 tests pass with proper test isolation to prevent mock pollution
between test modules.

* test(quality): audit and fix test quality issues

Code review audit identified and fixed the following issues:

- Remove bare try/except blocks that swallow all errors (7 tests fixed
  in recognition_manager_deep, replaced with proper assertions or deleted)
- Delete source code inspection tests that read .py files as strings
  instead of testing behavior (deleted test_about_dialog_coverage.py and
  test_first_run_dialog_coverage.py entirely - ~35 useless tests removed)
- Add meaningful assertions replacing weak assertIsNotNone/assertIsInstance
  checks (common_types_coverage, ibus_engine_coverage, keyboard_backends_extra)
- Fix tests that mock the system under test instead of its dependencies
  (text_injector_extra now mocks subprocess.run instead of injection methods)
- Add missing assertions to tests with no verification
  (ibus_engine focus_out, log window info, copy to clipboard)
- Verify download tests check requests.get was called with correct URLs
  (coverage_boost download tests)
- Fix pytest warning by renaming test_audio_input import to avoid
  pytest collecting it as a test function

All 1356 tests pass with 0 failures and 0 warnings.
Statement coverage: 80.3% (3257/4054 lines covered).

* style(tests): fix black formatting and isort import ordering

Auto-format all new test files with black and isort to pass CI lint checks.

* fix(tests): resolve CI hangs and rename test files for clarity

- Fix CI hangs by properly mocking gi/GTK/IBus in all test files
- Fix sys.modules pollution in recognition manager tests by using tmp_path
- Add pytest-timeout to prevent future hangs
- Rename 28 test files to use descriptive, consistent names mapping to source modules

* fix(tests): resolve Python 3.13 CI failures

- Fix _load_stdlib_module() in test_recognition_manager_downloads.py to
  handle stdlib modules that are packages (directories with __init__.py)
  rather than single .py files. In Python 3.13, zipfile became a package,
  causing FileNotFoundError during test collection (exit code 2).

- Fix invalid escape sequence '$' in test_cross_distro_compatibility.py
  by using a raw string. Python 3.13 reports this as SyntaxWarning and
  Python 3.14 will make it a SyntaxError.

* fix(tests): use direct import for zipfile instead of _load_stdlib_module

The _load_stdlib_module approach fails on Python 3.13 where zipfile is a
package (zipfile/__init__.py). Loading it via spec_from_file_location with
a custom name breaks relative imports inside the package (e.g.
'from ._path import ...' resolves to '_stdlib_zipfile._path' which doesn't
exist).

Simply import zipfile at module level before any test mocks can pollute
sys.modules — this is safe because the module-level code runs during test
collection, before any test fixtures or patches are applied.

* fix(tests): mock gi/GTK in conftest to prevent CI hangs

On CI, real PyGObject is installed and module-level imports in vocalinux
source files (ibus_engine, tray_indicator, settings_dialog, etc.) trigger
GTK initialization or IBus daemon connections that hang indefinitely in
headless environments. pytest-timeout's signal-based timeout cannot
interrupt these C-level blocking calls.

Fix by mocking gi and gi.repository in conftest.py (which runs before any
test module is collected), ensuring all test files are protected regardless
of whether they remember to mock individually.

Also add timeout-minutes: 10 to the CI test job as a safety net so that
any remaining hangs fail fast instead of running indefinitely.

* fix(tests): unconditionally mock gi in conftest for CI

The previous 'if gi not in sys.modules' guard was ineffective on CI
because PyGObject is installed via pip, so the real gi module is already
loaded. This caused GTK initialization and IBus daemon connections that
hang indefinitely in headless CI environments.

Now unconditionally replace gi and gi.repository with mocks during test
collection, regardless of whether the real package is installed.

* fix(tests): reduce timeout to 10s and use thread-based timeout

Use timeout_method=thread instead of signal (default) so that
pytest-timeout can interrupt C-level blocking calls (GTK operations,
socket accepts, subprocess waits) that the signal-based method cannot
handle. Also reduce per-test timeout from 30s to 10s since no legitimate
unit test should take longer, and hanging tests were consuming the entire
CI job timeout budget.

* fix(tests): set global socket timeout to prevent blocking on CI

Tests in test_ibus_engine.py create real Unix sockets with daemon threads
that block on socket.accept(). When tests fail or timeout, these threads
remain blocked indefinitely, preventing pytest from completing. The
thread-based timeout catches the hang but cannot terminate the blocking
accept() call.

Set socket.setdefaulttimeout(5) in conftest.py so all socket operations
(accept, connect, recv) will raise socket.timeout after 5 seconds instead
of blocking forever.

* fix(tests): add cleanup fixture for IBus socket server threads

Add autouse fixture that stops any leftover VocalinuxEngine socket server
threads after each test. Tests that trigger _start_socket_server() spawn
daemon threads blocking on socket.accept() that persist after the test
completes, eventually causing pytest-timeout to kill the process.

The cleanup fixture sets _server_running=False and closes the server
socket, which unblocks the accept() call and allows the daemon thread
to terminate.

* fix(tests): reduce socket timeout to 0.1s to avoid slowing tests

The 5-second socket timeout caused socket operations in daemon threads
to block for 5 seconds per iteration before timing out, significantly
slowing the test suite on CI. Reduce to 0.1s so blocking socket calls
fail fast without noticeably impacting test execution time.

* fix(tests): use 2s socket timeout and increase CI timeout to 15min

The 0.1s socket timeout was too aggressive and caused legitimate test
socket operations to fail. Use 2s which is long enough for test sockets
to work but short enough to unblock daemon threads.

Increase CI job timeout to 15 minutes to accommodate the socket timeout
overhead from daemon threads that retry every 2 seconds.

* fix(tests): block known-blocking daemon threads to prevent CI hangs

Instead of using socket timeouts (which either break tests or are too
slow), prevent specific known-blocking daemon threads from starting:
- ibus_engine.server_thread: blocks on socket.accept()
- evdev_backend._monitor_devices: blocks on select.select()

These threads are identified by their target function name and skipped
during Thread.start(). The thread is marked as started/stopped so
join() calls in cleanup code don't raise RuntimeError.

Test-created daemon threads (e.g. mock socket servers) are unaffected
since they use different target function names.

* fix(tests): patch Thread.join for Python 3.13 compatibility

Python 3.13 changed threading internals — join() now uses _handle.join()
which raises 'thread not started' for threads that were never actually
started. Instead of trying to fake internal state, patch join() to be a
no-op for threads that were skipped by our _safe_thread_start guard.

This fixes the 2 remaining test_evdev_backend_ext failures on Python 3.13.
2026-03-17 14:05:16 -07:00
Jatin K MalikandGitHub 9c16ab0aad chore: remove stale setup.py and build-website.sh (#326)
- Remove setup.py: redundant with pyproject.toml, had drifted deps
  (missing pywhispercpp, psutil, evdev; no platform markers; stale
  Python 3.12 max). pip has supported pyproject.toml since v21.3 (2021).
- Remove build-website.sh: broken script referencing non-existent
  fix-paths.sh. Web deploy is handled by npm scripts and GitHub Actions.
- Clean up CI triggers: remove setup.py and setup.cfg references from
  distro-test-matrix.yml and unified-pipeline.yml path filters.
2026-03-16 16:14:33 -07:00
Jatin K MalikandGitHub 98cf90c418 ci: add path-based filtering to skip unnecessary builds (#319)
- unified-pipeline.yml: replace blanket .github/workflows/** glob with
  specific .github/workflows/unified-pipeline.yml in both web and python
  filters, so editing nightly.yml or release.yml no longer triggers the
  full lint/test/build matrix
- distro-test-matrix.yml: add paths filter at workflow trigger level so
  the 4-container distro matrix only runs when installer, scripts,
  packaging, or version files change (previously ran on every push/PR
  including doc-only and web-only changes)

Saves CI minutes on documentation, website, and unrelated workflow edits.
2026-03-14 19:23:30 -07:00
Jatin K MalikandGitHub cff7b2467f fix(ci): upgrade deploy-website to Node.js 24, opt into Node24 actions (#312) 2026-03-14 18:02:40 -07:00
Jatin K MalikandGitHub b4e59b453d fix(ci): delete local tags before creating nightly release (#218)
The nightly workflow fails when re-running on the same day because
after deleting the remote tag, the local tag still exists in the
runner's checkout. GitHub CLI sees this local tag and expects it
to be pushed to remote.

This fix adds 'git tag -d' to delete local tags in both the
cleanup and create release steps, ensuring clean state before
creating new releases.
2026-02-16 20:52:09 -08:00
Jatin K MalikandGitHub 74f9536ff9 fix(ci): properly delete nightly builds older than 3 days (#217)
The previous cleanup logic sorted releases by column 3 which contained
relative dates like '3 days ago' as text. This doesn't work reliably
for sorting because '3 days ago' and '4 days ago' are compared as
strings, not dates.

This fix:
- Uses gh release list --json to get actual ISO 8601 creation timestamps
- Calculates a proper cutoff date (3 days ago in seconds since epoch)
- Parses and compares actual timestamps
- Only deletes releases that are truly older than 3 days

Fixes the nightly build retention policy.
2026-02-16 20:47:47 -08:00
Jatin K MalikandGitHub bba7829201 feat(web): overhaul SEO structure and intent landing pages (#210)
* feat(web): overhaul SEO structure and landing pages

Add distro-specific install pages and an engine comparison hub to capture high-intent organic queries. Centralize metadata and structured data handling to improve crawl consistency, internal linking, and rich-result eligibility.

* feat(web): add subpage navigation and visual polish

Make SEO landing pages easier to discover and navigate by adding persistent subpage header/footer links to home and key routes. Refresh install and comparison pages with colorful icon-driven sections while expanding homepage footer links for stronger internal linking.

* fix(ci): make web version sync robust to schema location

CI assumed softwareVersion lived in layout.tsx, but SEO refactors moved SoftwareApplication JSON-LD to page.tsx. Update workflow sync steps to patch whichever file currently contains softwareVersion so website build and release jobs keep working.

* chore(web): remove SEO audit artifact

Drop the internal SEO audit markdown from the PR so only production website and workflow changes are included.
2026-02-12 19:27:02 -08:00
Jatin K MalikandGitHub 86ee79cc0d chore: update install commands to use tag-based URLs (#200)
Changed install commands to download install.sh directly from the release
tag instead of from main branch with --tag parameter. This ensures:

1. The install script version matches the release being installed
2. No version mismatch between script and code
3. Simpler, cleaner install commands

Changes:
- install.sh: Updated error message to use v0.6.0-beta URL
- README.md: All install commands now use v0.6.0-beta/install.sh
- docs/INSTALL.md: Updated quick install command
- docs/UPDATE.md: Updated update command examples
- docs/RELEASE_PROCESS.md: Updated example command
- src/vocalinux/main.py: Updated error message install command
- tests/distro-testing-checklist.md: Updated download URL
- web/src/app/page.tsx: Now uses dynamic tag in URL (not main)
- .github/workflows/release.yml: Release notes use tag-based URL

Before:
  curl .../main/install.sh | bash -s -- --tag=v0.6.0-beta

After:
  curl .../v0.6.0-beta/install.sh | bash

Fixes version consistency between install script and installed code.
2026-02-12 13:02:51 -08:00
Jatin K MalikandGitHub 04bb814a52 fix(ci): safely handle multi-line commit messages in deploy check (#194)
The previous implementation directly interpolated the commit message
into the shell script, which broke when messages contained newlines.
Words like "not" were being interpreted as shell commands.

Fix: Pass commit message via environment variable and write to temp file
before grepping, avoiding shell injection issues.
2026-02-12 08:44:27 -08:00
jatinkrmalik 318e188245 fix(ci): handle both wheel and tar.gz file renaming in nightly builds
The sed pattern didn't correctly match tar.gz files which don't have
a dash after the version number. Fixed by explicitly handling both
.whl and .tar.gz file extensions with proper naming patterns.

Fixes the error: 'mv: source and destination are the same file'
2026-02-11 20:02:15 -08:00
jatinkrmalik 61b8555356 fix(ci): improve nightly build workflow for user accessibility
The nightly build workflow was not creating accessible releases for users.
This fix addresses several issues:

- Add write permissions (contents: read → contents: write) to create GitHub releases
- Create a persistent 'nightly' pre-release that users can easily find and download
- Add workflow_dispatch trigger for manual testing
- Improve version naming: {base_version}.dev{date}+{short_sha}
- Extend artifact retention from 7 to 30 days
- Add clear installation instructions in release notes

Users can now access nightly builds at:
https://github.com/jatinkrmalik/vocalinux/releases/tag/nightly

Fixes #186
2026-02-11 19:48:46 -08:00
Jatin K MalikandGitHub 57a0ddd0b8 feat(speech): add whisper.cpp with Vulkan support for GPU acceleration (#179)
* feat(speech): add whisper.cpp with Vulkan support for GPU acceleration

Add whisper.cpp as a new speech recognition engine with the following features:
- Vulkan GPU acceleration support (AMD, Intel, NVIDIA)
- Fallback to CUDA for NVIDIA GPUs
- CPU-only mode with automatic thread optimization
- Support for all model sizes: tiny, base, small, medium, large
- Hardware detection to recommend best model/backend
- Models downloaded from Hugging Face (ggml format)
- Updated UI to show compute backend info in settings
- pywhispercpp as the Python binding library
- whisper_cpp as the new default engine

Changes:
- New whispercpp_model_info.py with model metadata and hardware detection
- Updated recognition_manager.py with whisper.cpp init and transcription
- Updated settings_dialog.py with whisper.cpp UI support
- Updated config_manager.py with whisper_cpp_model_size config
- Updated main.py with whisper_cpp CLI option
- Updated pyproject.toml with pywhispercpp dependency
- Updated install.sh with vulkan-tools for GPU detection

Closes #104

* style: fix black and isort formatting issues

* test: update config manager test for whisper_cpp default engine

* feat(install): interactive mode with 3 engine choices and whisper.cpp as default

Major changes to install.sh:
- Interactive mode is now the DEFAULT (not --auto)
- Added --auto flag for non-interactive automatic installation
- New --engine flag to specify engine directly
- Interactive mode shows 3 engine options with visual boxes:
  1. whisper.cpp (recommended) - Vulkan/CUDA/CPU support
  2. whisper (OpenAI) - PyTorch-based, NVIDIA-only
  3. VOSK - lightweight option
- Hardware detection with recommendations:
  - Detects Vulkan support (AMD/Intel/NVIDIA)
  - Detects NVIDIA CUDA
  - Checks available RAM
  - Recommends best engine based on hardware
- Updated help text with new options and examples
- Removed old --with-whisper, --whisper-cpu, --no-whisper flags
- whisper.cpp is now the default engine for automatic mode

* feat(uninstall): kill running vocalinux processes before uninstall

* fix(whisper.cpp): auto-download model, use all CPU cores, hide unavailable engines

Three fixes for whisper.cpp implementation:

1. Auto-download model during install
   - Added install_whispercpp_model() function to install.sh
   - Downloads ggml-tiny.bin (~39MB) from Hugging Face
   - Runs automatically when whisper.cpp engine is selected

2. Use all CPU cores for transcription
   - Added n_threads parameter to Model initialization
   - Uses multiprocessing.cpu_count() to get all cores
   - Significantly improves transcription speed

3. Hide unavailable engines from dropdown
   - Added get_available_engines() function to detect installed engines
   - Settings dialog now only shows engines that are actually installed
   - Falls back to first available engine if current not available

Fixes user-reported issues with whisper.cpp integration.

* ui(settings): display whisper.cpp correctly and increase dialog height

- Changed engine display name from 'whisper_cpp' to 'whisper.cpp'
- Added format_engine_display_name() helper function
- Dialog now uses 75% of screen height for better visibility
- More options visible by default without scrolling

* revert(settings): remove display name change, keep dialog height increase

- Reverted engine display name change (was breaking engine selection)
- Kept dialog height at 75% of screen for better visibility

* style: fix black and isort formatting for whisper.cpp logging

* style: fix black formatting in settings_dialog.py

* ci: fix Fedora 39 container package installation

Add dnf cache update and fallback with --nogpgcheck for Fedora containers
that may have stale or missing package metadata.
2026-02-11 19:37:58 -08:00
Jatin K MalikandGitHub 04eada775b feat: Phase 5 & 6 - Complete cross-distro compatibility fixes (#168)
Phase 5: Fix remaining hardcoded GI_TYPELIB_PATH values
- install.sh: Use dynamic GI_TYPELIB_DETECTED in package verification (line 1208)
- install.sh: Use dynamic path in desktop entry Exec line (line 1651)
- CI workflow: Use pkg-config for dynamic GI_TYPELIB_PATH detection (line 151)

Phase 6: Testing & validation improvements
- Add comprehensive test_cross_distro_compatibility.py test suite
- Tests verify no hardcoded paths, dynamic detection works, wrapper scripts correct
- Update DISTRO_COMPATIBILITY.md with implementation status and technical details

Fixes #157 (remaining issues)
Related to #48 (Snap packaging)
2026-02-09 21:07:25 -08:00
Jatin K MalikandGitHub 8e48b997a5 ci: Actually test install.sh distro detection in CI matrix (#163)
* docs: Add distribution package mapping reference

Add a comprehensive YAML reference file documenting package names
across different Linux distributions. This serves as:

1. Documentation for manual installation on unsupported distros
2. Reference for adding support for new distributions
3. Auxiliary reference for the installer's embedded package mappings

Completes Task 6 from the cross-distribution compatibility fix plan.

Related to: #158, #159, #160, #161

* ci: Actually test install.sh distro detection in CI matrix

Previously, the distro-test-matrix.yml workflow only did syntax checks
on install.sh without actually testing the core cross-distribution
functionality that was added in phases 1-4.

This update adds proper tests for:

1. Distro Detection - Tests detect_distro() function logic across
   different containers to verify proper identification of Ubuntu,
   Debian, Fedora, etc.

2. Typelib Path Detection - Tests detect_typelib_path() function
   which uses pkg-config and fallback paths for GI_TYPELIB_PATH

3. Virtual Environment Creation - Verifies Python venv can be
   created with minimal system dependencies

4. Dependency Checker - Runs check-system-deps.sh to see what's
   missing on each distro

5. Installer Help - Verifies install.sh --help works

This ensures the cross-distribution compatibility improvements
are actually tested by CI, not just syntax-checked.

Related to: #158, #159, #160, #161, #162

* ci: Fix distro test - avoid sourcing install.sh (root check fails)

The install.sh script has a root check that exits immediately when
running as root, which causes CI to fail when we try to source it.

Instead, we now test the distro detection logic directly without
sourcing install.sh. This gives us the same test coverage while
avoiding the root check issue.
2026-02-07 18:22:02 -08:00
Jatin K MalikandGitHub 6b0e81c117 feat: Phase 4 - Testing & Polish improvements (#161)
Add testing infrastructure and documentation improvements.

**Task 12: Add pkg-config to Core Dependencies**
- Added pkg-config check at the start of install_system_dependencies()
- Added pkg-config to all distribution package lists
- Provides distro-specific install instructions if pkg-config is missing
- Critical for library detection (GI_TYPELIB_PATH, PortAudio, etc.)

**Task 13: Update README with Distro Info**
- Updated Requirements section with tested distributions
- Added link to DISTRO_COMPATIBILITY.md
- Listed officially supported distros: Ubuntu 22.04+, Debian 11+, Fedora 39+, Arch, openSUSE
- Mentioned experimental support for Gentoo, Alpine, Void, Solus

**Task 14: Create Test Matrix for CI**
- New workflow: .github/workflows/distro-test-matrix.yml
- Tests on multiple container images: Ubuntu 22.04, 24.04, Debian 12, Fedora 39
- Runs dependency checker on each distro
- Tests Python imports and bash syntax validation
- Uses continue-on-error for experimental distro support

**Task 15: Integration Testing Checklist**
- New file: tests/distro-testing-checklist.md
- Comprehensive checklist for testing on new distributions
- Covers: Pre-install, Installation, Post-install, Functionality, Performance, Cleanup
- Includes quick reference commands
- Desktop environment and application-specific testing sections
- Template for submitting test results

Part of cross-distribution compatibility improvements (Phase 4 of 5).
Related to #157
2026-02-07 16:59:29 -08:00
Jatin K MalikandGitHub 099f9d27ad fix(ci): make workflow robust to special characters in commit messages (#152)
The unified-pipeline workflow was failing when commit messages contained
special characters (like quotes in 'won\'t be transcribed'). The shell
pattern matching was fragile and would break on various characters.

Fix:
- Replace fragile glob pattern matching with grep case-insensitive search
- Look for common website-related commit prefixes:
  feat(website)
  docs(website)
  chore(website)
  fix(website)
  refactor(website)
- This is more robust and handles special characters gracefully
- Fix YAML formatting issue with blank line

This makes the CI workflow more reliable and less fragile.
2026-02-05 18:56:51 -08:00
Jatin K MalikandGitHub ab47329706 fix(website): critical SEO fixes - schema version, FAQ & HowTo structured data (#142)
* fix(website): update schema version and add structured data for SEO

- Fix softwareVersion from "0.0.0" to "0.4.1-alpha" in SoftwareApplication schema
- Add FAQPage schema for rich results in search engines
- Add HowTo schema for installation guide steps
- Update sitemap.xml lastmod date to 2026-02-05

Fixes #138

* ci: skip Python builds when only web/ folder changes

- Add path filters to detect changes in web/ vs Python files
- Make python-lint and python-test jobs depend on changes job
- Skip Python CI when only web files are modified
- Expand Python path filters to include common config files

Closes #138
2026-02-05 17:01:19 -08:00
Jatin K MalikandGitHub b62fb9049b feat(ci): add nightly build workflow (#129)
- Adds scheduled daily builds at 2 AM UTC
- Builds Python packages and uploads as artifacts
- 7-day retention to keep storage minimal
- No release tab pollution - artifacts only
2026-02-05 01:06:51 -08:00
6f54dd80e0 Fix Python 3.13 and Wayland compatibility (#125)
* Fix Python 3.13 and Wayland compatibility

This commit addresses installation failures on modern Linux distributions
(Ubuntu 25.10+) with Python 3.13 and Wayland-only sessions.

Changes:

1. **Add Python 3.13 support** (pyproject.toml)
   - Add Python 3.13 to classifiers
   - Update black target versions to include py312, py313
   - No code changes needed - already compatible

2. **Use system site-packages for PyGObject** (install.sh)
   - Change venv creation to use --system-site-packages flag
   - Avoids PyGObject build failures with Python 3.13
   - System PyGObject (python3-gi) is already installed as dependency
   - Building from source is unnecessary and fragile with new Python versions

3. **Improve Wayland text injection support** (install.sh)
   - Install ydotool as fallback (wtype doesn't work with GNOME Wayland)
   - Add user to 'input' group for uinput device access
   - Install udev rule for /dev/uinput permissions
   - Provide clear warning about logout requirement

Technical details:
- wtype uses Wayland virtual keyboard protocol (not supported by GNOME)
- ydotool uses Linux uinput kernel module (works with all compositors)
- System PyGObject 3.50.0+ supports Python 3.13
- Building PyGObject 3.54.5 from source fails with Python 3.13 build tools

Fixes installation on:
- Ubuntu 25.10 (Questing Quokka) - Wayland-only, Python 3.13
- Arch Linux with Python 3.13
- Fedora 41+ with Python 3.13

Tested on: Ubuntu 25.10 with Python 3.13.7, GNOME 49 Wayland

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Prioritize ydotool over wtype for universal Wayland compatibility

wtype uses the virtual-keyboard Wayland protocol which is not supported
by GNOME/Mutter compositors. ydotool uses the Linux uinput kernel module
which works with all Wayland compositors including GNOME.

This change swaps the priority order to check ydotool first, ensuring
text injection works on GNOME Wayland (Ubuntu 25.10+) while still
falling back to wtype for compositors that support it.

Tested on Ubuntu 25.10 with GNOME 49 Wayland - text injection now works
perfectly with ydotool.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* ci: trigger workflow run

* ci: run lint/tests on python 3.13

---------

Co-authored-by: ACT900 <179795730+ACT900@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 22:31:24 -08:00
Jatin K MalikandGitHub 9decf120db fix: clean up pagespeed follow-ups (#120) 2026-02-04 19:36:44 -08:00
Jatin K MalikandGitHub 0d9c488d82 fix: optimize PageSpeed Insights performance (#115)
* fix: optimize PageSpeed Insights performance

This commit addresses several PageSpeed Insights issues to improve
the performance score from 56 to a target of 90+.

Changes:
- Add SWC config to output modern ES2022 JavaScript, eliminating
  unnecessary polyfills (~12 KiB savings)
- Convert vocalinux.png to WebP format (17KB vs 207KB - 92% reduction)
- Add OptimizedImage component with WebP/PNG fallback support
- Add _headers file for proper static asset caching (1 year cache
  for immutable assets)
- Configure Next.js with optimizePackageImports for framer-motion
  and lucide-react
- Fix heading hierarchy issue (Quick Install h3 -> h2)
- Add console.log removal in production builds

Expected improvements:
- Image delivery: ~41 KiB savings
- Legacy JavaScript: ~12 KiB savings
- Cache lifetime: 754 KiB proper caching
- Accessibility score: 98 -> 100 (heading order fix)

* test: add coverage for PageSpeed optimization

Add comprehensive test suite for PageSpeed Insights optimization changes:

- WebP image loading tests (optimized-image.tsx)
- next/image component configuration tests (next.config.js)
- _headers file generation and cache header tests
- Lazy loading behavior tests

Includes:
- Jest configuration with TypeScript support
- React Testing Library setup
- 54 test cases covering all PageSpeed optimization features
- Build verification

All tests pass: npm run test
Build passes: npm run build

* ci: trigger workflow

* ci: trigger workflow run

* ci: trigger workflow
2026-02-04 19:25:34 -08:00
Jatin K MalikandGitHub 44634bb529 fix: escape commit message in Detect Changes step (#90)
The commit message was being directly inserted into the bash comparison,
which broke when the message contained special characters like parentheses.

Fix by assigning to a variable first before the comparison.
2026-01-28 23:27:42 -08:00
Jatin K MalikandGitHub 7d56cc7bb3 ci: always deploy website on version changes and releases (#84)
The website displays the software version from source code in its
JSON-LD structured data. Previously, when version bumps occurred
(changing only src/vocalinux/version.py), the website was not rebuilt
or deployed because the path filter only detected 'python' changes,
not 'web' changes.

Changes:
- unified-pipeline.yml: Deploy website when either web OR python files
  change (for version updates)
- unified-pipeline.yml: Add version sync step to copy version from
  src/vocalinux/version.py to web/src/app/layout.tsx during build
- release.yml: Always deploy website as part of release workflow

This ensures the website's displayed version stays in sync with the
actual package version.
2026-01-28 20:13:15 -08:00
Jatin K MalikandGitHub 9bae706bbd fix: download install.sh from main to get --tag support (#78)
The v0.3.0-alpha release was created before the --tag feature was
added to install.sh, so installing from that tag fails with "Unknown
option: --tag=v0.3.0-alpha".

Solution: Always download install.sh from main (which has --tag support)
and pass the release tag as a parameter. This ensures users get a working
installer that can install the specific stable release.

Changes:
- web/src/app/page.tsx: Download from main instead of ${latestRelease}
- README.md: Update install commands to download from main
- docs/INSTALL.md: Update install command
- .github/workflows/release.yml: Update release notes
2026-01-28 19:36:06 -08:00
dff07ac960 Fix: Use latest release tag for install commands (#74)
* fix: Use latest release tag for install commands instead of main branch

The web install commands previously pointed to install.sh from the main branch,
which could be unstable/untested code. Now they dynamically fetch the latest
release tag from GitHub API and use that for the install script URLs.

Changes:
- Add getInstallCommands() function that takes a release tag
- Add latestRelease state that fetches from GitHub releases API
- Update all install commands to use the fetched release tag
- Fallback to 'main' if GitHub API fails

* docs: Update README and docs to use latest release tag

Also update GitHub release workflow to use the release tag dynamically.

Changes:
- README.md: Update install commands to use v0.3.0-alpha tag
- docs/INSTALL.md: Update install command to use v0.3.0-alpha tag
- .github/workflows/release.yml: Use ${{ github.ref_name }} for install URL
- Add note pointing to GitHub Releases for latest version

---------

Co-authored-by: Claude Opus <noreply@anthropic.com>
2026-01-26 00:45:34 -08:00
jatinkrmalik e5263b2078 Fix web build/deploy triggers using paths-filter [web] 2026-01-19 23:42:37 -08:00
jatinkrmalik b869c13ff5 Fix CI: Simplify deploy-website condition [web]
Deploy website whenever web-build succeeds on main branch.
The web-build job already has the conditional logic for when to build.
2026-01-19 17:43:38 -08:00
jatinkrmalik 9afc3d4717 Fix CI: Auto-detect web/ changes for website build & deploy [web]
- Build website when files in web/ directory are modified
- Deploy website on workflow_dispatch without requiring [web] tag
- Keep backward compatibility with [web] commit message trigger
2026-01-19 17:37:28 -08:00
Jatin K MalikandGitHub 2dcf0ef17c feat: Enable automated PyPI publishing on release (#46)
- Added publish-pypi job to release workflow
- Builds, verifies, and uploads package to PyPI after GitHub release
- Uses PYPI_API_TOKEN secret for authentication
- Added id-token permission for trusted publishing support
- Package verification with twine check before upload
2025-12-29 21:56:18 -08:00
jatinkrmalik 0c0e65b732 fix: read version from file instead of importing (avoids gi dependency) 2025-12-28 15:32:23 -08:00
Jatin K MalikandGitHub 1dc1d44665 feat: Alpha Launch v0.2.0 - Complete UX Overhaul 🚀🎤 (#39)
* feat: prepare for v0.2.0-alpha release

* feat: prepare for v0.2.0-alpha release

* chore: remove CHANGELOG.md, use GitHub Releases instead

* refactor: use existing About dialog instead of Settings section

* style: enhance About dialog UI readability

* style: fix formatting with black and isort

* feat: show VAD and silence timeout settings for Whisper engine

- Renamed 'VOSK Settings' to 'Recognition Settings'
- VAD Sensitivity and Silence Timeout now apply to both engines
- Added tooltips explaining each setting
- VOSK-specific model info only shown when VOSK selected

* fix: resolve overlapping UI elements in settings dialog

* fix: save VAD and silence timeout settings for both engines

Previously these settings were only saved when VOSK was selected.
Now they persist correctly for Whisper as well.

* fix: show download progress when selecting undownloaded model

Previously when auto-applying settings, models would download silently
in the background without showing the progress dialog. Now:
- Download progress dialog appears for undownloaded models
- Model icons update correctly after download completes

* feat: add download progress, speed, ETA and cancel button

- Show real download progress percentage for VOSK models
- Display download speed (MB/s) and estimated time remaining
- Add Cancel button to abort downloads
- Update status during extraction phase
- Whisper downloads still pulse (uses internal downloader)

* fix: defer model download until needed, don't block startup

- App now starts instantly even if models aren't downloaded
- Models are downloaded on-demand when selected in Settings
- If user tries to dictate without a model, plays error sound
- Added model_ready property to check if engine is usable

* fix: improve first-run UX without downloaded models

- Settings dialog now defaults to smallest available model, not saved config
- Only show saved model if it's actually downloaded
- Add desktop notification when trying to dictate without a model
- Prevents auto-downloading large models on first launch

* feat: add download progress tracking for Whisper models

- Implement custom Whisper model download with progress/speed/ETA
- Uses OpenAI's CDN URLs directly instead of whisper.load_model()
- Progress callback works the same as VOSK downloads
- Supports cancellation during download

* fix: enable download progress callback for Whisper models

Progress callback was only being set for VOSK downloads, not Whisper.
Now both engines show real-time progress, speed, and ETA.

* fix: update tests for defer_download and config manager mocking

- test_main: Mock ConfigManager to prevent saved config from overriding test values
- test_settings_dialog: Mock ModelDownloadDialog to prevent GTK init errors
- test_speech_recognition: Use proper MockVoskModule class instead of MagicMock, pass defer_download=False for download test
- test_whisper_support: Pass defer_download=False to trigger model loading in test

* fix: resolve test failures for CI

- test_main: Fix ConfigManager patch path to use source module
- test_settings_dialog: Mock _is_vosk_model_downloaded and _is_whisper_model_downloaded to skip download flow, add missing dialog attributes
- test_speech_recognition: Replace recognizer with properly configured mock that returns valid JSON, fixing test isolation issues when running all tests together

* fix: mock _download_whisper_model in whisper test to avoid requests exception handling issue

* fix: add gir1.2-girepository-2.0 dep for PyGObject on Ubuntu 24.04

- Add missing girepository-2.0 package for newer Ubuntu runners
- Use --no-build-isolation for PyGObject to use system packages

* fix: skip PyGObject pip install, use system python3-gi package

- Use --no-deps for editable install to skip PyGObject
- Install other deps explicitly without PyGObject
- Add python3-gi-cairo for complete GTK support
- Removes problematic girepository-2.0 build requirement

* fix: install PyGObject via pip with proper build deps

- Remove python3-gi/python3-gi-cairo (doesn't work with setup-python)
- Install PyGObject from pip after installing build dependencies
- Simplify venv setup without --system-site-packages hack

* Fix GObject

* fix: set GI_TYPELIB_PATH for pip-installed PyGObject to find AppIndicator3
2025-12-28 15:29:51 -08:00
Jatin K MalikandGitHub 26355a6b0a Unify CI workflows into a single pipeline with path-based filtering (#28) 2025-06-21 15:24:57 -05:00
Jatin K MalikandGitHub 038bfd8fab Clean Rebuild and Web CI Workflow Implementation (#27)
* Remove external tool dependencies and branding

* Add package lock json

* Add web CI workflow to validate web changes on PRs and commits
2025-06-21 14:54:31 -05:00
jatinkrmalik 7cef6ad66c fix: force orphan deployment to fix file structure in gh-pages 2025-05-25 21:45:22 -05:00
jatinkrmalik b90d497f5a fix: add package-lock.json for GitHub Actions caching
- Allow web/package-lock.json in .gitignore for npm caching
- Add package-lock.json to enable GitHub Actions dependency caching
- This fixes the 'unable to cache dependencies' error in CI
2025-05-25 21:16:27 -05:00
jatinkrmalik ec68dd90f0 Add Next.js website with GitHub Pages deployment
- Added complete Next.js single-page website for Vocalinux
- Configured static export with proper GitHub Pages deployment
- Added GitHub Actions workflow for automated deployment to gh-pages branch
- Configured custom domain (vocalinux.com) with CNAME file
- Added comprehensive build script with npm support
- Responsive design with dark/light theme toggle
- Modern UI components with Tailwind CSS and shadcn/ui
- Proper SEO metadata and accessibility features
2025-05-25 21:11:17 -05:00
Jatin K MalikandGitHub d1c3e286f1 Add Codecov integration for test results and coverage reports (#20) 2025-04-19 00:08:08 -05:00
Jatin K MalikandGitHub a33c0d1b4c Simplify Keyboard Shortcuts to Exclusive Double-tap Ctrl Implementation (#9)
* Implement double-tap Ctrl keyboard shortcut feature

* Simplify keyboard shortcuts to only use double-tap Ctrl

* Update docs

* Fix syntax

* Fix CI build by adding portaudio19-dev dependency
2025-04-18 23:36:49 -05:00
Jatin K MalikandGitHub a28f55b72e Add pre-commit hooks to match GitHub CI pipeline (#7)
* Add pre-commit hooks to match CI pipeline linting rules

* Add pre-commit hooks that match GitHub CI pipeline exactly

* Ran lint check
2025-04-17 00:05:34 -05:00