Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d29fa48
feat(mobile): Kin routes, placeholder screens and home entry row (MOB-2)
Surajsm60720 Nov 8, 2026
dab5c69
chore(mobile): merge MOB-1 client state into MOB-2
Surajsm60720 Nov 8, 2026
f81cd31
fix(mobile): align Kin home row and states with MOB-1 and review (MOB-2)
Surajsm60720 Nov 8, 2026
17302e1
Merge remote-tracking branch 'origin/kin-mob-1-client-state' into kin…
Surajsm60720 Nov 8, 2026
ac71795
Merge remote-tracking branch 'origin/kin-mob-1-client-state' into kin…
Surajsm60720 Nov 8, 2026
a6ec7ef
Merge remote-tracking branch 'origin/kin-mob-1-client-state' into kin…
Surajsm60720 Nov 8, 2026
d83c490
fix(mobile): open Kin chats from the list and Waiting on you
Surajsm60720 Nov 8, 2026
d25a380
fix(mobile): untitled group and router chats no longer take an agent'…
Surajsm60720 Nov 8, 2026
72ae5f4
Merge remote-tracking branch 'origin/kin-mob-1-client-state' into kin…
Surajsm60720 Nov 8, 2026
f9b7984
Merge origin/kin-mob-1-client-state into kin-mob-2-routes
Surajsm60720 Nov 8, 2026
6322c23
Merge remote-tracking branch 'origin/kin' into sync/mob-2
Surajsm60720 Nov 9, 2026
cd9cab3
Merge remote-tracking branch 'origin/kin' into kin-mob-2-routes
Surajsm60720 Nov 9, 2026
8f49bf3
fix(mobile): keep Kin's agents and viewer for an offline host's cache
Surajsm60720 Nov 9, 2026
873fcbb
feat(mobile): route Kin notification taps and buttons, and register t…
Surajsm60720 Nov 9, 2026
f0ebc4b
docs(kin): name the heads-up button start_now, as the server accepts
Surajsm60720 Nov 9, 2026
214ade6
fix(mobile): Kin notification buttons act only on the Kin host
Surajsm60720 Nov 9, 2026
2d0b320
fix(mobile): reopen Kin chats when Kin comes back and end Home labels…
Surajsm60720 Nov 9, 2026
1781bfb
Merge remote-tracking branch 'origin/kin' into HEAD
Surajsm60720 Nov 9, 2026
6f3bfbc
Merge branch 'kin-mob-2-routes' into kin-mob-11-notifications
Surajsm60720 Nov 9, 2026
c04b4e7
fix(mobile): stop re-registering a Kin push token another person holds
Surajsm60720 Nov 9, 2026
e2d674e
test(mobile): reopen a Kin chat when the resumed backlog changes nothing
Surajsm60720 Nov 9, 2026
e80d252
Merge remote-tracking branch 'origin/kin-mob-2-routes' into HEAD
Surajsm60720 Nov 9, 2026
4a343fc
fix(mobile): scope a Kin push refusal to the person it was refused for
Surajsm60720 Nov 9, 2026
85d35ad
fix(mobile): drop a Kin chat's turned-off view when its session ends
Surajsm60720 Nov 9, 2026
8491477
Merge origin/kin into kin-mob-2-routes
Surajsm60720 Nov 9, 2026
80ecba0
Merge kin-mob-2-routes into kin-mob-11-notifications
Surajsm60720 Nov 9, 2026
537ae79
Merge origin/kin into kin-mob-2-routes
Surajsm60720 Nov 9, 2026
6560acc
Merge kin-mob-2-routes into kin-mob-11-notifications
Surajsm60720 Nov 9, 2026
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
2 changes: 0 additions & 2 deletions apps/mobile/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import { LogBox } from "react-native";
import { featureFlags } from "react-native-screens";

import App from "./src/App";
// Kin: dev-only inbox log, gated on EXPO_PUBLIC_KIN_DEV_LOG=1.
import "./src/features/chats/state/kinDevLogEntry";

// Enables iOS FormSheet sizing for nested native stacks in non-fitToContents sheets.
featureFlags.experiment.synchronousScreenUpdatesEnabled = true;
Expand Down
2 changes: 2 additions & 0 deletions apps/mobile/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
pruneIncomingShareImports,
startIncomingShareInbox,
} from "./features/sharing/IncomingShareProvider";
import { installKinNotifications } from "./features/chats/notifications/installKinNotifications";
import {
installAgentNotificationNavigation,
setAgentNotificationPathname,
Expand Down Expand Up @@ -193,6 +194,7 @@ const appServiceDisposers = [
installThreadOutboxDelivery(),
installComposerAttachmentUploads(),
startIncomingShareInbox(),
installKinNotifications(linkToAppPath),
installAgentNotificationNavigation(linkToAppPath),
installAppShortcuts(linkToAppPath),
installAppUpdateChecks(),
Expand Down
2 changes: 2 additions & 0 deletions apps/mobile/src/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import { DevicePreviewRouteScreen } from "./features/devices/DevicePreviewRouteS
import { BrowserPreviewRouteScreen } from "./features/browser/BrowserPreviewRouteScreen";
import { GitBranchesSheet } from "./features/threads/git/GitBranchesSheet";
import { GitCommitSheet } from "./features/threads/git/GitCommitSheet";
import { KIN_SCREENS } from "./features/chats/routes";
import { GitConfirmSheet } from "./features/threads/git/GitConfirmSheet";
import { GitOverviewSheet } from "./features/threads/git/GitOverviewSheet";
import { ThreadPullRequestsSheet } from "./features/threads/ThreadPullRequestsSheet";
Expand Down Expand Up @@ -698,6 +699,7 @@ const RootStackConfig = createWorkspaceStackNavigator({
options: sheetRoute({ detent: 0.55, maxDetent: 0.7, androidFit: true }),
}),
...SETTINGS_SCREENS,
...KIN_SCREENS,
SettingsLegal: createNativeStackScreen({
screen: SettingsLegalRouteScreen,
linking: "settings/legal",
Expand Down
33 changes: 33 additions & 0 deletions apps/mobile/src/features/chats/KinChatScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { useNavigation, type StaticScreenProps } from "@react-navigation/native";
import { View } from "react-native";

import { AppBar } from "../../components/ui/AppBar";
import { EmptyState } from "../../components/ui/EmptyState";
import { ScreenContent } from "../../components/ui/ScreenContent";
import { KinChatPushWatch } from "./notifications/KinChatPushWatch";

type KinChatParams = {
readonly environmentId: string;
readonly orgId: string;
readonly chatId: string;
};

/** Placeholder until MOB-4's feed, so the chat list, Waiting on you and links can open a chat. */
export function KinChatScreen({ route }: StaticScreenProps<KinChatParams>) {
const navigation = useNavigation();
return (
<View collapsable={false} className="flex-1 bg-screen">
<KinChatPushWatch environmentId={route.params.environmentId} chatId={route.params.chatId} />
<AppBar title="Chat" onBack={() => navigation.goBack()} />
<ScreenContent surface="screen">
<View className="flex-1 justify-center p-4">
<EmptyState
variant="plain"
title="Chats open in the next build"
detail="Update the app to read and reply here."
/>
</View>
</ScreenContent>
</View>
);
}
66 changes: 66 additions & 0 deletions apps/mobile/src/features/chats/KinChatsScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { useNavigation } from "@react-navigation/native";

import { EmptyState } from "../../components/ui/EmptyState";
import { ListRow } from "../../components/ui/ListRow";
import { ListSection } from "../../components/ui/ListSection";
import { KinInboxPage } from "./components/KinScreenState";
import { selectKinInboxView } from "./state/kinInboxModel";
import { kinChatTitle, kinDirectory } from "./state/kinScreenState";
import { useKinInbox } from "./state/useKinInbox";

/** Placeholder chat list until MOB-3: Waiting on you and plain rows. */
export function KinChatsScreen() {
const navigation = useNavigation();
const { host, state, retry } = useKinInbox();
const { agentNames } = kinDirectory(host);
return (
<KinInboxPage title="Kin" state={state} onRetry={retry}>
{(ready) => {
const view = selectKinInboxView(ready.inbox.value);
if (view.rows.length === 0) {
return (
<EmptyState
title="No chats yet"
detail="Your lead's chat appears here once Kin is set up."
/>
);
}
return (
<>
{view.waitingCount > 0 ? (
<ListSection>
<ListRow
icon="exclamationmark.circle"
label="Waiting on you"
detail={String(view.waitingCount)}
onPress={() => navigation.navigate("KinWaiting")}
/>
</ListSection>
) : null}
<ListSection>
{view.rows.map((row) => {
const title = kinChatTitle(row.chat, agentNames);
return (
<ListRow
key={row.chat.chatId}
icon="bubble.left"
label={title}
description={row.chat.lastMessage?.body ?? "No messages yet"}
{...(row.chat.unread > 0 ? { detail: `${row.chat.unread} unread` } : {})}
onPress={() =>
navigation.navigate("KinChat", {
environmentId: ready.environmentId,
orgId: row.chat.orgId,
chatId: row.chat.chatId,
})
}
/>
);
})}
</ListSection>
</>
);
}}
</KinInboxPage>
);
}
94 changes: 94 additions & 0 deletions apps/mobile/src/features/chats/KinHomeEntry.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import { useNavigation } from "@react-navigation/native";
import { use } from "react";
import { View } from "react-native";

import { SymbolView } from "../../components/ui/AppSymbol";
import { AppText as Text } from "../../components/ui/AppText";
import { usePaneRole } from "../../components/ui/Pane";
import { RowPressable } from "../../components/ui/RowPressable";
import { cn } from "../../lib/cn";
import { NativePrimaryColumnContext } from "../../native/v5-workspace-context";
import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
import {
getThreadListV2RowAppearance,
THREAD_LIST_V2_ROW_CONTENT_CLASS_NAME,
THREAD_LIST_V2_ROW_DIVIDERS,
} from "../threads/thread-list-v2-row-appearance";

import { selectKinInboxView } from "./state/kinInboxModel";
import { kinHomeLabel, kinHomeSubtitle } from "./state/kinScreenState";
import { useKinInbox } from "./state/useKinInbox";

/** Home's Kin row, first in the thread list. Renders nothing unless an environment hosts Kin. */
export function KinHomeEntry() {
const navigation = useNavigation();
const sidebarPane = usePaneRole() === "sidebar" && use(NativePrimaryColumnContext) !== null;
const appearance = getThreadListV2RowAppearance(
useAppearancePreferences().themeVariables,
sidebarPane,
false,
);
const { host, state } = useKinInbox();
if (host._tag !== "host") return null;

const view = state._tag === "ready" ? selectKinInboxView(state.inbox.value) : null;
const waitingCount = view?.waitingCount ?? 0;
const unreadCount = view?.unreadCount ?? 0;
const subtitle = kinHomeSubtitle(state, view);

const content = (
<View className="flex-row items-center gap-3">
<SymbolView
name="bubble.left.and.bubble.right"
size={18}
tintColorClassName={appearance.mutedIconTintClassName}
type="monochrome"
/>
<View className="flex-1">
<Text className={cn("text-base font-t3-medium", appearance.foregroundClassName)}>Kin</Text>
{subtitle === null ? null : (
<Text
numberOfLines={1}
className={cn(
"mt-0.5 text-xs",
waitingCount > 0
? "font-t3-bold text-primary"
: appearance.tertiaryForegroundClassName,
)}
>
{subtitle}
</Text>
)}
</View>
{unreadCount > 0 ? (
<View className="min-w-5 items-center rounded-full bg-primary px-1.5 py-0.5">
<Text className="text-2xs font-t3-bold text-primary-foreground">{unreadCount}</Text>
</View>
) : null}
</View>
);

return (
<View style={appearance.swipeContainerStyle}>
<RowPressable
accessibilityRole="button"
accessibilityLabel={kinHomeLabel(subtitle, unreadCount)}
accessibilityHint="Opens your Kin chats"
className={appearance.className}
interactionClassName={appearance.interactionClassName}
interactionOpacity={appearance.interactionOpacity}
onPress={() => navigation.navigate("KinChats")}
style={appearance.cardStyle}
>
{sidebarPane ? (
content
) : (
<View>
<View className={THREAD_LIST_V2_ROW_CONTENT_CLASS_NAME}>{content}</View>
{THREAD_LIST_V2_ROW_DIVIDERS ? <View className="ml-5 h-px bg-border-subtle" /> : null}
</View>
)}
</RowPressable>
</View>
);
}
55 changes: 55 additions & 0 deletions apps/mobile/src/features/chats/KinWaitingScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { useNavigation } from "@react-navigation/native";

import { EmptyState } from "../../components/ui/EmptyState";
import { ListRow } from "../../components/ui/ListRow";
import { ListSection } from "../../components/ui/ListSection";
import { KinInboxPage } from "./components/KinScreenState";
import { selectKinInboxView } from "./state/kinInboxModel";
import { formatKinTime, kinDirectory, kinWaitingRowView } from "./state/kinScreenState";
import { useKinInbox } from "./state/useKinInbox";

/** Placeholder Waiting on you until the native cards land: one row per item, oldest first. */
export function KinWaitingScreen() {
const navigation = useNavigation();
const { host, state, retry } = useKinInbox();
const { agentNames } = kinDirectory(host);
return (
<KinInboxPage title="Waiting on you" state={state} onRetry={retry}>
{(ready) => {
const view = selectKinInboxView(ready.inbox.value);
if (view.waiting.length === 0) {
return (
<EmptyState
variant="plain"
title="Nothing is waiting on you."
detail="Approvals and questions from your leads show up here."
/>
);
}
return (
<ListSection>
{view.waiting.map((item) => {
const row = kinWaitingRowView(item, ready.inbox.value.chats, agentNames);
return (
<ListRow
key={item.waitingId}
icon="exclamationmark.circle"
label={`${row.label} · ${row.chatTitle}`}
description={row.text ?? `Open the chat with ${row.chatTitle}`}
detail={formatKinTime(new Date(row.createdAt))}
onPress={() =>
navigation.navigate("KinChat", {
environmentId: ready.environmentId,
orgId: item.orgId,
chatId: item.chatId,
})
}
/>
);
})}
</ListSection>
);
}}
</KinInboxPage>
);
}
Loading