Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: add per-browser hide toggle for voice widget

Adam Eivy318e0cdcd5f9
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index abe4ebe186..24f958c852 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -1,5 +1,6 @@
## Added
+- **Hide voice widget per-browser** — the floating voice widget can now be dismissed entirely by clicking the new eye-off icon (next to the mobile FAB or in the desktop controls bar). The preference persists in `localStorage` under `portos.voice.hidden`, so iPhones/Safari sessions where the mic APIs don't work can stay clean while the desktop keeps the widget. Re-enable via **Settings → Voice → "Show floating voice widget"**; a custom `portos:voice:visibility` DOM event syncs the change live without a reload.
- **Daily Log — voice-dictatable diary in the Brain section** — new `Brain → Daily Log` tab at `/brain/daily-log` for free-form typed or dictated daily entries. One entry per date, stored in `data/brain/journals.json` with per-segment source metadata (`text` vs `voice`). Five voice tools land in the CoS: `daily_log_open` ("open my daily log" — navigates + optionally starts dictation), `daily_log_start_dictation` / `daily_log_stop_dictation`, `daily_log_append` (one-shot append without dictation mode), and `daily_log_read` (reads the entry verbatim via TTS). Dictation mode short-circuits the LLM at the server — every voice utterance appends straight to the log until the user says "stop dictation" — so the CoS stops talking back while you ramble. Tools can now emit client-side side effects (`voice:navigate`, `voice:dictation`); the Voice widget listens and routes the browser + surfaces a "Dictating to Daily Log" chip. Optional Obsidian mirror: each entry auto-writes to `<vault>/<folder>/<YYYY-MM-DD>.md` when a vault is configured in the tab's settings panel (reuses the existing Notes vault registry), picking up iCloud backup for free. Entries flow through `brainMemoryBridge.js` (new `journals` brain type, `daily-log` category) so the CoS memory system vector-embeds each day and agents can semantically search across the log history. New routes: `GET/PUT/DELETE /api/brain/daily-log/:date`, `POST /api/brain/daily-log/:date/append`, `GET/PUT /api/brain/daily-log/settings`, `POST /api/brain/daily-log/sync-obsidian`.
- **Voice CoS tool expansion — round two** — nine more hands-free tools registered in `server/services/voice/tools.js`, further expanding the Voice CoS toolset:
- `brain_list_recent` — "Read me my last five captures"; returns the newest inbox entries with date + text.
diff --git a/client/src/components/settings/VoiceTab.jsx b/client/src/components/settings/VoiceTab.jsx
index 7777eda79c..e56e5bc196 100644
--- a/client/src/components/settings/VoiceTab.jsx
+++ b/client/src/components/settings/VoiceTab.jsx
@@ -34,6 +34,9 @@ const KOKORO_DTYPES = [
const ACCENT_LABELS = { 'en-US': 'American', 'en-GB': 'British' };
+const HIDDEN_KEY = 'portos.voice.hidden';
+const VISIBILITY_EVENT = 'portos:voice:visibility';
+
const formatVoiceLabel = (v, engine) => {
if (engine === 'piper') {
// Always lead with the voice ID so entries are distinguishable even if the
@@ -95,6 +98,17 @@ export function VoiceTab() {
const [testing, setTesting] = useState(false);
const [previewingVoice, setPreviewingVoice] = useState(null);
const [downloadingVoice, setDownloadingVoice] = useState(null);
+ const [widgetHidden, setWidgetHidden] = useState(() => {
+ if (typeof window === 'undefined') return false;
+ return window.localStorage.getItem(HIDDEN_KEY) === '1';
+ });
+
+ const toggleWidgetHidden = (next) => {
+ if (next) window.localStorage.setItem(HIDDEN_KEY, '1');
+ else window.localStorage.removeItem(HIDDEN_KEY);
+ window.dispatchEvent(new Event(VISIBILITY_EVENT));
+ setWidgetHidden(next);
+ };
const currentEngine = cfg?.tts?.engine;
@@ -219,6 +233,19 @@ export function VoiceTab() {
</span>
</label>
+ <label className="flex items-center gap-3 cursor-pointer">
+ <input
+ type="checkbox"
+ checked={!widgetHidden}
+ onChange={(e) => toggleWidgetHidden(!e.target.checked)}
+ className="w-4 h-4"
+ />
+ <span className="text-sm text-white">Show floating voice widget</span>
+ <span className="text-xs text-gray-500">
+ (per-browser preference — Safari on iPhone does not support the mic APIs this widget uses)
+ </span>
+ </label>
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
{status?.services && Object.entries(status.services).map(([k, probe]) => (
<ServiceBadge key={k} label={SERVICE_LABELS[k] || k} probe={probe} />
diff --git a/client/src/components/voice/VoiceWidget.jsx b/client/src/components/voice/VoiceWidget.jsx
index 4bc16cc38f..965b24673f 100644
--- a/client/src/components/voice/VoiceWidget.jsx
+++ b/client/src/components/voice/VoiceWidget.jsx
@@ -1,6 +1,6 @@
import { useState, useEffect, useRef, useCallback } from 'react';
import { useNavigate } from 'react-router-dom';
-import { Mic, MicOff, Brain, Volume2, Square, Trash2, ChevronDown, ChevronUp, Send, Infinity as InfinityIcon, NotebookPen, X } from 'lucide-react';
+import { Mic, MicOff, Brain, Volume2, Square, Trash2, ChevronDown, ChevronUp, Send, Infinity as InfinityIcon, NotebookPen, X, EyeOff } from 'lucide-react';
import {
startCapture, stopCapture, interrupt, resetConversation, sendText, onVoiceEvent, isCapturing,
startContinuous, stopContinuous, isContinuous, whenPlaybackDrained, getVadLevel,
@@ -13,6 +13,8 @@ import toast from '../ui/Toast';
const QUIET_MIC_THRESHOLD = 0.02;
const HANDS_FREE_KEY = 'portos.voice.handsFree';
+const HIDDEN_KEY = 'portos.voice.hidden';
+const VISIBILITY_EVENT = 'portos:voice:visibility';
const STAGE = {
idle: { icon: Mic, label: '', tone: 'text-gray-300' },
@@ -53,6 +55,10 @@ export default function VoiceWidget() {
const stored = window.localStorage.getItem(HANDS_FREE_KEY);
return stored === null ? true : stored === '1';
});
+ const [hidden, setHidden] = useState(() => {
+ if (typeof window === 'undefined') return false;
+ return window.localStorage.getItem(HIDDEN_KEY) === '1';
+ });
const [level, setLevel] = useState(0);
const scrollRef = useRef(null);
const useWebSpeech = sttEngine === 'web-speech' && webSpeechSupported;
@@ -302,7 +308,32 @@ export default function VoiceWidget() {
return () => window.removeEventListener('keydown', onKey);
}, [enabled, hotkey, toggleCapture]);
- if (!enabled) return null;
+ // Settings → Voice can toggle widget visibility without a reload. Listen for
+ // the custom event and the storage event (covers other tabs).
+ useEffect(() => {
+ const sync = () => {
+ setHidden(window.localStorage.getItem(HIDDEN_KEY) === '1');
+ };
+ window.addEventListener(VISIBILITY_EVENT, sync);
+ window.addEventListener('storage', sync);
+ return () => {
+ window.removeEventListener(VISIBILITY_EVENT, sync);
+ window.removeEventListener('storage', sync);
+ };
+ }, []);
+
+ const hideWidget = useCallback(() => {
+ if (isWebSpeechCapturing()) stopWebSpeechCapture();
+ if (isContinuous()) stopContinuous();
+ if (isCapturing()) stopCapture({ submit: false });
+ interrupt();
+ window.localStorage.setItem(HIDDEN_KEY, '1');
+ window.dispatchEvent(new Event(VISIBILITY_EVENT));
+ setHidden(true);
+ toast('Voice widget hidden. Re-enable in Settings → Voice.');
+ }, []);
+
+ if (!enabled || hidden) return null;
const { icon: Icon, label, tone } = STAGE[stage] || STAGE.idle;
const capturing = ACTIVE_STAGES.has(stage) || isWebSpeechCapturing();
@@ -312,6 +343,13 @@ export default function VoiceWidget() {
{!expanded && (
<div className="md:hidden flex items-center gap-2">
{capturing && <span className={`text-xs ${tone} bg-port-card/95 backdrop-blur border border-port-border rounded-full px-2 py-1`}>{label}</span>}
+ <button
+ onClick={hideWidget}
+ title="Hide voice widget (restore in Settings → Voice)"
+ className="p-2 rounded-full bg-port-card border border-port-border text-gray-400 hover:text-white shadow-lg"
+ >
+ <EyeOff size={14} />
+ </button>
<button
onClick={() => { setExpanded(true); toggleCapture(); }}
className={`p-3 rounded-full shadow-lg transition-colors ${
@@ -450,6 +488,13 @@ export default function VoiceWidget() {
>
<X size={14} />
</button>
+ <button
+ onClick={hideWidget}
+ title="Hide voice widget (restore in Settings → Voice)"
+ className="p-2 rounded-full text-gray-400 hover:text-white hover:bg-port-border/70"
+ >
+ <EyeOff size={14} />
+ </button>
</div>
</div>
</div>