@gymmymac/bob-widget 3.2.17 → 3.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,11 +5,43 @@ All notable changes to the `@gymmymac/bob-widget` package will be documented in
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [v3.2.17] - 2026-03-21
8
+ ## [v3.2.20] - 2026-03-30
9
+
10
+ ### Fixed
11
+
12
+ - **Mobile height gap between chat drawer and bottom nav** — Replaced CSS percentage height inheritance (`absolute inset-0`) with explicit pixel heights via a new `useContainerHeight` hook backed by `ResizeObserver`. On mobile Safari, `dvh` recalculations during URL-bar show/hide and virtual keyboard transitions caused the container height to fluctuate, detaching the chat drawer from the bottom of the screen. The widget now observes its parent's actual pixel height and applies it directly, immune to `dvh` drift.
13
+ - **Chat drawer GPU layer stability** — Added `will-change: transform, height` to `ContainedChatDrawer` to prevent compositor layer detachment during height transitions.
14
+ - **AskBob demo page updated** — Reference implementation now uses `visualViewport` listeners to set explicit pixel height on the Bob container, serving as a guide for CARFIX production integration.
15
+
16
+ ---
17
+
18
+ ## [v3.2.19] - 2026-03-26
19
+
20
+ ### Fixed
21
+
22
+ - **Premature product shelf spinner fixed** — Decoupled `isResearching` from general message sends. The product shelf loading spinner now only appears when parts are actually being fetched (after vehicle identification or when the backend emits a `researching_parts` SSE event). Previously, the spinner showed on every message send, even during conversational REGO lookup. Added `onPartsResearchStart` callback to separate animation state (thinking) from shelf visibility.
23
+
24
+ ---
25
+
26
+ ## [v3.2.18] - 2026-03-26
27
+
28
+ ### Fixed
29
+
30
+ - **iOS TTS now works on ALL iOS browsers (Safari, Chrome, Firefox)** — Replaced the silent-WAV `HTMLAudioElement` unlock with a shared **Web Audio API `AudioContext`** singleton. The context is `.resume()`'d on the first user gesture and stays unlocked for the page lifetime. All TTS playback now routes through `decodeAudioData()` → `AudioBufferSourceNode`, which succeeds even after async `fetch()` calls. This fixes the root cause: iOS WebKit does not transfer an audio "unlock" between different `Audio` elements.
31
+
32
+ ### Removed
33
+
34
+ - **Canned speech / pre-recorded audio clips fully stripped** — Removed all `audio_hint`, `bob_searching` audio, clip pattern matching, `AudioController` priority system, `getSearchingClip()`, `checkCannedResponse()`, and `fetchAudioClip()`. All responses now go through AI → ElevenLabs TTS exclusively. The `AUDIO DISABLED` rule was also removed from the LLM system prompt (`rules_and_guardrails`).
35
+
36
+ ---
37
+
38
+ ## [v3.2.17] - 2026-03-26
9
39
 
10
40
  ### Fixed
11
41
 
12
42
  - **`identifiedVehicle` now persisted in session** — Previously, navigating away and returning restored messages and conversation state but lost the identified vehicle. This caused `vehicleContext` to be `null` in subsequent requests, breaking `add_to_cart` and other vehicle-dependent tools. The vehicle is now saved/restored alongside all other session data.
43
+ - **Long-press on PTT no longer selects images on mobile** — Added scoped `user-select: none` and `-webkit-touch-callout: none` to the widget root and layout containers. Text selection is re-enabled on `<input>` and `<textarea>` elements. Product tiles, variant cards, and host-page elements remain fully interactive and selectable.
44
+ - **iOS audio playback (TTS) now works** — Added a silent-audio unlock mechanism that triggers on the first user touch within the widget. This satisfies iOS Safari's autoplay policy so that subsequent `Audio.play()` calls from Bob's TTS succeed without requiring each one to originate from a direct gesture.
13
45
 
14
46
  ---
15
47
 
@@ -15,6 +15,8 @@ interface UseBobChatProps {
15
15
  onStreamComplete?: () => void;
16
16
  onShowingProduct?: () => void;
17
17
  onResearchStart?: () => void;
18
+ /** v3.2.18: Fires only when parts/packages are actually being fetched (not on every message) */
19
+ onPartsResearchStart?: () => void;
18
20
  onReadyToSpeak?: () => void;
19
21
  onHighlightPart?: (partType: string) => void;
20
22
  onHighlightProduct?: (product: HighlightedProduct) => void;
@@ -33,7 +35,7 @@ interface UseBobChatProps {
33
35
  [key: string]: unknown;
34
36
  };
35
37
  }
36
- export declare const useBobChat: ({ setAnimationState, manualMode, talkingState, thinkingState, completeState, idleState, listenState, onStreamStart, onStreamComplete, onShowingProduct, onResearchStart, onReadyToSpeak, onHighlightPart, onHighlightProduct, onNoPartsFound, onAutoFetchComplete, onVariantSelectionRequired, shelfCategoriesRef, initialVehicle }: UseBobChatProps) => {
38
+ export declare const useBobChat: ({ setAnimationState, manualMode, talkingState, thinkingState, completeState, idleState, listenState, onStreamStart, onStreamComplete, onShowingProduct, onResearchStart, onPartsResearchStart, onReadyToSpeak, onHighlightPart, onHighlightProduct, onNoPartsFound, onAutoFetchComplete, onVariantSelectionRequired, shelfCategoriesRef, initialVehicle }: UseBobChatProps) => {
37
39
  messages: Message[];
38
40
  input: string;
39
41
  setInput: import('react').Dispatch<import('react').SetStateAction<string>>;
@@ -0,0 +1,13 @@
1
+ import { RefObject } from 'react';
2
+
3
+ /**
4
+ * useContainerHeight — ResizeObserver-based hook that returns the actual
5
+ * pixel height of the referenced element. Falls back to `null` when
6
+ * ResizeObserver is unavailable (the caller should use `height: 100%`).
7
+ *
8
+ * Why: On mobile Safari, `100dvh` / percentage heights fluctuate during
9
+ * URL-bar show/hide and virtual-keyboard transitions. An explicit pixel
10
+ * height keeps the widget layout stable and prevents the "gap" between
11
+ * the chat drawer and the host's bottom navigation.
12
+ */
13
+ export declare function useContainerHeight(ref: RefObject<HTMLElement | null>): number | null;