Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions apps/mobile/src/features/threads/thread-list-v2-items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,10 @@ import {
import { QueuedMessageIcon } from "./queued-message-icon";
import { shouldRecedeThreadRow } from "./thread-row-emphasis";
import { ThreadSearchMatchExcerpt } from "./thread-search-match";
import { useScaledTextRole } from "../settings/appearance/useScaledTextRole";
import { PullRequestGlyph } from "../pull-requests/pullRequestGlyphs";
import { pullRequestStatus } from "../pull-requests/pullRequestStatus";

const TITLE_FAVICON_SIZE = 15;
// Centers the favicon on the first line of the text-base title.
const TITLE_FAVICON_OFFSET = 4;
// Lines below the title start where the title text does.
const TITLE_TEXT_INSET = TITLE_FAVICON_SIZE + 8;

interface StatusLabel {
readonly label: string;
readonly icon: AppSymbolName;
Expand Down Expand Up @@ -602,7 +597,12 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
readonly searchQuery?: string;
readonly simultaneousSwipeGesture?: ComponentProps<typeof ThreadSwipeable>["simultaneousWith"];
}) {
const { width: windowWidth } = useWindowDimensions();
const { width: windowWidth, fontScale } = useWindowDimensions();
const titleTypography = useScaledTextRole("body");
const metadataTypography = useScaledTextRole("label");
const projectIconSize = titleTypography.fontSize * 1.25 * fontScale;
const machineIconSize = metadataTypography.fontSize * fontScale;
const titleLineHeight = titleTypography.lineHeight * fontScale;
const {
thread,
variant,
Expand Down Expand Up @@ -1001,17 +1001,17 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
? `Opens the thread. Swipe left to ${primaryAction.label.toLowerCase()}.`
: `Opens the thread. Swipe left for ${primaryAction.label.toLowerCase()} and snooze actions.`;

const titleTextInset = props.project ? TITLE_TEXT_INSET : 0;
const titleTextInset = props.project ? projectIconSize + 8 : 0;
const cardContent = (
<>
<View className="flex-row items-start gap-2">
{props.project ? (
<View style={{ marginTop: TITLE_FAVICON_OFFSET }}>
<View className="justify-center" style={{ height: titleLineHeight }}>
<ProjectFavicon
environmentId={thread.environmentId}
faviconPath={props.project.faviconPath}
projectIcon={props.project.projectIcon}
size={TITLE_FAVICON_SIZE}
size={projectIconSize}
projectTitle={props.project.title}
workspaceRoot={props.project.workspaceRoot}
/>
Expand All @@ -1029,7 +1029,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
>
{thread.title}
</Text>
<View className="flex-row items-center gap-1.5" style={{ marginTop: 3 }}>
<View className="flex-row items-center gap-1.5" style={{ minHeight: titleLineHeight }}>
{props.hasQueuedMessages ? <QueuedMessageIcon selected={selected} /> : null}
{pinnedRow ? (
<SymbolView
Expand Down Expand Up @@ -1140,7 +1140,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
{props.environmentMachine ? (
<EnvironmentMachineSymbol
kind={props.environmentMachine}
size={11}
size={machineIconSize}
tintColorClassName={
selected
? selectedThreadRowColors.mutedIconTintClassName
Expand Down Expand Up @@ -1301,7 +1301,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
environmentId={thread.environmentId}
faviconPath={props.project.faviconPath}
projectIcon={props.project.projectIcon}
size={15}
size={projectIconSize}
projectTitle={props.project.title}
workspaceRoot={props.project.workspaceRoot}
/>
Expand Down
Loading