@simon-says-build/demo-player 0.14.2 → 0.14.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simon-says-build/demo-player",
3
- "version": "0.14.2",
3
+ "version": "0.14.3",
4
4
  "description": "SimonSays mobile demo player: walks a preview's viewer through a job's change, inside the app. Renders nothing unless the bundle carries a demo.",
5
5
  "repository": {
6
6
  "type": "git",
package/src/DemoHost.js CHANGED
@@ -23,7 +23,7 @@ import { pageName } from './page-name.js';
23
23
  // app (box-none). An app without react-native-screens keeps the in-tree layer.
24
24
  let FullWindowOverlay = null;
25
25
  try { FullWindowOverlay = require('react-native-screens').FullWindowOverlay || null; } catch { FullWindowOverlay = null; }
26
- import { OVERLAY_ID, overlayLayer, chapterOf, cardBox, pinnedBox, setTuckedDemo, overlayAnnounced, tapInside, currentDemo, demoConfig, findTarget, handlerFor, introBody, introOf, onDemo, phoneSteps, playDemo, releaseOf, reviewChangesOf, scalePoint, rescueNote, screenCandidates, stepTitle, targetOfKey } from './core.js';
26
+ import { OVERLAY_ID, overlayLayer, pressableHost, rowBox, chapterOf, cardBox, pinnedBox, setTuckedDemo, overlayAnnounced, tapInside, currentDemo, demoConfig, findTarget, handlerFor, introBody, introOf, onDemo, phoneSteps, playDemo, releaseOf, reviewChangesOf, scalePoint, rescueNote, screenCandidates, stepTitle, targetOfKey } from './core.js';
27
27
  import { demoApi, tourOf } from './api.js';
28
28
  import { signInFirst, openInApp } from './signin.js';
29
29
  import { runEvent, fillStep } from './events.js';
@@ -157,7 +157,8 @@ function Player({ config, router, insets, onClose, children }) {
157
157
  const started = Date.now();
158
158
  const tick = async () => {
159
159
  const f = findTarget(fiberOf(rootRef.current), target);
160
- const r = f ? await measure(f) : null;
160
+ const host = f ? pressableHost(f) : null;
161
+ const r = f ? rowBox(await measure(f), host !== f ? await measure(host) : null, screen) : null;
161
162
  if (!live) return;
162
163
  setFound(f);
163
164
  setRect(r);
package/src/core.js CHANGED
@@ -10,7 +10,7 @@ import { bubbleBox } from './step-place.js';
10
10
  // What this player is, said when the app registers for "Ready to see"
11
11
  // (packages/ssb-overlay sends it; functions/in-app-notify.mjs clientOf). Kept
12
12
  // equal to package.json by test/core.test.mjs.
13
- export const PLAYER_VERSION = '0.14.2';
13
+ export const PLAYER_VERSION = '0.14.3';
14
14
 
15
15
  export const HOST = 5;
16
16
  export const TEXT = 6;
@@ -144,6 +144,26 @@ export function handlerFor(f, name) {
144
144
  return null;
145
145
  }
146
146
 
147
+ /**
148
+ * THE THING A PERSON TAPS (0.14.3, 2026-11-07): a target found by its words is
149
+ * often a Text inside a pressable row. Ringing the Text put a small ring on a
150
+ * label at the row's edge, and a tap anywhere else on the row — what a person
151
+ * and SSB's check both do — was not seen as the try: Connie Ho's "Open Yane"
152
+ * opened her profile and the card kept asking (demo 16D4S5HqugIonvUSdC5u).
153
+ * → the first host view of the nearest ancestor with an onPress (the row), or
154
+ * `f` when there is none. Pure (walks fibers: return / child, tag 5 = host).
155
+ */
156
+ export function pressableHost(f) {
157
+ let p = f;
158
+ while (p && typeof p.memoizedProps?.onPress !== 'function') p = p.return;
159
+ if (!p) return f;
160
+ for (let q = p; q; q = q.child) if (q.tag === 5 && q.stateNode) return q;
161
+ return f;
162
+ }
163
+ /** Use the row's box only when it is a row, not a screen-sized wrapper. Pure. */
164
+ export const rowBox = (text, row, screen) =>
165
+ row && text && row.width * row.height <= 0.4 * screen.width * screen.height ? row : text;
166
+
147
167
  /** A recorded point, scaled from the recording screen to `screen`. */
148
168
  export function scalePoint(point, screen, from = RECORDED_SCREEN) {
149
169
  return {