Skip to content
Open
Show file tree
Hide file tree
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
46 changes: 46 additions & 0 deletions apps/mobile/src/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ import { GitBranchesSheet } from "./features/threads/git/GitBranchesSheet";
import { GitCommitSheet } from "./features/threads/git/GitCommitSheet";
import { GitConfirmSheet } from "./features/threads/git/GitConfirmSheet";
import { GitOverviewSheet } from "./features/threads/git/GitOverviewSheet";
import { PullRequestCommentSheet } from "./features/pull-requests/PullRequestCommentSheet";
import { PullRequestDetailScreen } from "./features/pull-requests/PullRequestDetailScreen";
import { PullRequestDiffScreen } from "./features/pull-requests/PullRequestDiffScreen";
import { PullRequestReviewersSheet } from "./features/pull-requests/PullRequestReviewersSheet";
import { PullRequestsRouteScreen } from "./features/pull-requests/PullRequestsRouteScreen";
import { ThreadRouteScreen } from "./features/threads/ThreadRouteScreen";
import { ConnectionsRouteScreen } from "./features/connection/ConnectionsRouteScreen";
import { ConnectionsNewRouteScreen } from "./features/connection/ConnectionsNewRouteScreen";
Expand Down Expand Up @@ -291,6 +296,8 @@ const WORKSPACE_OVERLAY_ROUTES = new Set([
"GitConfirm",
"GitOverview",
"NewTaskSheet",
"PullRequestComment",
"PullRequestReviewers",
"SettingsLegal",
"SettingsSheet",
"ThreadReviewComment",
Expand Down Expand Up @@ -424,6 +431,45 @@ export const RootStack = createNativeStackNavigator({
linking: THREAD_LINKING_PREFIX,
options: GLASS_HEADER_OPTIONS,
}),
PullRequests: createNativeStackScreen({
screen: PullRequestsRouteScreen,
linking: "pull-requests",
options: {
...GLASS_HEADER_OPTIONS,
headerLargeTitle: Platform.OS === "ios",
title: "Pull Requests",
},
}),
PullRequestDetail: createNativeStackScreen({
screen: PullRequestDetailScreen,
linking: "pull-requests/:environmentId/:projectId/:number",
options: GLASS_HEADER_OPTIONS,
}),
PullRequestDiff: createNativeStackScreen({
screen: PullRequestDiffScreen,
linking: "pull-requests/:environmentId/:projectId/:number/diff",
options: SOLID_HEADER_OPTIONS,
}),
PullRequestComment: createNativeStackScreen({
screen: PullRequestCommentSheet,
linking: "pull-requests/:environmentId/:projectId/:number/comment",
options: {
presentation: Platform.OS === "android" ? "fullScreenModal" : "formSheet",
sheetAllowedDetents: Platform.OS === "android" ? undefined : [0.55, 0.92],
sheetGrabberVisible: Platform.OS !== "android",
...(Platform.OS === "ios" ? SHEET_SOLID_HEADER_OPTIONS : { headerShown: false }),
},
}),
PullRequestReviewers: createNativeStackScreen({
screen: PullRequestReviewersSheet,
linking: "pull-requests/:environmentId/:projectId/:number/reviewers",
Comment thread
SergeSerb2 marked this conversation as resolved.
options: {
presentation: Platform.OS === "android" ? "fullScreenModal" : "formSheet",
sheetAllowedDetents: Platform.OS === "android" ? undefined : [0.7, 0.92],
sheetGrabberVisible: Platform.OS !== "android",
...(Platform.OS === "ios" ? SHEET_SOLID_HEADER_OPTIONS : { headerShown: false }),
},
Comment thread
SergeSerb2 marked this conversation as resolved.
}),
ThreadTerminal: createNativeStackScreen({
screen: ThreadTerminalRouteScreen,
linking: `${THREAD_LINKING_PREFIX}/terminal`,
Expand Down
4 changes: 4 additions & 0 deletions apps/mobile/src/components/AppSymbol.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import {
IconTrash,
IconTypography,
IconUserCircle,
IconUsers,
IconWifiOff,
IconWorld,
IconX,
Expand Down Expand Up @@ -118,12 +119,15 @@ const ANDROID_ICON_BY_SF_SYMBOL: Partial<Record<SFSymbol, Icon>> = {
"folder.badge.plus": IconFolderPlus,
"folder.fill": IconFolder,
gearshape: IconSettings,
hammer: IconHammer,
"info.circle": IconInfoCircle,
link: IconLink,
"line.3.horizontal.decrease.circle": IconFilter,
"line.3.horizontal.decrease.circle.fill": IconFilter,
magnifyingglass: IconSearch,
"minus.circle": IconMinus,
paintbrush: IconPalette,
"person.2": IconUsers,
"person.crop.circle": IconUserCircle,
pin: IconPin,
"pin.slash": IconPinnedOff,
Expand Down
7 changes: 6 additions & 1 deletion apps/mobile/src/connection/runtime.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Connection } from "@t3tools/client-runtime/connection";
import { pullRequestDiffLoaderLayer } from "@t3tools/client-runtime/state/pull-requests";
import { shellSnapshotLoaderLayer } from "@t3tools/client-runtime/state/shell";
import { threadSnapshotLoaderLayer } from "@t3tools/client-runtime/state/threads";
import * as Layer from "effect/Layer";
Expand All @@ -15,7 +16,11 @@ const providedConnectionPlatformLayer = connectionPlatformLayer.pipe(
Layer.provide(runtimeContextLayer),
);

const snapshotLoaderLayer = Layer.merge(threadSnapshotLoaderLayer, shellSnapshotLoaderLayer);
const snapshotLoaderLayer = Layer.mergeAll(
threadSnapshotLoaderLayer,
shellSnapshotLoaderLayer,
pullRequestDiffLoaderLayer,
);

type ConnectionLayerSource =
| typeof Connection.layer
Expand Down
22 changes: 22 additions & 0 deletions apps/mobile/src/features/home/HomeHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export function HomeHeader(props: {
readonly onProjectSortOrderChange: (sortOrder: HomeProjectSortOrder) => void;
readonly onThreadSortOrderChange: (sortOrder: SidebarThreadSortOrder) => void;
readonly onOpenEnvironments: () => void;
readonly onOpenPullRequests: () => void;
readonly onOpenSettings: () => void;
readonly onStartNewTask: () => void;
}) {
Expand Down Expand Up @@ -256,6 +257,19 @@ function AndroidHomeHeader(props: HomeHeaderProps) {
{/* Built identically to the filter button so the two circles
match exactly (ControlPill sizes via Tailwind classes and
resolves to a different box). */}
<Pressable
accessibilityLabel="Open pull requests"
accessibilityRole="button"
onPress={props.onOpenPullRequests}
className="size-11 items-center justify-center rounded-full bg-subtle"
>
<SymbolView
name="arrow.triangle.pull"
size={18}
tintColor={iconColor}
type="monochrome"
/>
</Pressable>
<Pressable
accessibilityLabel="Open settings"
accessibilityRole="button"
Expand Down Expand Up @@ -329,6 +343,14 @@ function IosHomeHeader(props: HomeHeaderProps) {
unstable_headerRightItems:
Platform.OS === "ios"
? () => [
withNativeGlassHeaderItem({
accessibilityLabel: "Open pull requests",
icon: { name: "arrow.triangle.pull", type: "sfSymbol" } as const,
identifier: "home-pull-requests",
label: "",
onPress: props.onOpenPullRequests,
type: "button",
}),
withNativeGlassHeaderItem({
accessibilityLabel: "Open settings",
icon: { name: "ellipsis", type: "sfSymbol" } as const,
Expand Down
14 changes: 11 additions & 3 deletions apps/mobile/src/features/home/HomeRouteScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,20 @@ export function HomeRouteScreen() {
options={{ title: "", headerTitle: "", unstable_headerLeftItems: () => [] }}
/>
<WorkspaceSidebarToolbar
afterSidebarButton={
afterSidebarButton={[
<NativeHeaderToolbar.Button
key="pull-requests"
accessibilityLabel="Open pull requests"
icon="arrow.triangle.pull"
onPress={() => navigation.navigate("PullRequests")}
/>,
<NativeHeaderToolbar.Button
key="new-task"
accessibilityLabel="New task"
icon="square.and.pencil"
onPress={() => navigation.navigate("NewTaskSheet", { screen: "NewTask" })}
/>
}
/>,
]}
/>
<WorkspaceEmptyDetail
onStartNewTask={() => navigation.navigate("NewTaskSheet", { screen: "NewTask" })}
Expand Down Expand Up @@ -157,6 +164,7 @@ export function HomeRouteScreen() {
params: { screen: "SettingsEnvironments" },
})
}
onOpenPullRequests={() => navigation.navigate("PullRequests")}
onOpenSettings={() =>
navigation.navigate("SettingsSheet", {
screen: "SettingsContent",
Expand Down
5 changes: 5 additions & 0 deletions apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,10 @@ function AdaptiveWorkspaceLayoutContent(
});
}, [navigation]);

const handleOpenPullRequests = useCallback(() => {
navigation.navigate("PullRequests");
}, [navigation]);

// Minted here (root stack navigation) so the sidebar pane stays free of
// navigation hooks — on iOS it renders inside an independent nav tree.
const handleOpenEnvironmentSettings = useCallback(() => {
Expand Down Expand Up @@ -534,6 +538,7 @@ function AdaptiveWorkspaceLayoutContent(
onRequestVisibility={revealPrimarySidebar}
selectedThreadKey={selectedThreadKey}
onOpenSettings={handleOpenSettings}
onOpenPullRequests={handleOpenPullRequests}
onOpenEnvironmentSettings={handleOpenEnvironmentSettings}
onNewThreadInProject={handleNewThreadInProject}
onSelectThread={handleSelectThread}
Expand Down
Loading
Loading