@devries-cameron20 / t3code Mirror · read-only / commits / 85f2479ffe
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 24, 12:45 UTC

refactor(mobile): style plain views with Uniwind classes instead of the theme bridge (#9322)

Co-authored-by: Julius Marminge <julius@mac.lan> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

Julius Marminge committed Sep 2, 2026 at 20:02 UTC 85f2479ffe5c9d8ffa91f1bfae5234df4061292f
5 files changed +17 -64
apps/mobile/src/features/settings/appearance/components/FontSizeSliderRow.tsx
+4 -9
@@ -12,7 +12,6 @@ import Animated, {
12 import type { ComponentProps } from "react";
13
14 import { AppText as Text } from "../../../../components/AppText";
15 -import { useUniwindTheme } from "../../../../lib/useUniwindTheme";
15
16 type SymbolName = ComponentProps<typeof SymbolView>["name"];
17
@@ -36,10 +35,6 @@ export function FontSizeSliderRow(props: {
35 readonly value: number;
36 readonly onChange: (value: number) => void;
37 }) {
39 - const theme = useUniwindTheme();
40 - const trackColor = theme["--color-secondary-border"];
41 - const fillColor = theme["--color-primary"];
42 -
38 const latest = useRef(props);
39 latest.current = props;
40
@@ -172,12 +167,12 @@ export function FontSizeSliderRow(props: {
167 }}
168 >
169 <View
175 - className="w-full rounded-full"
176 - style={{ backgroundColor: trackColor, height: TRACK_HEIGHT }}
170 + className="w-full rounded-full bg-secondary-border"
171 + style={{ height: TRACK_HEIGHT }}
172 >
173 <Animated.View
179 - className="absolute inset-y-0 left-0 rounded-full"
180 - style={[{ backgroundColor: fillColor }, fillStyle]}
174 + className="absolute inset-y-0 left-0 rounded-full bg-primary"
175 + style={fillStyle}
176 />
177 </View>
178 <Animated.View
apps/mobile/src/features/threads/NewTaskContextPickerScreens.tsx
+1 -6
@@ -23,8 +23,6 @@ import { SymbolView } from "../../components/AppSymbol";
23 import { AppText as Text } from "../../components/AppText";
24 import { ThemedSwitch } from "../../components/ThemedSwitch";
25 import { cn } from "../../lib/cn";
26 -import { useFontFamily } from "../../lib/useFontFamily";
27 -import { useUniwindTheme } from "../../lib/useUniwindTheme";
26 import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/StackHeader";
27 import { useAtomCommand } from "../../state/use-atom-command";
28 import { vcsEnvironment } from "../../state/vcs";
@@ -193,8 +191,6 @@ export function NewTaskBranchPickerRouteScreen() {
191 const flow = useNewTaskFlow();
192 const navigation = useNavigation();
193 const insets = useSafeAreaInsets();
196 - const foregroundColor = useUniwindTheme()["--color-foreground"];
197 - const fontFamily = useFontFamily("regular");
194 const switchRef = useAtomCommand(vcsEnvironment.switchRef, { reportFailure: false });
195 const [switchingBranchName, setSwitchingBranchName] = useState<string | null>(null);
196 const selectingBranchNameRef = useRef<string | null>(null);
@@ -417,11 +413,10 @@ export function NewTaskBranchPickerRouteScreen() {
413 <TextInput
414 autoCapitalize="none"
415 autoCorrect={false}
420 - className="h-11 rounded-xl bg-card px-4 text-base text-foreground"
416 + className="h-11 rounded-xl bg-card px-4 font-sans text-base text-foreground"
417 onChangeText={flow.setBranchQuery}
418 placeholder="Find a branch"
419 placeholderTextColorClassName={"accent-placeholder"}
424 - style={{ color: foregroundColor, fontFamily }}
420 value={flow.branchQuery}
421 />
422 </View>
apps/mobile/src/features/threads/thread-list-items.tsx
+9 -41
@@ -276,9 +276,6 @@ export const PendingTaskListRow = memo(function PendingTaskListRow(props: {
276 readonly onDeletePendingTask: (pendingTask: PendingNewTask) => void;
277 }) {
278 const compact = props.variant === "compact";
279 - const theme = useUniwindTheme();
280 - const separatorColor = theme["--color-separator"];
281 - const pressedBackgroundColor = theme["--color-subtle"];
279
280 const { pendingTask, onSelectPendingTask, onDeletePendingTask } = props;
281 const timestamp = relativeTime(pendingTask.message.createdAt);
@@ -333,25 +330,11 @@ export const PendingTaskListRow = memo(function PendingTaskListRow(props: {
330 accessibilityHint="Opens the queued task for editing"
331 accessibilityLabel={pendingTask.title}
332 accessibilityRole="button"
336 - className="bg-screen"
333 + className="bg-screen active:opacity-70"
334 onPress={() => onSelectPendingTask(pendingTask)}
338 - style={({ pressed }) => ({ opacity: pressed ? 0.7 : 1 })}
335 >
340 - <View
341 - style={{
342 - paddingLeft: THREAD_LIST_COMPACT_INSET,
343 - paddingRight: 18,
344 - paddingTop: 10,
345 - }}
346 - >
347 - <View
348 - style={{
349 - gap: 3,
350 - borderBottomWidth: props.isLast ? 0 : 1,
351 - borderBottomColor: separatorColor,
352 - paddingBottom: 10,
353 - }}
354 - >
336 + <View className="pr-[18px] pt-[10px]" style={{ paddingLeft: THREAD_LIST_COMPACT_INSET }}>
337 + <View className={cn("gap-[3px] pb-[10px]", !props.isLast && "border-b border-separator")}>
338 <View className="flex-row items-center justify-between gap-2">
339 <Text className="flex-1 text-lg font-t3-bold text-foreground" numberOfLines={1}>
340 {pendingTask.title}
@@ -376,16 +359,16 @@ export const PendingTaskListRow = memo(function PendingTaskListRow(props: {
359 accessibilityHint="Opens the queued task for editing"
360 accessibilityLabel={pendingTask.title}
361 accessibilityRole="button"
362 + className="active:bg-subtle"
363 onPress={() => onSelectPendingTask(pendingTask)}
380 - style={({ pressed }) => ({
381 - backgroundColor: pressed ? pressedBackgroundColor : "transparent",
364 + style={{
365 borderRadius: SIDEBAR_ROW_RADIUS,
366 cursor: "pointer",
367 minHeight: 64,
368 justifyContent: "center",
369 paddingHorizontal: 12,
370 paddingVertical: 10,
388 - })}
371 + }}
372 >
373 <View className="gap-[3px]">
374 <View className="flex-row items-center justify-between gap-2">
@@ -455,7 +438,6 @@ export const ThreadListRow = memo(function ThreadListRow(props: {
438 const [hovered, setHovered] = useRecyclingState(false);
439
440 const theme = useUniwindTheme();
458 - const separatorColor = theme["--color-separator"];
441 const screenColor = theme["--color-screen"];
442 const drawerColor = theme["--color-drawer"];
443 const pressedBackgroundColor = theme["--color-subtle"];
@@ -589,28 +571,14 @@ export const ThreadListRow = memo(function ThreadListRow(props: {
571 accessibilityHint="Swipe left for archive and delete actions"
572 accessibilityLabel={threadAccessibilityLabel}
573 accessibilityRole="button"
592 - className="bg-screen"
574 + className="bg-screen active:opacity-70"
575 onPress={() => {
576 close();
577 onSelectThread(thread);
578 }}
597 - style={({ pressed }) => ({ opacity: pressed ? 0.7 : 1 })}
579 >
599 - <View
600 - style={{
601 - paddingLeft: THREAD_LIST_COMPACT_INSET,
602 - paddingRight: 18,
603 - paddingTop: 10,
604 - }}
605 - >
606 - <View
607 - style={{
608 - gap: 3,
609 - borderBottomWidth: props.isLast ? 0 : 1,
610 - borderBottomColor: separatorColor,
611 - paddingBottom: 10,
612 - }}
613 - >
580 + <View className="pr-[18px] pt-[10px]" style={{ paddingLeft: THREAD_LIST_COMPACT_INSET }}>
581 + <View className={cn("gap-[3px] pb-[10px]", !props.isLast && "border-b border-separator")}>
582 <View className="flex-row items-center justify-between gap-2">
583 <Text className="flex-1 text-lg font-t3-bold text-foreground" numberOfLines={1}>
584 {thread.title}
apps/mobile/src/features/threads/thread-list-v2-items.tsx
+3 -6
@@ -214,9 +214,6 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props
214 readonly onDeletePendingTask: (pendingTask: PendingNewTask) => void;
215 }) {
216 const { pendingTask, onSelectPendingTask, onDeletePendingTask } = props;
217 - const theme = useUniwindTheme();
218 - const drawerColor = theme["--color-drawer"];
219 - const pressedBackgroundColor = theme["--color-subtle"];
217 const sidebarPane = props.pane === "sidebar";
218 const projectTitle =
219 props.projectTitle ?? props.project?.title ?? pendingTask.creation.projectTitle ?? "";
@@ -291,15 +288,15 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props
288 accessibilityHint="Opens the queued task for editing"
289 accessibilityLabel={pendingTask.title}
290 accessibilityRole="button"
291 + className={sidebarPane ? "bg-drawer active:bg-subtle" : undefined}
292 onPress={() => onSelectPendingTask(pendingTask)}
293 style={
294 sidebarPane
297 - ? ({ pressed }) => ({
298 - backgroundColor: pressed ? pressedBackgroundColor : drawerColor,
295 + ? {
296 borderRadius: SIDEBAR_V2_ROW_RADIUS,
297 paddingHorizontal: 12,
298 paddingVertical: 10,
302 - })
299 + }
300 : ({ pressed }) => ({ opacity: pressed ? 0.7 : 1 })
301 }
302 >
vite.config.ts
-2
@@ -144,9 +144,7 @@ export default defineConfig({
144 "apps/mobile/src/features/review/useNativeReviewDiffBridge.ts",
145 "apps/mobile/src/features/settings/SettingsEnvironmentsRouteScreen.tsx",
146 "apps/mobile/src/features/settings/appearance/components/AppearancePreviews.tsx",
147 - "apps/mobile/src/features/settings/appearance/components/FontSizeSliderRow.tsx",
147 "apps/mobile/src/features/threads/GitActionProgressOverlay.tsx",
149 - "apps/mobile/src/features/threads/NewTaskContextPickerScreens.tsx",
148 "apps/mobile/src/features/threads/NewTaskDraftScreen.tsx",
149 "apps/mobile/src/features/threads/ThreadComposer.tsx",
150 "apps/mobile/src/features/threads/ThreadFeed.tsx",