Skip to content

Commit e0c85a2

Browse files
shivamhwpT3 Code Test
andauthored
fix(mobile): avoid double dividers between thread sections (pingdotgg#5391)
Co-authored-by: T3 Code Test <[email protected]>
1 parent 3c5bdb8 commit e0c85a2

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

‎apps/mobile/src/features/home/HomeScreen.tsx‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,11 @@ export function HomeScreen(props: HomeScreenProps) {
694694
);
695695

696696
const renderV2Item = useCallback(
697-
({ item }: { readonly item: ThreadListV2ListItem }) => {
697+
({ item, index }: { readonly item: ThreadListV2ListItem; readonly index: number }) => {
698+
const nextItem = threadListV2Items[index + 1];
699+
const showTrailingDivider =
700+
nextItem?.type === "v2-thread" ||
701+
(nextItem?.type === "v2-pending" && !nextItem.showPendingDivider);
698702
if (item.type === "v2-pending") {
699703
const pendingScopeKey = scopedProjectKey(
700704
item.pendingTask.message.environmentId,
@@ -712,6 +716,7 @@ export function HomeScreen(props: HomeScreenProps) {
712716
: null
713717
}
714718
showPendingDivider={item.showPendingDivider}
719+
showTrailingDivider={showTrailingDivider}
715720
onSelectPendingTask={props.onSelectPendingTask}
716721
onDeletePendingTask={props.onDeletePendingTask}
717722
/>
@@ -744,6 +749,7 @@ export function HomeScreen(props: HomeScreenProps) {
744749
pinned={item.item.pinned}
745750
snoozePresetMinute={nowMinute}
746751
snoozeWakeLabelText={item.snoozeWakeLabelText}
752+
showTrailingDivider={showTrailingDivider}
747753
project={
748754
projectByKey.get(scopedProjectKey(thread.environmentId, thread.projectId)) ?? null
749755
}
@@ -814,6 +820,7 @@ export function HomeScreen(props: HomeScreenProps) {
814820
serverConfigs,
815821
settlementEnvironmentIds,
816822
snoozeEnvironmentIds,
823+
threadListV2Items,
817824
threadSearchMatchByKey,
818825
toggleSettledShelf,
819826
toggleSnoozedShelf,

‎apps/mobile/src/features/threads/thread-list-v2-items.tsx‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props
204204
readonly pane?: "screen" | "sidebar";
205205
/** Draws the "Pending" divider above the first queued row. */
206206
readonly showPendingDivider: boolean;
207+
/** Keeps row hairlines inside a section; section headers draw their own rule. */
208+
readonly showTrailingDivider?: boolean;
207209
readonly onSelectPendingTask: (pendingTask: PendingNewTask) => void;
208210
readonly onDeletePendingTask: (pendingTask: PendingNewTask) => void;
209211
}) {
@@ -291,7 +293,9 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props
291293
) : (
292294
<View className="bg-screen">
293295
<View className="px-5 py-2.5">{rowContent}</View>
294-
<View className="ml-5 h-px bg-border-subtle" />
296+
{props.showTrailingDivider !== false ? (
297+
<View className="ml-5 h-px bg-border-subtle" />
298+
) : null}
295299
</View>
296300
)}
297301
</Pressable>
@@ -327,6 +331,8 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
327331
into the drawer surface, selection filled with the accent color —
328332
matching the v1 sidebar rows. */
329333
readonly pane?: "screen" | "sidebar";
334+
/** Keeps row hairlines inside a section; section headers draw their own rule. */
335+
readonly showTrailingDivider?: boolean;
330336
/** Highlights the thread open in the detail pane (iPad split view). The
331337
compact Home list never sets it — phones navigate away on select. */
332338
readonly selected?: boolean;
@@ -728,7 +734,9 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
728734
actions reveal behind the row. */
729735
<View className="bg-screen">
730736
<View className="px-5 py-2.5">{cardContent}</View>
731-
<View className="ml-5 h-px bg-border-subtle" />
737+
{props.showTrailingDivider !== false ? (
738+
<View className="ml-5 h-px bg-border-subtle" />
739+
) : null}
732740
</View>
733741
)}
734742
</Pressable>

0 commit comments

Comments
 (0)