@testerpaykit/expo 0.6.1 → 0.7.1

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
@@ -2,6 +2,97 @@
2
2
 
3
3
  All notable changes to `@testerpaykit/expo` are documented here.
4
4
 
5
+ ## 0.7.1 — 2026-09-22
6
+
7
+ **A backgrounded host app must never be asked for a bitmap.**
8
+
9
+ ### Fixed
10
+ - `captureView()` now refuses to capture while the host app is not in the
11
+ foreground, and re-checks after the redaction microtask (the bug-report
12
+ sheet's auto-capture waits 50 ms on its own — long enough for the user to
13
+ leave). `captureRef` ends up in UIKit's
14
+ `drawViewHierarchyInRect:afterScreenUpdates:`, which re-parents the view into
15
+ a temporary window; with no foreground scene UIKit raises an NSException on
16
+ the main thread, inside a React UI block — unreachable for JS, so the **host
17
+ app aborts**. That is the one thing this SDK promises never to do.
18
+
19
+ Found from a tester's iPhone (iOS 27, umkreis build 28, 2026-09-20): three
20
+ SIGABRT crash reports, all `procRole: Non UI`, all with
21
+ `drawViewHierarchyInRect:` below `-[RCTUIManagerProxy addUIBlock:]`. A
22
+ skipped capture returns `null` and logs through `console.debug` — the same
23
+ contract as a missing `react-native-view-shot`, so callers need no change.
24
+
25
+ ## 0.7.0 — 2026-08-06
26
+
27
+ **Three umkreis dogfood findings: a real bug report could be a
28
+ fabrication, the report window hid the bug it described, and the
29
+ language picker never actually did anything.**
30
+
31
+ ### Added
32
+ - `VoiceBugInputSheetProps.sheetOpacity?: number` (default `1`,
33
+ unchanged) — scales the backdrop and sheet alpha together so a host
34
+ can keep the screen behind the sheet legible while a tester records.
35
+ Previously the sheet was fully opaque no matter what.
36
+ - `VoiceBugInputSheetProps.voiceLanguage?: 'auto' | string` — forces
37
+ the Whisper language hint (any ISO-639-1 code, not just `'de'`/
38
+ `'en'`) instead of leaving it to the tester's chip tap. Useful for a
39
+ host whose tester pool speaks one known language.
40
+ - `VoiceExtractResult.transcriptConfidence: number` and
41
+ `.lowConfidence: boolean` — the server's own confidence in the
42
+ Whisper transcript. Below the server's threshold, `title`/
43
+ `description` are the RAW transcript rather than an LLM paraphrase;
44
+ surface this in host UI so a tester (or a coordinator, via the new
45
+ `bug_reports.transcript_confidence` column) can tell a clean
46
+ transcript from a guess.
47
+ - `VoiceExtractResult.detectedLanguage?: string` — Whisper's own
48
+ language guess, present whenever the request sent no explicit hint.
49
+
50
+ ### Changed
51
+ - The sheet's language chip now defaults to the **device locale**
52
+ (best-effort `expo-localization`, peer-optional) instead of always
53
+ starting at `'auto'`. In practice nobody taps a small chip mid-bug-
54
+ report, so `'auto'` was the value every real recording shipped with
55
+ — and Whisper's own auto-detect degrades on short/noisy clips.
56
+ - `VoiceExtractAudio.language` widened from `'de' | 'en'` to `string`
57
+ so a detected device locale or a host's `voiceLanguage` can pass
58
+ through unconstrained.
59
+
60
+ ### Fixed
61
+ - **The language picker chip did nothing.** The client sent
62
+ `{ language: 'de' }`; the server route reads `body['source_language']`
63
+ — so the DE/EN toggle never reached Whisper, even on the rare
64
+ occasion a tester tapped it. Renamed to the field the server
65
+ actually reads.
66
+ - `VoiceExtractResult.sourceLanguage` was only ever set when the
67
+ request carried an explicit language hint — meaning it, and the
68
+ `bug_reports.tester_language` column it feeds, stayed `null` for
69
+ every voice report recorded in `'auto'` mode (which was all of
70
+ them). Now falls back to the server's own `detectedLanguage`.
71
+
72
+ ## 0.6.1 — 2026-07-28
73
+
74
+ **Four umkreis dogfood findings from a real TestFlight integration
75
+ (Expo SDK 57), ordered by severity.**
76
+
77
+ ### Fixed
78
+ - **Bug submission failed silently** without `crypto.getRandomValues`
79
+ — the `uuid` package was gone from the runtime. New `src/uuid.ts`
80
+ generates v4 ids via a graceful chain (`crypto.randomUUID` →
81
+ `crypto.getRandomValues` → `expo-crypto` → seeded `Math.random`);
82
+ the `react-native-get-random-values` polyfill is no longer needed.
83
+ - Voice notes used the dead `expo-av` API. `VoiceBugInputSheet` now
84
+ uses `expo-audio` (`AudioModule.AudioRecorder`, flattened
85
+ `RecordingPresets`); file reads go through new shared
86
+ `fs-legacy.ts` (`expo-file-system/legacy` first, SDK 54's split),
87
+ deduplicating three copies of the same fallback logic.
88
+ - Optional peer dependencies failed silently at the worst moment —
89
+ new `setup-check.ts` logs once at init (dev only) which optional
90
+ modules are missing and which feature each absence turns off.
91
+ - FAB menu ran off-screen on the right half of the display (iPhone
92
+ 17 Pro Max) — the anchor now pins via the horizontal counterpart of
93
+ the existing `openUp` logic, plus a `maxWidth` so labels wrap
94
+ instead of clipping.
95
+
5
96
  ## 0.6.0 — 2026-07-10
6
97
 
7
98
  **Hosts can place the feedback FAB — and it finally sits where you put it.**
package/dist/index.d.mts CHANGED
@@ -1633,11 +1633,17 @@ interface VoiceExtractAudio {
1633
1633
  /** MIME type of the audio. Whisper accepts m4a / aac / wav / mp3 /
1634
1634
  * webm; the server forwards whatever we send. */
1635
1635
  mimeType: string;
1636
- /** Optional ISO-639-1 language hint forwarded to Whisper. When
1637
- * set, transcription skips language detection and treats the
1638
- * audio as the given language — faster + more accurate when the
1639
- * tester knows their own language. Omit to let Whisper detect. */
1640
- language?: 'de' | 'en';
1636
+ /**
1637
+ * Optional ISO-639-1 language hint forwarded to Whisper (any code
1638
+ * Whisper accepts, e.g. `'de'`, `'tr'`, `'ru'` — not just DE/EN;
1639
+ * widened from the original `'de' | 'en'` union so a host's
1640
+ * `voiceLanguage` prop or a detected device locale can pass through
1641
+ * unconstrained). When set, transcription skips language detection
1642
+ * and treats the audio as the given language — faster + more
1643
+ * accurate when the tester's language is known. Omit to let
1644
+ * Whisper detect.
1645
+ */
1646
+ language?: string;
1641
1647
  }
1642
1648
  interface VoiceExtractResult {
1643
1649
  /** Raw Whisper transcript. */
@@ -1649,11 +1655,38 @@ interface VoiceExtractResult {
1649
1655
  /** Server enum — same set the BugReportSheet's Frequency chips use. */
1650
1656
  frequency: 'always' | 'often' | 'sometimes' | 'rarely';
1651
1657
  /**
1652
- * Voice-bug split (A2): ISO-639-1 code the tester spoke in. The
1653
- * server doesn't echo it, so we carry the request hint through —
1654
- * it rides to submit as the O-Ton language label.
1658
+ * Voice-bug split (A2): ISO-639-1 code the tester spoke in. When
1659
+ * the request carried an explicit hint that wins; otherwise this
1660
+ * is the server's OWN Whisper-detected guess (`detectedLanguage`
1661
+ * below) — umkreis finding #1's third ask was "fill this in even
1662
+ * in auto mode", not just when the host bothered to set the chip.
1655
1663
  */
1656
1664
  sourceLanguage?: string;
1665
+ /**
1666
+ * 0..1 confidence the server had in the Whisper transcript. Below
1667
+ * ~0.5 (see bug_enrichment.dart's `lowConfidenceThreshold`), title
1668
+ * and description above are the RAW transcript, not an LLM
1669
+ * paraphrase — the server skipped extraction rather than asking a
1670
+ * model to polish something it couldn't reliably read (umkreis
1671
+ * finding #1, 2026-08-06). Thread this through to
1672
+ * `BugReportDraft.transcriptConfidence` so it lands on the stored
1673
+ * report for a coordinator to see.
1674
+ */
1675
+ transcriptConfidence: number;
1676
+ /**
1677
+ * Convenience flag — `transcriptConfidence < lowConfidenceThreshold`,
1678
+ * computed server-side so the client doesn't need to know the
1679
+ * threshold. Host UI can show "this looks garbled, please
1680
+ * re-record?" when true.
1681
+ */
1682
+ lowConfidence: boolean;
1683
+ /**
1684
+ * ISO-639-1 code Whisper guessed on its own — only present when the
1685
+ * request sent no language hint (i.e. `audio.language` was unset /
1686
+ * `'auto'`). Unmapped Whisper language names pass through
1687
+ * lowercased rather than being dropped.
1688
+ */
1689
+ detectedLanguage?: string;
1657
1690
  }
1658
1691
  /**
1659
1692
  * Send an audio recording to the voice-extract endpoint and return
@@ -1700,13 +1733,35 @@ interface VoiceBugInputSheetProps {
1700
1733
  /** Accent colour for the mic + active chip. Default `#D83232`
1701
1734
  * (bug-red). Hosts that want a brand-tint can override. */
1702
1735
  accentColor?: string;
1736
+ /**
1737
+ * Opacity of the backdrop + sheet, together, on a 0..1 scale.
1738
+ * Default `1` — fully opaque, unchanged from before this prop
1739
+ * existed. A tester describing a bug describes what's on the
1740
+ * screen behind this sheet; at `1` that screen is completely
1741
+ * hidden while they're doing it. Lower values (e.g. `0.35`, close
1742
+ * to the ~30% overall coverage a host asked for) keep both layers
1743
+ * translucent together so the failing screen stays legible.
1744
+ * (umkreis finding #2, 2026-08-06.)
1745
+ */
1746
+ sheetOpacity?: number;
1747
+ /**
1748
+ * Force the Whisper language hint instead of letting the tester
1749
+ * pick via the chip. Any ISO-639-1 code Whisper accepts (`'de'`,
1750
+ * `'tr'`, …), or `'auto'` to explicitly keep auto-detect. Use this
1751
+ * when the host knows its audience speaks one language —
1752
+ * `voiceLanguage="de"` for an all-German tester pool, say.
1753
+ * Overrides the device-locale default below entirely; the tester
1754
+ * can still tap the chip to cycle away from it.
1755
+ * (umkreis finding #2, 2026-08-06.)
1756
+ */
1757
+ voiceLanguage?: 'auto' | string;
1703
1758
  /** Host-side string overrides. Any missing key falls back to the
1704
1759
  * German default copy. */
1705
1760
  strings?: VoiceBugStrings;
1706
1761
  style?: StyleProp<ViewStyle>;
1707
1762
  testID?: string;
1708
1763
  }
1709
- declare function VoiceBugInputSheet({ visible, tpk, onCancel, onExtracted, maxSeconds, accentColor, strings, style, testID, }: VoiceBugInputSheetProps): React.ReactElement;
1764
+ declare function VoiceBugInputSheet({ visible, tpk, onCancel, onExtracted, maxSeconds, accentColor, sheetOpacity, voiceLanguage, strings, style, testID, }: VoiceBugInputSheetProps): React.ReactElement;
1710
1765
  /** Maps the sheet's classification onto the BugReportSheet's
1711
1766
  * BugReportType union. Exported so the host can call it when
1712
1767
  * building the initialDraft for the bug sheet. */
package/dist/index.d.ts CHANGED
@@ -1633,11 +1633,17 @@ interface VoiceExtractAudio {
1633
1633
  /** MIME type of the audio. Whisper accepts m4a / aac / wav / mp3 /
1634
1634
  * webm; the server forwards whatever we send. */
1635
1635
  mimeType: string;
1636
- /** Optional ISO-639-1 language hint forwarded to Whisper. When
1637
- * set, transcription skips language detection and treats the
1638
- * audio as the given language — faster + more accurate when the
1639
- * tester knows their own language. Omit to let Whisper detect. */
1640
- language?: 'de' | 'en';
1636
+ /**
1637
+ * Optional ISO-639-1 language hint forwarded to Whisper (any code
1638
+ * Whisper accepts, e.g. `'de'`, `'tr'`, `'ru'` — not just DE/EN;
1639
+ * widened from the original `'de' | 'en'` union so a host's
1640
+ * `voiceLanguage` prop or a detected device locale can pass through
1641
+ * unconstrained). When set, transcription skips language detection
1642
+ * and treats the audio as the given language — faster + more
1643
+ * accurate when the tester's language is known. Omit to let
1644
+ * Whisper detect.
1645
+ */
1646
+ language?: string;
1641
1647
  }
1642
1648
  interface VoiceExtractResult {
1643
1649
  /** Raw Whisper transcript. */
@@ -1649,11 +1655,38 @@ interface VoiceExtractResult {
1649
1655
  /** Server enum — same set the BugReportSheet's Frequency chips use. */
1650
1656
  frequency: 'always' | 'often' | 'sometimes' | 'rarely';
1651
1657
  /**
1652
- * Voice-bug split (A2): ISO-639-1 code the tester spoke in. The
1653
- * server doesn't echo it, so we carry the request hint through —
1654
- * it rides to submit as the O-Ton language label.
1658
+ * Voice-bug split (A2): ISO-639-1 code the tester spoke in. When
1659
+ * the request carried an explicit hint that wins; otherwise this
1660
+ * is the server's OWN Whisper-detected guess (`detectedLanguage`
1661
+ * below) — umkreis finding #1's third ask was "fill this in even
1662
+ * in auto mode", not just when the host bothered to set the chip.
1655
1663
  */
1656
1664
  sourceLanguage?: string;
1665
+ /**
1666
+ * 0..1 confidence the server had in the Whisper transcript. Below
1667
+ * ~0.5 (see bug_enrichment.dart's `lowConfidenceThreshold`), title
1668
+ * and description above are the RAW transcript, not an LLM
1669
+ * paraphrase — the server skipped extraction rather than asking a
1670
+ * model to polish something it couldn't reliably read (umkreis
1671
+ * finding #1, 2026-08-06). Thread this through to
1672
+ * `BugReportDraft.transcriptConfidence` so it lands on the stored
1673
+ * report for a coordinator to see.
1674
+ */
1675
+ transcriptConfidence: number;
1676
+ /**
1677
+ * Convenience flag — `transcriptConfidence < lowConfidenceThreshold`,
1678
+ * computed server-side so the client doesn't need to know the
1679
+ * threshold. Host UI can show "this looks garbled, please
1680
+ * re-record?" when true.
1681
+ */
1682
+ lowConfidence: boolean;
1683
+ /**
1684
+ * ISO-639-1 code Whisper guessed on its own — only present when the
1685
+ * request sent no language hint (i.e. `audio.language` was unset /
1686
+ * `'auto'`). Unmapped Whisper language names pass through
1687
+ * lowercased rather than being dropped.
1688
+ */
1689
+ detectedLanguage?: string;
1657
1690
  }
1658
1691
  /**
1659
1692
  * Send an audio recording to the voice-extract endpoint and return
@@ -1700,13 +1733,35 @@ interface VoiceBugInputSheetProps {
1700
1733
  /** Accent colour for the mic + active chip. Default `#D83232`
1701
1734
  * (bug-red). Hosts that want a brand-tint can override. */
1702
1735
  accentColor?: string;
1736
+ /**
1737
+ * Opacity of the backdrop + sheet, together, on a 0..1 scale.
1738
+ * Default `1` — fully opaque, unchanged from before this prop
1739
+ * existed. A tester describing a bug describes what's on the
1740
+ * screen behind this sheet; at `1` that screen is completely
1741
+ * hidden while they're doing it. Lower values (e.g. `0.35`, close
1742
+ * to the ~30% overall coverage a host asked for) keep both layers
1743
+ * translucent together so the failing screen stays legible.
1744
+ * (umkreis finding #2, 2026-08-06.)
1745
+ */
1746
+ sheetOpacity?: number;
1747
+ /**
1748
+ * Force the Whisper language hint instead of letting the tester
1749
+ * pick via the chip. Any ISO-639-1 code Whisper accepts (`'de'`,
1750
+ * `'tr'`, …), or `'auto'` to explicitly keep auto-detect. Use this
1751
+ * when the host knows its audience speaks one language —
1752
+ * `voiceLanguage="de"` for an all-German tester pool, say.
1753
+ * Overrides the device-locale default below entirely; the tester
1754
+ * can still tap the chip to cycle away from it.
1755
+ * (umkreis finding #2, 2026-08-06.)
1756
+ */
1757
+ voiceLanguage?: 'auto' | string;
1703
1758
  /** Host-side string overrides. Any missing key falls back to the
1704
1759
  * German default copy. */
1705
1760
  strings?: VoiceBugStrings;
1706
1761
  style?: StyleProp<ViewStyle>;
1707
1762
  testID?: string;
1708
1763
  }
1709
- declare function VoiceBugInputSheet({ visible, tpk, onCancel, onExtracted, maxSeconds, accentColor, strings, style, testID, }: VoiceBugInputSheetProps): React.ReactElement;
1764
+ declare function VoiceBugInputSheet({ visible, tpk, onCancel, onExtracted, maxSeconds, accentColor, sheetOpacity, voiceLanguage, strings, style, testID, }: VoiceBugInputSheetProps): React.ReactElement;
1710
1765
  /** Maps the sheet's classification onto the BugReportSheet's
1711
1766
  * BugReportType union. Exported so the host can call it when
1712
1767
  * building the initialDraft for the bug sheet. */