yaver-feedback-react-native 0.8.13 → 0.9.2

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.
Files changed (76) hide show
  1. package/app.plugin.js +126 -9
  2. package/dist/BlackBox.js +9 -1
  3. package/dist/DeployPanel.js +65 -0
  4. package/dist/Discovery.js +13 -2
  5. package/dist/FeedbackModal.js +477 -66
  6. package/dist/MachinePickerScreen.js +14 -5
  7. package/dist/P2PClient.d.ts +94 -1
  8. package/dist/P2PClient.js +281 -2
  9. package/dist/ShakeDetector.js +2 -0
  10. package/dist/VibeChatScreen.d.ts +6 -1
  11. package/dist/VibeChatScreen.js +204 -1
  12. package/dist/YaverFeedback.d.ts +98 -0
  13. package/dist/YaverFeedback.js +509 -46
  14. package/dist/__tests__/BlackBox.relayPassword.test.d.ts +1 -0
  15. package/dist/__tests__/BlackBox.relayPassword.test.js +105 -0
  16. package/dist/__tests__/BlackBoxAutoStart.test.d.ts +1 -0
  17. package/dist/__tests__/BlackBoxAutoStart.test.js +91 -0
  18. package/dist/__tests__/BlackBoxAutoStartColdStart.test.d.ts +1 -0
  19. package/dist/__tests__/BlackBoxAutoStartColdStart.test.js +156 -0
  20. package/dist/__tests__/BrowserLaneIcon.test.d.ts +3 -0
  21. package/dist/__tests__/BrowserLaneIcon.test.js +80 -0
  22. package/dist/__tests__/P2PClient.test.js +2 -2
  23. package/dist/__tests__/ReportIdentity.test.d.ts +1 -0
  24. package/dist/__tests__/ReportIdentity.test.js +168 -0
  25. package/dist/__tests__/SDKToken.test.js +1 -1
  26. package/dist/__tests__/ShakeToggle.test.d.ts +1 -0
  27. package/dist/__tests__/ShakeToggle.test.js +121 -0
  28. package/dist/__tests__/pickTargetDevice.test.d.ts +1 -0
  29. package/dist/__tests__/pickTargetDevice.test.js +89 -0
  30. package/dist/__tests__/reloadActions.test.d.ts +1 -0
  31. package/dist/__tests__/reloadActions.test.js +129 -0
  32. package/dist/__tests__/reloadActionsParity.test.d.ts +1 -0
  33. package/dist/__tests__/reloadActionsParity.test.js +42 -0
  34. package/dist/__tests__/types.test.js +5 -5
  35. package/dist/_core/device.d.ts +19 -9
  36. package/dist/_core/device.js +20 -14
  37. package/dist/capture.d.ts +6 -0
  38. package/dist/capture.js +53 -0
  39. package/dist/index.d.ts +4 -0
  40. package/dist/index.js +11 -1
  41. package/dist/reloadActions.d.ts +88 -0
  42. package/dist/reloadActions.js +200 -0
  43. package/dist/storeShots.d.ts +67 -0
  44. package/dist/storeShots.js +137 -0
  45. package/dist/types.d.ts +215 -3
  46. package/dist/voice.d.ts +61 -0
  47. package/dist/voice.js +246 -0
  48. package/package.json +14 -3
  49. package/src/BlackBox.ts +10 -1
  50. package/src/DeployPanel.tsx +74 -0
  51. package/src/Discovery.ts +13 -2
  52. package/src/FeedbackModal.tsx +563 -87
  53. package/src/MachinePickerScreen.tsx +12 -3
  54. package/src/P2PClient.ts +314 -2
  55. package/src/ShakeDetector.ts +1 -0
  56. package/src/VibeChatScreen.tsx +219 -0
  57. package/src/YaverFeedback.ts +498 -46
  58. package/src/__tests__/BlackBox.relayPassword.test.ts +129 -0
  59. package/src/__tests__/BlackBoxAutoStart.test.ts +111 -0
  60. package/src/__tests__/BlackBoxAutoStartColdStart.test.ts +191 -0
  61. package/src/__tests__/BrowserLaneIcon.test.ts +85 -0
  62. package/src/__tests__/P2PClient.test.ts +2 -2
  63. package/src/__tests__/ReportIdentity.test.ts +203 -0
  64. package/src/__tests__/SDKToken.test.ts +1 -1
  65. package/src/__tests__/ShakeToggle.test.ts +153 -0
  66. package/src/__tests__/pickTargetDevice.test.ts +101 -0
  67. package/src/__tests__/reloadActions.test.ts +171 -0
  68. package/src/__tests__/reloadActionsParity.test.ts +49 -0
  69. package/src/__tests__/types.test.ts +5 -5
  70. package/src/_core/device.ts +20 -14
  71. package/src/capture.ts +51 -0
  72. package/src/index.ts +21 -0
  73. package/src/reloadActions.ts +273 -0
  74. package/src/storeShots.ts +189 -0
  75. package/src/types.ts +217 -3
  76. package/src/voice.ts +270 -0
@@ -1,6 +1,7 @@
1
1
  import React, { useCallback, useEffect, useState } from 'react';
2
2
  import {
3
3
  ActivityIndicator,
4
+ Alert,
4
5
  Pressable,
5
6
  ScrollView,
6
7
  StyleSheet,
@@ -184,6 +185,47 @@ export const DeployPanel: React.FC<DeployPanelProps> = ({ onClose }) => {
184
185
  );
185
186
  };
186
187
 
188
+ // First-class App Store screenshots: walk the app's routes on THIS
189
+ // device, screenshot each, upload to the agent (which runs the ASC
190
+ // backend). Closes the overlay first so the captures are clean (no
191
+ // modal in frame), then reports via an alert.
192
+ const runStoreShots = () => {
193
+ const cfg = YaverFeedback.getConfig() as { storeShots?: any } | null;
194
+ const ss = cfg?.storeShots;
195
+ if (!ss?.routes?.length) {
196
+ setStatus('Set config.storeShots.routes (and a navigationRef) to enable.');
197
+ setStatusTone('error');
198
+ return;
199
+ }
200
+ const app = resolveAppSlug();
201
+ onClose();
202
+ // Defer so the overlay is fully dismissed before the first capture.
203
+ setTimeout(async () => {
204
+ try {
205
+ const res = await YaverFeedback.captureStoreScreenshots({
206
+ app,
207
+ routes: ss.routes,
208
+ navigationRef: ss.navigationRef,
209
+ screens: ss.screens,
210
+ submit: ss.submit,
211
+ });
212
+ const msg = res.ok
213
+ ? res.submitted
214
+ ? 'Submitted for App Store review 🎉'
215
+ : res.staged
216
+ ? `Uploaded ${res.uploaded} screenshots — staged. One tap left in App Store Connect.`
217
+ : `Uploaded ${res.uploaded} App Store screenshots.`
218
+ : res.message || 'Capture failed.';
219
+ Alert.alert('App Store screenshots', msg);
220
+ } catch (e: any) {
221
+ Alert.alert('App Store screenshots', e?.message ?? 'Capture failed.');
222
+ }
223
+ }, 500);
224
+ };
225
+
226
+ const storeShotsEnabled =
227
+ ((YaverFeedback.getConfig() as { storeShots?: any } | null)?.storeShots?.routes?.length ?? 0) > 0;
228
+
187
229
  const triggerDeploy = async (machine: string) => {
188
230
  if (!options) return;
189
231
  setShipping(true);
@@ -277,6 +319,19 @@ export const DeployPanel: React.FC<DeployPanelProps> = ({ onClose }) => {
277
319
  <ScrollView style={styles.list}>{options.devices.map(machineRow)}</ScrollView>
278
320
  ) : null}
279
321
 
322
+ {storeShotsEnabled && (
323
+ <Pressable
324
+ onPress={runStoreShots}
325
+ disabled={shipping}
326
+ style={({ pressed }) => [styles.shotsBtn, pressed && styles.rowPressed]}
327
+ >
328
+ <Text style={styles.shotsBtnText}>📸 App Store screenshots</Text>
329
+ <Text style={styles.shotsBtnSub}>
330
+ capture this app on-device + upload to App Store Connect
331
+ </Text>
332
+ </Pressable>
333
+ )}
334
+
280
335
  {status && (
281
336
  <Text
282
337
  style={[
@@ -388,6 +443,25 @@ const styles = StyleSheet.create({
388
443
  rowMetaWarning: {
389
444
  color: 'rgb(255,178,115)',
390
445
  },
446
+ shotsBtn: {
447
+ marginTop: 12,
448
+ paddingVertical: 12,
449
+ paddingHorizontal: 14,
450
+ borderRadius: 10,
451
+ backgroundColor: 'rgba(124,109,255,0.16)',
452
+ borderWidth: 1,
453
+ borderColor: 'rgba(124,109,255,0.4)',
454
+ },
455
+ shotsBtnText: {
456
+ color: '#fff',
457
+ fontSize: 14,
458
+ fontWeight: '600',
459
+ },
460
+ shotsBtnSub: {
461
+ color: 'rgba(255,255,255,0.55)',
462
+ fontSize: 12,
463
+ marginTop: 2,
464
+ },
391
465
  status: {
392
466
  color: 'rgba(255,255,255,0.55)',
393
467
  fontSize: 12,
package/src/Discovery.ts CHANGED
@@ -7,6 +7,14 @@ type AsyncStorageLike = {
7
7
  setItem: (key: string, value: string) => Promise<void>;
8
8
  removeItem: (key: string) => Promise<void>;
9
9
  };
10
+
11
+ function unrefTimer(timer: ReturnType<typeof setTimeout>): void {
12
+ const maybeNodeTimer = timer as unknown as { unref?: () => void };
13
+ if (typeof maybeNodeTimer.unref === 'function') {
14
+ maybeNodeTimer.unref();
15
+ }
16
+ }
17
+
10
18
  function getAsyncStorage(): AsyncStorageLike | null {
11
19
  try {
12
20
  const mod = require('@react-native-async-storage/async-storage');
@@ -362,14 +370,15 @@ export class YaverDiscovery {
362
370
  static async probe(url: string): Promise<DiscoveryResult | null> {
363
371
  const base = url.replace(/\/$/, '');
364
372
  const start = Date.now();
373
+ let timeoutId: ReturnType<typeof setTimeout> | null = null;
365
374
  try {
366
375
  const controller = new AbortController();
367
- const timeoutId = setTimeout(() => controller.abort(), PROBE_TIMEOUT_MS);
376
+ timeoutId = setTimeout(() => controller.abort(), PROBE_TIMEOUT_MS);
377
+ unrefTimer(timeoutId);
368
378
  const response = await fetch(`${base}/health`, {
369
379
  method: 'GET',
370
380
  signal: controller.signal,
371
381
  });
372
- clearTimeout(timeoutId);
373
382
  if (!response.ok) return null;
374
383
  const latency = Date.now() - start;
375
384
  let hostname = 'Unknown';
@@ -384,6 +393,8 @@ export class YaverDiscovery {
384
393
  return { url: base, hostname, version, latency };
385
394
  } catch {
386
395
  return null;
396
+ } finally {
397
+ if (timeoutId) clearTimeout(timeoutId);
387
398
  }
388
399
  }
389
400