Commit Graph
144 Commits
Author SHA1 Message Date
harukin-expo-dev-env 30b8b37343 fix: 津島ノ宮駅の表示ロジックを削除し、関連コードを整理 2026-08-06 08:06:34 +00:00
harukin-expo-dev-env 3a7e2c060c fix: 津島ノ宮駅のGoogleマップURLを修正 2026-08-03 23:29:35 +00:00
harukin-expo-dev-env 0207a728e8 fix: 津島ノ宮駅の表示ロジックを追加し、駅間の位置データを正しく表示 2026-08-03 22:52:57 +00:00
harukin-expo-dev-env dfec6d1c89 fix: 列車情報の表示ロジックを改善し、条件付きHTML生成を追加 2026-07-14 09:11:23 +00:00
harukin-expo-dev-env 12b01edb3e fix: 修正された列車データの取得と表示ロジックを改善し、未登録列車の処理を追加 2026-07-14 00:46:35 +00:00
harukin-expo-dev-env ca045ca3a3 feat: Implement X投稿向け運行情報画像セット generation in ndView.tsx
- Added functionality to generate a set of images for posting to X (formerly Twitter) with multiple images.
- Introduced a new button for creating X投稿向け画像, which generates up to 4 PNG images.
- The first image serves as a cover with a route map and summary, while subsequent images contain detailed operation information.
- Ensured images maintain a fixed size of 1080 x 1440 px and follow specific naming conventions.
- Implemented error handling for image generation failures and ensured compatibility with existing sharing features.
- Updated UI elements and styles for the new functionality, including button states and layout adjustments.
- Added necessary TypeScript type checks and validation for the new features.
2026-07-12 19:01:51 +00:00
harukin-expo-dev-env 9fe6f3ebf3 履歴管理機能を追加し、ビューポートメタタグの管理を強化 2026-07-10 11:28:15 +00:00
harukin-expo-dev-env 3f6b9da6c5 Adjust train type badge rendering 2026-07-09 10:15:49 +00:00
harukin-expo-dev-env c44bad5f86 unyohubアイコン対応 2026-06-23 16:40:44 +00:00
harukin-expo-dev-envandCopilot ce4172d327 fix: マリンライナー編成順序の修正(elesite連携)
マリンライナー(3xxxM)の岡山〜高松間の駅シーケンスを
elesiteTrainOrder.ts と webViewInjectjavascript.ts に追加。
originData には JR 西日本区間の駅がないため、
MARINE_STATION_SEQUENCE としてインラインで定義した。

これにより heading_to:"unknown" のマリン系統でも
正しく進行方向を推論できるようになり、
連結順序が逆順になる問題を解消した。

Co-authored-by: Copilot <[email protected]>
2026-05-20 13:48:47 +00:00
harukin-expo-dev-env 48a078f831 feat: add experimental diagram URL support and update related components 2026-05-19 03:06:45 +00:00
harukin-expo-dev-env 17565da7ab Refactor Elesite sorting logic and introduce new utility functions
- Moved the Elesite sorting logic to a new module `elesiteTrainOrder.ts`.
- Created utility functions to infer heading direction and sort Elesite entries by train number.
- Updated `injectJavascriptData` to utilize the new sorting logic and handle station sequences.
- Refactored `useElesite` to use the new sorting utility for improved readability and maintainability.
2026-05-15 17:21:18 +00:00
harukin-expo-dev-env 86092b33de Add script to compile web inject JavaScript with minification and obfuscation options
- Introduced `compile-web-script.ts` for generating JavaScript files for userscripts.
- Supports options for minification and obfuscation.
- Generates base JS, minified JS, and obfuscated userscript.
- Configurable via command line arguments and environment variables.
2026-05-05 08:04:47 +00:00
harukin-expo-dev-env bd1b1f15c0 fix: update header colors in injected JavaScript for better visibility 2026-05-02 02:52:22 +00:00
harukin-expo-dev-envandCopilot 85b0eb5b58 fix: eliminate UX flash by calling setStrings() immediately in observer
The 100ms pure-debounce approach caused a visible layout flash on every
render (normal mode too) because Tokyo UX was not applied for 100ms.

Fix: call setStrings() immediately in the MutationObserver callback to
prevent any flash, AND keep a 250ms delayed follow-up call to catch
async train re-renders from mock XHR setTimeout(0) responses.

Co-authored-by: Copilot <[email protected]>
2026-05-01 11:59:52 +00:00
harukin-expo-dev-envandCopilot 8885a70792 fix: re-apply Tokyo UX after async train re-renders
Root cause: setStrings() was called synchronously in setReload(),
but the mock XHR interceptor responds via setTimeout(0), so the
site re-rendered train elements AFTER setStrings() ran, stripping
Tokyo UX styling.

Two-pronged fix:
1. setReload() now calls setStrings() again after 200ms to
   re-apply Tokyo UX once the async re-render completes.
2. textInsert MutationObserver now watches with subtree:true
   (childList only, not attributes - no infinite loop risk)
   with 100ms debouncing, so ANY train element re-render
   (including those triggered by mock XHR data) will trigger
   a re-application of Tokyo UX.
   - currentLines postMessage now only fires when direct
     children of #disp change (line selection changes only)

Co-authored-by: Copilot <[email protected]>
2026-05-01 11:51:13 +00:00
harukin-expo-dev-envandCopilot c6aecd151c fix: Tokyo UX stripped when mock is active
Two bugs caused the Tokyo UX to be stripped/broken when mock mode was ON:

1. **Double callback firing**: the interceptor's `setTimeout` called both
   `onreadystatechange.call(self)` AND `dispatchEvent(new Event('readystatechange'))`.
   Since `dispatchEvent` already fires `onXxx` property handlers via the DOM event
   model, the page's callback fired twice, causing a second DOM re-render that could
   overwrite Tokyo UX modifications. Fixed by relying on `dispatchEvent` only (with
   `ProgressEvent` for load events), with a direct-call fallback only for environments
   that lack `dispatchEvent`.

2. **No double-injection guard**: if `injectedJavaScriptBeforeContentLoaded` caused
   the interceptor to run more than once (e.g., `onPageStarted` fires multiple times
   on Android), `_origOpen` would capture the already-patched version, leading to
   unexpected behaviour. Fixed by adding `if (window.__jrsMockActive) return;` at the
   top of the interceptor IIFE.

3. **Belt-and-suspenders injection**: the interceptor is now also prepended to
   `injectedJavaScript` (Tokyo UX script) via the restored `mockApiConfig` parameter
   on `injectJavascriptData`. The `__jrsMockActive` guard ensures it's a no-op when
   `injectedJavaScriptBeforeContentLoaded` already ran it, but guarantees the
   interceptor is active on platforms where IJBCL is unreliable — before
   `MoveDisplayStation` triggers the first train-data poll via `onLoadEnd`.

Co-authored-by: Copilot <[email protected]>
2026-05-01 11:40:11 +00:00
harukin-expo-dev-envandCopilot 75fce29d74 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 <[email protected]>
2026-04-30 16:50:55 +00:00
harukin-expo-dev-envandCopilot eed51d31fa feat: add WebView XHR interceptor for mock train position injection
- Scrape & analyse all 19 internal APIs of train.jr-shikoku.co.jp/sp.html
  using puppeteer + Chromium remote debugging
- Save live-captured sample JSON for every API endpoint under
  lib/mockApi/mockData/ (station lists, lang, timetable, train positions, etc.)
- Add lib/mockApi/webviewXhrInterceptor.ts – generates a JS snippet that
  overrides XMLHttpRequest inside the WebView before page scripts run;
  intercepts /g?arg1=train&arg2=train (and optionally all static APIs)
  returning mock data instead of the real server response
- Add lib/mockApi/index.ts – convenience re-exports + MOCK_TRAIN_POSITIONS
  constant pre-populated with captured sample data
- Extend InjectJavascriptOptions with optional mockApiConfig field
- injectJavascriptData() prepends the interceptor JS when mockApiConfig is set
- TrainMenuContext gains mockApiEnabled / setMockApiEnabled and
  mockTrainPositions / setMockTrainPositions state; consumers can enable
  mock mode and inject custom TrainEntry[] without reloading the app

Co-authored-by: Copilot <[email protected]>
2026-04-30 15:30:06 +00:00
harukin-expo-dev-env 1567468071 fix: expose setReload function to the global window object for accessibility 2026-04-30 14:01:55 +00:00
harukin-expo-dev-env bfdbef6e6f fix: update WebView navigation and adjust interval timing in CurrentTrainProvider 2026-04-19 11:09:13 +00:00
harukin-expo-dev-env 990e6f4a04 Add new logo image for Elesite to relationLogo assets 2026-04-13 07:47:25 +00:00
harukin-expo-dev-env 86713d2647 WebViewコンポーネントにcontentMode="mobile"を追加し、表示を最適化 2026-03-30 23:45:31 +00:00
harukin-expo-dev-env 6d66a7bdd2 HeaderText: useMemoフックにtrainNumとallCustomTrainDataを追加して依存関係を最適化
TrainIconStatus: アンパンマンステータスAPIのエンドポイント判定を追加
webViewInjectjavascript: 新しい列車アイテムの最大幅を設定
2026-03-30 05:54:25 +00:00
harukin-expo-dev-env be0080389a fix: サウンド設定のJavaScriptインジェクションを遅延させ、列車番号のオーバーライドを追加 2026-03-29 11:42:09 +00:00
harukin-expo-dev-env 69b8dc9d88 feat: カラーテーマ設定とサウンド設定機能を追加し、外部起動方法をREADMEに記載 2026-03-26 13:55:24 +00:00
harukin-expo-dev-env a4e3e0833d fix: UIの色設定をダークモードに対応させ、視認性を向上 2026-03-26 08:56:31 +00:00
harukin-expo-dev-env 814de31418 feat: add date formatting and stale check for Unyohub entries in TrainDataSources 2026-03-23 01:10:59 +00:00
harukin-expo-dev-env 684aaeb92f fix(webViewInjectjavascript): improve operation list fetching logic to handle null data 2026-03-17 02:33:52 +00:00
harukin-expo-dev-env 983d48a1fe fix: update cache expiration times for various data types 2026-03-11 08:41:47 +00:00
harukin-expo-dev-env cc15e6a1ee feat: update elesite integration to prioritize non-empty formation units and improve sorting logic 2026-03-08 08:52:58 +00:00
harukin-expo-dev-env 66650764df feat: add elesite integration and configuration settings
- Introduced useElesite hook for managing elesite data and settings.
- Added elesite logo asset.
- Updated types to include elesite data structures.
- Enhanced TrainMenuProvider to manage elesite usage settings.
- Implemented data fetching and caching for elesite information.
- Added utility functions to retrieve train information from elesite data.
2026-03-07 16:24:07 +00:00
harukin-expo-dev-env d7f227d5e5 運用Hubの列車データ取得ロジックを改善し、方向に基づいて運用番号を正しい順序でソートする機能を追加 2026-03-06 10:37:00 +00:00
harukin-expo-dev-env ac2548e7b6 運用Hub情報の判定ロジックを改善し、車番が空でないエントリのみを考慮するように修正 2026-03-06 07:24:58 +00:00
harukin-expo-dev-env 7b7ec45bfa 停止中の点滅アニメーションを動的に注入する機能を追加 2026-03-03 02:52:25 +00:00
harukin-expo-dev-env b60a43f25c setReloadの呼び出しをsetTimeoutで遅延させ、スクリプト実行の完了後に処理を行うように変更 2026-03-02 12:50:56 +00:00
harukin-expo-dev-env 7004eeefad Add station data, train icon mapping, and train type configuration
- Introduced `stationData.ts` to store station information including names, numbers, and features.
- Created `trainIconMap.ts` for mapping train numbers to their respective image URLs, including dynamic URLs for special trains.
- Added `trainTypeConfig.ts` to define display settings for various train types, including colors and labels for different categories.
2026-03-02 12:38:43 +00:00
harukin-expo-dev-env 413ef4acb3 不要なコメントを削除し、列番データの処理を簡素化 2026-03-02 09:37:04 +00:00
harukin-expo-dev-env 7f3a1493ef InjectJavascriptOptionsインターフェースを追加し、injectJavascriptData関数の引数をオブジェクト形式に変更 2026-03-02 09:06:25 +00:00
harukin-expo-dev-env 8e64932a01 useIntervalとwebViewInjectjavascriptでのデータ取得処理を最適化し、localStorageキャッシュを実装。バックグラウンド復帰時にデータを即時再取得する機能を追加。 2026-03-02 05:59:01 +00:00
harukin-expo-dev-env 9036e7a8c1 古いWebViewの互換性向上のため、onclick属性の処理を改善し、イベントの伝播を制御。PopUpMenuとShowTrainTimeInfo関数をObject.definePropertyでロック。 2026-03-02 04:05:48 +00:00
harukin-expo-dev-env 1bf4a6991d Font Awesomeの依存を削除し、インラインSVGに置き換え。全WebView対応のバッジ表示を実装。 2026-03-02 03:40:09 +00:00
harukin-expo-dev-env 03b9080c06 Font Awesomeの非同期読み込みを追加し、lodash依存を削除。軽量な変更検出ユーティリティを実装し、データ取得処理を最適化。 2026-03-02 03:27:22 +00:00
harukin-expo-dev-env 4952e32e65 アイコンの反転表示対応 2026-02-20 17:06:01 +00:00
harukin-expo-dev-env ff46c6ac8f 各コンポーネントでキャッシュバスティングを実装し、運用hubデータの取得時にタイムスタンプを追加。列車情報の表示をスクロール可能な形式に変更。 2026-02-13 15:49:04 +00:00
harukin-expo-dev-env 0a677c908d 列車運用hubの設定を追加し、データ取得ロジックを実装 2026-02-09 03:42:30 +00:00
harukin-expo-dev-env a42c0871bd unyohub連携仮作成 2026-02-07 17:19:16 +00:00
harukin-expo-dev-env ec947ab4ec optionalTextに「最終」がある場合に赤色に 2026-02-07 08:47:03 +00:00
harukin-expo-dev-env b653ab8b5b 複数色に対応したグラデーション生成機能を追加 2026-02-02 14:20:08 +00:00
harukin-expo-dev-env efd260ca72 release準備 2026-02-01 10:20:51 +00:00