Skip to content
Merged

canary #6988

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ android {
dimension "environment"
applicationId "me.tinykitten.trainlcd.dev"
versionNameSuffix "-dev"
versionCode 100000765
versionCode 100000767
versionName "10.15.1"
}
prod {
dimension "environment"
versionCode 100000765
versionCode 100000767
versionName "10.15.1"
}
// ストア配信する dev (Canary) と applicationId を分けた、ローカル検証専用のフレーバー。
Expand All @@ -177,7 +177,7 @@ android {
dimension "environment"
applicationId "me.tinykitten.trainlcd.local"
versionNameSuffix "-local"
versionCode 100000765
versionCode 100000767
versionName "10.15.1"
}
}
Expand Down
6 changes: 3 additions & 3 deletions android/wearable/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ android {
dimension = "environment"
applicationIdSuffix = ".dev"
versionNameSuffix = "-dev"
versionCode = 100000766
versionCode = 100000768
versionName = "10.15.1"
}
create("prod") {
dimension = "environment"
versionCode = 100000766
versionCode = 100000768
versionName = "10.15.1"
}
// :app の local フレーバーと対になるローカル検証専用フレーバー。Wear の Data Layer は
Expand All @@ -100,7 +100,7 @@ android {
dimension = "environment"
applicationIdSuffix = ".local"
versionNameSuffix = "-local"
versionCode = 100000766
versionCode = 100000768
versionName = "10.15.1"
}
}
Expand Down
4 changes: 2 additions & 2 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default {
userInterfaceStyle: 'automatic',
// Expo SDK 57 の各モジュール(expo / expo-modules-core ほか)は podspec で iOS 16.4 以上を要求する
deploymentTarget: '16.4',
buildNumber: '2912',
buildNumber: '2913',
scheme: IS_DEV ? 'CanaryTrainLCD' : 'ProdTrainLCD',
bundleIdentifier: IS_DEV
? 'me.tinykitten.trainlcd.dev'
Expand All @@ -71,7 +71,7 @@ export default {
? 'me.tinykitten.trainlcd.dev'
: 'me.tinykitten.trainlcd',
permissions: [],
versionCode: 100000765,
versionCode: 100000767,
},
owner: 'trainlcd',
experiments: {
Expand Down
36 changes: 18 additions & 18 deletions ios/TrainLCD.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2550,7 +2550,7 @@
CODE_SIGN_ENTITLEMENTS = ProdTrainLCD.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = E6R2G33Z36;
INFOPLIST_FILE = TrainLCD/Schemes/Prod/Info.plist;
Expand Down Expand Up @@ -2590,7 +2590,7 @@
CODE_SIGN_ENTITLEMENTS = ProdTrainLCD.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
DEVELOPMENT_TEAM = E6R2G33Z36;
INFOPLIST_FILE = TrainLCD/Schemes/Prod/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = TrainLCD;
Expand Down Expand Up @@ -2649,7 +2649,7 @@
CODE_SIGN_ENTITLEMENTS = TrainLCD/trainlcd.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
CXX = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -2756,7 +2756,7 @@
CODE_SIGN_ENTITLEMENTS = TrainLCD/trainlcd.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
CXX = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -2837,7 +2837,7 @@
CODE_SIGN_ENTITLEMENTS = CanaryTrainLCD.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = E6R2G33Z36;
INFOPLIST_FILE = TrainLCD/Schemes/Dev/Info.plist;
Expand Down Expand Up @@ -2877,7 +2877,7 @@
CODE_SIGN_ENTITLEMENTS = CanaryTrainLCD.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
INFOPLIST_FILE = TrainLCD/Schemes/Dev/Info.plist;
Expand Down Expand Up @@ -3089,7 +3089,7 @@
CODE_SIGN_ENTITLEMENTS = RideSessionActivity/CanaryRideSessionActivity.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -3141,7 +3141,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -3192,7 +3192,7 @@
CODE_SIGN_ENTITLEMENTS = WatchWidget/ProdWatchWidget.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -3250,7 +3250,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -3301,7 +3301,7 @@
CODE_SIGN_ENTITLEMENTS = WatchWidget/CanaryWatchWidget.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -3358,7 +3358,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -3407,7 +3407,7 @@
CODE_SIGN_ENTITLEMENTS = RideSessionActivity/ProdRideSessionActivity.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -3459,7 +3459,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -3678,7 +3678,7 @@
CODE_SIGN_ENTITLEMENTS = ProdAppClip/ProdAppClip.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand Down Expand Up @@ -3734,7 +3734,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand Down Expand Up @@ -3784,7 +3784,7 @@
CODE_SIGN_ENTITLEMENTS = CanaryAppClip/CanaryAppClip.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand Down Expand Up @@ -3842,7 +3842,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2912;
CURRENT_PROJECT_VERSION = 2913;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand Down
33 changes: 32 additions & 1 deletion src/components/DevOverlay.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ import { act, fireEvent, render } from '@testing-library/react-native';
import * as Application from 'expo-application';
import { useAtomValue } from 'jotai';
import { Dimensions, StyleSheet } from 'react-native';
import type { Station } from '~/@types/graphql';
import { LineType, type Station } from '~/@types/graphql';
import { MAX_PERMIT_ACCURACY } from '~/constants/location';
import { BAD_ACCURACY_THRESHOLD } from '~/constants/threshold';
import * as remoteConfigModule from '~/lib/remoteConfig';
import { etaAnchorAtom } from '~/store/atoms/etaFallback';
import {
accuracyHistoryAtom,
backgroundLocationTrackingAtom,
locationAtom,
rawLocationAtom,
smoothingDecisionAtom,
} from '~/store/atoms/location';
import { autoModeEnabledAtom } from '~/store/atoms/navigation';
import { isLEDThemeAtom } from '~/store/atoms/theme';
Expand Down Expand Up @@ -106,13 +108,17 @@ describe('DevOverlay', () => {
autoModeEnabled = false,
etaPhase = null,
etaAnchor = null,
filterAccuracyHistory = [15],
smoothingDecision = { skipSmoothing: false, lineType: null },
}: {
location?: unknown;
rawLocation?: unknown;
backgroundLocationTracking?: boolean;
autoModeEnabled?: boolean;
etaPhase?: unknown;
etaAnchor?: unknown;
filterAccuracyHistory?: number[];
smoothingDecision?: { skipSmoothing: boolean; lineType: unknown };
} = {}) => {
mockGetEtaPhaseNow.mockReturnValue(etaPhase as never);
mockUseAtomValue.mockImplementation((atom) => {
Expand All @@ -131,6 +137,12 @@ describe('DevOverlay', () => {
if (atom === etaAnchorAtom) {
return etaAnchor as never;
}
if (atom === accuracyHistoryAtom) {
return filterAccuracyHistory as never;
}
if (atom === smoothingDecisionAtom) {
return smoothingDecision as never;
}
if (atom === isLEDThemeAtom) {
return false as never;
}
Expand Down Expand Up @@ -330,6 +342,25 @@ describe('DevOverlay', () => {
);
});

// filterのskipSmoothingとlineTypeは、判定時に1つのatomへまとめて書かれた組を
// そのまま出す。片方をstationAtomから読み直すと、測位と無関係な路線の
// 切り替わりで持ち出し時の値だけが進み、両者で検算できなくなる。
it('平滑化の判定は結果と入力を同じ組のまま出力する', async () => {
setupAtomValues({
smoothingDecision: { skipSmoothing: true, lineType: LineType.Subway },
});
const { getByTestId } = render(<DevOverlay />);

fireEvent.press(getByTestId('dev-overlay-copy-button'));
await act(async () => {});

const copied = JSON.parse(mockCopyTextToClipboard.mock.calls[0][0]);
expect(copied.filter).toMatchObject({
skipSmoothing: true,
lineType: LineType.Subway,
});
});

it('押した直後はCOPIED表示になり、一定時間で戻る', async () => {
jest.useFakeTimers();
try {
Expand Down
12 changes: 12 additions & 0 deletions src/components/DevOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ import { useTelemetryEnabled } from '~/hooks/useTelemetryEnabled';
import { getMaxPermitAccuracy, isEtaAssistEnabled } from '~/lib/remoteConfig';
import { etaAnchorAtom } from '~/store/atoms/etaFallback';
import {
accuracyHistoryAtom,
backgroundLocationTrackingAtom,
locationAtom,
rawLocationAtom,
smoothingDecisionAtom,
} from '~/store/atoms/location';
import { autoModeEnabledAtom } from '~/store/atoms/navigation';
import { copyTextToClipboard } from '~/utils/clipboard';
Expand Down Expand Up @@ -463,6 +465,13 @@ const DevOverlay: React.FC<Props> = ({ unrotated = false }) => {
const isBackgroundLocationTracking = useAtomValue(
backgroundLocationTrackingAtom
);
// 平滑化の要否を決めている履歴と、その判定結果。チャート用のchartHistoryとは
// 別物なので、診断の持ち出しでは両方を出す。
// 判定結果と、その判定に使ったlineTypeは同じatomから取る。lineTypeを
// stationAtomから読むと、測位と無関係な路線の切り替わりで持ち出し時の値だけが
// 進み、判定時のskipSmoothingと食い違う。
const filterAccuracyHistory = useAtomValue(accuracyHistoryAtom);
const smoothingDecision = useAtomValue(smoothingDecisionAtom);
// ETA補助の診断表示。有効フラグ(リモート設定/手動トグル)は非リアクティブなgetter、
// アンカーはatomから購読する。推定フェーズは常駐タイマーで公開されなくなったため、
// DevOverlay自身の1秒ティック(nowTick)を評価時刻としてオンデマンド計算する。
Expand Down Expand Up @@ -555,6 +564,9 @@ const DevOverlay: React.FC<Props> = ({ unrotated = false }) => {
rawLocation,
filteredLocation: simulatedLocation,
accuracyHistory: chartHistory,
filterAccuracyHistory,
skipSmoothing: smoothingDecision.skipSmoothing,
lineType: smoothingDecision.lineType,
effectiveSpeedMps: effectiveSpeed,
hasMeasuredSpeed: hasEverMeasuredSpeed,
maxPermitAccuracy,
Expand Down
Loading
Loading