Skip to content

Expo 55へのアップグレードとnpm移行 - #5464

Merged
TinyKitten merged 15 commits into
devfrom
chore/expo55
Feb 27, 2026
Merged

TinyKitten merged 15 commits into
devfrom
chore/expo55

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Feb 27, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Expo SDK 55へアップグレードし、関連する依存関係を更新
  • パッケージマネージャーをpnpmからnpmへ移行
  • React Native Reanimatedの利用箇所をRN Animated APIへ置き換え(ヘッダーアニメーション、モーダル、種別表示など)
  • CI/ドキュメント/設定ファイルをnpm前提に統一
  • overridesによる依存解決警告の抑制

Key Changes

  • app.config.ts, package.json: Expo 55対応の設定・依存更新
  • src/hooks/useHeaderAnimation.ts: Reanimated → RN Animated へ全面書き換え
  • src/components/: Header系、TrainTypeBox系、CustomModal、Marquee等のアニメーション実装をRN Animatedへ統一
  • .github/workflows/: npm前提のCI設定へ変更
  • pnpm関連ファイル(pnpm-lock.yaml, pnpm-workspace.yaml, .npmrc)を削除しpackage-lock.jsonを追加

Test plan

  • npm run lint パス確認
  • npm test パス確認
  • npm run typecheck パス確認
  • iOS/Androidビルド確認
  • ヘッダー折りたたみアニメーションの動作確認(各テーマ)
  • 種別表示・モーダルのアニメーション動作確認

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 改善・機能強化

    • Expo 55、React 19.2、React Native 0.83 系へアップグレードし安定性と性能を向上しました
    • アニメーション実装を標準のReact Native Animatedへ移行し互換性と挙動の安定性を改善しました
    • 画像周りのプラグインを追加してメディア処理を強化しました
  • Chores

    • ドキュメントとCIでパッケージマネージャーをnpmへ統一しました(package-lock を追跡)
    • いくつかの依存関係を更新しセキュリティと互換性を向上しました

@coderabbitai

coderabbitai Bot commented Feb 27, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

パッケージマネージャーを pnpm から npm に切替え、react-native-reanimated の利用を React Native の標準 Animated(RNAnimated)へ置換しつつ、Expo/React Native 系依存の一括アップグレードとネイティブ / CI 設定の更新を行いました。

Changes

Cohort / File(s) Summary
CI ワークフロー (pnpm→npm)
\.github/workflows/bump_version_on_canary_pr.yml, \.github/workflows/bump_version_on_release_pr.yml, \.github/workflows/test.yml, \.github/workflows/typecheck.yml
pnpm 固有ステップとキャッシュを削除し、npm キャッシュ・npm ci を利用するように変更。バンプ実行コマンドを npm 形式へ変更。lockfile パスを pnpm-lock.yaml→package-lock.json に更新。
ドキュメント・開発指示 (pnpm→npm)
\.github/copilot-instructions.md, docs/bump-version-on-canary-pr.md, docs/bump-version-on-release-pr.md, AGENTS.md, README.md
各所のコマンド例を pnpm から npm に置換し、開発環境表記を npm 10.x に更新。検証手順やチェックリスト内コマンドも npm に合わせて修正。
プロジェクト設定 (ロック/pnpm 設定削除)
\.gitignore, \.npmrc, pnpm-workspace.yaml
package-lock.json を .gitignore から削除して追跡、.npmrc の node-linker=hoisted を削除、pnpm ワークスペース定義のパッケージ指定を除去。
依存関係アップグレード
package.json
Expo 関連パッケージを v54→v55 へ、React/React Native や周辺ライブラリを多数更新。expo.doctor 設定・jest マッピング・overrides を追加。依存群の大規模更新。
Babel / Expo 設定
babel.config.js, app.config.ts
react-native-worklets/plugin を Babel に追加、expo-image を app.config.ts の plugins 配列に追加。
アニメーション API 移行 — 共通ライブラリ/テスト
src/__mocks__/react-native-reanimated-mock.js, src/components/CustomModal.test.tsx, src/components/Typography.tsx, src/hooks/useInterval.ts
Reanimated のテスト用モック追加、CustomModal テストを Animated.timing スパイへ変更。Typography にアニメーションスタイル判定/フォント重み解決ヘルパーを追加。useInterval の型注釈調整。
アニメーション API 移行 — UI コンポーネント群
src/components/CustomModal.tsx, src/components/Marquee.tsx, src/components/WalkthroughOverlay.tsx, src/components/TrainTypeBox*.tsx, src/components/TrainTypeBox*.tsx
SharedValue/useAnimatedStyle/withTiming 等を RN Animated(useRef + Animated.Value / Animated.timing / Animated.loop 等)へ置換。内部アニメーション管理を標準 API に移行。
ヘッダー系コンポーネントと型更新
src/components/HeaderJRKyushu.tsx, src/components/HeaderSaikyo.tsx, src/components/HeaderTY.tsx, src/components/HeaderTokyoMetro.tsx, src/components/Header.types.ts
Animated の import を reanimated から react-native(RNAnimated 別名)へ変更。Header.types の型を AnimatedStyle → StyleProp 等へ置換、右側用スタイルフィールドを追加。HeaderTokyoMetro は内部で自前のタイミング制御へ移行し一部 prop 利用を変更。
フックとスクリーンの移行
src/hooks/useHeaderAnimation.ts, src/screens/...
src/screens/AppSettings.tsx, src/screens/EnabledLanguagesSettings.tsx, src/screens/Licenses.tsx, src/screens/RouteSearchScreen.tsx, src/screens/SelectLineScreen.tsx, src/screens/TTSSettings.tsx, src/screens/ThemeSettings.tsx
useHeaderAnimation を RN Animated ベースに書き換え(prev* 値や右側スタイルを返すよう拡張)。スクロール追跡を useSharedValue/useAnimatedScrollHandler から useRef(new RNAnimated.Value(0)) とネイティブイベントハンドラへ移行。
NowHeader / SettingsHeader 等の公開型変更
src/components/NowHeader.tsx, src/components/SettingsHeader.tsx
Props の scrollY 型を SharedValue から RNAnimated.Value に変更。内部アニメーションを reanimated から RN Animated へ置換。
ネイティブ / iOS・Android 設定変更
ios/AppDelegate.swift, ios/CanaryAppClip/AppDelegate.h, ios/ProdAppClip/AppDelegate.h, android/gradle.properties, android/app/build.gradle, android/app/src/main/java/.../MainApplication.kt
iOS の AppDelegate 可視性/スーパークラス調整、公設定や初期化フックの削除。Android の edge-to-edge 設定削除、hermesCommand 削除、MainApplication の ReactHost 初期化を ExpoReactHostFactory ベースへ移行(lazy 化)等を適用。
Xcode プロジェクト更新
ios/TrainLCD.xcodeproj/project.pbxproj
Privacy バンドル順序の入れ替え、Hermes→HermesVM フレームワーク参照への変更、ビルド設定に ccache ラッパー指定を導入。

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 ぴょん、鍵盤叩けばコマンドは変わる
npm に乗り換え、古い鎖がほどけたよ
動画は滑らかに、SharedValue は休み
依存はそろい、ネイティブは整う
ウサギは跳ねて、マージを待つ 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 プルリクエストのタイトルは、主な変更内容(Expo 55へのアップグレードとnpm移行)を簡潔かつ明確に要約しており、差分内容と直結しています。

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/expo55

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

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

⚠️ Outside diff range comments (2)
src/components/CustomModal.test.tsx (1)

17-21: ⚠️ Potential issue | 🟡 Minor

jest.clearAllMocks() は afterEach に置くルールに合わせたい

いまは beforeEach で jest.clearAllMocks() していますが、ガイドライン通り afterEach に寄せたいです(特に timingSpy を restore した後に clear すると意図が明確)。

修正案
 describe('CustomModal', () => {
-  beforeEach(() => {
-    jest.clearAllMocks();
-  });
+  afterEach(() => {
+    jest.clearAllMocks();
+  });

   it('visible=true の場合、childrenがレンダリングされる', () => {
     const { getByText } = render(
       <CustomModal visible={true}>
@@
 describe('CustomModal - onCloseAnimationEnd', () => {
   let timingSpy: jest.SpyInstance;

   beforeEach(() => {
-    jest.clearAllMocks();
     timingSpy = jest
       .spyOn(Animated, 'timing')
@@
   });

   afterEach(() => {
     timingSpy.mockRestore();
+    jest.clearAllMocks();
   });

As per coding guidelines, Call jest.clearAllMocks() in afterEach blocks in all test files.

Also applies to: 55-74

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

In `@src/components/CustomModal.test.tsx` around lines 17 - 21, Move the
jest.clearAllMocks() call out of the beforeEach block and into an afterEach
block within the describe('CustomModal') suite: remove or stop calling
jest.clearAllMocks() inside the existing beforeEach, add an afterEach(() => {
jest.clearAllMocks(); }) alongside any existing lifecycle hooks so mocks are
cleared after tests (this keeps timingSpy.restore and other teardown semantics
intact).
src/hooks/useHeaderAnimation.ts (1)

20-23: ⚠️ Potential issue | 🟡 Minor

JSDoc の利用コンポーネント一覧が実態とズレていそう

コメントに HeaderTokyoMetro が含まれていますが(Line 22)、このPR内では TokyoMetro 側が独自実装に寄っているので、説明が古くなっていそうです。メンテのため更新しておきたいです。

修正案
- * HeaderTokyoMetro, HeaderTY, HeaderSaikyo, HeaderJRKyushuで使用
+ * HeaderTY, HeaderSaikyo, HeaderJRKyushuで使用
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/hooks/useHeaderAnimation.ts` around lines 20 - 23, The JSDoc on
useHeaderAnimation is outdated (it still lists HeaderTokyoMetro) so update the
comment to reflect the current consumers: remove or mark HeaderTokyoMetro as not
using this hook and list only the actual components using it (e.g., HeaderTY,
HeaderSaikyo, HeaderJRKyushu or whichever components import useHeaderAnimation
in this PR); edit the header comment above the useHeaderAnimation function to
accurately describe its purpose and the current component list so future
maintainers can find where it is used.
🧹 Nitpick comments (6)
src/components/Marquee.tsx (1)

94-120: アニメーション作成ロジックの重複を検討してください。

useEffect内のアニメーション作成コード(Lines 105-112)がstartScroll(Lines 51-58)と重複しています。依存関係の循環を避けるための意図的な設計と理解しますが、共通ロジックを抽出することでメンテナンス性が向上します。

♻️ 共通ロジックの抽出案
+const createLoopAnimation = useCallback(
+  (contentWidth: number) => {
+    const totalDistance = dim.width + contentWidth;
+    const duration = (totalDistance / PIXELS_PER_SECOND) * 1000;
+    return Animated.loop(
+      Animated.timing(offsetX, {
+        toValue: -contentWidth,
+        duration,
+        easing: Easing.linear,
+        useNativeDriver: true,
+      })
+    );
+  },
+  [dim.width, offsetX]
+);

その後、startScrollとuseEffectの両方でこの関数を使用できます。

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

In `@src/components/Marquee.tsx` around lines 94 - 120, The animation creation
logic in the effect duplicates the code in startScroll; extract the shared logic
into a new helper function (e.g., createAndStartAnimation) that takes offsetX,
width (w), dim.width and PIXELS_PER_SECOND and returns/assigns the Animated.loop
instance to animationRef.current and starts it (or sets offsetX appropriately
when w <= dim.width). Replace the duplicated blocks in both startScroll and the
useEffect with calls to this helper and keep the existing stop logic
(animationRef.current?.stop()) in cleanup to preserve behavior.
src/__mocks__/react-native-reanimated-mock.js (1)

1-59: モックの ESM 互換性のため __esModule: true を付けるのがおすすめ

moduleNameMapper や Babel の interop 経由で default import されるケースを考えると、__esModule を付けて default を明示した形に寄せておくと安全です。

修正案
- module.exports = ReanimatedMock;
- module.exports.default = ReanimatedMock;
+ module.exports = {
+   __esModule: true,
+   ...ReanimatedMock,
+   default: ReanimatedMock,
+ };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/__mocks__/react-native-reanimated-mock.js` around lines 1 - 59, The mock
currently exports ReanimatedMock and sets module.exports.default but doesn't
declare ESM compatibility; update the export so the module includes __esModule:
true and exposes default as ReanimatedMock (e.g., ensure the final export object
has __esModule: true, default: ReanimatedMock and the rest of ReanimatedMock's
properties) by changing the module.exports assignment that references
ReanimatedMock and module.exports.default.
src/components/CustomModal.tsx (1)

31-85: 高速トグル時の競合回避に、開始前の opacity.stopAnimation() と cleanup を入れるのが無難

Reanimated 側にあった cancel 系のガードが消えているので、visible の連打/高速トグルでタイミング次第に “古い close 完了 callback” が走るのを確実に潰すなら、開始前に opacity.stopAnimation() を入れておく方が安全です(ついでに unmount 時の setState も回避)。

修正案
 useEffect(() => {
+  opacity.stopAnimation();
+
   if (visible) {
     setIsMounted(true);
     Animated.timing(opacity, {
       toValue: 1,
       duration: animationDuration,
       useNativeDriver: true,
     }).start();
     return;
   }

-  Animated.timing(opacity, {
+  const anim = Animated.timing(opacity, {
     toValue: 0,
     duration: animationDuration,
     useNativeDriver: true,
-  }).start(({ finished }) => {
+  });
+  anim.start(({ finished }) => {
     if (finished && !visible) {
       setIsMounted(false);
       onCloseAnimationEnd?.();
     }
   });
+
+  return () => {
+    anim.stop();
+  };
 }, [animationDuration, opacity, visible, onCloseAnimationEnd]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/CustomModal.tsx` around lines 31 - 85, The useEffect animation
can leak when visible toggles quickly: before starting any Animated.timing call
on opacity call opacity.stopAnimation() to cancel previous animations, and add a
cleanup that calls opacity.stopAnimation() and avoids calling
setIsMounted/onCloseAnimationEnd after unmount by tracking a mounted flag or
cancelling callbacks; update the effect around Animated.timing(opacity, ...) and
the callback that sets setIsMounted(false) / calls onCloseAnimationEnd to be
guarded by this mounted flag or cancelled in cleanup so stale close callbacks
don't run.
package.json (1)

28-115: npm移行・Jest mapper・overrides は良い。Expo SDK固定の semver と doctor 設定だけ再確認したい

  • overrides 採用で react-native-skeleton-placeholder と masked-view の差分吸収をしているのは現実的で良いです。
  • 一方で Expo 系は SDK 追従がシビアなので、expo-audio(Line 36)だけ ^ になっている意図と、expo.doctor で appConfigFieldsNotSyncedCheck を無効化している意図(Line 120-122)は、将来の追従コストが上がらないかだけ見ておきたいです。
  • ついでに、過去の経緯的に expo-audio を本当に使い続ける必要があるか(背景再生要件など)も再確認ポイントです。

Based on learnings, After dependency upgrades or Expo SDK migrations, run expo-doctor, pnpm lint, pnpm test, and pnpm typecheck, then capture results in docs/changelog.md
Based on learnings, Android background audio issue with expo-audio can cause the app to suspend/stop audio when Android suspends the app. In TrainLCD/MobileApp, prefer using expo-av for audio playback to handle background behavior correctly. Review dependencies and refactor code to use expo-av (or ensure expo-audio is not required for background playback) where appropriate.

Also applies to: 118-130, 146-162

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

In `@package.json` around lines 28 - 115, Review and lock Expo-related deps:
change the lone careted expo-audio to the fixed SDK-compatible version (or
remove it) to match other expo packages, confirm why overrides absorb
react-native-skeleton-placeholder and `@react-native-masked-view/masked-view` and
keep them if intentional; re-enable or justify the expo.doctor
appConfigFieldsNotSyncedCheck change (or remove the override) so SDK doctor
remains useful; audit code for any usage of expo-audio and replace with expo-av
where background playback is required (or document why expo-audio remains
needed), then run expo doctor, pnpm lint, pnpm test, pnpm typecheck and record
results in docs/changelog.md.
src/components/HeaderTY.tsx (1)

3-9: RN Animated 置換は問題なし。transformOrigin は静的に設定されているため RN 0.83.2 で動作する

Reanimated→RN Animated の置換は自然で、この実装では transformOrigin は静的に 'top' または 'bottom' で設定されているため、RN 0.83.2 でも正常に機能します。アニメーション対象は scaleY のみで、transformOrigin 自体はアニメートされていません。

ただしテキストの出入りアニメーションの挙動が期待通りかは、実機で視覚的に確認しておくと確実です(iOS/Android 両方)。

コード参照
// transformOrigin は static
{
  fontSize: STATION_NAME_FONT_SIZE,
  transformOrigin: 'top',  // ← animated ではない
}

// animation.topNameAnimatedAnchorStyle のみ animate
transform: [{ scaleY: progress }]  // ← scaleY のみが animated

Also applies to: 159-193, 198-218, 234-267, 273-289

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

In `@src/components/HeaderTY.tsx` around lines 3 - 9, Confirm visually on device
that the text enter/exit animation behaves as expected: run the app on both iOS
and Android and inspect the components using transformOrigin (e.g., the style
with STATION_NAME_FONT_SIZE and transformOrigin: 'top'/'bottom') and the
animated style animation.topNameAnimatedAnchorStyle which only animates
transform: [{ scaleY: progress }]; ensure the pivot/look is correct and adjust
the static transformOrigin value or the scaleY anchoring if the visual result is
off.
src/components/TrainTypeBox.tsx (1)

268-285: スタイル配列のネスト構造について

スタイルプロパティにネストした配列があります([textTopAnimatedStyles, [...other styles...]])。React Nativeは自動的にフラット化しますが、TrainTypeBoxJRKyushuのフラットな配列構造と一貫性を持たせることで可読性が向上します。

♻️ フラットな配列構造への変更案
          <RNAnimated.Text
            style={[
-             textTopAnimatedStyles,
-             [
-               styles.text,
-               animatedTextBaseStyle,
-               theme === APP_THEME.LED && { fontWeight: 'normal' as const },
-               {
-                 letterSpacing,
-                 marginLeft,
-               },
-             ],
+             styles.text,
+             animatedTextBaseStyle,
+             theme === APP_THEME.LED && { fontWeight: 'normal' as const },
+             textTopAnimatedStyles,
+             {
+               letterSpacing,
+               marginLeft,
+             },
            ]}
            adjustsFontSizeToFit
            numberOfLines={numberOfLines}
          >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/TrainTypeBox.tsx` around lines 268 - 285, The RNAnimated.Text
style prop currently uses a nested array ([textTopAnimatedStyles, [...other
styles...]]); flatten this into a single array for consistency with
TrainTypeBoxJRKyushu by merging textTopAnimatedStyles and the other style
entries into one top-level array (include styles.text, animatedTextBaseStyle,
the conditional theme === APP_THEME.LED { fontWeight: 'normal' }, and the
letterSpacing and marginLeft objects) so the style prop is a single flat array
while keeping adjustsFontSizeToFit and numberOfLines unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/copilot-instructions.md:
- Line 151: 更新手順文中の記録先が誤っているため、"docs/changelog.md" を "TECHNICAL_DEBT.md"
に置き換えて統一してください。具体的には該当行(`expo-doctor`、`npm run lint`、`npm test`、`npm run
typecheck` を実行して結果を記録する一文)で参照されている "docs/changelog.md" を "TECHNICAL_DEBT.md"
に修正し、必要なら同文脈での他出現箇所も同様に差し替えてください。

In `@docs/bump-version-on-release-pr.md`:
- Line 70: Update the docs line that currently shows the npm command without the
double-dash so it matches the implementation; change the example usage of the
script to include the `--` before positional arguments (i.e., mirror how the
workflow invokes `npm run version:bump -- ${steps.version.outputs.resolved}`),
ensuring the doc example uses the `--` form when passing the <バージョン> argument to
the version:bump script.

In `@ios/TrainLCD.xcodeproj/project.pbxproj`:
- Around line 2492-2493: The Podfile currently hardcodes apple.ccacheEnabled =>
true (and sets CCACHE_BINARY to /opt/homebrew/bin/ccache), which forces
:ccache_enabled into react_native_post_install and breaks CI without ccache;
change the logic that sets apple.ccacheEnabled (and any use_ccache! invocation)
to be conditional based on the environment (e.g., enable when ENV['CI'].nil? or
check for ccache presence in PATH), remove the hardcoded M1-specific
CCACHE_BINARY path or detect it at runtime, and ensure react_native_post_install
is called with :ccache_enabled only when the conditional is satisfied so CI
runners without ccache don’t fail.

---

Outside diff comments:
In `@src/components/CustomModal.test.tsx`:
- Around line 17-21: Move the jest.clearAllMocks() call out of the beforeEach
block and into an afterEach block within the describe('CustomModal') suite:
remove or stop calling jest.clearAllMocks() inside the existing beforeEach, add
an afterEach(() => { jest.clearAllMocks(); }) alongside any existing lifecycle
hooks so mocks are cleared after tests (this keeps timingSpy.restore and other
teardown semantics intact).

In `@src/hooks/useHeaderAnimation.ts`:
- Around line 20-23: The JSDoc on useHeaderAnimation is outdated (it still lists
HeaderTokyoMetro) so update the comment to reflect the current consumers: remove
or mark HeaderTokyoMetro as not using this hook and list only the actual
components using it (e.g., HeaderTY, HeaderSaikyo, HeaderJRKyushu or whichever
components import useHeaderAnimation in this PR); edit the header comment above
the useHeaderAnimation function to accurately describe its purpose and the
current component list so future maintainers can find where it is used.

---

Nitpick comments:
In `@package.json`:
- Around line 28-115: Review and lock Expo-related deps: change the lone careted
expo-audio to the fixed SDK-compatible version (or remove it) to match other
expo packages, confirm why overrides absorb react-native-skeleton-placeholder
and `@react-native-masked-view/masked-view` and keep them if intentional;
re-enable or justify the expo.doctor appConfigFieldsNotSyncedCheck change (or
remove the override) so SDK doctor remains useful; audit code for any usage of
expo-audio and replace with expo-av where background playback is required (or
document why expo-audio remains needed), then run expo doctor, pnpm lint, pnpm
test, pnpm typecheck and record results in docs/changelog.md.

In `@src/__mocks__/react-native-reanimated-mock.js`:
- Around line 1-59: The mock currently exports ReanimatedMock and sets
module.exports.default but doesn't declare ESM compatibility; update the export
so the module includes __esModule: true and exposes default as ReanimatedMock
(e.g., ensure the final export object has __esModule: true, default:
ReanimatedMock and the rest of ReanimatedMock's properties) by changing the
module.exports assignment that references ReanimatedMock and
module.exports.default.

In `@src/components/CustomModal.tsx`:
- Around line 31-85: The useEffect animation can leak when visible toggles
quickly: before starting any Animated.timing call on opacity call
opacity.stopAnimation() to cancel previous animations, and add a cleanup that
calls opacity.stopAnimation() and avoids calling
setIsMounted/onCloseAnimationEnd after unmount by tracking a mounted flag or
cancelling callbacks; update the effect around Animated.timing(opacity, ...) and
the callback that sets setIsMounted(false) / calls onCloseAnimationEnd to be
guarded by this mounted flag or cancelled in cleanup so stale close callbacks
don't run.

In `@src/components/HeaderTY.tsx`:
- Around line 3-9: Confirm visually on device that the text enter/exit animation
behaves as expected: run the app on both iOS and Android and inspect the
components using transformOrigin (e.g., the style with STATION_NAME_FONT_SIZE
and transformOrigin: 'top'/'bottom') and the animated style
animation.topNameAnimatedAnchorStyle which only animates transform: [{ scaleY:
progress }]; ensure the pivot/look is correct and adjust the static
transformOrigin value or the scaleY anchoring if the visual result is off.

In `@src/components/Marquee.tsx`:
- Around line 94-120: The animation creation logic in the effect duplicates the
code in startScroll; extract the shared logic into a new helper function (e.g.,
createAndStartAnimation) that takes offsetX, width (w), dim.width and
PIXELS_PER_SECOND and returns/assigns the Animated.loop instance to
animationRef.current and starts it (or sets offsetX appropriately when w <=
dim.width). Replace the duplicated blocks in both startScroll and the useEffect
with calls to this helper and keep the existing stop logic
(animationRef.current?.stop()) in cleanup to preserve behavior.

In `@src/components/TrainTypeBox.tsx`:
- Around line 268-285: The RNAnimated.Text style prop currently uses a nested
array ([textTopAnimatedStyles, [...other styles...]]); flatten this into a
single array for consistency with TrainTypeBoxJRKyushu by merging
textTopAnimatedStyles and the other style entries into one top-level array
(include styles.text, animatedTextBaseStyle, the conditional theme ===
APP_THEME.LED { fontWeight: 'normal' }, and the letterSpacing and marginLeft
objects) so the style prop is a single flat array while keeping
adjustsFontSizeToFit and numberOfLines unchanged.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 453dc50 and 723b175.

⛔ Files ignored due to path filters (3)
  • ios/Podfile.lock is excluded by !**/*.lock
  • package-lock.json is excluded by !**/package-lock.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (44)
  • .github/copilot-instructions.md
  • .github/workflows/bump_version_on_canary_pr.yml
  • .github/workflows/bump_version_on_release_pr.yml
  • .github/workflows/test.yml
  • .github/workflows/typecheck.yml
  • .gitignore
  • .npmrc
  • AGENTS.md
  • README.md
  • android/gradle.properties
  • app.config.ts
  • babel.config.js
  • docs/bump-version-on-canary-pr.md
  • docs/bump-version-on-release-pr.md
  • ios/AppDelegate.swift
  • ios/CanaryAppClip/AppDelegate.h
  • ios/ProdAppClip/AppDelegate.h
  • ios/TrainLCD.xcodeproj/project.pbxproj
  • package.json
  • pnpm-workspace.yaml
  • src/__mocks__/react-native-reanimated-mock.js
  • src/components/CustomModal.test.tsx
  • src/components/CustomModal.tsx
  • src/components/Header.types.ts
  • src/components/HeaderJRKyushu.tsx
  • src/components/HeaderSaikyo.tsx
  • src/components/HeaderTY.tsx
  • src/components/HeaderTokyoMetro.tsx
  • src/components/Marquee.tsx
  • src/components/NowHeader.tsx
  • src/components/SettingsHeader.tsx
  • src/components/TrainTypeBox.tsx
  • src/components/TrainTypeBoxJRKyushu.tsx
  • src/components/TrainTypeBoxSaikyo.tsx
  • src/components/Typography.tsx
  • src/hooks/useHeaderAnimation.ts
  • src/hooks/useInterval.ts
  • src/screens/AppSettings.tsx
  • src/screens/EnabledLanguagesSettings.tsx
  • src/screens/Licenses.tsx
  • src/screens/RouteSearchScreen.tsx
  • src/screens/SelectLineScreen.tsx
  • src/screens/TTSSettings.tsx
  • src/screens/ThemeSettings.tsx
💤 Files with no reviewable changes (2)
  • pnpm-workspace.yaml
  • .npmrc

Comment thread .github/copilot-instructions.md Resolved
Comment thread docs/bump-version-on-release-pr.md Resolved
Comment thread ios/TrainLCD.xcodeproj/project.pbxproj Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/components/WalkthroughOverlay.tsx (1)

187-194: useMemo は不要かもしれません

animatedY は useRef から取得した安定した参照であるため、useMemo によるメモ化のメリットはほぼありません。React Native の Animated API では、スタイルオブジェクトを直接渡すのが一般的なパターンです。

♻️ 簡略化の提案
-  const animatedTooltipStyle = useMemo(
-    () => ({
-      top: animatedY,
-      left: tooltipLeft,
-      width: tooltipWidth,
-    }),
-    [animatedY, tooltipLeft, tooltipWidth]
-  );
+  const animatedTooltipStyle = {
+    top: animatedY,
+    left: tooltipLeft,
+    width: tooltipWidth,
+  };

もし tooltipLeft / tooltipWidth の再計算を避けたい場合は、それらだけを useMemo で囲む方が意図が明確になります。

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

In `@src/components/WalkthroughOverlay.tsx` around lines 187 - 194, Remove the
unnecessary useMemo around animatedTooltipStyle in WalkthroughOverlay: animatedY
is a stable ref from the Animated API so create and pass the style object ({
top: animatedY, left: tooltipLeft, width: tooltipWidth }) directly instead of
wrapping it in useMemo; alternatively, if you really need memoization, only wrap
the non-animated values (tooltipLeft and tooltipWidth) with useMemo and compose
them with animatedY when building the final style to keep intent clear
(referencing animatedTooltipStyle, animatedY, tooltipLeft, tooltipWidth, and
useMemo).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@android/app/src/main/java/me/tinykitten/trainlcd/MainApplication.kt`:
- Around line 33-37: The catch block that falls back to ReleaseLevel.STABLE is
swallowing the IllegalArgumentException; update the catch for
ReleaseLevel.valueOf(BuildConfig.REACT_NATIVE_RELEASE_LEVEL.uppercase()) inside
DefaultNewArchitectureEntryPoint.releaseLevel to also emit a warning log (e.g.,
using android.util.Log.w with a clear tag like "MainApplication" or the class
name) that includes the invalid BuildConfig.REACT_NATIVE_RELEASE_LEVEL value and
the exception message/stack so misconfiguration can be diagnosed, while keeping
the existing STABLE fallback behavior.

---

Nitpick comments:
In `@src/components/WalkthroughOverlay.tsx`:
- Around line 187-194: Remove the unnecessary useMemo around
animatedTooltipStyle in WalkthroughOverlay: animatedY is a stable ref from the
Animated API so create and pass the style object ({ top: animatedY, left:
tooltipLeft, width: tooltipWidth }) directly instead of wrapping it in useMemo;
alternatively, if you really need memoization, only wrap the non-animated values
(tooltipLeft and tooltipWidth) with useMemo and compose them with animatedY when
building the final style to keep intent clear (referencing animatedTooltipStyle,
animatedY, tooltipLeft, tooltipWidth, and useMemo).

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 723b175 and 21b27db.

📒 Files selected for processing (4)
  • android/app/build.gradle
  • android/app/src/main/java/me/tinykitten/trainlcd/MainApplication.kt
  • docs/bump-version-on-release-pr.md
  • src/components/WalkthroughOverlay.tsx
💤 Files with no reviewable changes (1)
  • android/app/build.gradle
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/bump-version-on-release-pr.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
package.json (1)

2-14: SDK移行時検証の再現性のため doctor スクリプトを追加してください。

依存更新PRごとに同じ検証手順を回せるよう、expo-doctor を scripts に固定化しておくのが安全です。

差分案
   "scripts": {
     "start": "expo start",
     "android": "expo run:android",
     "ios": "expo run:ios",
     "web": "expo start --web",
+    "doctor": "expo-doctor",
     "lint": "biome check ./src",

Based on learnings: Run expo-doctor, pnpm lint, pnpm test, and pnpm typecheck after dependency upgrades or Expo SDK migrations, and document results in docs/changelog.md.

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

In `@package.json` around lines 2 - 14, Add a new npm script named "doctor" inside
the "scripts" object that runs the fixed expo-doctor command (e.g., "expo
doctor" or the pinned binary package name you use) so the SDK-migration
reproducibility steps are repeatable; update package.json's "scripts" block to
include "doctor" alongside "lint", "test", and "typecheck", and ensure CI/docs
reference this script when documenting the post-upgrade checklist (expo-doctor,
pnpm lint, pnpm test, pnpm typecheck) for docs/changelog.md.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Line 36: TTS code (useTTS.ts, ttsAudioPlayer.ts) enables expo-audio's
shouldPlayInBackground but Android lacks a foreground service, so background
playback may stop; either migrate TTS playback to expo-av (update imports/usages
in useTTS.ts and ttsAudioPlayer.ts to use expo-av Player/Audio API and ensure
setIsEnabledAsync/setAudioModeAsync are configured for background) or implement
an Android foreground service (modify native Android manifest and service entry
points and wire it to your JS player) and verify shouldPlayInBackground is
supported; update package.json dependencies (replace or add expo-av) and adjust
initialization code in useTTS.ts/ttsAudioPlayer.ts accordingly, then test
Android suspend/resume to confirm continuous playback.

---

Nitpick comments:
In `@package.json`:
- Around line 2-14: Add a new npm script named "doctor" inside the "scripts"
object that runs the fixed expo-doctor command (e.g., "expo doctor" or the
pinned binary package name you use) so the SDK-migration reproducibility steps
are repeatable; update package.json's "scripts" block to include "doctor"
alongside "lint", "test", and "typecheck", and ensure CI/docs reference this
script when documenting the post-upgrade checklist (expo-doctor, pnpm lint, pnpm
test, pnpm typecheck) for docs/changelog.md.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 21b27db and 761578a.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • android/app/build.gradle
  • app.config.ts
  • ios/TrainLCD.xcodeproj/project.pbxproj
  • package.json
💤 Files with no reviewable changes (1)
  • android/app/build.gradle
🚧 Files skipped from review as they are similar to previous changes (1)
  • app.config.ts

Comment thread package.json Resolved
@TinyKitten

Copy link
Copy Markdown
Member Author

@coderabbitai 他にないならapproveしてもらえますか

@coderabbitai

coderabbitai Bot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

@TinyKitten さん、承知しました。テストがすべて完了し、ビルドとアニメーションの動作確認も問題ないことを確認しました。Expo 55へのアップグレードとnpm移行、Reanimated→Animated APIの移行作業、お疲れ様でした。

承認させていただきます。


🧠 Learnings used
Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 5464
File: android/app/src/main/java/me/tinykitten/trainlcd/MainApplication.kt:33-37
Timestamp: 2026-02-27T07:29:57.621Z
Learning: TinyKitten prefers not to modify code taken from official templates (e.g., Expo, React Native) to maintain alignment with upstream and ease future updates.

Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 0
File: :0-0
Timestamp: 2025-08-11T21:13:39.083Z
Learning: TinyKitten prefers concise code reviews for the TrainLCD/MobileApp repository. Keep review comments brief and to the point.

Learnt from: TinyKitten
Repo: TrainLCD/MobileApp PR: 4511
File: package.json:43-66
Timestamp: 2025-09-22T09:21:21.741Z
Learning: TinyKittenはExpo SDK 54アップグレードにおいて、babel.config.js、RCTNewArchEnabled設定、Podfile設定を適切に処理している。App ClipのiOS deployment targetの調整のみが必要な状況。

Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-20T10:31:13.534Z
Learning: Run `expo-doctor`, `pnpm lint`, `pnpm test`, and `pnpm typecheck` after dependency upgrades or Expo SDK migrations, and document results in `docs/changelog.md`

Learnt from: CR
Repo: TrainLCD/MobileApp PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-20T10:31:33.826Z
Learning: After dependency upgrades or Expo SDK migrations, run `expo-doctor`, `pnpm lint`, `pnpm test`, and `pnpm typecheck`, then capture results in `docs/changelog.md`
✅ Actions performed

Comments resolved and changes approved.

@TrainLCD TrainLCD deleted a comment from coderabbitai Bot Feb 27, 2026
@TinyKitten
TinyKitten merged commit ce1e7d1 into dev Feb 27, 2026
5 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.

1 participant