Files
VoiceStudio/frontend/src-tauri/debian/postinst
T
Palash Debnath 93025d9a81 fix(dictation): stop the widget stranding an empty square, repair the swept data dirs (#1398)
The dictation hotkey could leave a blank dark square stuck on the desktop with no way to dismiss it. Three defects compounded: the tray listener's effect depended on [state], so it detached across an await on every state change and a press landing in that gap was lost; an idle pill renders null, so the window Rust had already shown was empty; and the opaque chrome background made that empty window a hard-edged square. Nothing could hide it — dismiss() is only reachable from the X button, Esc, or a post-session timer, none of which exist for a session that never started.

Fixed at the invariant rather than the call sites: the listener subscribes once for the component's lifetime, the widget window's chrome background is transparent, and an idle-but-visible window reconciles itself to hidden. The reconcile is polled (a dropped press changes no React state, so there is nothing to key an effect off) and aborts if its effect is torn down mid-check, so it can never hide a dictation that has just started.

Also in scope:

- The rename sweep had repointed three data-dir literals at a brand-named directory that does not exist, so smoke-test.sh verified a directory the backend never writes and desktop-prod.sh silently stopped clearing backend state on Windows. Both invisible on macOS, where they are usually run. A guard test now pins the assignments specifically.
- The dictation model picker's download sizes were wrong for all seven models, in both directions — Parakeet TDT v3 (the recommended default) understated 180 MB against an actual 670 MB, while the low-RAM fallbacks were overstated threefold, discouraging exactly the choice that would have helped. Measured from the published repos and pinned by a test.
- The 0.6B Parakeet models now decode on more threads, capped by host cores and still overridable.
- uninstall.ps1 gained a UTF-8 BOM (Windows PowerShell 5.1 mis-decodes its non-ASCII output without one), and sponsor.yml lost its last OmniVoice references.
2026-08-07 05:39:41 +05:30

40 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
# VoiceStudio — .deb post-install hook.
#
# Issue #76: prior versions placed bundled ffprobe at /usr/bin/ffprobe via
# Tauri's externalBin, overwriting the system ffprobe on Ubuntu 26.04 + others.
# We now ship our copy at /usr/lib/omnivoice-studio/bin/ffprobe via deb.files
# (see frontend/src-tauri/tauri.linux.conf.json). This script:
# 1. Removes the legacy /usr/bin/ffprobe ONLY IF dpkg reports it as owned by
# our package (so we never blow away a user's distro-shipped ffprobe).
# 2. Ensures the new binary is executable.
set -e
LEGACY_PATH="/usr/bin/ffprobe"
NEW_PATH="/usr/lib/omnivoice-studio/bin/ffprobe"
case "$1" in
configure)
# Step 1 — defensive cleanup of a legacy package-owned /usr/bin/ffprobe.
# Only remove if dpkg confirms our package owns the file. This protects
# users who have a system ffprobe installed separately (a real risk on
# Ubuntu 26.04 — see #76).
if [ -e "$LEGACY_PATH" ] || [ -L "$LEGACY_PATH" ]; then
OWNER="$(dpkg -S "$LEGACY_PATH" 2>/dev/null | cut -d: -f1 || echo "")"
case "$OWNER" in
omnivoice-studio|omnivoice|OmniVoice*)
rm -f "$LEGACY_PATH" || true
;;
esac
fi
# Step 2 — make sure the new path is executable.
if [ -e "$NEW_PATH" ]; then
chmod 755 "$NEW_PATH" || true
fi
;;
esac
exit 0