Page MenuHomePhabricator

D10673.id35742.diff
No OneTemporary

D10673.id35742.diff

diff --git a/lib/components/chat-mention-provider.react.js b/lib/components/chat-mention-provider.react.js
--- a/lib/components/chat-mention-provider.react.js
+++ b/lib/components/chat-mention-provider.react.js
@@ -13,7 +13,6 @@
import type {
ChatMentionCandidate,
ChatMentionCandidatesObj,
- LegacyResolvedThreadInfo,
LegacyThreadInfo,
} from '../types/thread-types.js';
import { useResolvedThreadInfosObj } from '../utils/entity-helpers.js';
@@ -77,11 +76,9 @@
}
function getChatMentionCandidates(
- threadInfos: { +[id: string]: LegacyThreadInfo | ThreadInfo },
+ threadInfos: { +[id: string]: ThreadInfo },
resolvedThreadInfos: {
- +[id: string]:
- | LegacyResolvedThreadInfo
- | MinimallyEncodedResolvedThreadInfo,
+ +[id: string]: MinimallyEncodedResolvedThreadInfo,
},
): {
chatMentionCandidatesObj: ChatMentionCandidatesObj,
@@ -219,9 +216,7 @@
function useChatMentionCandidatesObjAndUtils(): {
chatMentionCandidatesObj: ChatMentionCandidatesObj,
resolvedThreadInfos: {
- +[id: string]:
- | LegacyResolvedThreadInfo
- | MinimallyEncodedResolvedThreadInfo,
+ +[id: string]: MinimallyEncodedResolvedThreadInfo,
},
communityThreadIDForGenesisThreads: { +[id: string]: string },
} {
diff --git a/lib/shared/markdown.js b/lib/shared/markdown.js
--- a/lib/shared/markdown.js
+++ b/lib/shared/markdown.js
@@ -11,7 +11,6 @@
import type { MinimallyEncodedResolvedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
import type {
ChatMentionCandidates,
- LegacyResolvedThreadInfo,
RelativeMemberInfo,
} from '../types/thread-types.js';
@@ -286,7 +285,7 @@
chatMentionCandidates: ChatMentionCandidates,
capture: Capture,
): {
- threadInfo: ?(LegacyResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo),
+ threadInfo: ?MinimallyEncodedResolvedThreadInfo,
content: string,
hasAccessToChat: boolean,
} {
diff --git a/lib/shared/mention-utils.js b/lib/shared/mention-utils.js
--- a/lib/shared/mention-utils.js
+++ b/lib/shared/mention-utils.js
@@ -14,7 +14,6 @@
import { threadTypes } from '../types/thread-types-enum.js';
import type {
ChatMentionCandidates,
- LegacyResolvedThreadInfo,
LegacyThreadInfo,
RelativeMemberInfo,
} from '../types/thread-types.js';
@@ -37,7 +36,7 @@
type MentionTypeaheadChatSuggestionItem = {
+type: 'chat',
- +threadInfo: LegacyResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo,
+ +threadInfo: MinimallyEncodedResolvedThreadInfo,
};
export type MentionTypeaheadSuggestionItem =
@@ -78,7 +77,7 @@
}
function getRawChatMention(
- threadInfo: LegacyResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo,
+ threadInfo: MinimallyEncodedResolvedThreadInfo,
): string {
return `@[[${threadInfo.id}:${encodeChatMentionText(threadInfo.uiName)}]]`;
}
diff --git a/lib/shared/mention-utils.test.js b/lib/shared/mention-utils.test.js
--- a/lib/shared/mention-utils.test.js
+++ b/lib/shared/mention-utils.test.js
@@ -7,7 +7,6 @@
renderChatMentionsWithAltText,
} from './mention-utils.js';
import type { MinimallyEncodedResolvedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyResolvedThreadInfo } from '../types/thread-types.js';
describe('encodeChatMentionText', () => {
it('should encode closing brackets', () => {
@@ -37,9 +36,7 @@
it('should return raw chat mention', () =>
expect(
getRawChatMention({
- ...(({}: any):
- | LegacyResolvedThreadInfo
- | MinimallyEncodedResolvedThreadInfo),
+ ...(({}: any): MinimallyEncodedResolvedThreadInfo),
id: '256|123',
uiName: 'thread-name',
}),
@@ -48,9 +45,7 @@
it('should return raw chat mention with encoded text', () =>
expect(
getRawChatMention({
- ...(({}: any):
- | LegacyResolvedThreadInfo
- | MinimallyEncodedResolvedThreadInfo),
+ ...(({}: any): MinimallyEncodedResolvedThreadInfo),
id: '256|123',
uiName: 'thread-]name]]',
}),
diff --git a/lib/types/filter-types.js b/lib/types/filter-types.js
--- a/lib/types/filter-types.js
+++ b/lib/types/filter-types.js
@@ -3,7 +3,6 @@
import t, { type TUnion } from 'tcomb';
import type { MinimallyEncodedResolvedThreadInfo } from './minimally-encoded-thread-permissions-types.js';
-import type { LegacyResolvedThreadInfo } from './thread-types.js';
import { tID, tShape, tString } from '../utils/validation-utils.js';
export const calendarThreadFilterTypes = Object.freeze({
@@ -42,6 +41,6 @@
};
export type FilterThreadInfo = {
- +threadInfo: LegacyResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo,
+ +threadInfo: MinimallyEncodedResolvedThreadInfo,
+numVisibleEntries: number,
};
diff --git a/lib/types/thread-types.js b/lib/types/thread-types.js
--- a/lib/types/thread-types.js
+++ b/lib/types/thread-types.js
@@ -191,26 +191,6 @@
pinnedCount: t.maybe(t.Number),
});
-export type LegacyResolvedThreadInfo = {
- +id: string,
- +type: ThreadType,
- +name: ?string,
- +uiName: string,
- +avatar?: ?ClientAvatar,
- +description: ?string,
- +color: string, // hex, without "#" or "0x"
- +creationTime: number, // millisecond timestamp
- +parentThreadID: ?string,
- +containingThreadID: ?string,
- +community: ?string,
- +members: $ReadOnlyArray<LegacyRelativeMemberInfo>,
- +roles: { +[id: string]: LegacyRoleInfo },
- +currentUser: ThreadCurrentUserInfo,
- +sourceMessageID?: string,
- +repliesCount: number,
- +pinnedCount?: number,
-};
-
export type ServerMemberInfo = {
+id: string,
+role: ?string,
@@ -487,7 +467,7 @@
export type ThreadStoreThreadInfos = LegacyRawThreadInfos;
export type ChatMentionCandidate = {
- +threadInfo: LegacyResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo,
+ +threadInfo: MinimallyEncodedResolvedThreadInfo,
+rawChatName: string | ThreadEntity,
};
export type ChatMentionCandidates = {
diff --git a/lib/utils/drawer-utils.react.js b/lib/utils/drawer-utils.react.js
--- a/lib/utils/drawer-utils.react.js
+++ b/lib/utils/drawer-utils.react.js
@@ -10,10 +10,7 @@
ThreadInfo,
} from '../types/minimally-encoded-thread-permissions-types.js';
import { communitySubthreads } from '../types/thread-types-enum.js';
-import type {
- LegacyResolvedThreadInfo,
- LegacyThreadInfo,
-} from '../types/thread-types.js';
+import type { LegacyThreadInfo } from '../types/thread-types.js';
type WritableCommunityDrawerItemData<T> = {
threadInfo: ThreadInfo,
@@ -81,17 +78,10 @@
}
function useAppendCommunitySuffix(
- communities: $ReadOnlyArray<
- LegacyResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo,
- >,
-): $ReadOnlyArray<
- LegacyResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo,
-> {
+ communities: $ReadOnlyArray<MinimallyEncodedResolvedThreadInfo>,
+): $ReadOnlyArray<MinimallyEncodedResolvedThreadInfo> {
return React.useMemo(() => {
- const result: (
- | LegacyResolvedThreadInfo
- | MinimallyEncodedResolvedThreadInfo
- )[] = [];
+ const result: MinimallyEncodedResolvedThreadInfo[] = [];
const names = new Map<string, number>();
for (const chat of communities) {
diff --git a/native/avatars/thread-avatar.react.js b/native/avatars/thread-avatar.react.js
--- a/native/avatars/thread-avatar.react.js
+++ b/native/avatars/thread-avatar.react.js
@@ -14,10 +14,7 @@
ThreadInfo,
} from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
-import type {
- LegacyResolvedThreadInfo,
- LegacyThreadInfo,
-} from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import Avatar from './avatar.react.js';
import { useSelector } from '../redux/redux-utils.js';
@@ -27,7 +24,6 @@
| RawThreadInfo
| LegacyThreadInfo
| ThreadInfo
- | LegacyResolvedThreadInfo
| MinimallyEncodedResolvedThreadInfo,
+size: AvatarSize,
};
diff --git a/native/chat/settings/delete-thread.react.js b/native/chat/settings/delete-thread.react.js
--- a/native/chat/settings/delete-thread.react.js
+++ b/native/chat/settings/delete-thread.react.js
@@ -31,7 +31,6 @@
} from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type {
LeaveThreadPayload,
- LegacyResolvedThreadInfo,
LegacyThreadInfo,
} from 'lib/types/thread-types.js';
import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js';
@@ -118,7 +117,7 @@
type Props = {
...BaseProps,
// Redux state
- +threadInfo: LegacyResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo,
+ +threadInfo: MinimallyEncodedResolvedThreadInfo,
+shouldUseDeleteConfirmationAlert: boolean,
+loadingStatus: LoadingStatus,
+colors: Colors,
diff --git a/native/chat/settings/thread-settings-avatar.react.js b/native/chat/settings/thread-settings-avatar.react.js
--- a/native/chat/settings/thread-settings-avatar.react.js
+++ b/native/chat/settings/thread-settings-avatar.react.js
@@ -4,13 +4,12 @@
import { View } from 'react-native';
import type { MinimallyEncodedResolvedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyResolvedThreadInfo } from 'lib/types/thread-types.js';
import EditThreadAvatar from '../../avatars/edit-thread-avatar.react.js';
import { useStyles } from '../../themes/colors.js';
type Props = {
- +threadInfo: LegacyResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo,
+ +threadInfo: MinimallyEncodedResolvedThreadInfo,
+canChangeSettings: boolean,
};
function ThreadSettingsAvatar(props: Props): React.Node {
diff --git a/native/chat/settings/thread-settings-delete-thread.react.js b/native/chat/settings/thread-settings-delete-thread.react.js
--- a/native/chat/settings/thread-settings-delete-thread.react.js
+++ b/native/chat/settings/thread-settings-delete-thread.react.js
@@ -4,7 +4,6 @@
import { Text, View } from 'react-native';
import type { MinimallyEncodedResolvedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyResolvedThreadInfo } from 'lib/types/thread-types.js';
import type { ThreadSettingsNavigate } from './thread-settings.react.js';
import Button from '../../components/button.react.js';
@@ -13,7 +12,7 @@
import type { ViewStyle } from '../../types/styles.js';
type Props = {
- +threadInfo: LegacyResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo,
+ +threadInfo: MinimallyEncodedResolvedThreadInfo,
+navigate: ThreadSettingsNavigate,
+buttonStyle: ViewStyle,
};
diff --git a/native/chat/settings/thread-settings-name.react.js b/native/chat/settings/thread-settings-name.react.js
--- a/native/chat/settings/thread-settings-name.react.js
+++ b/native/chat/settings/thread-settings-name.react.js
@@ -18,7 +18,6 @@
import type { MinimallyEncodedResolvedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type {
ChangeThreadSettingsPayload,
- LegacyResolvedThreadInfo,
UpdateThreadRequest,
} from 'lib/types/thread-types.js';
import {
@@ -62,7 +61,7 @@
};
type BaseProps = {
- +threadInfo: LegacyResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo,
+ +threadInfo: MinimallyEncodedResolvedThreadInfo,
+nameEditValue: ?string,
+setNameEditValue: (value: ?string, callback?: () => void) => void,
+canChangeSettings: boolean,
diff --git a/web/calendar/entry.react.js b/web/calendar/entry.react.js
--- a/web/calendar/entry.react.js
+++ b/web/calendar/entry.react.js
@@ -37,7 +37,6 @@
import type { MinimallyEncodedResolvedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type { Dispatch } from 'lib/types/redux-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
-import type { LegacyResolvedThreadInfo } from 'lib/types/thread-types.js';
import { dateString } from 'lib/utils/date-utils.js';
import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js';
import { ServerError } from 'lib/utils/errors.js';
@@ -65,7 +64,7 @@
};
type Props = {
...BaseProps,
- +threadInfo: LegacyResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo,
+ +threadInfo: MinimallyEncodedResolvedThreadInfo,
+loggedIn: boolean,
+calendarQuery: () => CalendarQuery,
+online: boolean,
diff --git a/web/markdown/markdown-chat-mention.react.js b/web/markdown/markdown-chat-mention.react.js
--- a/web/markdown/markdown-chat-mention.react.js
+++ b/web/markdown/markdown-chat-mention.react.js
@@ -3,13 +3,12 @@
import * as React from 'react';
import type { MinimallyEncodedResolvedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyResolvedThreadInfo } from 'lib/types/thread-types.js';
import css from './markdown.css';
import { useOnClickThread } from '../selectors/thread-selectors.js';
type MarkdownChatMentionProps = {
- +threadInfo: LegacyResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo,
+ +threadInfo: MinimallyEncodedResolvedThreadInfo,
+hasAccessToChat: boolean,
+text: string,
};
diff --git a/web/modals/history/history-entry.react.js b/web/modals/history/history-entry.react.js
--- a/web/modals/history/history-entry.react.js
+++ b/web/modals/history/history-entry.react.js
@@ -21,7 +21,6 @@
} from 'lib/types/entry-types.js';
import type { LoadingStatus } from 'lib/types/loading-types.js';
import type { MinimallyEncodedResolvedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyResolvedThreadInfo } from 'lib/types/thread-types.js';
import type { UserInfo } from 'lib/types/user-types.js';
import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js';
import {
@@ -41,7 +40,7 @@
};
type Props = {
...BaseProps,
- +threadInfo: LegacyResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo,
+ +threadInfo: MinimallyEncodedResolvedThreadInfo,
+loggedIn: boolean,
+restoreLoadingStatus: LoadingStatus,
+calendarQuery: () => CalendarQuery,
diff --git a/web/navigation-sidebar/community-list-item.react.js b/web/navigation-sidebar/community-list-item.react.js
--- a/web/navigation-sidebar/community-list-item.react.js
+++ b/web/navigation-sidebar/community-list-item.react.js
@@ -4,7 +4,6 @@
import { unreadCountSelectorForCommunity } from 'lib/selectors/thread-selectors.js';
import type { MinimallyEncodedResolvedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyResolvedThreadInfo } from 'lib/types/thread-types.js';
import css from './community-list-item.css';
import { navigationSidebarLabelTooltipMargin } from './navigation-sidebar-constants.js';
@@ -15,7 +14,7 @@
import { tooltipPositions } from '../tooltips/tooltip-utils.js';
type Props = {
- +threadInfo: LegacyResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo,
+ +threadInfo: MinimallyEncodedResolvedThreadInfo,
};
function CommunityListItem(props: Props): React.Node {

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 27, 11:34 AM (19 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2590299
Default Alt Text
D10673.id35742.diff (14 KB)

Event Timeline