Skip to content

Commit 6408c79

Browse files
committed
fix(web): preserve rtl sentence direction with main fast path
2 parents 2bd0655 + 6fc9144 commit 6408c79

110 files changed

Lines changed: 5156 additions & 686 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/mobile/src/components/MediaVideoPlayer.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ interface MediaVideoPlayerProps {
140140
readonly paused?: boolean;
141141
readonly onPlaybackStart?: () => void;
142142
readonly actionsSource?: MediaActionsSource;
143+
readonly borderRadius?: number;
143144
}
144145

145146
function MediaVideoPlayerContent(props: MediaVideoPlayerProps) {
@@ -152,7 +153,10 @@ function MediaVideoPlayerContent(props: MediaVideoPlayerProps) {
152153
<View
153154
collapsable={false}
154155
className="overflow-hidden rounded-[10px] bg-black"
155-
style={props.expanded ? { flex: 1 } : { width: "100%", maxWidth: 480, aspectRatio: 16 / 9 }}
156+
style={[
157+
props.expanded ? { flex: 1 } : { width: "100%", maxWidth: 480, aspectRatio: 16 / 9 },
158+
props.borderRadius === undefined ? null : { borderRadius: props.borderRadius },
159+
]}
156160
>
157161
{playbackUri ? (
158162
<LoadedMediaVideo

‎apps/mobile/src/features/pull-requests/PullRequestsScreen.tsx‎

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { useAtomValue } from "@effect/atom-react";
1111
import {
1212
Keyboard,
1313
Platform,
14+
Pressable,
1415
RefreshControl,
1516
ScrollView,
1617
View,
@@ -20,6 +21,7 @@ import { NativeScrollViewMarker as ScrollViewMarker } from "../../native/NativeS
2021
import { useSafeAreaInsets } from "react-native-safe-area-context";
2122

2223
import { AppText as Text } from "../../components/ui/AppText";
24+
import { SymbolView } from "../../components/ui/AppSymbol";
2325
import { EmptyState } from "../../components/ui/EmptyState";
2426
import { NativePrimaryColumnContext } from "../../native/v5-workspace-context";
2527
import { useNativeColumnLayoutMetrics } from "../../native/native-layout-metrics";
@@ -32,7 +34,6 @@ import {
3234
usePullRequestListFilters,
3335
type PullRequestFilterMenu,
3436
} from "./PullRequestListFilters";
35-
import { PullRequestCardRow } from "./PullRequestControls";
3637
import { usePullRequestList } from "./usePullRequestList";
3738
import { usePullRequestListControls } from "./usePullRequestListControls";
3839
import { usePullRequestListActions } from "./usePullRequestListActions";
@@ -58,26 +59,38 @@ function PullRequestScrollView(props: ScrollViewProps) {
5859
);
5960
}
6061

61-
function PullRequestListErrors(props: { readonly messages: readonly string[] }) {
62+
function PullRequestListError(props: { readonly message: string }) {
6263
const [expanded, setExpanded] = useState(false);
63-
const title = `${props.messages.length} ${props.messages.length === 1 ? "error" : "errors"} loading pull requests`;
6464
return (
65-
<View>
66-
<PullRequestCardRow
67-
title={title}
68-
icon="exclamationmark.triangle"
69-
compact
70-
last
71-
expanded={expanded}
72-
accessibilityLabel={`${title}. ${expanded ? "Hide" : "Show"} details`}
73-
onPress={() => setExpanded((value) => !value)}
65+
<Pressable
66+
accessibilityRole="button"
67+
accessibilityLabel={props.message}
68+
accessibilityState={{ expanded }}
69+
onPress={() => setExpanded((value) => !value)}
70+
// A long press selects the text; collapsing under that selection crashes Android's
71+
// smart-select animation, so it must not also count as a press.
72+
onLongPress={() => undefined}
73+
className="min-h-11 flex-row items-center gap-3 px-4 py-2.5 active:opacity-70"
74+
>
75+
<SymbolView
76+
name="exclamationmark.triangle"
77+
size={18}
78+
tintColorClassName="accent-icon-muted"
7479
/>
75-
{expanded ? (
76-
<Text selectable className="px-4 pb-3 text-sm text-foreground-muted">
77-
{props.messages.join("\n")}
78-
</Text>
79-
) : null}
80-
</View>
80+
<Text
81+
selectable={expanded}
82+
numberOfLines={expanded ? undefined : 1}
83+
ellipsizeMode="tail"
84+
className="min-w-0 flex-1 text-sm text-foreground-muted"
85+
>
86+
{props.message}
87+
</Text>
88+
<SymbolView
89+
name={expanded ? "chevron.up" : "chevron.down"}
90+
size={11}
91+
tintColorClassName="accent-icon-muted"
92+
/>
93+
</Pressable>
8194
);
8295
}
8396

@@ -334,13 +347,14 @@ export function PullRequestsScreen(
334347
<>
335348
<PullRequestListFilters sidebar={sidebar} filters={filters} />
336349
{result.data?.errors.length ? (
337-
<PullRequestListErrors
338-
key={JSON.stringify(targets)}
339-
messages={result.data.errors.map(
340-
(error) =>
341-
`${error.projectTitle || environments.find((environment) => environment.environmentId === error.environmentId)?.environmentLabel || "Environment"}: ${error.message}`,
342-
)}
343-
/>
350+
<View key={JSON.stringify(targets)}>
351+
{result.data.errors.map((error) => (
352+
<PullRequestListError
353+
key={`${error.environmentId} ${error.projectTitle} ${error.message}`}
354+
message={`${error.projectTitle || environments.find((environment) => environment.environmentId === error.environmentId)?.environmentLabel || "Environment"}: ${error.message}`}
355+
/>
356+
))}
357+
</View>
344358
) : null}
345359
</>
346360
}

0 commit comments

Comments
 (0)