authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-02 20:02:29-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-03 03:02:29+00:00
log85f2479ffe5c9d8ffa91f1bfae5234df4061292f
treebbedb0a2a3a5410e418d8c681eaa879abf61caa0
parentb9b1b8fdddf9d006fdb820af770063e1f968345b
signature Signed by PGP key B5690EEEBB952194

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>

5 files changed, 17 insertions(+), 64 deletions(-)

apps/mobile/src/features/settings/appearance/components/FontSizeSliderRow.tsx+4-9
...@@ -12,7 +12,6 @@ import Animated, {...@@ -12,7 +12,6 @@ import Animated, {
12import type { ComponentProps } from "react";12import type { ComponentProps } from "react";
1313
14import { AppText as Text } from "../../../../components/AppText";14import { AppText as Text } from "../../../../components/AppText";
15import { useUniwindTheme } from "../../../../lib/useUniwindTheme";
1615
17type SymbolName = ComponentProps<typeof SymbolView>["name"];16type SymbolName = ComponentProps<typeof SymbolView>["name"];
1817
...@@ -36,10 +35,6 @@ export function FontSizeSliderRow(props: {...@@ -36,10 +35,6 @@ export function FontSizeSliderRow(props: {
36 readonly value: number;35 readonly value: number;
37 readonly onChange: (value: number) => void;36 readonly onChange: (value: number) => void;
38}) {37}) {
39 const theme = useUniwindTheme();
40 const trackColor = theme["--color-secondary-border"];
41 const fillColor = theme["--color-primary"];
42
43 const latest = useRef(props);38 const latest = useRef(props);
44 latest.current = props;39 latest.current = props;
4540
...@@ -172,12 +167,12 @@ export function FontSizeSliderRow(props: {...@@ -172,12 +167,12 @@ export function FontSizeSliderRow(props: {
172 }}167 }}
173 >168 >
174 <View169 <View
175 className="w-full rounded-full"170 className="w-full rounded-full bg-secondary-border"
176 style={{ backgroundColor: trackColor, height: TRACK_HEIGHT }}171 style={{ height: TRACK_HEIGHT }}
177 >172 >
178 <Animated.View173 <Animated.View
179 className="absolute inset-y-0 left-0 rounded-full"174 className="absolute inset-y-0 left-0 rounded-full bg-primary"
180 style={[{ backgroundColor: fillColor }, fillStyle]}175 style={fillStyle}
181 />176 />
182 </View>177 </View>
183 <Animated.View178 <Animated.View
apps/mobile/src/features/threads/NewTaskContextPickerScreens.tsx+1-6
...@@ -23,8 +23,6 @@ import { SymbolView } from "../../components/AppSymbol";...@@ -23,8 +23,6 @@ import { SymbolView } from "../../components/AppSymbol";
23import { AppText as Text } from "../../components/AppText";23import { AppText as Text } from "../../components/AppText";
24import { ThemedSwitch } from "../../components/ThemedSwitch";24import { ThemedSwitch } from "../../components/ThemedSwitch";
25import { cn } from "../../lib/cn";25import { cn } from "../../lib/cn";
26import { useFontFamily } from "../../lib/useFontFamily";
27import { useUniwindTheme } from "../../lib/useUniwindTheme";
28import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/StackHeader";26import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/StackHeader";
29import { useAtomCommand } from "../../state/use-atom-command";27import { useAtomCommand } from "../../state/use-atom-command";
30import { vcsEnvironment } from "../../state/vcs";28import { vcsEnvironment } from "../../state/vcs";
...@@ -193,8 +191,6 @@ export function NewTaskBranchPickerRouteScreen() {...@@ -193,8 +191,6 @@ export function NewTaskBranchPickerRouteScreen() {
193 const flow = useNewTaskFlow();191 const flow = useNewTaskFlow();
194 const navigation = useNavigation();192 const navigation = useNavigation();
195 const insets = useSafeAreaInsets();193 const insets = useSafeAreaInsets();
196 const foregroundColor = useUniwindTheme()["--color-foreground"];
197 const fontFamily = useFontFamily("regular");
198 const switchRef = useAtomCommand(vcsEnvironment.switchRef, { reportFailure: false });194 const switchRef = useAtomCommand(vcsEnvironment.switchRef, { reportFailure: false });
199 const [switchingBranchName, setSwitchingBranchName] = useState<string | null>(null);195 const [switchingBranchName, setSwitchingBranchName] = useState<string | null>(null);
200 const selectingBranchNameRef = useRef<string | null>(null);196 const selectingBranchNameRef = useRef<string | null>(null);
...@@ -417,11 +413,10 @@ export function NewTaskBranchPickerRouteScreen() {...@@ -417,11 +413,10 @@ export function NewTaskBranchPickerRouteScreen() {
417 <TextInput413 <TextInput
418 autoCapitalize="none"414 autoCapitalize="none"
419 autoCorrect={false}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"
421 onChangeText={flow.setBranchQuery}417 onChangeText={flow.setBranchQuery}
422 placeholder="Find a branch"418 placeholder="Find a branch"
423 placeholderTextColorClassName={"accent-placeholder"}419 placeholderTextColorClassName={"accent-placeholder"}
424 style={{ color: foregroundColor, fontFamily }}
425 value={flow.branchQuery}420 value={flow.branchQuery}
426 />421 />
427 </View>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,9 +276,6 @@ export const PendingTaskListRow = memo(function PendingTaskListRow(props: {
276 readonly onDeletePendingTask: (pendingTask: PendingNewTask) => void;276 readonly onDeletePendingTask: (pendingTask: PendingNewTask) => void;
277}) {277}) {
278 const compact = props.variant === "compact";278 const compact = props.variant === "compact";
279 const theme = useUniwindTheme();
280 const separatorColor = theme["--color-separator"];
281 const pressedBackgroundColor = theme["--color-subtle"];
282279
283 const { pendingTask, onSelectPendingTask, onDeletePendingTask } = props;280 const { pendingTask, onSelectPendingTask, onDeletePendingTask } = props;
284 const timestamp = relativeTime(pendingTask.message.createdAt);281 const timestamp = relativeTime(pendingTask.message.createdAt);
...@@ -333,25 +330,11 @@ export const PendingTaskListRow = memo(function PendingTaskListRow(props: {...@@ -333,25 +330,11 @@ export const PendingTaskListRow = memo(function PendingTaskListRow(props: {
333 accessibilityHint="Opens the queued task for editing"330 accessibilityHint="Opens the queued task for editing"
334 accessibilityLabel={pendingTask.title}331 accessibilityLabel={pendingTask.title}
335 accessibilityRole="button"332 accessibilityRole="button"
336 className="bg-screen"333 className="bg-screen active:opacity-70"
337 onPress={() => onSelectPendingTask(pendingTask)}334 onPress={() => onSelectPendingTask(pendingTask)}
338 style={({ pressed }) => ({ opacity: pressed ? 0.7 : 1 })}
339 >335 >
340 <View336 <View className="pr-[18px] pt-[10px]" style={{ paddingLeft: THREAD_LIST_COMPACT_INSET }}>
341 style={{337 <View className={cn("gap-[3px] pb-[10px]", !props.isLast && "border-b border-separator")}>
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 >
355 <View className="flex-row items-center justify-between gap-2">338 <View className="flex-row items-center justify-between gap-2">
356 <Text className="flex-1 text-lg font-t3-bold text-foreground" numberOfLines={1}>339 <Text className="flex-1 text-lg font-t3-bold text-foreground" numberOfLines={1}>
357 {pendingTask.title}340 {pendingTask.title}
...@@ -376,16 +359,16 @@ export const PendingTaskListRow = memo(function PendingTaskListRow(props: {...@@ -376,16 +359,16 @@ export const PendingTaskListRow = memo(function PendingTaskListRow(props: {
376 accessibilityHint="Opens the queued task for editing"359 accessibilityHint="Opens the queued task for editing"
377 accessibilityLabel={pendingTask.title}360 accessibilityLabel={pendingTask.title}
378 accessibilityRole="button"361 accessibilityRole="button"
362 className="active:bg-subtle"
379 onPress={() => onSelectPendingTask(pendingTask)}363 onPress={() => onSelectPendingTask(pendingTask)}
380 style={({ pressed }) => ({364 style={{
381 backgroundColor: pressed ? pressedBackgroundColor : "transparent",
382 borderRadius: SIDEBAR_ROW_RADIUS,365 borderRadius: SIDEBAR_ROW_RADIUS,
383 cursor: "pointer",366 cursor: "pointer",
384 minHeight: 64,367 minHeight: 64,
385 justifyContent: "center",368 justifyContent: "center",
386 paddingHorizontal: 12,369 paddingHorizontal: 12,
387 paddingVertical: 10,370 paddingVertical: 10,
388 })}371 }}
389 >372 >
390 <View className="gap-[3px]">373 <View className="gap-[3px]">
391 <View className="flex-row items-center justify-between gap-2">374 <View className="flex-row items-center justify-between gap-2">
...@@ -455,7 +438,6 @@ export const ThreadListRow = memo(function ThreadListRow(props: {...@@ -455,7 +438,6 @@ export const ThreadListRow = memo(function ThreadListRow(props: {
455 const [hovered, setHovered] = useRecyclingState(false);438 const [hovered, setHovered] = useRecyclingState(false);
456439
457 const theme = useUniwindTheme();440 const theme = useUniwindTheme();
458 const separatorColor = theme["--color-separator"];
459 const screenColor = theme["--color-screen"];441 const screenColor = theme["--color-screen"];
460 const drawerColor = theme["--color-drawer"];442 const drawerColor = theme["--color-drawer"];
461 const pressedBackgroundColor = theme["--color-subtle"];443 const pressedBackgroundColor = theme["--color-subtle"];
...@@ -589,28 +571,14 @@ export const ThreadListRow = memo(function ThreadListRow(props: {...@@ -589,28 +571,14 @@ export const ThreadListRow = memo(function ThreadListRow(props: {
589 accessibilityHint="Swipe left for archive and delete actions"571 accessibilityHint="Swipe left for archive and delete actions"
590 accessibilityLabel={threadAccessibilityLabel}572 accessibilityLabel={threadAccessibilityLabel}
591 accessibilityRole="button"573 accessibilityRole="button"
592 className="bg-screen"574 className="bg-screen active:opacity-70"
593 onPress={() => {575 onPress={() => {
594 close();576 close();
595 onSelectThread(thread);577 onSelectThread(thread);
596 }}578 }}
597 style={({ pressed }) => ({ opacity: pressed ? 0.7 : 1 })}
598 >579 >
599 <View580 <View className="pr-[18px] pt-[10px]" style={{ paddingLeft: THREAD_LIST_COMPACT_INSET }}>
600 style={{581 <View className={cn("gap-[3px] pb-[10px]", !props.isLast && "border-b border-separator")}>
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 >
614 <View className="flex-row items-center justify-between gap-2">582 <View className="flex-row items-center justify-between gap-2">
615 <Text className="flex-1 text-lg font-t3-bold text-foreground" numberOfLines={1}>583 <Text className="flex-1 text-lg font-t3-bold text-foreground" numberOfLines={1}>
616 {thread.title}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,9 +214,6 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props
214 readonly onDeletePendingTask: (pendingTask: PendingNewTask) => void;214 readonly onDeletePendingTask: (pendingTask: PendingNewTask) => void;
215}) {215}) {
216 const { pendingTask, onSelectPendingTask, onDeletePendingTask } = props;216 const { pendingTask, onSelectPendingTask, onDeletePendingTask } = props;
217 const theme = useUniwindTheme();
218 const drawerColor = theme["--color-drawer"];
219 const pressedBackgroundColor = theme["--color-subtle"];
220 const sidebarPane = props.pane === "sidebar";217 const sidebarPane = props.pane === "sidebar";
221 const projectTitle =218 const projectTitle =
222 props.projectTitle ?? props.project?.title ?? pendingTask.creation.projectTitle ?? "";219 props.projectTitle ?? props.project?.title ?? pendingTask.creation.projectTitle ?? "";
...@@ -291,15 +288,15 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props...@@ -291,15 +288,15 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props
291 accessibilityHint="Opens the queued task for editing"288 accessibilityHint="Opens the queued task for editing"
292 accessibilityLabel={pendingTask.title}289 accessibilityLabel={pendingTask.title}
293 accessibilityRole="button"290 accessibilityRole="button"
291 className={sidebarPane ? "bg-drawer active:bg-subtle" : undefined}
294 onPress={() => onSelectPendingTask(pendingTask)}292 onPress={() => onSelectPendingTask(pendingTask)}
295 style={293 style={
296 sidebarPane294 sidebarPane
297 ? ({ pressed }) => ({295 ? {
298 backgroundColor: pressed ? pressedBackgroundColor : drawerColor,
299 borderRadius: SIDEBAR_V2_ROW_RADIUS,296 borderRadius: SIDEBAR_V2_ROW_RADIUS,
300 paddingHorizontal: 12,297 paddingHorizontal: 12,
301 paddingVertical: 10,298 paddingVertical: 10,
302 })299 }
303 : ({ pressed }) => ({ opacity: pressed ? 0.7 : 1 })300 : ({ pressed }) => ({ opacity: pressed ? 0.7 : 1 })
304 }301 }
305 >302 >
vite.config.ts-2
...@@ -144,9 +144,7 @@ export default defineConfig({...@@ -144,9 +144,7 @@ export default defineConfig({
144 "apps/mobile/src/features/review/useNativeReviewDiffBridge.ts",144 "apps/mobile/src/features/review/useNativeReviewDiffBridge.ts",
145 "apps/mobile/src/features/settings/SettingsEnvironmentsRouteScreen.tsx",145 "apps/mobile/src/features/settings/SettingsEnvironmentsRouteScreen.tsx",
146 "apps/mobile/src/features/settings/appearance/components/AppearancePreviews.tsx",146 "apps/mobile/src/features/settings/appearance/components/AppearancePreviews.tsx",
147 "apps/mobile/src/features/settings/appearance/components/FontSizeSliderRow.tsx",
148 "apps/mobile/src/features/threads/GitActionProgressOverlay.tsx",147 "apps/mobile/src/features/threads/GitActionProgressOverlay.tsx",
149 "apps/mobile/src/features/threads/NewTaskContextPickerScreens.tsx",
150 "apps/mobile/src/features/threads/NewTaskDraftScreen.tsx",148 "apps/mobile/src/features/threads/NewTaskDraftScreen.tsx",
151 "apps/mobile/src/features/threads/ThreadComposer.tsx",149 "apps/mobile/src/features/threads/ThreadComposer.tsx",
152 "apps/mobile/src/features/threads/ThreadFeed.tsx",150 "apps/mobile/src/features/threads/ThreadFeed.tsx",