- 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.
- Implemented a script to generate a Tampermonkey userscript from ndView.tsx.
- Extracted and modified the operation page script body to include necessary postMessage functions.
- Added metadata for the userscript including name, namespace, version, and match URL.
- Ensured compatibility with Tampermonkey's GM_download for image capture.
- 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.
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 <[email protected]>
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 <[email protected]>
- 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 <[email protected]>