-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fix(mobile): restore iOS Threads branding #4862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
juliusmarminge
merged 6 commits into
pingdotgg:main
from
PixPMusic:pixpmusic/restore-ios-home-branding
Jul 30, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1fa081b
fix(mobile): restore branded iOS Threads header
PixPMusic a0d328c
fix(mobile): match iOS native title scale
PixPMusic 33ea6b1
fix(mobile): match iOS brand proportions
PixPMusic 574c5d8
fix(mobile): preserve iOS scrollfade with branding
PixPMusic fc85e35
fix(mobile): stabilize split header transitions
PixPMusic 077cbed
fix(mobile): capture store screenshots as Alpha
PixPMusic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| import Constants from "expo-constants"; | ||
| import type { | ||
| NativeStackHeaderItem, | ||
| NativeStackNavigationOptions, | ||
| } from "@react-navigation/native-stack"; | ||
| import { Platform, View } from "react-native"; | ||
|
|
||
| import { AppText as Text } from "./AppText"; | ||
| import { T3Wordmark } from "./T3Wordmark"; | ||
| import { IPAD_HOME_TITLE_OFFSET } from "../lib/layoutMetrics"; | ||
| import { resolveMobileStageLabel } from "../lib/mobileBranding"; | ||
| import { useThemeColor } from "../lib/useThemeColor"; | ||
| import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../native/native-glass"; | ||
|
|
||
| // Native leading items inherit different UIKit margins than title views. | ||
| const IOS_NATIVE_LEADING_TITLE_OFFSET = -6; | ||
| const IPAD_NATIVE_LEADING_TITLE_OFFSET = 7; | ||
|
|
||
| /** | ||
| * Compact brand lockup sized for native navigation bars. | ||
| */ | ||
| export function CompactBrandTitle( | ||
| props: { | ||
| readonly nativeLeadingItem?: boolean; | ||
| } = {}, | ||
| ) { | ||
| const iconColor = useThemeColor("--color-icon"); | ||
| const mutedColor = useThemeColor("--color-foreground-muted"); | ||
| const subtleColor = useThemeColor("--color-subtle"); | ||
| const stageLabel = resolveMobileStageLabel(Constants.expoConfig?.extra?.appVariant); | ||
| const titleOffset = | ||
| Platform.OS !== "ios" | ||
| ? 0 | ||
| : props.nativeLeadingItem | ||
| ? Platform.isPad | ||
| ? IPAD_NATIVE_LEADING_TITLE_OFFSET | ||
| : IOS_NATIVE_LEADING_TITLE_OFFSET | ||
| : Platform.isPad | ||
| ? IPAD_HOME_TITLE_OFFSET | ||
| : 0; | ||
|
|
||
| return ( | ||
| <View | ||
| aria-level={1} | ||
| accessibilityLabel="T3 Code, Threads" | ||
| accessible | ||
| role="heading" | ||
| style={{ | ||
| alignItems: "center", | ||
| flexDirection: "row", | ||
| gap: 6, | ||
| marginLeft: titleOffset, | ||
| }} | ||
| > | ||
| <T3Wordmark color={iconColor} height={15} /> | ||
| <Text | ||
| style={{ | ||
| color: mutedColor, | ||
| fontFamily: "DMSans-Medium", | ||
| fontSize: 21, | ||
| letterSpacing: -0.5, | ||
| }} | ||
| > | ||
| Code | ||
| </Text> | ||
| <View | ||
| style={{ | ||
| backgroundColor: subtleColor, | ||
| borderRadius: 999, | ||
| paddingHorizontal: 6, | ||
| paddingVertical: 2, | ||
| }} | ||
| > | ||
| <Text | ||
| style={{ | ||
| color: mutedColor, | ||
| fontFamily: "DMSans-Bold", | ||
| fontSize: 9, | ||
| letterSpacing: 0.9, | ||
| textTransform: "uppercase", | ||
| }} | ||
| > | ||
| {stageLabel} | ||
| </Text> | ||
| </View> | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| export function renderCompactBrandTitle() { | ||
| return <CompactBrandTitle />; | ||
| } | ||
|
|
||
| export function renderCompactBrandHeaderItems(): NativeStackHeaderItem[] { | ||
| return [ | ||
| { | ||
| element: <CompactBrandTitle nativeLeadingItem />, | ||
| hidesSharedBackground: true, | ||
| type: "custom", | ||
| }, | ||
| ]; | ||
| } | ||
|
|
||
| export function getCompactBrandHeaderOptions( | ||
| fallbackTitleStyle?: NativeStackNavigationOptions["headerTitleStyle"], | ||
| ): NativeStackNavigationOptions { | ||
| if (Platform.OS === "ios" && NATIVE_LIQUID_GLASS_SUPPORTED) { | ||
| return { | ||
| headerTitle: "Threads", | ||
| headerTitleStyle: { color: "transparent", fontSize: 18, fontWeight: "800" }, | ||
| title: "Threads", | ||
| unstable_headerLeftItems: renderCompactBrandHeaderItems, | ||
| }; | ||
| } | ||
|
|
||
| return { | ||
| headerTitle: renderCompactBrandTitle, | ||
| headerTitleStyle: fallbackTitleStyle, | ||
| title: "Threads", | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| /** Horizontal inset shared by the home header and compact thread list. */ | ||
| export const HOME_HORIZONTAL_INSET = 20; | ||
|
|
||
| /** Compensates for the tighter native sidebar title margin on iPad. */ | ||
| export const IPAD_HOME_TITLE_OFFSET = 10; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { describe, expect, it } from "vite-plus/test"; | ||
|
|
||
| import { resolveMobileStageLabel } from "./mobileBranding"; | ||
|
|
||
| describe("resolveMobileStageLabel", () => { | ||
| it.each([ | ||
| ["development", "Dev"], | ||
| ["preview", "Nightly"], | ||
| ["production", "Alpha"], | ||
| [undefined, "Alpha"], | ||
| ])("maps %s builds to %s", (appVariant, expected) => { | ||
| expect(resolveMobileStageLabel(appVariant)).toBe(expected); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| export type MobileStageLabel = "Alpha" | "Dev" | "Nightly"; | ||
|
|
||
| export function resolveMobileStageLabel(appVariant: unknown): MobileStageLabel { | ||
| if (appVariant === "development") return "Dev"; | ||
| if (appVariant === "preview") return "Nightly"; | ||
| return "Alpha"; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.