Skip to content
Open
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
9 changes: 5 additions & 4 deletions app/(tabs)/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { ScreenContainer } from "@/components/screen-container";
import { HostInformation } from "@/components/host-information";
import { palette, statusLabel, type AssessmentStatus } from "@/constants/commander";
import { useLocalAssessment } from "@/hooks/use-local-assessment";
import { useThemeContext } from "@/lib/theme-provider";

const statusColors: Record<AssessmentStatus, { text: string; fill: string }> = {
critical: { text: palette.red, fill: "#FCECEB" },
Expand All @@ -27,8 +28,8 @@ export default function CommandCenterScreen() {
const checks = report?.checks ?? [];
const summary = report?.summary;

const [themeMode, setThemeMode] = useState<"dark" | "modern">("dark");
const modern = themeMode === "modern";
const { colorScheme, setColorScheme } = useThemeContext();
const modern = colorScheme === "light";
const [expandedFinding, setExpandedFinding] = useState<string | null>(null);
const [usbExpanded, setUsbExpanded] = useState(false);
const [scopeOpen, setScopeOpen] = useState(false);
Expand All @@ -52,7 +53,7 @@ export default function CommandCenterScreen() {
<Text style={styles.kicker}>DROID COMMANDER // FIELD CONSOLE</Text>
<Text style={[styles.wordmark, modern && styles.modernText]}>Droid Commander</Text>
</View>
<Pressable accessibilityRole="button" accessibilityLabel={`Switch to ${modern ? "Dark Tactical Premium" : "Modern Professional"} theme`} onPress={() => setThemeMode(modern ? "dark" : "modern")} style={[styles.themeToggle, modern && styles.themeToggleModern]}>
<Pressable accessibilityRole="button" accessibilityLabel={`Switch to ${modern ? "Dark Tactical Premium" : "Modern Professional"} theme`} onPress={() => setColorScheme(modern ? "dark" : "light")} style={[styles.themeToggle, modern && styles.themeToggleModern]}>
<Text style={[styles.themeToggleText, modern && styles.themeToggleTextModern]}>{modern ? "◐ MODERN" : "◑ TACTICAL"}</Text>
</Pressable>
</View>
Expand All @@ -64,7 +65,7 @@ export default function CommandCenterScreen() {
A consent-first field instrument for learning how device posture can be measured and improved.
</Text>
</View>
<Text style={styles.buildTag}>FIELD BUILD{"\n"}0.1</Text>
<Text style={styles.buildTag}>TEST BUILD{"\n"}UI-FIX-01</Text>
</View>

<View style={[styles.postureCard, modern && styles.postureCardModern]}>
Expand Down
10 changes: 3 additions & 7 deletions app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { GestureHandlerRootView } from "react-native-gesture-handler";
import "react-native-reanimated";
import { Platform } from "react-native";
import * as SplashScreen from "expo-splash-screen";

// Keep the native splash visible until the in-app launch overlay has mounted.
void SplashScreen.preventAutoHideAsync().catch(() => {});
import "@/lib/_core/nativewind-pressable";
import { ThemeProvider } from "@/lib/theme-provider";
import { AnimatedLaunchScreen } from "@/components/animated-launch-screen";
Expand Down Expand Up @@ -35,13 +38,6 @@ export default function RootLayout() {
const [insets, setInsets] = useState<EdgeInsets>(initialInsets);
const [frame, setFrame] = useState<Rect>(initialFrame);

// Explicitly dismiss the native splash once the React root has mounted.
useEffect(() => {
void SplashScreen.hideAsync().catch(() => {
// Expo may already have dismissed the splash screen.
});
}, []);

// Initialize Manus runtime for cookie injection from parent container.
useEffect(() => {
initManusRuntime();
Expand Down
4 changes: 4 additions & 0 deletions components/animated-launch-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
View,
} from "react-native";

import * as SplashScreen from "expo-splash-screen";
import { design } from "@/constants/design-system";

/**
Expand All @@ -21,6 +22,9 @@ export function AnimatedLaunchScreen() {
const progress = useRef(new Animated.Value(0)).current;

useEffect(() => {
// Reveal this overlay only after it has mounted over the native splash.
void SplashScreen.hideAsync().catch(() => {});

const pulse = Animated.loop(
Animated.sequence([
Animated.timing(ring, {
Expand Down
Loading