Skip to content

feat(examples): add flappy-bird hook demo to React templates#2325

Merged
Huxpro merged 3 commits intolynx-family:mainfrom
Huxpro:feat/react-flappy-hook
Mar 11, 2026
Merged

feat(examples): add flappy-bird hook demo to React templates#2325
Huxpro merged 3 commits intolynx-family:mainfrom
Huxpro:feat/react-flappy-hook

Conversation

@Huxpro
Copy link
Copy Markdown
Collaborator

@Huxpro Huxpro commented Mar 10, 2026

Summary

  • Add a useFlappy custom Hook that demonstrates reactive physics in ReactLynx — tap anywhere to make the Lynx logo jump with gravity-based flappy-bird mechanics
  • src/lib/flappy.ts contains a framework-agnostic physics engine; src/useFlappy.ts wraps it as a React Hook with useState/useRef/useCallback
  • Applied to examples/react and all four create-rspeedy React templates (TS, JS, vitest-rltl-ts, vitest-rltl-js)

Test plan

  • cd examples/react && pnpm dev — tap anywhere to see logo jump and fall with gravity
  • npx create-rspeedy@latest with each React template — verify useFlappy hook and flappy interaction work

Summary by CodeRabbit

  • New Features
    • Interactive physics-driven logo animation: tapping triggers smooth, gravity-and-momentum vertical movement. Available across all React templates and exposes adjustable physics parameters.
  • Behavior Changes
    • Tap handling adjusted so container taps trigger the jump while logo tap still toggles its variant, preserving existing tap behavior.
  • Tests
    • Updated snapshots to reflect the new inline transform style on the logo.

Add a `useFlappy` custom hook that demonstrates reactive physics
in ReactLynx. Tap anywhere to make the Lynx logo jump with
gravity-based flappy-bird mechanics.

- `src/lib/flappy.ts` — framework-agnostic physics engine
- `src/useFlappy.ts` — React hook wrapping createFlappy
- Updated `App.tsx` with `bindtap={jump}` and `translateY` transform

Applied to: examples/react, template-react-ts, template-react-js,
template-react-vitest-rltl-ts, template-react-vitest-rltl-js
Copilot AI review requested due to automatic review settings March 10, 2026 07:33
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 10, 2026

⚠️ No Changeset found

Latest commit: 2a25145

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 10, 2026

📝 Walkthrough

Walkthrough

Adds a Flappy Bird-style physics engine (createFlappy) and corresponding useFlappy hook across multiple React template projects; integrates the hook into App components to drive logo vertical translation and binds container taps to trigger jumps.

Changes

Cohort / File(s) Summary
Examples (React)
examples/react/src/lib/flappy.ts, examples/react/src/useFlappy.ts, examples/react/src/App.tsx
New TypeScript flappy engine and hook; App uses useFlappy() to expose [logoY, jump], applies style="transform:translateY(${logoY}px)" to the Logo, and binds root tap to jump.
Template: React JS
packages/rspeedy/create-rspeedy/template-react-js/src/lib/flappy.js, packages/rspeedy/create-rspeedy/template-react-js/src/useFlappy.js, packages/rspeedy/create-rspeedy/template-react-js/src/App.jsx
Added JS flappy engine and hook; App wired to hook, logo transform updated, root view handles tap to invoke jump.
Template: React TS
packages/rspeedy/create-rspeedy/template-react-ts/src/lib/flappy.ts, packages/rspeedy/create-rspeedy/template-react-ts/src/useFlappy.ts, packages/rspeedy/create-rspeedy/template-react-ts/src/App.tsx
Added TypeScript flappy engine and hook with types/interfaces; App integrated the hook and logo transform, root tap triggers jump.
Template: React Vitest RLTL JS
packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/lib/flappy.js, packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/useFlappy.js, packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/App.jsx, packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/__tests__/index.test.jsx
Added JS flappy engine and hook; App uses hook and logo transform; updated test snapshots to include inline style="transform:translateY(0px)".
Template: React Vitest RLTL TS
packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/lib/flappy.ts, packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/useFlappy.ts, packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/App.tsx, packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/__tests__/index.test.tsx
Added TypeScript flappy engine and hook; App integrated hook and logo transform; test snapshot updated to include the new inline transform style.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • upupming
  • colinaaa

Poem

🐰 I dug a tiny engine bright and small,
It counts the frames and hears each tap and call.
Logos bob up, then tumble down with glee,
A jump, a stack, a loop — physics set free!
Hop on, press root, watch playful motion be.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the primary change: adding a flappy-bird physics hook demo to React templates, which aligns with the main objectives of introducing useFlappy hook and applying it across multiple React templates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Flappy Bird–style “tap to jump” demo to ReactLynx example + all create-rspeedy React templates by introducing a small physics engine (createFlappy) and a React hook wrapper (useFlappy) used to animate the logo via translateY(...).

Changes:

  • Add framework-agnostic flappy physics engine (src/lib/flappy.*) and a React hook wrapper (src/useFlappy.*).
  • Wire the hook into each template/example App so tapping triggers jump and the logo animates vertically.
  • Apply these additions across TS/JS templates including the vitest + rltl variants, plus examples/react.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/lib/flappy.ts Adds TS physics engine used by the hook/template demo
packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/useFlappy.ts Adds TS hook wrapper around the physics engine
packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/App.tsx Uses useFlappy to animate logo + bind tap to jump
packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/lib/flappy.js Adds JS physics engine used by the hook/template demo
packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/useFlappy.js Adds JS hook wrapper around the physics engine
packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/App.jsx Uses useFlappy to animate logo + bind tap to jump
packages/rspeedy/create-rspeedy/template-react-ts/src/lib/flappy.ts Adds TS physics engine for the standard TS template
packages/rspeedy/create-rspeedy/template-react-ts/src/useFlappy.ts Adds TS hook wrapper for the standard TS template
packages/rspeedy/create-rspeedy/template-react-ts/src/App.tsx Uses useFlappy to animate logo + bind tap to jump
packages/rspeedy/create-rspeedy/template-react-js/src/lib/flappy.js Adds JS physics engine for the standard JS template
packages/rspeedy/create-rspeedy/template-react-js/src/useFlappy.js Adds JS hook wrapper for the standard JS template
packages/rspeedy/create-rspeedy/template-react-js/src/App.jsx Uses useFlappy to animate logo + bind tap to jump
examples/react/src/lib/flappy.ts Adds TS physics engine for the example app
examples/react/src/useFlappy.ts Adds TS hook wrapper for the example app
examples/react/src/App.tsx Uses useFlappy to animate logo + bind tap to jump

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (2)
examples/react/src/useFlappy.ts (1)

24-38: options is effectively init-only.

Line 30 creates the engine once and Lines 34-38 only dispose it on unmount, so later gravity/jumpForce/stackFactor/frameMs changes never reach the engine. Recreate the engine when those fields change, or document the parameter as initialization-only.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/react/src/useFlappy.ts` around lines 24 - 38, useFlappy currently
creates the FlappyEngine once (engineRef.current via createFlappy) and never
recreates it when options change, so runtime updates to
gravity/jumpForce/stackFactor/frameMs are ignored; update useFlappy to recreate
the engine when relevant options change by moving engine creation into a
useEffect that depends on the specific options fields (or a stable serialized
options key), e.g. on
options.gravity/options.jumpForce/options.stackFactor/options.frameMs: on each
dependency change, call engineRef.current?.destroy() then set engineRef.current
= createFlappy(..., options) and ensure you still clean up on unmount;
alternatively, if you intend options to be initialization-only, update the
doc/comment for useFlappy to state that options are immutable after mount.
packages/rspeedy/create-rspeedy/template-react-js/src/useFlappy.js (1)

18-28: options are init-only with the current lifecycle.

createFlappy(...) only runs while engineRef.current is null, and the cleanup on Lines 24-28 only fires on unmount. Later gravity/jumpForce/stackFactor/frameMs changes will be ignored unless the engine is recreated.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/rspeedy/create-rspeedy/template-react-js/src/useFlappy.js` around
lines 18 - 28, The engine is only created once so later changes to init-only
options (gravity, jumpForce, stackFactor, frameMs) are ignored; update the hook
to recreate the engine whenever those option values change by adding a useEffect
that depends on the options (or their individual keys), which on change calls
engineRef.current?.destroy(), reassigns engineRef.current = createFlappy(...,
options) and wires setY, and retains the existing unmount cleanup; reference
engineRef.current, createFlappy, destroy, and the existing cleanup useEffect
when implementing this.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@examples/react/src/lib/flappy.ts`:
- Around line 60-63: In the jump() function change the clamping expression so
velocity is capped at the intended jumpForce: replace the Math.min usage with
Math.max when computing velocity = Math.min(velocity + jumpForce * stackFactor,
jumpForce) so the result becomes velocity = Math.max(velocity + jumpForce *
stackFactor, jumpForce); this ensures repeated taps do not push velocity past
the one-jump cap (refer to jump(), velocity, jumpForce, stackFactor, timer).

In `@packages/rspeedy/create-rspeedy/template-react-js/src/lib/flappy.js`:
- Around line 42-45: In function jump(), the current clamp uses Math.min which
is wrong for negative jumpForce; change the clamp expression that sets velocity
(the line using Math.min(velocity + jumpForce * stackFactor, jumpForce)) to use
Math.max instead so rapid taps cannot exceed the intended one-full jumpForce
cap; update the expression that computes velocity (referencing velocity,
jumpForce, stackFactor) to Math.max(...) while leaving the surrounding logic
(including the timer check) intact.

In `@packages/rspeedy/create-rspeedy/template-react-ts/src/lib/flappy.ts`:
- Around line 60-63: In the jump() function fix the clamp so velocity cannot
exceed the intended full-jump limit: replace the Math.min clamp with Math.max to
ensure velocity is clamped at least to jumpForce (so when jumpForce is negative
rapid taps don't make velocity more negative than jumpForce); update the
expression that sets velocity (currently using Math.min with velocity +
jumpForce * stackFactor) to use Math.max(velocity + jumpForce * stackFactor,
jumpForce) and leave the surrounding logic (timer check, stackFactor, jumpForce)
unchanged.

In `@packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/App.jsx`:
- Around line 24-32: The test snapshot in __tests__/index.test.jsx still expects
the old component tree; update the test to reflect the new wrapper bindtap and
the Logo element's style and bindtap changes by refreshing the generated
snapshot or updating the expected JSX/HTML in the assertion for the App
component render; look for references to the App render/test block and the
previous snapshot between lines ~28-89 and re-run the snapshot update (or
replace the expected tree) so it includes the new outer view with bindtap={jump}
and the Logo element showing style={{ transform: `translateY(${logoY}px)` }} and
bindtap={onTap}.

In
`@packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/lib/flappy.js`:
- Around line 42-45: The rapid-tap clamp in function jump incorrectly uses
Math.min which, given a negative jumpForce, picks a more-negative value and
allows stacking beyond the intended single jump; change the clamp to use
Math.max so velocity = Math.max(velocity + jumpForce * stackFactor, jumpForce)
(referencing variables velocity, jumpForce, stackFactor and function jump) so
repeated taps cannot exceed one full jump; update the inline comment to reflect
clamping with Math.max when jumpForce is negative.

In `@packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/App.tsx`:
- Around line 26-34: The component tree now adds a root bindtap (jump) and Logo
props (style: translateY using logoY and bindtap: onTap), so update the failing
snapshot in index.test.tsx to match the new markup; re-run the test snapshot
update (e.g., run vitest -u or your test runner's update-snapshot command) so
the snapshot reflects the new root bindtap and the Logo style/bindtap
attributes.

In
`@packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/lib/flappy.ts`:
- Around line 60-63: In function jump(), the clamp uses Math.min which, given
jumpForce is negative, allows velocity to exceed the intended negative cap;
change the clamp to use Math.max so velocity = Math.max(velocity + jumpForce *
stackFactor, jumpForce) (referencing variables velocity, jumpForce, stackFactor
and the jump() function) to ensure rapid taps do not drive velocity beyond the
single full jumpForce bound; keep the existing timer logic intact.

---

Nitpick comments:
In `@examples/react/src/useFlappy.ts`:
- Around line 24-38: useFlappy currently creates the FlappyEngine once
(engineRef.current via createFlappy) and never recreates it when options change,
so runtime updates to gravity/jumpForce/stackFactor/frameMs are ignored; update
useFlappy to recreate the engine when relevant options change by moving engine
creation into a useEffect that depends on the specific options fields (or a
stable serialized options key), e.g. on
options.gravity/options.jumpForce/options.stackFactor/options.frameMs: on each
dependency change, call engineRef.current?.destroy() then set engineRef.current
= createFlappy(..., options) and ensure you still clean up on unmount;
alternatively, if you intend options to be initialization-only, update the
doc/comment for useFlappy to state that options are immutable after mount.

In `@packages/rspeedy/create-rspeedy/template-react-js/src/useFlappy.js`:
- Around line 18-28: The engine is only created once so later changes to
init-only options (gravity, jumpForce, stackFactor, frameMs) are ignored; update
the hook to recreate the engine whenever those option values change by adding a
useEffect that depends on the options (or their individual keys), which on
change calls engineRef.current?.destroy(), reassigns engineRef.current =
createFlappy(..., options) and wires setY, and retains the existing unmount
cleanup; reference engineRef.current, createFlappy, destroy, and the existing
cleanup useEffect when implementing this.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 978866b8-0a30-4ccd-9ddf-3f58c982eea6

📥 Commits

Reviewing files that changed from the base of the PR and between d034dae and 783fd1e.

📒 Files selected for processing (15)
  • examples/react/src/App.tsx
  • examples/react/src/lib/flappy.ts
  • examples/react/src/useFlappy.ts
  • packages/rspeedy/create-rspeedy/template-react-js/src/App.jsx
  • packages/rspeedy/create-rspeedy/template-react-js/src/lib/flappy.js
  • packages/rspeedy/create-rspeedy/template-react-js/src/useFlappy.js
  • packages/rspeedy/create-rspeedy/template-react-ts/src/App.tsx
  • packages/rspeedy/create-rspeedy/template-react-ts/src/lib/flappy.ts
  • packages/rspeedy/create-rspeedy/template-react-ts/src/useFlappy.ts
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/App.jsx
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/lib/flappy.js
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/useFlappy.js
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/App.tsx
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/lib/flappy.ts
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/useFlappy.ts

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 10, 2026

Merging this PR will improve performance by 13.77%

⚡ 2 improved benchmarks
✅ 70 untouched benchmarks
⏩ 3 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
basic-performance-nest-level-100 7.3 ms 6.9 ms +5.72%
transform 1000 view elements 46.3 ms 40.7 ms +13.77%

Comparing Huxpro:feat/react-flappy-hook (2a25145) with main (27f1cff)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@relativeci
Copy link
Copy Markdown

relativeci bot commented Mar 10, 2026

Web Explorer

#8105 Bundle Size — 384.5KiB (0%).

2a25145(current) vs 27f1cff main#8099(baseline)

Bundle metrics  no changes
                 Current
#8105
     Baseline
#8099
No change  Initial JS 155.59KiB 155.59KiB
No change  Initial CSS 35.1KiB 35.1KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 8 8
No change  Modules 238 238
No change  Duplicate Modules 16 16
No change  Duplicate Code 2.98% 2.98%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#8105
     Baseline
#8099
No change  JS 253.55KiB 253.55KiB
No change  Other 95.85KiB 95.85KiB
No change  CSS 35.1KiB 35.1KiB

Bundle analysis reportBranch Huxpro:feat/react-flappy-hookProject dashboard


Generated by RelativeCIDocumentationReport issue

- Fix Math.min → Math.max in jump() clamp across all 5 flappy engine
  files. With negative jumpForce, Math.min allowed velocity to exceed
  the intended cap on rapid taps.
- Update inline snapshots in vitest-rltl templates to include the new
  translateY style on the Logo element.
- Document that useFlappy options are init-only (read once on mount).
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/__tests__/index.test.tsx (1)

28-90: ⚠️ Potential issue | 🟡 Minor

Add an interaction assertion, not just the initial snapshot.

This snapshot only locks in the initial translateY(0px) render. If the new bindtap={jump} wiring or the logoY update path breaks, the test still passes. Please extend this case to trigger a tap and assert that the Logo transform changes afterward.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/__tests__/index.test.tsx`
around lines 28 - 90, The test currently only snapshots the initial render;
extend it to simulate the tap that should call the bound handler and update
logoY/transform. Locate the Logo element (class "Logo" or "Logo--lynx") in the
test that renders the tree, dispatch a tap/click event (use the test renderer's
event helper like fireEvent/triggerEvent or the rltl equivalent) to invoke
bindtap={jump}, then re-query the rendered tree and assert the Logo's
style.transform no longer equals "translateY(0px)" (or equals the expected
translated value), verifying the jump/logoY update path works.
🧹 Nitpick comments (1)
packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/__tests__/index.test.jsx (1)

10-103: Exercise the tap path, not just the initial snapshot.

This only proves the first render includes translateY(0px). If bindtap={jump} stops firing or logoY stops updating, the test still passes. Please add one interaction assertion that a tap changes the Logo transform.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/__tests__/index.test.jsx`
around lines 10 - 103, The test only verifies initial render; simulate a tap on
the Logo to exercise the jump handler and assert logoY/transform changes. Locate
the Logo element (e.g., the <view class="Logo"> or inner <image
class="Logo--lynx">) in the App test, dispatch a tap/click using fireEvent or
userEvent, await the update, and then assert that the Logo's style transform is
no longer "translateY(0px)" (or equals the expected translated value) to prove
the jump handler (jump) updated logoY.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@examples/react/src/lib/flappy.ts`:
- Around line 46-73: Make destroy irreversible by adding a destroyed flag
checked in loop and jump: in destroy(), set destroyed = true and
clearTimeout(timer) as now; in loop(), after calling onUpdate(y) do not schedule
setTimeout(loop, frameMs) if destroyed is true (return instead); in jump(),
no-op if destroyed is true so a late tap can't restart the loop. Reference
functions: loop, jump, destroy and the timer variable.

In `@packages/rspeedy/create-rspeedy/template-react-ts/src/useFlappy.ts`:
- Around line 43-45: The string directive inside the jump callback uses the
incorrect spelling 'background only' so the runtime will ignore it; update the
directive to the canonical hyphenated form 'background-only' inside the
useCallback for the jump function (the block that contains
engineRef.current?.jump()) so Lynx/background-only plugins recognize the thread
annotation.

---

Outside diff comments:
In
`@packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/__tests__/index.test.tsx`:
- Around line 28-90: The test currently only snapshots the initial render;
extend it to simulate the tap that should call the bound handler and update
logoY/transform. Locate the Logo element (class "Logo" or "Logo--lynx") in the
test that renders the tree, dispatch a tap/click event (use the test renderer's
event helper like fireEvent/triggerEvent or the rltl equivalent) to invoke
bindtap={jump}, then re-query the rendered tree and assert the Logo's
style.transform no longer equals "translateY(0px)" (or equals the expected
translated value), verifying the jump/logoY update path works.

---

Nitpick comments:
In
`@packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/__tests__/index.test.jsx`:
- Around line 10-103: The test only verifies initial render; simulate a tap on
the Logo to exercise the jump handler and assert logoY/transform changes. Locate
the Logo element (e.g., the <view class="Logo"> or inner <image
class="Logo--lynx">) in the App test, dispatch a tap/click using fireEvent or
userEvent, await the update, and then assert that the Logo's style transform is
no longer "translateY(0px)" (or equals the expected translated value) to prove
the jump handler (jump) updated logoY.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 94a23aad-a34a-4cd4-bd4a-57d1379c1ef2

📥 Commits

Reviewing files that changed from the base of the PR and between 783fd1e and 6c5bab7.

📒 Files selected for processing (12)
  • examples/react/src/lib/flappy.ts
  • examples/react/src/useFlappy.ts
  • packages/rspeedy/create-rspeedy/template-react-js/src/lib/flappy.js
  • packages/rspeedy/create-rspeedy/template-react-js/src/useFlappy.js
  • packages/rspeedy/create-rspeedy/template-react-ts/src/lib/flappy.ts
  • packages/rspeedy/create-rspeedy/template-react-ts/src/useFlappy.ts
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/__tests__/index.test.jsx
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/lib/flappy.js
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/useFlappy.js
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/__tests__/index.test.tsx
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/lib/flappy.ts
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/useFlappy.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/useFlappy.js
  • packages/rspeedy/create-rspeedy/template-react-js/src/useFlappy.js
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/lib/flappy.js
  • packages/rspeedy/create-rspeedy/template-react-js/src/lib/flappy.js
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/useFlappy.ts

@Huxpro Huxpro enabled auto-merge (squash) March 10, 2026 08:48
@Huxpro Huxpro merged commit 10ff8f7 into lynx-family:main Mar 11, 2026
105 of 113 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants