Skip to content
Merged

canary #6433

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
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ android {
dimension "environment"
applicationId "me.tinykitten.trainlcd.dev"
versionNameSuffix "-dev"
versionCode 100000536
versionCode 100000537
versionName "10.9.1"
}
prod {
dimension "environment"
versionCode 100000536
versionCode 100000537
versionName "10.9.1"
}
}
Expand Down
4 changes: 2 additions & 2 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ export default {
},
},
ios: {
buildNumber: '2749',
buildNumber: '2750',
scheme: IS_DEV ? 'CanaryTrainLCD' : 'ProdTrainLCD',
bundleIdentifier: IS_DEV ? 'me.tinykitten.trainlcd.dev' : 'me.tinykitten.trainlcd',
supportsTablet: true,
},
android: {
package: IS_DEV ? 'me.tinykitten.trainlcd.dev' : 'me.tinykitten.trainlcd',
permissions: [],
versionCode: 100000536,
versionCode: 100000537,
},
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 @@ -2407,7 +2407,7 @@
CODE_SIGN_ENTITLEMENTS = ProdTrainLCD.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = E6R2G33Z36;
INFOPLIST_FILE = TrainLCD/Schemes/Prod/Info.plist;
Expand Down Expand Up @@ -2446,7 +2446,7 @@
CODE_SIGN_ENTITLEMENTS = ProdTrainLCD.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
DEVELOPMENT_TEAM = E6R2G33Z36;
INFOPLIST_FILE = TrainLCD/Schemes/Prod/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = TrainLCD;
Expand Down Expand Up @@ -2505,7 +2505,7 @@
CODE_SIGN_ENTITLEMENTS = TrainLCD/trainlcd.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
CXX = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -2611,7 +2611,7 @@
CODE_SIGN_ENTITLEMENTS = TrainLCD/trainlcd.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
CXX = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -2690,7 +2690,7 @@
CODE_SIGN_ENTITLEMENTS = CanaryTrainLCD.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = E6R2G33Z36;
INFOPLIST_FILE = TrainLCD/Schemes/Dev/Info.plist;
Expand Down Expand Up @@ -2729,7 +2729,7 @@
CODE_SIGN_ENTITLEMENTS = CanaryTrainLCD.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
INFOPLIST_FILE = TrainLCD/Schemes/Dev/Info.plist;
Expand Down Expand Up @@ -2940,7 +2940,7 @@
CODE_SIGN_ENTITLEMENTS = RideSessionActivity/CanaryRideSessionActivity.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -2991,7 +2991,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -3042,7 +3042,7 @@
CODE_SIGN_ENTITLEMENTS = WatchWidget/ProdWatchWidget.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -3100,7 +3100,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -3151,7 +3151,7 @@
CODE_SIGN_ENTITLEMENTS = WatchWidget/CanaryWatchWidget.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -3208,7 +3208,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -3256,7 +3256,7 @@
CODE_SIGN_ENTITLEMENTS = RideSessionActivity/ProdRideSessionActivity.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -3307,7 +3307,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -3526,7 +3526,7 @@
CODE_SIGN_ENTITLEMENTS = ProdAppClip/ProdAppClip.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand Down Expand Up @@ -3582,7 +3582,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand Down Expand Up @@ -3632,7 +3632,7 @@
CODE_SIGN_ENTITLEMENTS = CanaryAppClip/CanaryAppClip.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand Down Expand Up @@ -3690,7 +3690,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2749;
CURRENT_PROJECT_VERSION = 2750;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
import { render } from '@testing-library/react-native';
import { createStore, Provider } from 'jotai';
import type { AvailableLanguage } from '~/constants';
import type { HeaderTransitionState } from '~/models/HeaderTransitionState';
import { headerStateAtom } from '~/store/atoms/navigation';
import {
enabledLanguagesAtom,
headerStateAtom,
} from '~/store/atoms/navigation';
import { EstimatedMinutesUnitLabel } from './EstimatedMinutesUnitLabel';

jest.mock('~/utils/isTablet', () => ({
__esModule: true,
default: false,
}));

const renderWithState = (headerState: HeaderTransitionState) => {
const renderWithState = (
headerState: HeaderTransitionState,
enabledLanguages?: AvailableLanguage[]
) => {
const store = createStore();
store.set(headerStateAtom, headerState);
if (enabledLanguages) {
store.set(enabledLanguagesAtom, enabledLanguages);
}
return render(
<Provider store={store}>
<EstimatedMinutesUnitLabel />
Expand Down Expand Up @@ -42,13 +52,18 @@ describe('EstimatedMinutesUnitLabel', () => {
expect(getByText('min.')).toBeTruthy();
});

it('中国語Stateでは「分」を表示する', () => {
const { getByText } = renderWithState('CURRENT_ZH');
it('中国語Stateでは駅名の英語表示に追従して「min.」を表示する', () => {
const { getByText } = renderWithState('CURRENT_ZH', ['JA', 'EN', 'ZH']);
expect(getByText('min.')).toBeTruthy();
});

it('中国語StateでもENが無効なら「分」を表示する', () => {
const { getByText } = renderWithState('CURRENT_ZH', ['JA', 'ZH']);
expect(getByText('分')).toBeTruthy();
});

it('韓国語Stateでは「」を表示する', () => {
it('韓国語Stateでは「」を表示する(韓国語専用表記は持たない)', () => {
const { getByText } = renderWithState('CURRENT_KO');
expect(getByText('')).toBeTruthy();
expect(getByText('')).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { atom, useAtomValue } from 'jotai';
import { useAtomValue } from 'jotai';
import type React from 'react';
import { StyleSheet, type TextStyle } from 'react-native';
import { headerStateAtom } from '~/store/atoms/navigation';
import { isEnAtom } from '~/store/selectors/isEn';
import isTablet from '~/utils/isTablet';
import Typography from '../../../Typography';

Expand All @@ -10,43 +10,32 @@ const styles = StyleSheet.create({
color: '#fff',
fontWeight: 'bold',
fontSize: isTablet ? 21 : 15,
// Yogaはwidth未指定の絶対配置子を親の幅を上限に測るため、幅の狭い
// ドットに載せると最長表記の「min.」が途中で切り詰められてしまう。
// 最長表記が縁取り込みで収まる固有幅を明示して親幅の影響を断つ
width: isTablet ? 56 : 40,
// 路線色バーの上に重ねて描画されるため、どの路線色でも判読できるよう縁取る
textShadowColor: '#000',
textShadowOffset: { width: 0, height: 0 },
textShadowRadius: 2,
},
});

// ヘッダーの言語Stateごとの単位表記。headerStateAtomは数秒ごとに
// ローテーションするため、算出済み文字列のderived atomを購読することで
// 単位が実際に変わったときだけ再レンダーされるようにする。
const estimatedMinutesUnitAtom = atom((get) => {
const langState = get(headerStateAtom).split('_')[1] ?? 'JA';
switch (langState) {
case 'EN':
return 'min.';
case 'KO':
return '분';
// JA・KANA・ZH (中国語も単位は「分」で通じるため共通)
default:
return '分';
}
});

export type EstimatedMinutesUnitLabelProps = {
style?: TextStyle;
};

// ETAの残り分数はドット内に数字のみで表示されるため、最後のドットの右隣に
// 単位を添えて数字の意味を示す。
// 単位を添えて数字の意味を示す。表記は駅名表示と同じ言語切替(isEnAtom)に
// 追従した「分/min.」の二択で、中国語・韓国語の専用表記は持たない
export const EstimatedMinutesUnitLabel: React.FC<
EstimatedMinutesUnitLabelProps
> = ({ style }) => {
const unit = useAtomValue(estimatedMinutesUnitAtom);
const isEn = useAtomValue(isEnAtom);

return (
<Typography style={[styles.text, style]} numberOfLines={1}>
{unit}
{isEn ? 'min.' : '分'}
</Typography>
);
};
3 changes: 2 additions & 1 deletion src/components/LineBoard/shared/styles/commonStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { RFValue } from '~/utils/rfValue';
// Shared bar positioning constants
export const BAR_BOTTOM_WEST = isTablet ? 32 : 48;
export const BAR_BOTTOM_JO = isTablet ? 32 : 48;
export const BAR_HEIGHT_JO = isTablet ? 64 : 40;
export const BAR_TERMINAL_BOTTOM_JO = isTablet ? 48 : 58;

// Androidタブレットでは駅名がヘッダーに食い込むのを防ぐためbottomオフセットを縮小する
Expand Down Expand Up @@ -43,7 +44,7 @@ export const commonLineBoardStyles = StyleSheet.create({
barJO: {
position: 'absolute',
bottom: BAR_BOTTOM_JO,
height: isTablet ? 64 : 40,
height: BAR_HEIGHT_JO,
},
barTerminal: {
position: 'absolute',
Expand Down
Loading
Loading