112 Commits

Author SHA1 Message Date
harukin-expo-dev-env
3554233994 fix: update header colors in injected JavaScript for better visibility 2026-05-02 02:52:22 +00:00
harukin-expo-dev-env
d71cc373c9 fix: sync WebView train display when playback frame changes
The XHR interceptor baked _MOCK_TRAIN at page load time, so seeking or
advancing a playback frame only changed React state but had no effect
on the already-loaded WebView page.

- webviewXhrInterceptor.ts:
  - Expose window.__jrsMockUpdateTrain(newData) from inside the IIFE so
    the _MOCK_TRAIN variable can be updated after page load
  - Add generateMockUpdateScript(trainPositions) helper: calls
    __jrsMockUpdateTrain with fresh data + GetDateTime, then calls
    window.setReload() to trigger the page's own redraw cycle

- WebView.tsx:
  - Import generateMockUpdateScript
  - Add useEffect watching mockTrainPositions (skips first mount since
    beforeContentLoaded already has correct data)
  - When mockApiFeatureEnabled && mockTrainPositions changes, inject the
    update script via webview.current.injectJavaScript()

Result: seeking, prev/next frame, and auto-advance during playback now
immediately update the train position display in the WebView.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-02 01:06:34 +00:00
harukin-expo-dev-env
3587f72434 feat: add RecordingStatusBar with elapsed timer and keep-awake
- RecordingStatusBar.tsx: shown during recorderState === 'recording'
  - absolute positioned red bar at top of map screen (zIndex 2000)
  - blinking REC dot (700ms interval) + REC label + MM:SS elapsed timer
  - snapshot count display (right side)
  - pointerEvents="none" so it doesn't block map interaction
  - activateKeepAwakeAsync while recording, deactivated on stop/unmount
    (same pattern as FixedPositionBox, tag = 'recording-status-bar')
- Apps.tsx: render <RecordingStatusBar /> alongside PlaybackTimeline

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-02 00:59:03 +00:00
harukin-expo-dev-env
4f4d3cad0a fix: crash on playback start + support multiple recordings
Crash fix (React Hooks violation):
- PlaybackTimeline.tsx: move ALL hooks (useRef for PanResponder, useCallback)
  to before the early return; use seekRef/totalRef to share values into
  PanResponder handlers without stale closure issues

Multiple recordings support:
- trainRecorder.ts: redesign to id-based multi-recording system
  - RecordingMeta type for lightweight list (no snapshots)
  - TrainRecording now includes id field
  - saveRecording/loadRecordingById/deleteRecordingById/loadRecordingList
  - migrateOldRecording() migrates old single MOCK_RECORDING key on first launch
- constants/storage.ts: add MOCK_RECORDINGS_INDEX + MOCK_RECORDING_DATA_PREFIX keys
- useTrainMenu: savedRecording → recordingList (RecordingMeta[]) + activeRecording (TrainRecording|null)
  - startPlayback(id) loads full recording on demand
  - deleteRecording(id) deletes by id and refreshes list
  - stopPlayback clears activeRecording
- DataSourceSettings: recording list UI
  - shows all recordings with date/time, snapshot count, duration
  - ▶ play and 削除 buttons per row
  - recording/playing status indicator

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-02 00:52:30 +00:00
harukin-expo-dev-env
8144e8a48a feat: add playback timeline UI with pause/resume/seek controls
- useTrainMenu: add playbackPaused state, pausePlayback/resumePlayback/seekToSnapshot
  - playback loop now respects playbackPaused (no timer when paused)
  - seekToSnapshot pauses playback and immediately applies snapshot data
  - expose playbackIndex, playbackPaused + new functions in context value
- PlaybackTimeline.tsx: new component shown when recorderState === 'playing'
  - absolute positioned bar at top of map screen (zIndex 2000)
  - prev/play-pause/next frame buttons + skip-to-start/end
  - time display (HH:mm:ss) + snapshot counter (n/total) + total duration
  - PanResponder-based scrubber track with filled progress bar and draggable thumb
- Apps.tsx: render <PlaybackTimeline /> alongside FixedPositionBox
- Remove MockApiToggle.tsx (no longer used since settings-only toggle)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-02 00:42:56 +00:00
harukin-expo-dev-env
a35956848a refactor: remove map-screen MOCK switch; settings toggle controls mock directly
The separate runtime MOCK switch on the map screen is removed.
Now the admin-only settings toggle (MOCK_API_FEATURE_ENABLED) is the
single control point — turning it on activates mock mode immediately,
turning it off deactivates it.

- useTrainMenu: remove mockApiEnabled/setMockApiEnabled state;
  mockApiConfig now derives from mockApiFeatureEnabled alone
- WebView: use mockApiFeatureEnabled for key prop (triggers reload)
- Apps.tsx: remove MockApiToggle import and JSX usage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-01 12:35:36 +00:00
harukin-expo-dev-env
1dcc25dec0 chore: update train.json with live disrupted data (2026-05-01 19:42)
94列車、62列車遅延の運行乱れデータをキャプチャ。
モックAPIのテストデータとして有用な状態。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-01 10:43:19 +00:00
harukin-expo-dev-env
8321a47cbb fix: move XHR interceptor to injectedJavaScriptBeforeContentLoaded
インターセプターをページスクリプトより前に実行されるよう修正。
injectedJavaScript(ページ読込後)からinjectedJavaScriptBeforeContentLoaded
(ページスクリプト実行前)へ移動することで、モックON時のページフリーズを解消。

- lib/webViewInjectjavascript.ts: injectJavascriptDataからインターセプターを分離、
  generateBeforeContentLoadedScript()を新規エクスポート
- stateBox/useTrainMenu.tsx: injectJavascriptBeforeContentLoadedを別途計算しコンテキストに追加
- components/Apps/WebView.tsx: injectedJavaScriptBeforeContentLoadedプロップを追加

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 16:50:55 +00:00
harukin-expo-dev-env
42473189da fix: reload WebView on mock toggle and fix XHR callback timing bug
- components/Apps/WebView.tsx:
  - import mockApiEnabled from context
  - add mockApiEnabled to WebView key so toggling forces a full reload
    (injectedJavaScript only runs at page load, so reload is required)

- lib/mockApi/webviewXhrInterceptor.ts:
  - Fix callback timing bug: callbacks set before open() were stored on
    _orig (because _mockBody was null), never on self._onload, causing
    mock send() to fire no-op callbacks
  - Always store all callbacks/listeners in _callbacks/_listeners maps
  - Apply _callbacks to _orig at send() time when not mocked
  - Fix addEventListener: always buffer in _listeners, apply to _orig
    at send() time; add removeEventListener support

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 15:50:37 +00:00
harukin-expo-dev-env
71e1ad8d22 feat: add admin mock API toggle in settings and map screen switch
- constants/storage.ts: add MOCK_API_FEATURE_ENABLED key
- stateBox/useTrainMenu.tsx:
  - import MOCK_TRAIN_POSITIONS; auto-populate on mount and on toggle-off
  - add mockApiFeatureEnabled (persistent, admin-only) state + setter
  - mockApiConfig now requires both mockApiFeatureEnabled AND mockApiEnabled
- components/Settings/DataSourceSettings.tsx:
  - add mock API debug section (admin-gated, showDebugSelector)
  - Switch toggles mockApiFeatureEnabled and persists to AsyncStorage
- components/Apps/MockApiToggle.tsx: new component
  - absolute-positioned to the left of ReloadButton
  - visible only when mockApiFeatureEnabled && mapSwitch==="true"
  - MOCK label + Switch toggles mockApiEnabled runtime state
- components/Apps.tsx: render MockApiToggle alongside ReloadButton

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 15:41:24 +00:00
harukin-expo-dev-env
057e595220 各コンポーネントにおけるLive Activity機能の一時的無効化、アイコン設定の改善、アイコンリストのセクション化、及び関連する状態管理の追加 2026-04-01 10:14:49 +00:00
harukin-expo-dev-env
69e61b401c Live Activity機能を一時的に無効化し、関連するコードを修正 2026-03-31 17:34:59 +00:00
harukin-expo-dev-env
b3d7ba448d WebViewコンポーネントにcontentMode="mobile"を追加し、表示を最適化 2026-03-30 23:45:31 +00:00
harukin-expo-dev-env
1084b6b299 各コンポーネントのアニメーション最適化とリファクタリング: useSharedValueとuseAnimatedStyleを導入し、パフォーマンスを向上 2026-03-30 10:11:14 +00:00
harukin-expo-dev-env
fbb8580d28 ActionSheetアニメーション阻害の修正: LayoutAnimation削除とブリンクアニメーション最適化
- ActionSheet内外のLayoutAnimation.configureNext/easeInEaseOutを削除
  (グローバルにレイアウト更新を乗っ取り、シートの開閉アニメーションと競合するため)
- trainIconStatus: reanimated withRepeat→useInterval+setStateに変更
  (UIスレッドの無限アニメーションがActionSheetスプリングと競合するため)
- EachTrainInfo: Rules of Hooks違反修正(useRef/useSheetMaxHeightを条件分岐前に移動)
- useAutoScroll: InteractionManager.runAfterInteractionsでシート展開完了後に実行

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 10:09:45 +00:00
harukin-expo-dev-env
9d76264a28 各コンポーネントでのuseMemoフックの追加とデータ処理の最適化 2026-03-30 04:00:25 +00:00
harukin-expo-dev-env
5420531c64 feat: Samsung DeXレスポンシブ対応 - lib/responsive.ts追加、主要コンポーネントにスケーリング適用
- useResponsive()フックを作成(fontScale/verticalScale/moderateScale)
- ベースデザイン: iPhone 14 Pro (393x852)、スケールダウンのみ(最大1.0)
- DynamicHeaderScrollView: ヘッダー高さにverticalScale適用
- EachTrainInfoCore: maxHeight緩和(70→80%)、ハンドラーサイズスケーリング
- StateBox/PositionBox/ScrollStickyContent/HeaderText: fontScale適用
- DataConnectedButton/EachStopList: fontScale+moderateScale適用
- JRSTraInfo/StationDeteilView: ハンドラー+フォントスケーリング
- ReloadButton/MapsButton/NewMenu: ボタンサイズ+フォントスケーリング
- useDeviceOrientationChange: 全Android端末でisLandscape=false
2026-03-29 15:23:28 +00:00
harukin-expo-dev-env
5cf864b9ab fix: サウンド設定のJavaScriptインジェクションを遅延させ、列車番号のオーバーライドを追加 2026-03-29 11:42:09 +00:00
harukin-expo-dev-env
5e66fab175 feat: カラーテーマ設定とサウンド設定機能を追加し、外部起動方法をREADMEに記載 2026-03-26 13:55:24 +00:00
harukin-expo-dev-env
e1293d2500 fix: UIの色設定をダークモードに対応させ、視認性を向上 2026-03-26 08:56:31 +00:00
harukin-expo-dev-env
8ce0244c4b fix: 駅固定通知の出発済み列車フィルタと棒線駅接近判定を修正
- バックグラウンドで出発済み列車が消えないバグを修正
  (LiveActivityForegroundService: scheduledMinutes+delay<nowMinutes で除外)
- parseTimeToMinutes() ヘルパーを Kotlin に追加
- UI側も遅延加算した発車時刻で出発済み判定するよう統一
  (StationDiagramView: getDelayMinutes + dayjs.add)
- between.ts の BetweenStation を使った接近セクション判定を実装
  (棒線駅で列車がセクション手前に居る場合は未到達扱いで保持)
- StationTrainInfo に sectionStation フィールドを追加
  (prevStop/nextStop を廃止し API Pos と直接照合可能な文字列に変更)
- docs/station-lock-dual-impl.md 作成(KotlinとTS間のデュアル実装ガイド)
2026-03-26 03:00:59 +00:00
harukin-expo-dev-env
50e514543b Refactor code structure for improved readability and maintainability 2026-03-25 15:09:56 +00:00
harukin-expo-dev-env
bf5be9bd57 feat: implement sound announcement feature for delayed trains with settings 2026-03-25 14:05:59 +00:00
harukinMBP
0bcb03f833 refactor: remove live notification functionality from FixedStation and FixedTrain components 2026-03-25 02:07:43 +09:00
harukinMBP
9037d21237 fix: TypeScript build errors (143 to 47) 2026-03-25 01:44:29 +09:00
harukin-expo-dev-env
4789543573 Merge origin/develop into develop and resolve conflicts 2026-03-24 16:11:08 +00:00
harukin-expo-dev-env
53b95a91d5 fix: アイコンプレビューが表示されないバグを修正
Image コンポーネントに padding: 30 を直接設定していたため、
RN 0.76+ の新アーキテクチャでコンテンツ領域がゼロになり画像が非表示になっていた。
padding を持つ wrapper View に移動し、Image サイズを 50x50 から 80x80 に拡大。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 08:26:40 +00:00
harukin-expo-dev-env
80eeb51134 fix: 各コンポーネントのスタイルとナビゲーションを改善し、パフォーマンスを向上 2026-03-24 06:39:37 +00:00
harukin-expo-dev-env
59653bbc16 fix: ダークモードに対応し、背景色を動的に変更 2026-03-24 04:37:46 +00:00
harukin-expo-dev-env
1d57f2a5c6 fix: 通知折りたたみ時も走行区間を表示
- contentTextにbody全行を全角スペース区切りで表示(折りたたみ時も見える)
- pollTrainPositionの変化なしスキップを除去(常に通知を更新)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 02:54:24 +00:00
harukin-expo-dev-env
d3e4b173c7 fix: StationNumber: null のスポットによるクラッシュを修正
- CarouselBox: key と keyExtractor を null セーフに
- StationPagination: data が空の場合の early return と optional chaining
- FixedStationBox / FixedTrainBox / ListViewItem: StationNumber?.slice() に修正

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 02:11:17 +00:00
harukin-expo-dev-env
dc3d250466 fix: 次駅表示をDirection非依存に修正(JS/Kotlin両方)
- JS側: currentPosition[0]ではなくstopStationIDList上のmax(idx0,idx1)で進行方向の駅を判定
- Kotlin側: pollRunnable復活、allStationsのダイヤ順でmaxOf(idx0,idx1)で向かう駅を判定
- Kotlin at-station: 停車中は現在駅を表示(JS側と統一)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 01:39:31 +00:00
harukin-expo-dev-env
3f6b3cfcfb fix: API呼び出しにタイムアウトを追加し、エラーハンドリングを改善 2026-03-24 00:19:19 +00:00
harukin-expo-dev-env
2cd5142262 fix: バックグラウンドでのデータ取得を継続し、列車追跡の終了条件をフォアグラウンドに依存させるよう修正 2026-03-23 15:52:23 +00:00
harukin-expo-dev-env
fb89a2b334 fix: Live Activity関連の不要なコードを削除し、トレイン情報の構築を最適化 2026-03-23 14:54:56 +00:00
harukin-expo-dev-env
a66af59438 fix: Live Activityの定期的な更新を追加し、selectedTrainの再計算を60秒ごとに実施 2026-03-23 11:45:08 +00:00
harukin-expo-dev-env
04d0f50b99 fix: Live Activityの自動開始条件をselectedTrainに依存させるように修正 2026-03-23 11:33:36 +00:00
harukin-expo-dev-env
91470b5db8 fix: LiveActivityButtonを削除し、FixedStationおよびFixedTrainコンポーネントでの自動Live Activity開始を実装 2026-03-23 11:25:29 +00:00
harukin-expo-dev-env
ffcc6ff660 fix: 列車通知機能に路線色を追加し、進捗スタイルのセグメントに対応 2026-03-23 10:55:14 +00:00
harukin-expo-dev-env
681b12b622 fix: 通知機能のエラーハンドリングを改善し、Androidの通知権限を要求する処理を追加 2026-03-23 09:37:15 +00:00
harukin-expo-dev-env
13f2c4de7a feat: 駅固定モード バックグラウンド更新 + 通知書式改善
- 駅固定モードでもForeground Serviceのバックグラウンドポーリングを有効化
- pollStationTrains(): APIから遅延情報を取得し通知を自動更新
- テキスト書式を「00:00 特急 ○○号 ○○行 定刻」に変更
- StationTrainInfo に typeColor フィールド追加
- StationLockNotificationBuilder: 種別名にBackgroundColorSpan適用
- ExpoLiveActivityModule: 駅固定もMap引数方式に変更
- trainsJson/stationName をServiceに保存してバックグラウンドで使用

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 06:31:05 +00:00
harukin-expo-dev-env
9271629aa9 fix: ProgressStyle復元 + 進捗位置更新の修正
- ProgressStyle (Point/Segment) を復元して描画
- 停車駅のみPointを配置(通過駅はセグメントのみ)
- currentStationIndex の部分一致フォールバック追加
- currentPosition 依存を除去し train.Pos から直接計算
- bodyフォーマッタで currentStation の '~' 区間を正しく分離

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 05:44:30 +00:00
harukin-expo-dev-env
86a4428861 feat: 通知進捗バー再設計 - 全駅対応の進捗表示
- 進捗バー: 小●=通過駅, 大●=停車駅, 🚃=現在地
- タイトル: ○○号 ○○行き
- サブタイトル: 次は ●● / △△~△△間走行中
- StationEntry (name, isStop) で全駅リスト(通過含む)を通知に渡す
- TrainFollowNotificationBuilder: allStationsJson対応のProgressStyle
- LiveActivityForegroundService: バックグラウンドポーリングでも全駅インデックス計算
- FixedTrainBox/LiveActivityButton: allStations, currentStationIndex を計算・送信

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 05:01:55 +00:00
harukin-expo-dev-env
0a2333a201 feat: add Android notification permission handling and improve error logging for live notifications 2026-03-22 23:06:56 +00:00
harukin-expo-dev-env
deb24caaa2 feat: add station progress tracking and notification updates for train follow feature 2026-03-22 17:09:19 +00:00
harukin-expo-dev-env
39a5b33e77 feat: add station progress tracking and notification updates for train follow feature 2026-03-22 17:09:19 +00:00
harukin-expo-dev-env
fbfb83fa34 feat: add live activity notifications for train tracking and station locking
- Implemented ExpoLiveActivity module for Android to manage live notifications.
- Added foreground service for train tracking and station locking notifications.
- Updated app permissions to include POST_NOTIFICATIONS.
- Enhanced FixedStation and FixedTrain components to support live notifications.
- Introduced new notification builders for train and station activities.
- Updated useCurrentTrain and useNotifications hooks to manage live notification state.
- Added notification channel for live tracking in Android.
2026-03-22 16:15:48 +00:00
harukin-expo-dev-env
777b5c8acb feat: add live activity notifications for train tracking and station locking
- Implemented ExpoLiveActivity module for Android to manage live notifications.
- Added foreground service for train tracking and station locking notifications.
- Updated app permissions to include POST_NOTIFICATIONS.
- Enhanced FixedStation and FixedTrain components to support live notifications.
- Introduced new notification builders for train and station activities.
- Updated useCurrentTrain and useNotifications hooks to manage live notification state.
- Added notification channel for live tracking in Android.
2026-03-22 16:15:48 +00:00
harukin-expo-dev-env
b243439e78 Refactor code structure for improved readability and maintainability 2026-03-20 07:14:58 +00:00
harukin-expo-dev-env
91cad9c2c8 Refactor code structure for improved readability and maintainability 2026-03-20 07:14:58 +00:00