GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(mobile): PR details use one native section tab control by wSedlacek · Pull Request #32270 · pingdotgg/t3code

fix(mobile): PR details use one native section tab control #32270

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.

Sign up for GitHub

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

Closed
wSedlacek wants to merge 3 commits into pingdotgg:main from wSedlacek:t3/use-native-pr-tabs

Uh oh!

There was an error while loading. Please reload this page.

Closed

fix(mobile): PR details use one native section tab control #32270

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit Hold shift + click to select a range
dff812b
fix(mobile): PR details use one native section tab control
wSedlacek Nov 7, 2026
a7a8a78
fix(mobile): keep PR section control aligned when guides remap
wSedlacek Nov 7, 2026
2fc327b
Merge remote-tracking branch 'github/main' into t3/use-native-pr-tabs
maria-rcks Nov 10, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Next Next commit
fix(mobile): PR details use one native section tab control
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@wSedlacek
wSedlacek committed Nov 9, 2026
commit dff812bcd8316e0233a22d505b9ceab1c1c5be57

There are no files selected for viewing

2 changes: 1 addition & 1 deletion 2 apps/mobile/src/components/ui/SegmentedControl.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function SegmentedControl<Value extends string | number>(
const option = props.options[nativeEvent.index];
if (option) props.onSelect(option.value);
}}
style={{ height: props.size === "compact" ? 32 : 36 }}
style={{ height: props.size === "compact" ? 32 : 36, width: "100%" }}
/>
</View>
);
Expand Down
105 changes: 78 additions & 27 deletions 105 apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { PullRequestActivityFilters } from "./PullRequestActivityFilters";
import type { LegendListRef } from "@legendapp/list/react-native";
import { AnimatedLegendList } from "@legendapp/list/reanimated";
import Animated from "react-native-reanimated";
import Animated, { useAnimatedStyle, useSharedValue } from "react-native-reanimated";
import {
PR_ROW_LAYOUT,
PR_ROW_ENTER,
Expand Down Expand Up @@ -124,6 +124,9 @@ import {
} from "@t3tools/client-runtime/source-control-clients";

const EMPTY_IDS: readonly string[] = [];
// Matches SegmentedControl's default height so the list spacer and overlay stay aligned.
const PR_SECTION_CONTROL_HEIGHT = Platform.OS === "android" ? 40 : 36;
const PR_LIST_CONTENT_TOP_PADDING = 8;

function usePullRequestActivityRows(params: PullRequestParams, filter: ActivityFilter) {
const navigation = useNavigation();
Expand Down Expand Up @@ -355,9 +358,27 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
offset: -contentTopInset,
});
const bodyY = useRef(0);
// Content Y of the section-control spacer: read-status height + y within the identity block.
const sectionControlReadStatusHeight = useRef(0);
const sectionControlYInHeader = useRef(0);
const [sectionControlReady, setSectionControlReady] = useState(false);
const [headerHeight, setHeaderHeight] = useState(0);
const [viewportHeight, setViewportHeight] = useState(0);
const scrollViews = useRef<Partial<Record<typeof section, LegendListRef | null>>>({});
// One native control stays mounted outside the opacity-hidden tabs (Usage-style), so Liquid
// Glass selection never remounts mid-gesture. Its top tracks the active tab's scroll.
const sectionControlTop = useSharedValue(0);
const sectionControlStyle = useAnimatedStyle(() => ({
transform: [{ translateY: sectionControlTop.value }],
}));
const syncSectionControlTop = (scrollY: number) => {
Comment thread
wSedlacek marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

sectionControlTop.set(
PR_LIST_CONTENT_TOP_PADDING +
sectionControlReadStatusHeight.current +
sectionControlYInHeader.current -
scrollY,
);
};
// AnimatedLegendList re-attaches its handle and sets state whenever its ref changes,
// so an inline ref in the tab map loops the screen into "Maximum update depth exceeded".
const [listRefs] = useState(() => {
Expand All @@ -383,6 +404,7 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
requestedSection.current = next;
scrollOffsets.current[next] = offset;
currentScrollOffset.current = { tab: next, offset };
syncSectionControlTop(offset);
scrollViews.current[next]?.scrollToOffset({ offset, animated: false });
setSection(next);
};
Expand Down Expand Up @@ -599,9 +621,12 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
onScroll={(event) => {
const offset = event.nativeEvent.contentOffset.y;
scrollOffsets.current[tab] = offset;
if (shown(requestedSection.current) === tab)
if (shown(requestedSection.current) === tab) {
currentScrollOffset.current = { tab, offset };
syncSectionControlTop(offset);
}
Comment thread
wSedlacek marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

}}
scrollEventThrottle={16}
className="flex-1"
renderScrollComponent={Platform.OS === "ios" ? NativeScrollView : undefined}
contentInsetAdjustmentBehavior="never"
Expand Down Expand Up @@ -636,7 +661,7 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
}}
contentContainerStyle={{
paddingHorizontal: 16,
paddingTop: 8,
paddingTop: PR_LIST_CONTENT_TOP_PADDING,
paddingBottom: 24 + (Platform.OS === "android" ? toolbarHeight : 0),
// Short tabs must still be tall enough to preserve the collapsed header.
minHeight: Math.max(
Expand Down Expand Up @@ -760,11 +785,18 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
maintainVisibleContentPosition={false}
ListHeaderComponent={
<>
<PullRequestReadStatus
pending={result.isPending && !identity}
error={result.error}
terminology={terminology}
/>
<View
onLayout={(event) => {
sectionControlReadStatusHeight.current = event.nativeEvent.layout.height;
syncSectionControlTop(currentScrollOffset.current.offset);
}}
>
<PullRequestReadStatus
pending={result.isPending && !identity}
error={result.error}
terminology={terminology}
/>
</View>
{identity ? (
<View
className="gap-5 pb-5"
Expand All @@ -774,25 +806,16 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
}}
>
<PullRequestIdentity pr={identity} params={params} />
{/* UIKit draws the tapped control's glass lens outside the hidden
tab's opacity, so only the visible tab mounts the control. */}
{Platform.OS !== "ios" || section === tab ? (
<SegmentedControl
options={[
{ value: "overview", label: "Overview" },
...(guidesEnabled
? [{ value: "guide" as const, label: "Guide" }]
: []),
{ value: "activity", label: "Activity" },
]}
selected={section}
onSelect={selectSection}
role="tab"
size="compact"
/>
) : (
<View style={{ height: 32 }} />
)}
{/* Spacer only: the real control is overlaid outside opacity:0 tabs so
UIKit's glass lens stays on one always-mounted native control. */}
<View
style={{ height: PR_SECTION_CONTROL_HEIGHT }}
onLayout={(event) => {
sectionControlYInHeader.current = event.nativeEvent.layout.y;
syncSectionControlTop(currentScrollOffset.current.offset);
setSectionControlReady(true);
}}
/>
</View>
) : null}
</>
Expand All @@ -801,6 +824,34 @@ export function PullRequestRouteScreen({ route }: StaticScreenProps<PullRequestP
/>
</View>
))}
{identity && sectionControlReady ? (
<View pointerEvents="box-none" style={StyleSheet.absoluteFill}>
<Animated.View
pointerEvents="box-none"
style={[
{
position: "absolute",
left: 16,
right: 16,
top: 0,
},
sectionControlStyle,
]}
>
<SegmentedControl
options={[
{ value: "overview", label: "Overview" },
...(guidesEnabled ? [{ value: "guide" as const, label: "Guide" }] : []),
{ value: "activity", label: "Activity" },
]}
selected={section}
onSelect={selectSection}
role="tab"
className="w-full"
/>
</Animated.View>
</View>
) : null}
Comment thread
wSedlacek marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

</ScreenContent>
<PullRequestActionToolbar
pr={pr}
Expand Down
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.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.