Skip to content

Commit

Permalink
Merge branch 'develop' into po/tlon-3304-preserve-navigation-state-wh…
Browse files Browse the repository at this point in the history
…en-resizing-window
  • Loading branch information
patosullivan committed Dec 6, 2024
2 parents eac8164 + f2d770e commit e24eaea
Show file tree
Hide file tree
Showing 35 changed files with 275 additions and 116 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
- uses: actions/checkout@v3
with:
ref: ${{ env.tag }}
ssh-key: ${{ secrets.DEPLOY_KEY }}
- uses: actions/download-artifact@v3
with:
name: "ui-dist"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/sync-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ jobs:
name: "Syncs the latest staging deploy from staging to develop"
steps:
- uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
- name: Set Git config
run: |
git config --local user.email "[email protected]"
git config --local user.name "Github Actions"
- name: Merge Dev to Master
- name: Merge Staging to Develop
run: |
git fetch --unshallow
git checkout staging
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
name: "Syncs the latest livenet deploy from develop to master"
steps:
- uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
- name: Set Git config
run: |
git config --local user.email "[email protected]"
Expand All @@ -22,4 +24,4 @@ jobs:
git checkout master
git pull
git merge --no-ff staging
git push
git push
2 changes: 1 addition & 1 deletion apps/tlon-mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
compileSdk rootProject.ext.compileSdkVersion
versionCode 108
versionName "4.2.4"
versionName "5.0.0"

buildConfigField("boolean", "REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS", (findProperty("reactNative.unstable_useRuntimeSchedulerAlways") ?: true).toString())
}
Expand Down
8 changes: 4 additions & 4 deletions apps/tlon-mobile/ios/Landscape.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 4.2.4;
MARKETING_VERSION = 5.0.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -1465,7 +1465,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 4.2.4;
MARKETING_VERSION = 5.0.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -1689,7 +1689,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 4.2.4;
MARKETING_VERSION = 5.0.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -1732,7 +1732,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 4.2.4;
MARKETING_VERSION = 5.0.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
2 changes: 2 additions & 0 deletions apps/tlon-mobile/src/components/AuthenticatedApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useShip } from '@tloncorp/app/contexts/ship';
import { useAppStatusChange } from '@tloncorp/app/hooks/useAppStatusChange';
import { useConfigureUrbitClient } from '@tloncorp/app/hooks/useConfigureUrbitClient';
import { useCurrentUserId } from '@tloncorp/app/hooks/useCurrentUser';
import { useFindSuggestedContacts } from '@tloncorp/app/hooks/useFindSuggestedContacts';
import { useNavigationLogging } from '@tloncorp/app/hooks/useNavigationLogger';
import { useNetworkLogger } from '@tloncorp/app/hooks/useNetworkLogger';
import { useTelemetry } from '@tloncorp/app/hooks/useTelemetry';
Expand Down Expand Up @@ -29,6 +30,7 @@ function AuthenticatedApp() {
useNavigationLogging();
useNetworkLogger();
useCheckAppUpdated();
useFindSuggestedContacts();

useEffect(() => {
configureClient();
Expand Down
4 changes: 2 additions & 2 deletions apps/tlon-mobile/src/screens/Onboarding/ReserveShipScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { NativeStackScreenProps } from '@react-navigation/native-stack';
import { useLureMetadata } from '@tloncorp/app/contexts/branch';
import { useSignupContext } from '.././../lib/signupContext';
import { NodeBootPhase } from '@tloncorp/app/lib/bootHelpers';
import {
ArvosDiscussing,
Expand All @@ -14,6 +13,7 @@ import {
} from '@tloncorp/ui';
import { useEffect, useMemo } from 'react';

import { useSignupContext } from '../../lib/signupContext';
import type { OnboardingStackParamList } from '../../types';

type Props = NativeStackScreenProps<OnboardingStackParamList, 'ReserveShip'>;
Expand All @@ -36,7 +36,7 @@ export const ReserveShipScreen = ({ navigation }: Props) => {
signupContext.setOnboardingValues({ didCompleteOnboarding: true });
}
signupContext.kickOffBootSequence();
}, []);
}, [signupContext]);

return (
<View flex={1} backgroundColor="$secondaryBackground">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {
import { useEffect } from 'react';
import { Controller, useForm } from 'react-hook-form';

import { useSignupContext } from '../../lib/signupContext';
import type { OnboardingStackParamList } from '../../types';
import { useSignupContext } from '.././../lib/signupContext';

type Props = NativeStackScreenProps<OnboardingStackParamList, 'SetNickname'>;

Expand Down
2 changes: 2 additions & 0 deletions apps/tlon-web-new/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from '@react-navigation/native';
import { useConfigureUrbitClient } from '@tloncorp/app/hooks/useConfigureUrbitClient';
import { useCurrentUserId } from '@tloncorp/app/hooks/useCurrentUser';
import { useFindSuggestedContacts } from '@tloncorp/app/hooks/useFindSuggestedContacts';
import { useIsDarkMode } from '@tloncorp/app/hooks/useIsDarkMode';
import { checkDb, useMigrations } from '@tloncorp/app/lib/webDb';
import { BasePathNavigator } from '@tloncorp/app/navigation/BasePathNavigator';
Expand Down Expand Up @@ -135,6 +136,7 @@ const App = React.memo(function AppComponent() {
const [dbIsLoaded, setDbIsLoaded] = useState(false);
const [startedSync, setStartedSync] = useState(false);
const configureClient = useConfigureUrbitClient();
useFindSuggestedContacts();

useEffect(() => {
handleError(() => {
Expand Down
2 changes: 1 addition & 1 deletion desk/desk.docket-0
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
info+'Start, host, and cultivate communities. Own your communications, organize your resources, and share documents. Tlon is a decentralized platform that offers a full, communal suite of tools for messaging, writing and sharing media with others.'
color+0xde.dede
image+'https://bootstrap.urbit.org/tlon.svg?v=1'
glob-http+['https://bootstrap.urbit.org/glob-0v4.irfsv.sq9vg.l6b96.rj7vs.74118.glob' 0v4.irfsv.sq9vg.l6b96.rj7vs.74118]
glob-http+['https://bootstrap.urbit.org/glob-0v2.imu38.n1u9d.o2plp.8juvp.5t2ao.glob' 0v2.imu38.n1u9d.o2plp.8juvp.5t2ao]
base+'groups'
version+[6 5 0]
website+'https://tlon.io'
Expand Down
10 changes: 9 additions & 1 deletion packages/app/features/top/ChannelScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,22 @@ export default function ChannelScreen(props: Props) {
store.syncChannelThreadUnreads(channel.id, {
priority: store.SyncPriority.High,
});
if (group) {
// Update the last visited channel in the group so we can return to it
// when we come back to the group
db.updateGroup({
id: group.id,
lastVisitedChannelId: channel.id,
});
}
}
// Mark the channel as visited when we unfocus/leave this screen
() => {
if (channel) {
store.markChannelVisited(channel);
}
};
}, [channel])
}, [channel, group])
);

const [channelNavOpen, setChannelNavOpen] = React.useState(false);
Expand Down
101 changes: 53 additions & 48 deletions packages/app/features/top/ChatListScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
GroupPreviewSheet,
InviteUsersSheet,
NavBarView,
NavigationProvider,
RequestsProvider,
ScreenHeader,
View,
Expand Down Expand Up @@ -45,8 +46,10 @@ export default function ChatListScreen(props: Props) {

export function ChatListScreenView({
previewGroupId,
focusedChannelId,
}: {
previewGroupId?: string;
focusedChannelId?: string;
}) {
const navigation = useNavigation<NavigationProp<RootStackParamList>>();
const [addGroupOpen, setAddGroupOpen] = useState(false);
Expand Down Expand Up @@ -267,55 +270,57 @@ export function ChatListScreenView({
setInviteSheetGroup(group);
}}
>
<View flex={1}>
<ScreenHeader
title={notReadyMessage ?? screenTitle}
rightControls={
<>
<ScreenHeader.IconButton
type="Search"
onPress={handleSearchInputToggled}
/>
<ScreenHeader.IconButton
type="Add"
onPress={() => setAddGroupOpen(true)}
/>
</>
}
/>
{chats && chats.unpinned.length ? (
<ChatList
activeTab={activeTab}
setActiveTab={setActiveTab}
pinned={resolvedChats.pinned}
unpinned={resolvedChats.unpinned}
pending={resolvedChats.pending}
onPressItem={onPressChat}
onSectionChange={handleSectionChange}
showSearchInput={showSearchInput}
onSearchToggle={handleSearchInputToggled}
searchQuery={searchQuery}
onSearchQueryChange={setSearchQuery}
<NavigationProvider focusedChannelId={focusedChannelId}>
<View flex={1}>
<ScreenHeader
title={notReadyMessage ?? screenTitle}
rightControls={
<>
<ScreenHeader.IconButton
type="Search"
onPress={handleSearchInputToggled}
/>
<ScreenHeader.IconButton
type="Add"
onPress={() => setAddGroupOpen(true)}
/>
</>
}
/>
) : null}

<WelcomeSheet
open={splashVisible}
onOpenChange={handleWelcomeOpenChange}
/>
<GroupPreviewSheet
open={!!selectedGroup}
onOpenChange={handleGroupPreviewSheetOpenChange}
group={selectedGroup ?? undefined}
onActionComplete={handleGroupAction}
/>
<InviteUsersSheet
open={inviteSheetGroup !== null}
onOpenChange={handleInviteSheetOpenChange}
onInviteComplete={() => setInviteSheetGroup(null)}
group={inviteSheetGroup ?? undefined}
/>
</View>
{chats && chats.unpinned.length ? (
<ChatList
activeTab={activeTab}
setActiveTab={setActiveTab}
pinned={resolvedChats.pinned}
unpinned={resolvedChats.unpinned}
pending={resolvedChats.pending}
onPressItem={onPressChat}
onSectionChange={handleSectionChange}
showSearchInput={showSearchInput}
onSearchToggle={handleSearchInputToggled}
searchQuery={searchQuery}
onSearchQueryChange={setSearchQuery}
/>
) : null}

<WelcomeSheet
open={splashVisible}
onOpenChange={handleWelcomeOpenChange}
/>
<GroupPreviewSheet
open={!!selectedGroup}
onOpenChange={handleGroupPreviewSheetOpenChange}
group={selectedGroup ?? undefined}
onActionComplete={handleGroupAction}
/>
<InviteUsersSheet
open={inviteSheetGroup !== null}
onOpenChange={handleInviteSheetOpenChange}
onInviteComplete={() => setInviteSheetGroup(null)}
group={inviteSheetGroup ?? undefined}
/>
</View>
</NavigationProvider>
<NavBarView
navigateToContacts={() => {
navigation.navigate('Contacts');
Expand Down
21 changes: 13 additions & 8 deletions packages/app/features/top/GroupChannelsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
ChatOptionsProvider,
GroupChannelsScreenView,
InviteUsersSheet,
NavigationProvider,
} from '@tloncorp/ui';
import { useCallback, useState } from 'react';

Expand All @@ -26,8 +27,10 @@ export function GroupChannelsScreen({ route }: Props) {

export function GroupChannelsScreenContent({
groupId: id,
focusedChannelId,
}: {
groupId: string;
focusedChannelId?: string;
}) {
const navigation = useNavigation<NavigationProp<RootStackParamList>>();
const isFocused = useIsFocused();
Expand Down Expand Up @@ -76,14 +79,16 @@ export function GroupChannelsScreenContent({
}}
{...useChatSettingsNavigation()}
>
<GroupChannelsScreenView
onChannelPressed={handleChannelSelected}
onBackPressed={handleGoBackPressed}
onJoinChannel={handleJoinChannel}
group={group}
unjoinedChannels={unjoinedChannels}
enableCustomChannels={enableCustomChannels}
/>
<NavigationProvider focusedChannelId={focusedChannelId}>
<GroupChannelsScreenView
onChannelPressed={handleChannelSelected}
onBackPressed={handleGoBackPressed}
onJoinChannel={handleJoinChannel}
group={group}
unjoinedChannels={unjoinedChannels}
enableCustomChannels={enableCustomChannels}
/>
</NavigationProvider>
<InviteUsersSheet
open={inviteSheetGroup !== null}
onOpenChange={(open) => {
Expand Down
10 changes: 10 additions & 0 deletions packages/app/hooks/useFindSuggestedContacts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as store from '@tloncorp/shared/store';
import { useEffect } from 'react';

export function useFindSuggestedContacts() {
const { data: joinedGroupCount } = store.useJoinedGroupsCount();

useEffect(() => {
store.findContactSuggestions();
}, [joinedGroupCount]);
}
12 changes: 12 additions & 0 deletions packages/app/navigation/desktop/HomeNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,19 @@ function DrawerContent(props: DrawerContentComponentProps) {
'groupId' in focusedRoute.params &&
focusedRoute.params.groupId
) {
if ('channelId' in focusedRoute.params) {
return (
<GroupChannelsScreenContent
groupId={focusedRoute.params.groupId}
focusedChannelId={focusedRoute.params.channelId}
/>
);
}
return <GroupChannelsScreenContent groupId={focusedRoute.params.groupId} />;
} else if (focusedRoute.params && 'channelId' in focusedRoute.params) {
return (
<ChatListScreenView focusedChannelId={focusedRoute.params.channelId} />
);
} else {
return <ChatListScreenView />;
}
Expand Down
Loading

0 comments on commit e24eaea

Please sign in to comment.