Skip to content
TypeScript

fix(mobile): the pull requests tab's empty detail asks for a pull request (#23143)

Julius Marmingeadded623d1d8
diff --git a/apps/mobile/src/features/layout/WorkspaceEmptyDetail.tsx b/apps/mobile/src/features/layout/WorkspaceEmptyDetail.tsx
index 12d42a8647a..3df93a6dd9f 100644
--- a/apps/mobile/src/features/layout/WorkspaceEmptyDetail.tsx
+++ b/apps/mobile/src/features/layout/WorkspaceEmptyDetail.tsx
@@ -5,11 +5,14 @@ import { AppText as Text } from "../../components/ui/AppText";
import { NewThreadButton } from "../../components/NewThreadButton";
import { FloatingActionButton } from "../../components/ui/FloatingActionButton";
import { EmptyState } from "../../components/ui/EmptyState";
+import type { WorkspaceTab } from "../workspace/workspace-tabs-state";
export function WorkspaceEmptyDetail(props: {
+ readonly tab?: WorkspaceTab;
readonly onStartNewTask?: () => void;
readonly onAddConnection?: () => void;
}) {
+ const pullRequests = props.tab === "pullRequests";
return (
<View
className={
@@ -43,13 +46,17 @@ export function WorkspaceEmptyDetail(props: {
tintColorClassName="accent-icon-subtle"
type="hierarchical"
/>
- <Text className="text-center text-xl font-t3-bold">Select a thread</Text>
+ <Text className="text-center text-xl font-t3-bold">
+ {pullRequests ? "Select a pull request" : "Select a thread"}
+ </Text>
<Text className="text-center text-base text-foreground-muted">
- {Platform.OS === "android"
- ? "Choose a thread from the sidebar or start a new thread."
- : "Choose a thread from the sidebar or start a new task."}
+ {pullRequests
+ ? "Choose a pull request from the sidebar to review it."
+ : Platform.OS === "android"
+ ? "Choose a thread from the sidebar or start a new thread."
+ : "Choose a thread from the sidebar or start a new task."}
</Text>
- {props.onStartNewTask ? (
+ {props.onStartNewTask && !pullRequests ? (
Platform.OS === "android" ? (
<NewThreadButton extended className="mt-2" onPress={props.onStartNewTask} />
) : (
diff --git a/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx b/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx
index bb3ed7fa4a3..059c88e26fa 100644
--- a/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx
+++ b/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx
@@ -280,6 +280,7 @@ function WorkspaceColumns(
/>
<ColumnContent>
<WorkspaceEmptyDetail
+ tab={selectedTab}
onStartNewTask={
// The detail bar or a visible sidebar already carries compose.
detailCompose || panes.primarySidebarVisible ? undefined : openNewTask