Skip to content

Commit f3b5cbd

Browse files
authored
feat: add offline voice-to-text with Whisper and UI improvements (#2)
* fix(voice-to-text): resolve 4 critical bugs in recording - Add single-instance detection to prevent duplicate tray icons - Implement window lifecycle management (hide instead of destroy) - Add microphone permission validation and audio stream checking - Move command invocation to Rust for global shortcut independence Fixes issues: global shortcut only working with window open, window not reopening after close, CLI creating duplicate instances, and blank audio transcription with model loaded. * build: add http-server for Tauri dev mode - Add http-server dependency for serving static files - Configure beforeDevCommand to auto-start dev server - Remove center positioning from recording window * feat(voice-to-text): implement audio device selection backend - Add list_audio_devices() to enumerate available microphones - Modify AudioRecorder to accept device_name parameter - Add RMS validation (threshold 0.001) to detect silent audio - Add 50ms delay before stopping stream to prevent sample loss - Persist selected device in WhisperSettings - Add Tauri commands: list_audio_devices, set_audio_device - Add window permissions: allow-hide, allow-show, allow-set-focus - Restore onCloseRequested behavior for minimize-to-tray * feat(voice-to-text): add audio device selection UI - Add microphone dropdown in Settings modal - Load and display available audio devices - Persist device selection on change - Add CSS styling for device selector - Add diagnostic logging for window close handlers * feat(voice-to-text): add recording modes and clipboard integration - Add button mode and shortcut mode for recording - Add cancel_recording command for better control - Add write_clipboard command for transcription results - Add long_recording_threshold setting (default 60s) - Enable macOS private API for better integration - Update recording window size and config * refactor(ui): reorganize toolbar layout and add close file button - Simplify toolbar to horizontal layout (file name on left, actions on right) - Add close file button (X) next to filename - Remove 'Arandu' label from toolbar for cleaner look - Add components.css for reusable component styles - Improve toolbar spacing and button consistency - Add closeFile() function to clear current file state * refactor(tray): update icon to match Arandu logo style - Replace horizontal bar with diamond/losango shape - Make apex more pointed (sharper top) - Use thinner stroke for refined appearance - Icon now matches the Arandu logo design * fix(ui): clear comments state when closing file - Reset selectedBlocks and commentsData - Hide bottom-bar (comments panel) - Hide stale comments banner - Prevents UI state from persisting after file close * fix(ui): restore refresh button padding - Revert padding from merge conflict resolution - Keep consistent with other toolbar buttons * ci(auto-tag): skip tag creation for docs-only changes - Check if apps/shared/scripts changed before creating tag - Skip release build for website/README updates only - Reduces unnecessary CI runs and costs * chore(deps): update Cargo.lock from merge * fix: address CodeRabbit review feedback on PR #2 - Guard against invalid stored shortcuts with fallback to default - Validate shortcut before unregistering previous binding - Add HTTP status validation in model download - Propagate transcriber segment text errors instead of silently dropping - Remove unreliable empty beforeBuildCommand from tauri.conf.json - Fix bottom bar visibility using class toggling instead of inline style - Wire setRecordingState() into all recording event listeners - Add recording-error handler and resetRecordingUi() in recording window - Clear timer on Cancel/Escape to prevent orphaned intervals - Extract duplicated window focus logic into show_main_window helper - Release recorder mutex before calling stop() to avoid blocking - Update AudioRecorder safety comment with cpal version constraint - Rename dirs_next() to home_dir() in cli_installer - Include release-tauri.yml in auto-tag grep pattern * fix: address second round of CodeRabbit review comments - Handle repos without v* tag in auto-tag workflow using git ls-tree - Fix duration log using wrong sample rate before resampling - Validate long-recording threshold input (NaN/negative) - Replace innerHTML with safe DOM creation for device options * fix: prevent XSS in model list and fix shortcut label formatting - Replace innerHTML with createElement + textContent for model info - Use replaceAll to remove all '+' from shortcut labels (Ctrl+Alt+Space) * fix(ui): auto-focus shortcut input when entering recording mode
1 parent b5417a2 commit f3b5cbd

21 files changed

Lines changed: 3578 additions & 91 deletions

.github/workflows/auto-tag.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,28 @@ jobs:
1414
fetch-depth: 0
1515
token: ${{ secrets.PAT }}
1616

17+
- name: Check if apps changed
18+
id: check_changes
19+
run: |
20+
LATEST_TAG=$(git tag --sort=-v:refname | grep '^v' | head -1)
21+
22+
# Check if any app-related files changed since last tag
23+
if [ -z "$LATEST_TAG" ]; then
24+
CHANGED_FILES=$(git ls-tree -r --name-only HEAD)
25+
else
26+
CHANGED_FILES=$(git diff --name-only "${LATEST_TAG}..HEAD")
27+
fi
28+
29+
if echo "$CHANGED_FILES" | grep -qE '^(apps/|shared/|scripts/set-version\.sh|\.github/workflows/(release|release-tauri|auto-tag)\.yml)'; then
30+
echo "apps_changed=true" >> "$GITHUB_OUTPUT"
31+
else
32+
echo "apps_changed=false" >> "$GITHUB_OUTPUT"
33+
echo "Only documentation/website changes detected, skipping release"
34+
fi
35+
1736
- name: Calculate next version
1837
id: version
38+
if: steps.check_changes.outputs.apps_changed == 'true'
1939
run: |
2040
LATEST_TAG=$(git tag --sort=-v:refname | grep '^v' | head -1)
2141
[ -z "$LATEST_TAG" ] && LATEST_TAG="v0.0.0"
@@ -64,7 +84,7 @@ jobs:
6484
echo "Bump: $BUMP ($LATEST_TAG -> v$NEXT)"
6585
6686
- name: Create and push tag
67-
if: steps.version.outputs.skip != 'true'
87+
if: steps.check_changes.outputs.apps_changed == 'true' && steps.version.outputs.skip != 'true'
6888
run: |
6989
git config user.name "github-actions[bot]"
7090
git config user.email "github-actions[bot]@users.noreply.github.com"

.github/workflows/release-tauri.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
if: matrix.platform == 'ubuntu-22.04'
8282
run: |
8383
sudo apt-get update
84-
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
84+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libasound2-dev cmake
8585
8686
- uses: actions/setup-node@v4
8787
with:

0 commit comments

Comments
 (0)