Skip to content

Commit 7153c10

Browse files
fix(mobile): a pull request opened from a thread keeps compose out of its bar
Opening a pull request from a thread pushes it onto the Threads tab's stack, so the selected tab stayed Threads and the iPhone Duo's detail bar offered New task beside the pull request's review actions. Pull request routes now skip detail compose wherever they open. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 420b39b commit 7153c10

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

‎apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ type ViewProps = ComponentProps<typeof NativeStackView>;
6060
type Descriptor = ViewProps["descriptors"][string];
6161
type Route = ViewProps["state"]["routes"][number];
6262

63+
const isPullRequestRoute = (route: Route) =>
64+
route.name === "PullRequest" ||
65+
route.name === "PullRequestFile" ||
66+
route.name === "PullRequestFiles";
67+
6368
function ColumnScreen(props: {
6469
readonly descriptor: Descriptor;
6570
readonly primary?: boolean;
@@ -139,7 +144,8 @@ function WorkspaceColumns(
139144
const openNewTask = () => props.navigation.navigate("NewTaskSheet", { screen: "NewTask" });
140145
// The Duo keeps compose in the detail column's bar, which is its vertical bar in landscape
141146
// and folded, so it sits with the column's other actions whichever screen is shown. Pull
142-
// requests leave it out; their bar is already full of review actions.
147+
// requests leave it out, including one opened from a thread; their bar is already full of
148+
// review actions.
143149
const detailCompose =
144150
isDuoDevice(deviceType) && selectedTab !== "pullRequests" ? openNewTask : undefined;
145151
const inspector = use(NativeWorkspaceInspectorContext);
@@ -149,12 +155,7 @@ function WorkspaceColumns(
149155
const collapsed = useRef(!layout.usesSplitView);
150156
const collapsedColumn = useRef<CollapsedSplitColumn>({ visible: compactColumn, leaving: null });
151157
const threadParams = props.detail.findLast((route) => route.name === "Thread")?.params;
152-
const pullRequestParams = props.detail.findLast(
153-
(route) =>
154-
route.name === "PullRequest" ||
155-
route.name === "PullRequestFile" ||
156-
route.name === "PullRequestFiles",
157-
)?.params;
158+
const pullRequestParams = props.detail.findLast(isPullRequestRoute)?.params;
158159
const selectedPullRequestKey =
159160
pullRequestParams &&
160161
"environmentId" in pullRequestParams &&
@@ -294,7 +295,7 @@ function WorkspaceColumns(
294295
descriptor={descriptor}
295296
onDismiss={handleNativeDismiss}
296297
onAppearance={followCollapsedSplit}
297-
onCompose={detailCompose}
298+
onCompose={isPullRequestRoute(route) ? undefined : detailCompose}
298299
navigation={props.navigation}
299300
/>
300301
) : null;

0 commit comments

Comments
 (0)