Skip to content

Commit a3d3f3a

Browse files
author
Lalit Sharma
committed
feat: complete theme-token migration and enhance error boundary with theme support
1 parent 2afccf2 commit a3d3f3a

7 files changed

Lines changed: 402 additions & 356 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.29] — 2026-02-26
9+
10+
### Changed
11+
- Continued the theme-token migration to remaining app surfaces by tokenizing `EclipsePreviewScreen` and removing hardcoded dark-only panel/background styling there.
12+
- Updated app error recovery UI to respect active app theme preference by wiring `ErrorBoundary` to theme colors through app state context.
13+
- Removed leftover hardcoded startup-shell fallback colors in `RootNavigator` styles so startup visual tokens come from the active theme.
14+
- Bumped `apps/mobile` version to `1.1.29`.
15+
16+
### Tests
17+
- Verified mobile checks pass after this migration step: `pnpm -C apps/mobile typecheck`, `pnpm -C apps/mobile test`, and `pnpm -C apps/mobile lint`.
18+
819
## [1.1.28] — 2026-02-26
920

1021
### Added

apps/mobile/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eclipse-timer/mobile",
3-
"version": "1.1.28",
3+
"version": "1.1.29",
44
"private": true,
55
"main": "index.js",
66
"scripts": {

apps/mobile/src/App.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import * as Sentry from "@sentry/react-native";
22
import * as SplashScreen from "expo-splash-screen";
3-
import { useEffect } from "react";
3+
import { type ReactNode, useEffect } from "react";
44
import { SafeAreaProvider } from "react-native-safe-area-context";
55

66
import ErrorBoundary from "./components/ErrorBoundary";
77
import RootNavigator from "./navigation/RootNavigator";
88
import { configureNotificationPresentationHandler } from "./services/notifications";
99
import { AppStateProvider } from "./state/appState";
10+
import { useAppTheme } from "./theme/useAppTheme";
1011

1112
SplashScreen.preventAutoHideAsync();
1213

@@ -21,26 +22,33 @@ if (isSentryEnabled) {
2122
});
2223
}
2324

24-
function AppInner() {
25+
function AppContent() {
2526
useEffect(() => {
2627
configureNotificationPresentationHandler();
2728
}, []);
2829

30+
return <RootNavigator />;
31+
}
32+
33+
function ThemedErrorBoundary({ children }: { children: ReactNode }) {
34+
const { colors } = useAppTheme();
35+
return <ErrorBoundary colors={colors}>{children}</ErrorBoundary>;
36+
}
37+
38+
function AppInner() {
2939
return (
3040
<SafeAreaProvider>
3141
<AppStateProvider>
32-
<RootNavigator />
42+
<ThemedErrorBoundary>
43+
<AppContent />
44+
</ThemedErrorBoundary>
3345
</AppStateProvider>
3446
</SafeAreaProvider>
3547
);
3648
}
3749

3850
function App() {
39-
return (
40-
<ErrorBoundary>
41-
<AppInner />
42-
</ErrorBoundary>
43-
);
51+
return <AppInner />;
4452
}
4553

4654
export default isSentryEnabled ? Sentry.wrap(App) : App;
Lines changed: 90 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import * as Sentry from "@sentry/react-native";
12
import { Component, type ReactNode } from "react";
23
import { Pressable, StyleSheet, Text, View } from "react-native";
3-
import * as Sentry from "@sentry/react-native";
4+
import type { AppThemeColors } from "../theme/colors";
45

56
type Props = {
67
children: ReactNode;
8+
colors?: AppThemeColors;
79
};
810

911
type State = {
@@ -33,6 +35,7 @@ export default class ErrorBoundary extends Component<Props, State> {
3335

3436
render() {
3537
if (this.state.hasError) {
38+
const styles = createStyles(this.props.colors ?? FALLBACK_ERROR_BOUNDARY_COLORS);
3639
return (
3740
<View style={styles.container}>
3841
<View style={styles.card}>
@@ -63,65 +66,89 @@ export default class ErrorBoundary extends Component<Props, State> {
6366
}
6467
}
6568

66-
const styles = StyleSheet.create({
67-
container: {
68-
flex: 1,
69-
backgroundColor: "#0b0b0b",
70-
alignItems: "center",
71-
justifyContent: "center",
72-
paddingHorizontal: 24,
73-
},
74-
card: {
75-
width: "100%",
76-
borderRadius: 14,
77-
backgroundColor: "#141414",
78-
borderWidth: 1,
79-
borderColor: "#2b2b2b",
80-
paddingVertical: 32,
81-
paddingHorizontal: 20,
82-
alignItems: "center",
83-
gap: 12,
84-
},
85-
emoji: {
86-
fontSize: 36,
87-
},
88-
title: {
89-
color: "white",
90-
fontSize: 20,
91-
fontWeight: "800",
92-
textAlign: "center",
93-
},
94-
message: {
95-
color: "#b7b7b7",
96-
fontSize: 14,
97-
lineHeight: 20,
98-
textAlign: "center",
99-
},
100-
debugBox: {
101-
width: "100%",
102-
borderRadius: 8,
103-
backgroundColor: "#1a1a1a",
104-
borderWidth: 1,
105-
borderColor: "#333",
106-
paddingVertical: 8,
107-
paddingHorizontal: 10,
108-
},
109-
debugText: {
110-
color: "#ff6b6b",
111-
fontSize: 12,
112-
fontFamily: "monospace",
113-
},
114-
button: {
115-
marginTop: 4,
116-
paddingVertical: 12,
117-
paddingHorizontal: 32,
118-
borderRadius: 12,
119-
backgroundColor: "#2c3cff",
120-
alignItems: "center",
121-
},
122-
buttonText: {
123-
color: "white",
124-
fontWeight: "800",
125-
fontSize: 15,
126-
},
127-
});
69+
const FALLBACK_ERROR_BOUNDARY_COLORS: AppThemeColors = {
70+
background: "#0b0b0b",
71+
surface: "#121212",
72+
surfaceMuted: "#171717",
73+
surfaceElevated: "#1b1b1b",
74+
border: "#2b2b2b",
75+
borderStrong: "#3a3a3a",
76+
textPrimary: "#ffffff",
77+
textSecondary: "#d5d5d5",
78+
textMuted: "#a8a8a8",
79+
primary: "#2c3cff",
80+
primaryMuted: "#1a2056",
81+
primaryText: "#ffffff",
82+
inputBackground: "#1b1b1b",
83+
inputBorder: "#2f2f2f",
84+
inputPlaceholder: "#6f6f6f",
85+
dangerBackground: "#351515",
86+
dangerBorder: "#7b2d2d",
87+
dangerText: "#ffb8b8",
88+
overlay: "rgba(0,0,0,0.58)",
89+
};
90+
91+
function createStyles(colors: AppThemeColors) {
92+
return StyleSheet.create({
93+
container: {
94+
flex: 1,
95+
backgroundColor: colors.background,
96+
alignItems: "center",
97+
justifyContent: "center",
98+
paddingHorizontal: 24,
99+
},
100+
card: {
101+
width: "100%",
102+
borderRadius: 14,
103+
backgroundColor: colors.surface,
104+
borderWidth: 1,
105+
borderColor: colors.border,
106+
paddingVertical: 32,
107+
paddingHorizontal: 20,
108+
alignItems: "center",
109+
gap: 12,
110+
},
111+
emoji: {
112+
fontSize: 36,
113+
},
114+
title: {
115+
color: colors.textPrimary,
116+
fontSize: 20,
117+
fontWeight: "800",
118+
textAlign: "center",
119+
},
120+
message: {
121+
color: colors.textMuted,
122+
fontSize: 14,
123+
lineHeight: 20,
124+
textAlign: "center",
125+
},
126+
debugBox: {
127+
width: "100%",
128+
borderRadius: 8,
129+
backgroundColor: colors.inputBackground,
130+
borderWidth: 1,
131+
borderColor: colors.inputBorder,
132+
paddingVertical: 8,
133+
paddingHorizontal: 10,
134+
},
135+
debugText: {
136+
color: colors.dangerText,
137+
fontSize: 12,
138+
fontFamily: "monospace",
139+
},
140+
button: {
141+
marginTop: 4,
142+
paddingVertical: 12,
143+
paddingHorizontal: 32,
144+
borderRadius: 12,
145+
backgroundColor: colors.primary,
146+
alignItems: "center",
147+
},
148+
buttonText: {
149+
color: colors.primaryText,
150+
fontWeight: "800",
151+
fontSize: 15,
152+
},
153+
});
154+
}

apps/mobile/src/navigation/RootNavigator.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -761,17 +761,14 @@ export default function RootNavigator() {
761761
const styles = StyleSheet.create({
762762
startupSafe: {
763763
flex: 1,
764-
backgroundColor: "#0b0b0b",
765764
alignItems: "center",
766765
justifyContent: "center",
767766
paddingHorizontal: 24,
768767
},
769768
startupCard: {
770769
width: "100%",
771770
borderRadius: 14,
772-
backgroundColor: "#121212",
773771
borderWidth: 1,
774-
borderColor: "#2b2b2b",
775772
paddingVertical: 24,
776773
paddingHorizontal: 16,
777774
alignItems: "center",
@@ -782,12 +779,10 @@ const styles = StyleSheet.create({
782779
height: 52,
783780
},
784781
startupTitle: {
785-
color: "white",
786782
fontSize: 20,
787783
fontWeight: "800",
788784
},
789785
startupSubtitle: {
790-
color: "#bdbdbd",
791786
fontSize: 13,
792787
},
793788
navigationRoot: {

0 commit comments

Comments
 (0)