nexus/ui/src/hooks
Nexus Dev 137bd3d0f6 fix(nexus): unblank assistant page on piper-tts import error
The usePiperTts hook imported a non-existent 'tts' namespace from
@mintplex-labs/piper-tts-web@1.0.4. The package exports named
functions (stored, download, predict, etc.) at the top level, not
under a tts namespace. The failing named-import threw at module-link
time, which crashed the lazy chunk for PersonalAssistant.tsx and
left /NEX/assistant blank with only a React error boundary fallback.

Two fixes in one file:

1. Import as namespace:
     import * as tts from "@mintplex-labs/piper-tts-web"
   ESM namespace imports synthesize a 'tts' object whose members are
   the package's named exports, so the existing tts.stored() /
   tts.download() / tts.predict() call sites bind to real functions
   without touching the hook body.

2. Wrap predict() Blob result in URL.createObjectURL() before passing
   to new Audio(). predict() returns Promise<Blob>, not a URL string,
   and Audio() cannot accept a Blob directly. Added a shared cleanup
   callback that revokes the object URL on onended/onerror and in the
   catch path so we don't leak blob URLs on every speak invocation.

Bug 1 was the page-blanking crash at module load. Bug 2 was a latent
runtime crash behind the speak button click handler, surfaced while
the file was already being edited.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 10:35:01 +00:00
..
useAgentOrder.ts Preserve sidebar order in company portability 2026-03-23 16:57:59 -05:00
useAutosaveIndicator.ts feat(issues): add issue documents and inline editing 2026-03-13 21:30:48 -05:00
useBrainstormerDefault.test.ts test(23-00): Wave 0 test stubs for Phase 23 components and hooks 2026-04-04 03:55:47 +00:00
useBrainstormerDefault.ts feat(23-02): add ChatTaskCreatedBadge, ChatStatusUpdateBadge, useBrainstormerDefault 2026-04-04 03:55:47 +00:00
useChatBookmarks.ts feat(24-02): API client methods and React Query hooks for search, bookmarks, branches 2026-04-04 03:55:48 +00:00
useChatConversations.ts feat(21-06): add search and agentId filter to listConversations 2026-04-04 03:55:47 +00:00
useChatFileUpload.ts feat(25-02): add chatApi.uploadFile and useChatFileUpload hook 2026-04-04 03:55:48 +00:00
useChatMessages.ts feat(21-05): create chat API client and TanStack Query hooks 2026-04-04 03:55:47 +00:00
useChatSearch.ts feat(24-02): API client methods and React Query hooks for search, bookmarks, branches 2026-04-04 03:55:48 +00:00
useCompanyPageMemory.test.ts Pin imported GitHub skills and add update checks 2026-03-14 13:52:20 -05:00
useCompanyPageMemory.ts Fix company switch remembered routes 2026-03-13 10:01:32 -05:00
useContentJob.ts feat: Phase 44 — Video & Presentations (Remotion MP4, SSE progress) 2026-04-05 09:57:11 +00:00
useDateRange.ts fix(costs): harden company auth check, fix frozen date memo, hide empty quota rows 2026-03-16 15:08:54 -05:00
useHardwareInfo.ts feat(39-02): VoiceStep hardware-aware UI with conditional enable/skip 2026-04-04 03:55:50 +00:00
useInboxBadge.ts Add mail-client keyboard shortcuts to inbox mine tab 2026-03-29 10:57:34 -05:00
useInstallPrompt.test.ts feat(26): merge worktree code from plans 26-00, 26-01, 26-03 2026-04-04 03:55:48 +00:00
useInstallPrompt.ts feat(26): merge worktree code from plans 26-00, 26-01, 26-03 2026-04-04 03:55:48 +00:00
useKeyboardShortcuts.ts feat(21-06): add conversation search input and Cmd+K shortcut 2026-04-04 03:55:47 +00:00
useMediaQuery.ts feat(26-02): create useMediaQuery hook, usePullToRefresh hook, and PullToRefresh component 2026-04-04 03:55:48 +00:00
useNexusMode.ts feat(33-01,33-02): memory service + sanitizer, personal assistant page 2026-04-04 03:55:49 +00:00
useOfflineQueue.test.ts feat(26): merge worktree code from plans 26-00, 26-01, 26-03 2026-04-04 03:55:48 +00:00
useOfflineQueue.ts feat(26): merge worktree code from plans 26-00, 26-01, 26-03 2026-04-04 03:55:48 +00:00
useOnlineStatus.ts feat(26): merge worktree code from plans 26-00, 26-01, 26-03 2026-04-04 03:55:48 +00:00
usePiperTts.ts fix(nexus): unblank assistant page on piper-tts import error 2026-04-11 10:35:01 +00:00
useProjectOrder.ts refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
usePullToRefresh.ts feat(26-02): create useMediaQuery hook, usePullToRefresh hook, and PullToRefresh component 2026-04-04 03:55:48 +00:00
usePushNotifications.test.ts feat(26): merge worktree code from plans 26-00, 26-01, 26-03 2026-04-04 03:55:48 +00:00
usePushNotifications.ts feat(26-04): create push API client, usePushNotifications hook, and NotificationPermissionPrompt 2026-04-04 03:55:48 +00:00
useStreamingChat.test.ts feat(22-01): add useStreamingChat hook, chat API stream method, and unit tests 2026-04-04 03:55:47 +00:00
useStreamingChat.ts feat(37-04): add voiceMode to chatApi.postMessageAndStream + useStreamingChat.startStream 2026-04-04 03:55:50 +00:00
useSystemProviders.ts feat: Phase 42 — Wallpapers, Social, Format Conversion & Voice (12 platforms, convert pipeline, offline badge) 2026-04-05 09:56:53 +00:00
useVadRecorder.ts feat(37-02): encodeWav utility, useVadRecorder + useVoiceMode hooks 2026-04-04 03:55:50 +00:00
useVoiceMode.ts feat(37-02): encodeWav utility, useVadRecorder + useVoiceMode hooks 2026-04-04 03:55:50 +00:00