Open History to see the last commit
1import { useAuth, useUser } from "@clerk/expo";
2import { useAtomSet, useAtomValue } from "@effect/atom-react";
3import Constants from "expo-constants";
4import * as Notifications from "expo-notifications";
5import { useNavigation } from "@react-navigation/native";
6import { NativeStackScreenOptions } from "../../native/StackHeader";
7import { SymbolView } from "../../components/AppSymbol";
8import * as Effect from "effect/Effect";
9import { AsyncResult } from "effect/unstable/reactivity";
10import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
11import { Alert, Linking, Platform, Pressable, ScrollView, View } from "react-native";
12import { useSafeAreaInsets } from "react-native-safe-area-context";
13
14import {
15 isAtomCommandInterrupted,
16 reportAtomCommandResult,
17 settleAsyncResult,
18 settlePromise,
19 squashAtomCommandFailure,
20} from "@t3tools/client-runtime/state/runtime";
21import { AndroidScreenHeader } from "../../components/AndroidScreenHeader";
22import { AppText as Text } from "../../components/AppText";
23import { supportsAgentAwarenessPush } from "../agent-awareness/capabilities";
24import { setLiveActivityUpdatesEnabled } from "../agent-awareness/liveActivityPreferences";
25import { requestAgentNotificationPermission } from "../agent-awareness/notificationPermissions";
26import {
27 getAgentAwarenessRegistrationStatus,
28 refreshAgentAwarenessRegistration,
29 subscribeAgentAwarenessRegistrationStatus,
30} from "../agent-awareness/remoteRegistration";
31import { refreshManagedRelayEnvironments } from "../cloud/managedRelayState";
32import { hasCloudPublicConfig, resolveRelayClerkTokenOptions } from "../cloud/publicConfig";
33import { withNativeGlassHeaderItem } from "../layout/native-glass-header-items";
34import { WorkspaceSidebarToolbar } from "../layout/workspace-sidebar-toolbar";
35import { runtime } from "../../lib/runtime";
36import { useThemeColor } from "../../lib/useThemeColor";
37import { mobilePreferencesAtom, updateMobilePreferencesAtom } from "../../state/preferences";
38import { useThreadListV2Enabled } from "../threads/use-thread-list-v2-enabled";
39import {
40 type AppUpdateCheckState,
41 isAppUpdateCheckAvailable,
42 registerHiddenUpdateTap,
43 runAppUpdateCheck,
44} from "../updates/app-updates";
45import { useSavedRemoteConnections } from "../../state/use-remote-environment-registry";
46import { SettingsRow } from "./components/SettingsRow";
47import { SettingsSection } from "./components/SettingsSection";
48import { SettingsSwitchRow } from "./components/SettingsSwitchRow";
49import { resolveAgentAwarenessPlatformPresentation } from "./SettingsRouteScreen.logic";
50
51type NotificationStatus = "checking" | "enabled" | "disabled" | "unsupported";
52type LiveActivityStatus = "checking" | "enabled" | "disabled" | "signed-out" | "linking";
53
54// Reflects whether the relay actually accepted this device's registration.
55// The notification and Live Activity switches are gated on this so they can
56// never read as enabled when the device cannot receive anything (e.g. the
57// registration request timed out).
58function useDeviceRegistered(): boolean {
59 const status = useSyncExternalStore(
60 subscribeAgentAwarenessRegistrationStatus,
61 getAgentAwarenessRegistrationStatus,
62 () => "unknown" as const,
63 );
64 return status === "registered";
65}
66
67export function SettingsRouteScreen() {
68 const navigation = useNavigation();
69
70 return (
71 <>
72 <WorkspaceSidebarToolbar />
73 {Platform.OS === "android" ? (
74 <>
75 {/* Android renders its own in-screen header instead of the native bar. */}
76 <NativeStackScreenOptions options={{ headerShown: false }} />
77 <AndroidScreenHeader title="Settings" onBack={() => navigation.goBack()} />
78 </>
79 ) : (
80 <NativeStackScreenOptions
81 options={{
82 unstable_headerRightItems:
83 Platform.OS === "ios"
84 ? () => [
85 withNativeGlassHeaderItem({
86 accessibilityLabel: "Close settings",
87 icon: { name: "xmark", type: "sfSymbol" } as const,
88 identifier: "settings-close",
89 label: "",
90 onPress: () => navigation.goBack(),
91 type: "button",
92 }),
93 ]
94 : undefined,
95 }}
96 />
97 )}
98 {hasCloudPublicConfig() ? <ConfiguredSettingsRouteScreen /> : <LocalSettingsRouteScreen />}
99 </>
100 );
101}
102
103function LocalSettingsRouteScreen() {
104 const insets = useSafeAreaInsets();
105 const { savedConnectionsById } = useSavedRemoteConnections();
106 const environmentCount = Object.keys(savedConnectionsById).length;
107
108 return (
109 <View collapsable={false} className="flex-1 bg-sheet">
110 <ScrollView
111 contentInsetAdjustmentBehavior="automatic"
112 showsVerticalScrollIndicator={false}
113 className="flex-1"
114 contentContainerClassName="gap-6 px-5 pt-4"
115 contentContainerStyle={{
116 paddingBottom: Math.max(insets.bottom, 18) + 18,
117 }}
118 >
119 <SettingsSection title="Configuration">
120 <SettingsRow
121 icon="desktopcomputer"
122 label="Environments"
123 value={`${environmentCount}`}
124 target="SettingsEnvironments"
125 />
126 </SettingsSection>
127
128 <GeneralSettingsSection />
129
130 <SettingsSection title="Appearance">
131 <SettingsRow icon="paintbrush" label="Appearance" target="SettingsAppearance" />
132 </SettingsSection>
133
134 <LegacySettingsSection />
135
136 <ArchivedThreadsSettingsSection />
137
138 <AppSettingsSection />
139 </ScrollView>
140 </View>
141 );
142}
143
144function ConfiguredSettingsRouteScreen() {
145 const preferencesResult = useAtomValue(mobilePreferencesAtom);
146 const savePreferences = useAtomSet(updateMobilePreferencesAtom);
147 const agentAwarenessPushAvailable = supportsAgentAwarenessPush();
148 const agentAwarenessPlatform = resolveAgentAwarenessPlatformPresentation(Platform.OS);
149 const insets = useSafeAreaInsets();
150 const navigation = useNavigation();
151 const { getToken, isLoaded, isSignedIn } = useAuth({ treatPendingAsSignedOut: false });
152 const { user } = useUser();
153 const { savedConnectionsById } = useSavedRemoteConnections();
154 const [notificationStatus, setNotificationStatus] = useState<NotificationStatus>("checking");
155 const [liveActivityStatus, setLiveActivityStatus] = useState<LiveActivityStatus>("checking");
156 const deviceRegistered = useDeviceRegistered();
157 const liveActivitiesPreferenceEnabled = AsyncResult.isSuccess(preferencesResult)
158 ? preferencesResult.value.liveActivitiesEnabled !== false
159 : true;
160
161 const connections = useMemo(() => Object.values(savedConnectionsById), [savedConnectionsById]);
162 const environmentCount = connections.length;
163 const accountLabel = useMemo(() => {
164 if (!isLoaded) return "Checking";
165 if (!isSignedIn) return "Sign in";
166 return user?.primaryEmailAddress?.emailAddress ?? "Signed in";
167 }, [isLoaded, isSignedIn, user?.primaryEmailAddress?.emailAddress]);
168
169 const refreshNotifications = useCallback(async () => {
170 if (process.env.EXPO_OS !== "ios") {
171 setNotificationStatus("unsupported");
172 return;
173 }
174 const result = await settlePromise(() => Notifications.getPermissionsAsync());
175 if (result._tag === "Failure") {
176 reportAtomCommandResult(result, { label: "notification permission refresh" });
177 setNotificationStatus("disabled");
178 return;
179 }
180 setNotificationStatus(result.value.granted ? "enabled" : "disabled");
181 }, []);
182
183 useEffect(() => {
184 void refreshNotifications();
185 }, [refreshNotifications]);
186
187 useEffect(() => {
188 if (!isLoaded) {
189 setLiveActivityStatus("checking");
190 return;
191 }
192 if (!isSignedIn) {
193 setLiveActivityStatus("signed-out");
194 return;
195 }
196 if (!AsyncResult.isSuccess(preferencesResult)) {
197 if (AsyncResult.isFailure(preferencesResult)) {
198 reportAtomCommandResult(preferencesResult, { label: "live activity preference load" });
199 setLiveActivityStatus("enabled");
200 } else {
201 setLiveActivityStatus("checking");
202 }
203 return;
204 }
205 setLiveActivityStatus(
206 preferencesResult.value.liveActivitiesEnabled === false ? "disabled" : "enabled",
207 );
208 }, [isLoaded, isSignedIn, preferencesResult]);
209
210 const requestNotifications = useCallback(async () => {
211 const result = await settleAsyncResult(() =>
212 runtime.runPromiseExit(
213 requestAgentNotificationPermission.pipe(
214 Effect.tap((permission) =>
215 permission.type === "granted" ? refreshAgentAwarenessRegistration() : Effect.void,
216 ),
217 ),
218 ),
219 );
220 if (result._tag === "Failure") {
221 if (!isAtomCommandInterrupted(result)) {
222 const error = squashAtomCommandFailure(result);
223 Alert.alert(
224 "Notifications unavailable",
225 error instanceof Error ? error.message : "Could not request notification permission.",
226 );
227 }
228 return;
229 }
230 if (result.value.type === "granted") {
231 setNotificationStatus("enabled");
232 // Permission alone is not enough: the switch stays off until the relay
233 // registration succeeds, so tell the user the truth about which happened.
234 if (getAgentAwarenessRegistrationStatus() === "registered") {
235 Alert.alert(
236 "Notifications enabled",
237 "Live Activity notifications are enabled for this device.",
238 );
239 } else {
240 Alert.alert(
241 "Couldn't finish enabling notifications",
242 "Notification access was granted, but this device could not be registered with T3 Connect. Notifications will start once registration succeeds.",
243 );
244 }
245 return;
246 }
247 if (result.value.type === "unsupported") {
248 setNotificationStatus("unsupported");
249 Alert.alert(
250 "Notifications unavailable",
251 "Live Activity notifications are only available on iOS.",
252 );
253 return;
254 }
255 setNotificationStatus("disabled");
256 if (result.value.canAskAgain) {
257 Alert.alert("Notifications disabled", "Notifications were not enabled.");
258 return;
259 }
260 Alert.alert(
261 "Notifications disabled",
262 "Notifications were denied for this app. Open Settings to enable them.",
263 [
264 { text: "Cancel", style: "cancel" },
265 { text: "Open Settings", onPress: () => void Linking.openSettings() },
266 ],
267 );
268 }, []);
269
270 const promptSignIn = useCallback(() => {
271 Alert.alert(
272 "Sign in to T3 Connect",
273 "Live Activity updates require T3 Connect so relay can deliver updates to this device.",
274 [
275 { text: "Cancel", style: "cancel" },
276 {
277 text: "Continue",
278 onPress: () => navigation.navigate("SettingsSheet", { screen: "SettingsAuth" }),
279 },
280 ],
281 );
282 }, [navigation]);
283
284 const linkEnvironments = useCallback(async () => {
285 if (!isSignedIn) {
286 promptSignIn();
287 return;
288 }
289
290 setLiveActivityStatus("linking");
291 const tokenResult = await settlePromise(() => getToken(resolveRelayClerkTokenOptions()));
292 if (tokenResult._tag === "Failure") {
293 setLiveActivityStatus("disabled");
294 const error = squashAtomCommandFailure(tokenResult);
295 Alert.alert(
296 "Live Activities unavailable",
297 error instanceof Error ? error.message : "Could not enable Live Activity updates.",
298 );
299 return;
300 }
301 if (!tokenResult.value) {
302 promptSignIn();
303 setLiveActivityStatus("signed-out");
304 return;
305 }
306
307 const updateResult = await settleAsyncResult(() =>
308 runtime.runPromiseExit(
309 setLiveActivityUpdatesEnabled({
310 enabled: true,
311 previousEnabled: liveActivitiesPreferenceEnabled,
312 clerkToken: tokenResult.value,
313 connections,
314 }),
315 ),
316 );
317 if (updateResult._tag === "Failure") {
318 setLiveActivityStatus("disabled");
319 if (!isAtomCommandInterrupted(updateResult)) {
320 const error = squashAtomCommandFailure(updateResult);
321 Alert.alert(
322 "Live Activities unavailable",
323 error instanceof Error ? error.message : "Could not enable Live Activity updates.",
324 );
325 }
326 return;
327 }
328
329 savePreferences({ liveActivitiesEnabled: true });
330 refreshManagedRelayEnvironments();
331 setLiveActivityStatus("enabled");
332 // The environment link can succeed while this device's own registration
333 // (the push-to-start token the relay needs) has not — don't claim Live
334 // Activities are live until the device is actually registered.
335 if (getAgentAwarenessRegistrationStatus() === "registered") {
336 Alert.alert(
337 "Live Activities enabled",
338 environmentCount > 0
339 ? `${environmentCount} environment${environmentCount === 1 ? "" : "s"} linked for Live Activity updates.`
340 : "Live Activity updates are enabled. Add an environment to start receiving updates.",
341 );
342 } else {
343 Alert.alert(
344 "Couldn't finish enabling Live Activities",
345 "This device could not be registered with T3 Connect, so Live Activities won't appear yet. They'll start once registration succeeds.",
346 );
347 }
348 }, [
349 connections,
350 environmentCount,
351 getToken,
352 isSignedIn,
353 liveActivitiesPreferenceEnabled,
354 promptSignIn,
355 savePreferences,
356 ]);
357
358 const handleDeviceNotificationsChange = useCallback(
359 (enabled: boolean) => {
360 if (enabled) {
361 void requestNotifications();
362 return;
363 }
364
365 Alert.alert(
366 "Disable notifications",
367 "Notification permission is controlled by iOS. Open Settings to disable notifications for T3 Code.",
368 [
369 { text: "Cancel", style: "cancel" },
370 { text: "Open Settings", onPress: () => void Linking.openSettings() },
371 ],
372 );
373 },
374 [requestNotifications],
375 );
376
377 const handleLiveActivitiesChange = useCallback(
378 (enabled: boolean) => {
379 if (!enabled) {
380 setLiveActivityStatus("disabled");
381 void (async () => {
382 let token: string | null = null;
383 if (isSignedIn) {
384 const tokenResult = await settlePromise(() =>
385 getToken(resolveRelayClerkTokenOptions()),
386 );
387 if (tokenResult._tag === "Failure") {
388 reportAtomCommandResult(tokenResult, {
389 label: "live activity disable token lookup",
390 });
391 return;
392 }
393 token = tokenResult.value;
394 }
395
396 const updateResult = await settleAsyncResult(() =>
397 runtime.runPromiseExit(
398 setLiveActivityUpdatesEnabled({
399 enabled: false,
400 previousEnabled: liveActivitiesPreferenceEnabled,
401 clerkToken: token,
402 connections,
403 }),
404 ),
405 );
406 if (updateResult._tag === "Failure") {
407 setLiveActivityStatus("enabled");
408 reportAtomCommandResult(updateResult, {
409 label: "live activity disable",
410 });
411 return;
412 }
413 savePreferences({ liveActivitiesEnabled: false });
414 refreshManagedRelayEnvironments();
415 })();
416 return;
417 }
418
419 if (!isSignedIn) {
420 promptSignIn();
421 return;
422 }
423
424 void linkEnvironments();
425 },
426 [
427 connections,
428 getToken,
429 isSignedIn,
430 linkEnvironments,
431 liveActivitiesPreferenceEnabled,
432 promptSignIn,
433 savePreferences,
434 ],
435 );
436
437 const openAccount = useCallback(() => {
438 if (!isLoaded) return;
439 navigation.navigate("SettingsSheet", { screen: "SettingsAuth" });
440 }, [isLoaded, navigation]);
441
442 return (
443 <View collapsable={false} className="flex-1 bg-sheet">
444 <ScrollView
445 contentInsetAdjustmentBehavior="automatic"
446 showsVerticalScrollIndicator={false}
447 className="flex-1"
448 contentContainerClassName="gap-6 px-5 pt-4"
449 contentContainerStyle={{
450 paddingBottom: Math.max(insets.bottom, 18) + 18,
451 }}
452 >
453 <View className="gap-3">
454 <SettingsSection title="Account">
455 <SettingsRow
456 icon="person.crop.circle"
457 label="T3 Account"
458 value={accountLabel}
459 onPress={openAccount}
460 />
461 </SettingsSection>
462 <Text className="px-2 text-sm text-foreground-muted">
463 T3 Code works locally without signing in. Cloud features are optional.
464 </Text>
465 </View>
466
467 <SettingsSection title="Configuration">
468 <SettingsRow
469 icon="desktopcomputer"
470 label="Environments"
471 value={`${environmentCount}`}
472 target="SettingsEnvironments"
473 />
474 <SettingsSwitchRow
475 icon="bell.badge"
476 label="Device Notifications"
477 disabled={
478 !agentAwarenessPlatform.supported ||
479 !agentAwarenessPushAvailable ||
480 notificationStatus === "checking" ||
481 notificationStatus === "unsupported"
482 }
483 subtitle={agentAwarenessPlatform.subtitle}
484 // Only reads as on when this device is actually registered with the
485 // relay; otherwise notifications cannot be delivered regardless of
486 // the local iOS permission.
487 value={
488 agentAwarenessPushAvailable && notificationStatus === "enabled" && deviceRegistered
489 }
490 onValueChange={handleDeviceNotificationsChange}
491 />
492 <SettingsSwitchRow
493 disabled={
494 !agentAwarenessPlatform.supported ||
495 !agentAwarenessPushAvailable ||
496 !isLoaded ||
497 liveActivityStatus === "checking" ||
498 liveActivityStatus === "linking"
499 }
500 icon="bolt.circle"
501 label="Live Activity Updates"
502 subtitle={agentAwarenessPlatform.subtitle}
503 // Same gate: a saved preference is meaningless until the device
504 // registration the relay needs to push updates has succeeded.
505 value={
506 agentAwarenessPushAvailable &&
507 (liveActivityStatus === "enabled" || liveActivityStatus === "linking") &&
508 deviceRegistered
509 }
510 onValueChange={handleLiveActivitiesChange}
511 />
512 </SettingsSection>
513
514 <GeneralSettingsSection />
515
516 <SettingsSection title="Appearance">
517 <SettingsRow icon="paintbrush" label="Appearance" target="SettingsAppearance" />
518 </SettingsSection>
519
520 <LegacySettingsSection />
521
522 <ArchivedThreadsSettingsSection />
523
524 <AppSettingsSection />
525 </ScrollView>
526 </View>
527 );
528}
529
530function GeneralSettingsSection() {
531 const preferencesResult = useAtomValue(mobilePreferencesAtom);
532 const savePreferences = useAtomSet(updateMobilePreferencesAtom);
533 const autoSettleOnMerge =
534 !AsyncResult.isSuccess(preferencesResult) ||
535 preferencesResult.value.autoSettleOnMerge !== false;
536
537 return (
538 <SettingsSection title="General">
539 <SettingsRow icon="folder" label="Project Grouping" target="SettingsProjectGrouping" />
540 <SettingsSwitchRow
541 icon="arrow.triangle.branch"
542 label="Auto-settle merged threads"
543 value={autoSettleOnMerge}
544 onValueChange={(value) => savePreferences({ autoSettleOnMerge: value })}
545 />
546 <SettingsRow icon="chart.bar.xaxis" label="Usage" target="SettingsUsage" />
547 </SettingsSection>
548 );
549}
550
551/**
552 * Device-local legacy toggles. Mobile has no client-settings sync, so this is
553 * the counterpart of web's Settings → General → Legacy features backed by
554 * mobile preferences.
555 */
556function LegacySettingsSection() {
557 const savePreferences = useAtomSet(updateMobilePreferencesAtom);
558 const preferences = useAtomValue(mobilePreferencesAtom);
559 const threadListV2Enabled = useThreadListV2Enabled();
560 const planModeEnabled =
561 AsyncResult.isSuccess(preferences) && preferences.value.planModeEnabled === true;
562
563 return (
564 <View className="gap-3">
565 <SettingsSection title="Legacy">
566 <SettingsSwitchRow
567 icon="sidebar.left"
568 label="Legacy Thread List"
569 value={!threadListV2Enabled}
570 onValueChange={(value) => savePreferences({ legacyThreadListEnabled: value })}
571 />
572 <SettingsSwitchRow
573 icon="hammer"
574 label="Plan Mode"
575 value={planModeEnabled}
576 onValueChange={(value) => savePreferences({ planModeEnabled: value })}
577 />
578 </SettingsSection>
579 <Text className="px-2 text-sm text-foreground-muted">
580 Opt into retired interfaces kept for compatibility. Plan Mode restores the Build/Plan
581 control; otherwise every task runs in Build mode.
582 </Text>
583 </View>
584 );
585}
586
587function AppSettingsSection() {
588 const icon = useThemeColor("--color-icon");
589 const [updateState, setUpdateState] = useState<AppUpdateCheckState>("idle");
590 const updateInFlight = useRef(false);
591 const hiddenUpdateTapCount = useRef(0);
592
593 const version = Constants.expoConfig?.version ?? "0.0.0";
594 // Fall back to "production" to match resolveAppVariant in app.config.ts, so a
595 // missing variant never mislabels a production build as development.
596 const variant = (Constants.expoConfig?.extra?.appVariant as string | undefined) ?? "production";
597 const variantLabel = variant === "production" ? "" : capitalize(variant);
598 const versionLabel = variantLabel ? `${version} · ${variantLabel}` : version;
599 const updateCheckAvailable = isAppUpdateCheckAvailable();
600 const busy =
601 updateState === "checking" || updateState === "downloading" || updateState === "restarting";
602
603 // "Up to date" is a transient acknowledgement, not a state worth persisting —
604 // return the version row to its normal, deliberately quiet state.
605 useEffect(() => {
606 if (updateState !== "current") return;
607 const timer = setTimeout(() => setUpdateState("idle"), 3000);
608 return () => clearTimeout(timer);
609 }, [updateState]);
610
611 const checkForUpdate = useCallback(async () => {
612 // `disabled={busy}` only takes effect on the next render, so two taps in the
613 // same frame would both get through. The ref closes that window.
614 if (updateInFlight.current) return;
615 updateInFlight.current = true;
616 try {
617 // The user asked for this restart by tapping the version row, so it may
618 // apply immediately instead of prompting.
619 await runAppUpdateCheck({
620 applyMode: "immediate",
621 onFailure: (message) => Alert.alert("Update failed", message),
622 onStateChange: setUpdateState,
623 });
624 } finally {
625 updateInFlight.current = false;
626 }
627 }, []);
628
629 const handleVersionPress = useCallback(() => {
630 if (!updateCheckAvailable || updateInFlight.current) return;
631 const tap = registerHiddenUpdateTap(hiddenUpdateTapCount.current);
632 hiddenUpdateTapCount.current = tap.nextCount;
633 if (tap.shouldCheck) {
634 void checkForUpdate();
635 }
636 }, [checkForUpdate, updateCheckAvailable]);
637
638 const statusLabel =
639 updateState === "checking"
640 ? "Checking…"
641 : updateState === "downloading"
642 ? "Downloading…"
643 : // "ready" appears only when this check joined an in-flight background-mode
644 // check; that download installs at the next backgrounding.
645 updateState === "ready"
646 ? "Update ready"
647 : updateState === "restarting"
648 ? "Restarting…"
649 : updateState === "current"
650 ? "Up to date"
651 : null;
652
653 const versionRow = (
654 <View className="flex-row items-center gap-4 p-4">
655 <SymbolView
656 name="info.circle"
657 size={22}
658 tintColor={icon}
659 type="monochrome"
660 weight="regular"
661 />
662 <Text className="flex-1 text-lg text-foreground">Version</Text>
663 <View className="items-end">
664 <Text className="text-lg text-foreground-muted">{versionLabel}</Text>
665 {statusLabel ? (
666 <Text className="text-xs text-foreground-muted/70">{statusLabel}</Text>
667 ) : null}
668 </View>
669 </View>
670 );
671
672 return (
673 <SettingsSection title="App">
674 <SettingsRow icon="internaldrive" label="Client Storage" target="SettingsClientStorage" />
675 <SettingsRow icon="doc.text" label="Legal" fullScreenTarget="SettingsLegal" />
676 {updateCheckAvailable ? (
677 <Pressable
678 accessibilityLabel={`Version ${versionLabel}`}
679 accessibilityRole="text"
680 disabled={busy}
681 onPress={handleVersionPress}
682 >
683 {versionRow}
684 </Pressable>
685 ) : (
686 versionRow
687 )}
688 </SettingsSection>
689 );
690}
691
692function capitalize(value: string): string {
693 return value.length > 0 ? value.charAt(0).toUpperCase() + value.slice(1) : value;
694}
695
696function ArchivedThreadsSettingsSection() {
697 return (
698 <SettingsSection title="Threads">
699 <SettingsRow icon="archivebox" label="Archived Threads" target="SettingsArchive" />
700 </SettingsSection>
701 );
702}